From a8252242ed951130951c7a5b8bac6fb9f68acb6d Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 27 May 2019 12:44:13 +0200 Subject: [PATCH 01/10] Do not show URL if app doesn't have one --- src/views/app/app_info.ms | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/app/app_info.ms b/src/views/app/app_info.ms index 8712e627..37b359c7 100644 --- a/src/views/app/app_info.ms +++ b/src/views/app/app_info.ms @@ -25,8 +25,10 @@
{{manifest.multi_instance}}
{{t 'install_time'}}
{{formatTime install_time day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}
-
{{t 'url'}}
-
https://{{settings.domain}}{{settings.path}}
+ {{#if settings.domain}} +
{{t 'url'}}
+
https://{{settings.domain}}{{settings.path}}
+ {{/if}} From 575d8ac6bafddd51d6d6fa2021240f009a725772 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 2 Jun 2019 17:31:11 +0200 Subject: [PATCH 02/10] [fix] weird dandling unused variable --- src/js/yunohost/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/yunohost/events.js b/src/js/yunohost/events.js index 2f4cd258..8b9abb4c 100644 --- a/src/js/yunohost/events.js +++ b/src/js/yunohost/events.js @@ -57,7 +57,7 @@ ' ('+y18n.t('read_more')+')'; c.flash('warning', warning); // Store viewed item - viewedItems.push(item.guid);i + viewedItems.push(item.guid); } }); // Saved viewed items to cookie From 5383c2d4c8c68c7b0a4e3ec7345e15fd8ab47f44 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 4 Jun 2019 19:56:40 +0200 Subject: [PATCH 03/10] [mod] use manifest.json/actions.json args format for the config_panel.toml --- src/css/style.less | 3 +++ src/js/yunohost/controllers/apps.js | 6 +++++ src/views/app/app_config-panel.ms | 38 ++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/css/style.less b/src/css/style.less index e1496f71..78bccd4b 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -613,6 +613,9 @@ input[type='radio'].nice-radio { margin-top: -5px; } +.auto-width { + width: auto; +} .app-card .panel-body { padding: 1.5rem; diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 9a7aafc9..74eaf76a 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -294,6 +294,11 @@ // Get app config panel app.get('#/apps/:app/config-panel', function (c) { c.api('/apps/'+c.params['app']+'/config-panel', function(data) { + $.each(data.config_panel.panel, function(_, panel) { + $.each(panel.sections, function(_, section) { + formatYunoHostStyleArguments(section.options, c.params); + }); + }); c.view('app/app_config-panel', data); }); }); @@ -430,6 +435,7 @@ if (args[k].type == 'boolean') { args[k].inputType = 'checkbox'; + console.log(args[k]); // Checked or not ? if (typeof args[k].default !== 'undefined') { if (args[k].default == true) { diff --git a/src/views/app/app_config-panel.ms b/src/views/app/app_config-panel.ms index 3d00f64c..011513ee 100644 --- a/src/views/app/app_config-panel.ms +++ b/src/views/app/app_config-panel.ms @@ -36,18 +36,48 @@
    {{#options}}
    - + + +
    + + {{#if choices}} + + {{else if (eq inputType "checkbox")}} + + {{else}} + + {{/if}} + + {{#if helpLink}} + {{{helpLink}}} + {{/if}} + + {{#if example}} + {{t 'form_input_example' example}} + {{/if}} + + {{#if helpText}} + {{{helpText}}} + {{/if}} +
    +
    + {{/options}}
From 4fbda06fdb64f4bcc54ed36b444b57af914a3c50 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 25 Jun 2019 05:37:38 +0200 Subject: [PATCH 04/10] [fix] alert-debug has transparent backgrond making it unreladable --- src/css/style.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/css/style.less b/src/css/style.less index 78bccd4b..a405434f 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -617,6 +617,10 @@ input[type='radio'].nice-radio { width: auto; } +.alert-debug { + background-color: white; +} + .app-card .panel-body { padding: 1.5rem; From 97836d7c5b52e862626e8ea250f2b35cd571ce0e Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 25 Jun 2019 05:37:50 +0200 Subject: [PATCH 05/10] [fix] true can be a real true sometime --- src/js/yunohost/controllers/apps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 74eaf76a..3980cb48 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -345,7 +345,7 @@ args[k].inputType = 'text'; args[k].isPassword = false; args[k].isDisplayText = false; - args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required'; + args[k].required = (typeof v.optional !== 'undefined' && (v.optional == "true" || v.optional == true)) ? '' : 'required'; args[k].attributes = ""; args[k].helpText = ""; args[k].helpLink = ""; From a87ecb7d8dfb7ef675ac6b6d9371fee377792920 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 25 Jun 2019 05:38:58 +0200 Subject: [PATCH 06/10] [fix] form is for all the panels at once otherwise we don't send everything --- src/views/app/app_config-panel.ms | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/app/app_config-panel.ms b/src/views/app/app_config-panel.ms index 011513ee..39a95035 100644 --- a/src/views/app/app_config-panel.ms +++ b/src/views/app/app_config-panel.ms @@ -16,6 +16,7 @@ {{#config_panel}}

{{../app_name}} configuration panel


+
{{#panel}}
- {{#sections}}

{{name}} {{help}}

@@ -85,13 +85,13 @@
{{/sections}} -
-
-
{{/panel}} +
+
+ {{/config_panel}} From ab6ad1e2355387d646a2e0a7a97ecbca2700a9d4 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 25 Jun 2019 05:39:15 +0200 Subject: [PATCH 07/10] [mod] remove useless tags --- src/views/app/app_config-panel.ms | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/views/app/app_config-panel.ms b/src/views/app/app_config-panel.ms index 39a95035..70069dd6 100644 --- a/src/views/app/app_config-panel.ms +++ b/src/views/app/app_config-panel.ms @@ -33,7 +33,6 @@

{{name}} {{help}}

-
    {{#options}}
    @@ -63,24 +62,7 @@ {{/if}}
- {{/options}} - -
{{/sections}} From 8e4fcd24d64167f4c8e112a28a47e578c6bf1728 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 25 Jun 2019 05:39:25 +0200 Subject: [PATCH 08/10] [mod] hide hidden fields --- src/css/style.less | 4 ++++ src/views/app/app_config-panel.ms | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/css/style.less b/src/css/style.less index a405434f..de65972f 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -617,6 +617,10 @@ input[type='radio'].nice-radio { width: auto; } +.input-hidden { + display: none; +} + .alert-debug { background-color: white; } diff --git a/src/views/app/app_config-panel.ms b/src/views/app/app_config-panel.ms index 70069dd6..61035438 100644 --- a/src/views/app/app_config-panel.ms +++ b/src/views/app/app_config-panel.ms @@ -34,7 +34,7 @@

{{name}} {{help}}

{{#options}} -
+
From e9c4857c9c3c4068aade141379aaa7d4bec93855 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 29 Jun 2019 05:58:34 +0200 Subject: [PATCH 09/10] [fix] config-panel needs user and domain list for its inputs --- src/js/yunohost/filters.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/yunohost/filters.js b/src/js/yunohost/filters.js index 043d7d14..0b793580 100644 --- a/src/js/yunohost/filters.js +++ b/src/js/yunohost/filters.js @@ -30,6 +30,8 @@ app.before(/apps\/install\//, prefetchUsers); app.before(/apps\/\w+\/actions/, prefetchUsers); app.before(/apps\/\w+\/actions/, prefetchDomains); + app.before(/apps\/\w+\/config-panel/, prefetchUsers); + app.before(/apps\/\w+\/config-panel/, prefetchDomains); app.before({except: {path: ['#/logout', '#/login', '#/postinstall', '#/postinstall/domain', '#/postinstall/password']}}, function (req) { From c5fde43f03275d51939adfd51b98ab2cd9f129b9 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 2 Jul 2019 21:57:27 +0200 Subject: [PATCH 10/10] [mod] remove debug code --- src/js/yunohost/controllers/apps.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 3980cb48..6c9ac406 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -435,7 +435,6 @@ if (args[k].type == 'boolean') { args[k].inputType = 'checkbox'; - console.log(args[k]); // Checked or not ? if (typeof args[k].default !== 'undefined') { if (args[k].default == true) {