From 426bd60d8a8849672a29a5cd42ca3af21fbc0da5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 25 Apr 2019 23:32:24 +0200 Subject: [PATCH 01/10] Handle high-quality state + have a orangish-green for app level 5 to 7 --- src/css/style.less | 10 ++++++++++ src/js/yunohost/controllers/apps.js | 19 ++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/css/style.less b/src/css/style.less index e1496f71..0a0bce90 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -573,6 +573,16 @@ input[type='radio'].nice-radio { } } +.label-hmokay, .btn-hmokay, .btn-hmokay:active, .btn-hmokay.active { + background-color: #71ae2a; + color: white; +} + +.btn-hmokay:hover, .btn-hmokay:active:hover, .btn-hmokay.active:hover { + background-color: #5e8f24; +} + + // only one card for small screens .app-card { width: 100%; diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 9a7aafc9..0dbbebd8 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -18,9 +18,12 @@ }); function levelToColor(level) { - if (level >= 3) { + if (level >= 8) { return 'success'; } + else if (level > 4) { + return 'hmokay'; + } else if (level >= 1) { return 'warning'; } @@ -32,9 +35,12 @@ } function stateToColor(state) { - if (state === "working" || state === "official") { + if (state === "high-quality") { return 'success'; } + else if (state === "working") { + return 'hmokay'; + } else { return 'danger'; } @@ -47,6 +53,9 @@ else if (stateColor === "warning" || levelColor === "warning" || levelColor === "default") { return 'warning'; } + else if (stateColor === "hmokay" || levelColor === "hmokay") { + return 'hmokay'; + } else { return 'success'; @@ -59,13 +68,13 @@ c.api('/apps?raw', function (dataraw) { // http://api.yunohost.org/#!/app/app_list_get_8 var apps = [] $.each(data['apps'], function(k, v) { - if (dataraw[v['id']]['state'] === "validated") + if(dataraw[v['id']]['high_quality'] && parseInt(dataraw[v['id']]['level']) > 7) { - dataraw[v['id']]['state'] = "official"; + dataraw[v['id']]['state'] = "high-quality"; } var state = dataraw[v['id']]['state']; var levelFormatted = parseInt(dataraw[v['id']]['level']); - var isWorking = (state === 'working' || state === 'official') && levelFormatted > 0; + var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0; // Keep only the first instance of each app and remove community not working apps if (!v['id'].match(/__[0-9]{1,5}$/) && (dataraw[v['id']]['repository'] === 'yunohost' || state !== 'notworking')) { From 3e3f75dc725d400874ff350a6650c972a3d2f130 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 00:12:48 +0200 Subject: [PATCH 02/10] No more notion of official/community apps, update filter for high-quality apps instead --- src/js/yunohost/controllers/apps.js | 6 +++--- src/locales/en.json | 4 ++-- src/views/app/app_list_install.ms | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 0dbbebd8..66ccef2b 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -75,11 +75,10 @@ var state = dataraw[v['id']]['state']; var levelFormatted = parseInt(dataraw[v['id']]['level']); var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0; - // Keep only the first instance of each app and remove community not working apps - if (!v['id'].match(/__[0-9]{1,5}$/) && (dataraw[v['id']]['repository'] === 'yunohost' || state !== 'notworking')) { + // Keep only the first instance of each app and remove not working apps + if (!v['id'].match(/__[0-9]{1,5}$/) && (state !== 'notworking')) { dataraw[v['id']]['installable'] = (!v['installed'] || dataraw[v['id']].manifest.multi_instance) - dataraw[v['id']]['isCommunity'] = !(dataraw[v['id']]['repository'] === 'yunohost'); dataraw[v['id']]['levelFormatted'] = isNaN(levelFormatted) ? '?' : levelFormatted; dataraw[v['id']]['levelColor'] = levelToColor(levelFormatted); dataraw[v['id']]['stateColor'] = stateToColor(state); @@ -89,6 +88,7 @@ dataraw[v['id']]['updateDate'] = dataraw[v['id']]['lastUpdate'] * 1000 || 0; dataraw[v['id']]['isSafe'] = (dataraw[v['id']]['installColor'] !== 'danger'); dataraw[v['id']]['isWorking'] = isWorking ? "isworking" : "notFullyWorking"; + dataraw[v['id']]['isHighQuality'] = (state === "high-quality") ? "ishighquality" : ""; jQuery.extend(dataraw[v['id']], v); apps.push(dataraw[v['id']]); diff --git a/src/locales/en.json b/src/locales/en.json index 7a164f1f..8dd39715 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -37,7 +37,7 @@ "app_state": "Application state: ", "app_state_inprogress": "In progress", "app_state_notworking": "Not working", - "app_state_official": "Official", + "app_state_highquality": "High quality", "app_state_working": "Working", "application": "Application", "applications": "Applications", @@ -225,7 +225,7 @@ "no_user_to_add": "No more users to add.", "non_compatible_api": "Non-compatible API", "ok": "OK", - "only_official_apps": "Only official apps", + "only_highquality_apps": "Only high-quality apps", "only_working_apps": "Only working apps", "open": "Open", "operations": "Operations", diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 70a54476..ab803dc4 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -24,7 +24,7 @@ @@ -34,11 +34,10 @@
{{#apps}} -
+

{{name}}

- {{#isCommunity}} {{t 'community'}}{{/isCommunity}} {{t state}} {{t 'level'}} {{levelFormatted}} {{#displayLicense}}{{license}}{{/displayLicense}} From db6722c510fd30cf429ca58b574e3cf04ea9d897 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 00:27:42 +0200 Subject: [PATCH 03/10] Add 'decent quality' (level >= 5) filter as default filter --- src/js/yunohost/controllers/apps.js | 10 ++++++---- src/locales/en.json | 1 + src/views/app/app_list_install.ms | 9 +++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 66ccef2b..e2c127ec 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -68,7 +68,7 @@ c.api('/apps?raw', function (dataraw) { // http://api.yunohost.org/#!/app/app_list_get_8 var apps = [] $.each(data['apps'], function(k, v) { - if(dataraw[v['id']]['high_quality'] && parseInt(dataraw[v['id']]['level']) > 7) + if (dataraw[v['id']]['high_quality'] && parseInt(dataraw[v['id']]['level']) > 7) { dataraw[v['id']]['state'] = "high-quality"; } @@ -87,8 +87,10 @@ && dataraw[v['id']]['manifest']['license'] !== 'free'); dataraw[v['id']]['updateDate'] = dataraw[v['id']]['lastUpdate'] * 1000 || 0; dataraw[v['id']]['isSafe'] = (dataraw[v['id']]['installColor'] !== 'danger'); + dataraw[v['id']]['decentQuality'] = (dataraw[v['id']]['levelColor'] === "hmokay" + || dataraw[v['id']]['levelColor'] === "success")?"decentQuality":"badQuality"; dataraw[v['id']]['isWorking'] = isWorking ? "isworking" : "notFullyWorking"; - dataraw[v['id']]['isHighQuality'] = (state === "high-quality") ? "ishighquality" : ""; + dataraw[v['id']]['isHighQuality'] = (state === "high-quality") ? "isHighQuality" : ""; jQuery.extend(dataraw[v['id']], v); apps.push(dataraw[v['id']]); @@ -116,8 +118,8 @@ return inputMatch && classMatch; }, - // Keep only official apps at first render - cardGrid.isotope({ filter: '.isworking' }); + // Default filter is 'decent quality apps' + cardGrid.isotope({ filter: '.decentQuality' }); jQuery('.dropdownFilter').on('click', function() { // change dropdown label diff --git a/src/locales/en.json b/src/locales/en.json index 8dd39715..8b352690 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -227,6 +227,7 @@ "ok": "OK", "only_highquality_apps": "Only high-quality apps", "only_working_apps": "Only working apps", + "only_decent_quality_apps": "Only decent quality apps", "open": "Open", "operations": "Operations", "os": "OS", diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index ab803dc4..6e301f90 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -20,11 +20,12 @@ @@ -34,7 +35,7 @@
{{#apps}} -
+

{{name}}

From 6b15bc50a6c88113c264adfa301e883c992b234d Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 20 Feb 2019 22:52:16 +0100 Subject: [PATCH 04/10] Add unmaintained states --- src/js/yunohost/controllers/apps.js | 33 +++++++++++++++++++++++++++++ src/locales/en.json | 3 +++ src/views/app/app_list_install.ms | 4 ++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index e2c127ec..d1dfc773 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -46,6 +46,21 @@ } } + function stateToMaintained(state) { + if ( state === "request_help" ) { + return 'info'; + } + else if ( state === "request_adoption" ) { + return 'warning'; + } + else if ( state === "orphaned" ) { + return 'danger'; + } + else { + return 'default'; + } + } + function combineColors(stateColor, levelColor, installable) { if (stateColor === "danger" || levelColor === "danger") { return 'danger'; @@ -75,6 +90,24 @@ var state = dataraw[v['id']]['state']; var levelFormatted = parseInt(dataraw[v['id']]['level']); var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0; + + if ( dataraw[v['id']]['maintained'] !== true ) + { + // Set the maintained status at Orphaned if the value of 'maintained' is 'false' + if ( dataraw[v['id']]['maintained'] === false ) + { + dataraw[v['id']]['MaintainedStatus'] = "orphaned"; + } + // Otherwise, set 'MaintainedStatus' at the value of 'maintained' and set 'maintained' as 'false' + else + { + dataraw[v['id']]['MaintainedStatus'] = dataraw[v['id']]['maintained']; + dataraw[v['id']]['maintained'] = false; + } + // Set the color for the label + dataraw[v['id']]['MaintainedColor'] = stateToMaintained(dataraw[v['id']]['MaintainedStatus']); + } + // Keep only the first instance of each app and remove not working apps if (!v['id'].match(/__[0-9]{1,5}$/) && (state !== 'notworking')) { diff --git a/src/locales/en.json b/src/locales/en.json index 8b352690..2d756115 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -230,6 +230,7 @@ "only_decent_quality_apps": "Only decent quality apps", "open": "Open", "operations": "Operations", + "orphaned": "Orphaned", "os": "OS", "password": "Password", "password_confirmation": "Password confirmation", @@ -279,6 +280,8 @@ "reception": "Reception", "refresh_app_list": "Refresh list", "remove_access": "Remove access", + "request_adoption": "Request for adoption", + "request_help": "Request for help", "restore": "Restore", "run": "Run", "running": "Running", diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 6e301f90..d2d4bee9 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -47,8 +47,8 @@
{{formatDate updateDate day="numeric" month="long" year="numeric"}} - - {{#maintained}} {{manifest.maintainer.name}}{{/maintained}} - {{^maintained}} {{t 'unmaintained'}}{{/maintained}} + {{manifest.maintainer.name}} + {{^maintained}} {{t MaintainedStatus}}{{/maintained}}
From 511842d7f02a69442cc1c8ef1f7d63b1a03d76c0 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 05:03:40 +0200 Subject: [PATCH 05/10] Simply / fix stuff related to maintained state + add detailed explanation --- src/js/yunohost/controllers/apps.js | 31 +++++++++++------------------ src/locales/en.json | 11 +++++++--- src/views/app/app_list_install.ms | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index d1dfc773..25d396d8 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -46,7 +46,7 @@ } } - function stateToMaintained(state) { + function maintainedStateToColor(state) { if ( state === "request_help" ) { return 'info'; } @@ -57,7 +57,7 @@ return 'danger'; } else { - return 'default'; + return 'success'; } } @@ -87,27 +87,19 @@ { dataraw[v['id']]['state'] = "high-quality"; } + if ( dataraw[v['id']]['maintained'] === false ) + { + dataraw[v['id']]['maintained'] = "orphaned"; + } + else if ( dataraw[v['id']]['maintained'] === true ) + { + dataraw[v['id']]['maintained'] = "maintained"; + } + var state = dataraw[v['id']]['state']; var levelFormatted = parseInt(dataraw[v['id']]['level']); var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0; - if ( dataraw[v['id']]['maintained'] !== true ) - { - // Set the maintained status at Orphaned if the value of 'maintained' is 'false' - if ( dataraw[v['id']]['maintained'] === false ) - { - dataraw[v['id']]['MaintainedStatus'] = "orphaned"; - } - // Otherwise, set 'MaintainedStatus' at the value of 'maintained' and set 'maintained' as 'false' - else - { - dataraw[v['id']]['MaintainedStatus'] = dataraw[v['id']]['maintained']; - dataraw[v['id']]['maintained'] = false; - } - // Set the color for the label - dataraw[v['id']]['MaintainedColor'] = stateToMaintained(dataraw[v['id']]['MaintainedStatus']); - } - // Keep only the first instance of each app and remove not working apps if (!v['id'].match(/__[0-9]{1,5}$/) && (state !== 'notworking')) { @@ -115,6 +107,7 @@ dataraw[v['id']]['levelFormatted'] = isNaN(levelFormatted) ? '?' : levelFormatted; dataraw[v['id']]['levelColor'] = levelToColor(levelFormatted); dataraw[v['id']]['stateColor'] = stateToColor(state); + dataraw[v['id']]['maintainedColor'] = maintainedStateToColor(dataraw[v['id']]['maintained']); dataraw[v['id']]['installColor'] = combineColors(dataraw[v['id']]['stateColor'], dataraw[v['id']]['levelColor']); dataraw[v['id']]['displayLicense'] = (dataraw[v['id']]['manifest']['license'] !== undefined && dataraw[v['id']]['manifest']['license'] !== 'free'); diff --git a/src/locales/en.json b/src/locales/en.json index 2d756115..2416f30e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -198,6 +198,8 @@ "logout": "Logout", "mailbox_quota_description": "For example, 700M is a CD, 4700M is a DVD.", "mailbox_quota_placeholder": "Leave empty or set to 0 to disable.", + "maintained": "maintained", + "maintained_details": "This app was maintained by its maintainer in the last few months.", "manage_apps": "Manage apps", "manage_domains": "Manage domains", "manage_users": "Manage users", @@ -230,7 +232,8 @@ "only_decent_quality_apps": "Only decent quality apps", "open": "Open", "operations": "Operations", - "orphaned": "Orphaned", + "orphaned": "not maintained", + "orphaned_details": "This app is not maintained anymore. It may still be working but won't receive any upgrade. Feel free to come and revive it!", "os": "OS", "password": "Password", "password_confirmation": "Password confirmation", @@ -280,8 +283,10 @@ "reception": "Reception", "refresh_app_list": "Refresh list", "remove_access": "Remove access", - "request_adoption": "Request for adoption", - "request_help": "Request for help", + "request_adoption": "waiting adoption", + "request_adoption_details": "The current maintainer would like to stop maintaining this app. Feel free to propose yourself as the new maintainer!", + "request_help": "need help", + "request_help_details": "The current maintainer would like some help with the maintainance of this app. Feel free to come contribute on it!", "restore": "Restore", "run": "Run", "running": "Running", diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index d2d4bee9..a7deb500 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -41,6 +41,7 @@
{{t state}} {{t 'level'}} {{levelFormatted}} + {{t maintained}} {{#displayLicense}}{{license}}{{/displayLicense}}
{{description}}
@@ -48,7 +49,6 @@
{{formatDate updateDate day="numeric" month="long" year="numeric"}} - {{manifest.maintainer.name}} - {{^maintained}} {{t MaintainedStatus}}{{/maintained}}
From 6116f9945906f566d1b879305d2ad03a484f45f4 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 15:47:59 +0200 Subject: [PATCH 06/10] Clean / simplify code ... --- src/js/yunohost/controllers/apps.js | 57 +++++++++++++++-------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 25d396d8..c05fe46c 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -83,43 +83,46 @@ c.api('/apps?raw', function (dataraw) { // http://api.yunohost.org/#!/app/app_list_get_8 var apps = [] $.each(data['apps'], function(k, v) { - if (dataraw[v['id']]['high_quality'] && parseInt(dataraw[v['id']]['level']) > 7) + app = dataraw[v['id']]; + app.level = parseInt(app.level); + + if (app.high_quality && app.level > 7) { - dataraw[v['id']]['state'] = "high-quality"; + app.state = "high-quality"; } - if ( dataraw[v['id']]['maintained'] === false ) + if ( app.maintained === false ) { - dataraw[v['id']]['maintained'] = "orphaned"; + app.maintained = "orphaned"; } - else if ( dataraw[v['id']]['maintained'] === true ) + else if ( app.maintained === true ) { - dataraw[v['id']]['maintained'] = "maintained"; + app.maintained = "maintained"; } - var state = dataraw[v['id']]['state']; - var levelFormatted = parseInt(dataraw[v['id']]['level']); - var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0; + var isWorking = (app.state === 'working' || app.state === "high-quality") && app.level > 0; // Keep only the first instance of each app and remove not working apps - if (!v['id'].match(/__[0-9]{1,5}$/) && (state !== 'notworking')) { + if (!v['id'].match(/__[0-9]{1,5}$/) && (app.state !== 'notworking')) { - dataraw[v['id']]['installable'] = (!v['installed'] || dataraw[v['id']].manifest.multi_instance) - dataraw[v['id']]['levelFormatted'] = isNaN(levelFormatted) ? '?' : levelFormatted; - dataraw[v['id']]['levelColor'] = levelToColor(levelFormatted); - dataraw[v['id']]['stateColor'] = stateToColor(state); - dataraw[v['id']]['maintainedColor'] = maintainedStateToColor(dataraw[v['id']]['maintained']); - dataraw[v['id']]['installColor'] = combineColors(dataraw[v['id']]['stateColor'], dataraw[v['id']]['levelColor']); - dataraw[v['id']]['displayLicense'] = (dataraw[v['id']]['manifest']['license'] !== undefined - && dataraw[v['id']]['manifest']['license'] !== 'free'); - dataraw[v['id']]['updateDate'] = dataraw[v['id']]['lastUpdate'] * 1000 || 0; - dataraw[v['id']]['isSafe'] = (dataraw[v['id']]['installColor'] !== 'danger'); - dataraw[v['id']]['decentQuality'] = (dataraw[v['id']]['levelColor'] === "hmokay" - || dataraw[v['id']]['levelColor'] === "success")?"decentQuality":"badQuality"; - dataraw[v['id']]['isWorking'] = isWorking ? "isworking" : "notFullyWorking"; - dataraw[v['id']]['isHighQuality'] = (state === "high-quality") ? "isHighQuality" : ""; + app.installable = (!v.installed || app.manifest.multi_instance) + app.levelFormatted = isNaN(app.level) ? '?' : app.level; - jQuery.extend(dataraw[v['id']], v); - apps.push(dataraw[v['id']]); + app.levelColor = levelToColor(app.level); + app.stateColor = stateToColor(app.state); + app.maintainedColor = maintainedStateToColor(app.maintained); + app.installColor = combineColors(app.stateColor, app.levelColor); + + app.displayLicense = (app['manifest']['license'] !== undefined + && app['manifest']['license'] !== 'free'); + app.updateDate = app.lastUpdate * 1000 || 0; + app.isSafe = (app.installColor !== 'danger'); + app.isWorking = isWorking ? "isworking" : "notFullyWorking"; + app.isHighQuality = (app.state === "high-quality") ? "isHighQuality" : ""; + app.decentQuality = (app.levelColor === "hmokay" + || app.levelColor === "success")?"decentQuality":"badQuality"; + + jQuery.extend(app, v); + apps.push(app); } }); @@ -159,7 +162,7 @@ jQuery("#filter-app-cards").on("keyup", function() { cardGrid.isotope({ filter: filterByClassAndName }); }); - }; + }; // render c.view('app/app_list_install', {apps: apps}, setupFilterEvents); From 1ad5c362a76e7773157f2dd397f5853a6333d7aa Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 16:49:35 +0200 Subject: [PATCH 07/10] Fix maintainers display --- src/js/yunohost/controllers/apps.js | 34 +++++++++++++++++++++++++++++ src/views/app/app_list_install.ms | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index c05fe46c..c3f0ea0e 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -77,6 +77,39 @@ } } + function extractMaintainer(manifest) { + if (manifest.maintainer === undefined) + { + if ((manifest.developer !== undefined) && (manifest.developer.name !== undefined)) + { + return manifest.developer.name; + } + else + { + return "?"; + } + } + else if (Array.isArray(manifest.maintainer)) + { + maintainers = []; + manifest.maintainer.forEach(function(maintainer) { + if (maintainer.name !== undefined) + { + maintainers.push(maintainer.name); + } + }); + return maintainers.join(', '); + } + else if (manifest.maintainer.name !== undefined) + { + return manifest.maintainer.name; + } + else + { + return "?"; + } + } + // List available apps app.get('#/apps/install', function (c) { c.api('/apps', function (data) { // http://api.yunohost.org/#!/app/app_list_get_8 @@ -99,6 +132,7 @@ app.maintained = "maintained"; } + app.manifest.maintainer = extractMaintainer(app.manifest); var isWorking = (app.state === 'working' || app.state === "high-quality") && app.level > 0; // Keep only the first instance of each app and remove not working apps diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index a7deb500..0adfd4cb 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -48,7 +48,7 @@
{{formatDate updateDate day="numeric" month="long" year="numeric"}} - - {{manifest.maintainer.name}} + {{manifest.maintainer}}
From 2da00ac7063cdbb160e4f17a130dae8970c0828c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 17:21:09 +0200 Subject: [PATCH 08/10] Revert the 'hmokay' for level 5-7 apps, instead have a purple for high quality and level 8 labels --- src/css/style.less | 10 ++-------- src/js/yunohost/controllers/apps.js | 14 +++++--------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/css/style.less b/src/css/style.less index 0a0bce90..406382aa 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -573,16 +573,10 @@ input[type='radio'].nice-radio { } } -.label-hmokay, .btn-hmokay, .btn-hmokay:active, .btn-hmokay.active { - background-color: #71ae2a; - color: white; +.label-best { + background-color: darkorchid; } -.btn-hmokay:hover, .btn-hmokay:active:hover, .btn-hmokay.active:hover { - background-color: #5e8f24; -} - - // only one card for small screens .app-card { width: 100%; diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index c3f0ea0e..09fd5ad3 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -19,10 +19,10 @@ function levelToColor(level) { if (level >= 8) { - return 'success'; + return 'best'; } else if (level > 4) { - return 'hmokay'; + return 'success'; } else if (level >= 1) { return 'warning'; @@ -36,10 +36,10 @@ function stateToColor(state) { if (state === "high-quality") { - return 'success'; + return 'best'; } else if (state === "working") { - return 'hmokay'; + return 'success'; } else { return 'danger'; @@ -68,9 +68,6 @@ else if (stateColor === "warning" || levelColor === "warning" || levelColor === "default") { return 'warning'; } - else if (stateColor === "hmokay" || levelColor === "hmokay") { - return 'hmokay'; - } else { return 'success'; @@ -152,8 +149,7 @@ app.isSafe = (app.installColor !== 'danger'); app.isWorking = isWorking ? "isworking" : "notFullyWorking"; app.isHighQuality = (app.state === "high-quality") ? "isHighQuality" : ""; - app.decentQuality = (app.levelColor === "hmokay" - || app.levelColor === "success")?"decentQuality":"badQuality"; + app.decentQuality = (app.level > 4)?"decentQuality":"badQuality"; jQuery.extend(app, v); apps.push(app); From 01cc551305cacc2fcfb0a1369ab51a8474eb6ea8 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 26 Apr 2019 18:07:59 +0200 Subject: [PATCH 09/10] Fix translation of app state + add explanation about their meaning --- src/locales/en.json | 12 ++++++++---- src/views/app/app_list_install.ms | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 2416f30e..ca225d52 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -35,10 +35,14 @@ "app_no_actions": "This application doesn't have any actions", "app_repository": "Application origin: ", "app_state": "Application state: ", - "app_state_inprogress": "In progress", - "app_state_notworking": "Not working", - "app_state_highquality": "High quality", - "app_state_working": "Working", + "app_state_inprogress": "in progress", + "app_state_inprogress_explanation": "This maintainer of this app declared that this application is not ready yet for production use. BE CAREFUL!", + "app_state_notworking": "not working", + "app_state_notworking_explanation": "This maintainer of this app declared it as 'not working'. IT WILL BREAK YOUR SYSTEM!", + "app_state_high-quality": "high quality", + "app_state_high-quality_explanation": "This app is well-integrated with YunoHost. It has been (and is!) peer-reviewed by the YunoHost app team. It can be expected to be safe and maintained on the long-term.", + "app_state_working": "working", + "app_state_working_explanation": "The maintainer of this app declared it as 'working'. It means that it should be functional (c.f. application level) but is not necessarily peer-reviewed, it may still contain issues or is not fully integrated with YunoHost.", "application": "Application", "applications": "Applications", "archive_empty": "Empty archive", diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 0adfd4cb..55cebef3 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -39,7 +39,7 @@

{{name}}

- {{t state}} + {{t (concat 'app_state_' state) }} {{t 'level'}} {{levelFormatted}} {{t maintained}} {{#displayLicense}}{{license}}{{/displayLicense}} From da0d86603ab84cc090854ed3ea9ee91ea278d944 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 31 May 2019 17:02:03 +0200 Subject: [PATCH 10/10] Move license info the install form, don't show it on app market anymore --- src/js/yunohost/controllers/apps.js | 5 ++--- src/locales/en.json | 2 +- src/views/app/app_install.ms | 4 ++++ src/views/app/app_list_install.ms | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 09fd5ad3..10982dc7 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -143,8 +143,6 @@ app.maintainedColor = maintainedStateToColor(app.maintained); app.installColor = combineColors(app.stateColor, app.levelColor); - app.displayLicense = (app['manifest']['license'] !== undefined - && app['manifest']['license'] !== 'free'); app.updateDate = app.lastUpdate * 1000 || 0; app.isSafe = (app.installColor !== 'danger'); app.isWorking = isWorking ? "isworking" : "notFullyWorking"; @@ -542,7 +540,8 @@ app.helper('appInstallForm', function(appId, manifest, params) { var data = { id: appId, - manifest: manifest + manifest: manifest, + displayLicense: (manifest['license'] !== undefined && manifest['license'] !== 'free') }; formatYunoHostStyleArguments(data.manifest.arguments.install, params); diff --git a/src/locales/en.json b/src/locales/en.json index ca225d52..50596213 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -29,7 +29,6 @@ "app_install_cancel": "Installation cancelled.", "app_install_custom_no_manifest": "No manifest.json file", "app_list": "App list", - "app_license": "License of the app", "app_level": "App level", "app_make_default": "Make default", "app_no_actions": "This application doesn't have any actions", @@ -192,6 +191,7 @@ "label": "Label", "label_for_manifestname": "Label for %s", "level": "level", + "license": "License", "loading": "Loading …", "local_archives": "Local archives", "local_ip": "Local IP", diff --git a/src/views/app/app_install.ms b/src/views/app/app_install.ms index dce1686a..dcf8e017 100644 --- a/src/views/app/app_install.ms +++ b/src/views/app/app_install.ms @@ -19,6 +19,10 @@
{{id}}
{{t 'description'}}
{{description}}
+ {{#displayLicense}} +
{{t 'license'}}
+
{{manifest.license}}
+ {{/displayLicense}}
{{t 'version'}}
{{manifest.version}}
{{t 'multi_instance'}}
diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 55cebef3..52a11a5f 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -42,7 +42,6 @@ {{t (concat 'app_state_' state) }} {{t 'level'}} {{levelFormatted}} {{t maintained}} - {{#displayLicense}}{{license}}{{/displayLicense}}
{{description}}