Display 'official' instead of 'validated'

This commit is contained in:
Alexandre Aubin 2018-10-23 18:50:48 +00:00
parent c6ce7b9eff
commit 6692227f6d

View file

@ -32,7 +32,7 @@
} }
function stateToColor(state) { function stateToColor(state) {
if (state === "working" || state === "validated") { if (state === "working" || state === "official") {
return 'success'; return 'success';
} }
else { else {
@ -58,9 +58,13 @@
c.api('/apps?raw', function (dataraw) { // http://api.yunohost.org/#!/app/app_list_get_8 c.api('/apps?raw', function (dataraw) { // http://api.yunohost.org/#!/app/app_list_get_8
var apps = [] var apps = []
$.each(data['apps'], function(k, v) { $.each(data['apps'], function(k, v) {
if (dataraw[v['id']]['state'] === "validated")
{
dataraw[v['id']]['state'] = "official";
}
var state = dataraw[v['id']]['state']; var state = dataraw[v['id']]['state'];
var levelFormatted = parseInt(dataraw[v['id']]['level']); var levelFormatted = parseInt(dataraw[v['id']]['level']);
var isWorking = (state === 'working' || state === 'validated') && levelFormatted > 0; var isWorking = (state === 'working' || state === 'official') && levelFormatted > 0;
// Keep only the first instance of each app and remove community not working apps // 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')) { if (!v['id'].match(/__[0-9]{1,5}$/) && (dataraw[v['id']]['repository'] === 'yunohost' || state !== 'notworking')) {