mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
appcatalog: adapt to app v2 quality stuff changes
This commit is contained in:
parent
dd652296dc
commit
adefa0d702
2 changed files with 29 additions and 62 deletions
|
@ -73,14 +73,9 @@
|
||||||
"app_show_categories": "Show categories",
|
"app_show_categories": "Show categories",
|
||||||
"app_state_inprogress": "not yet working",
|
"app_state_inprogress": "not yet working",
|
||||||
"app_state_inprogress_explanation": "This maintainer of this app declared that this application is not ready yet for production use. BE CAREFUL!",
|
"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_lowquality": "low quality",
|
"app_state_lowquality": "low quality",
|
||||||
"app_state_lowquality_explanation": "This app may be functional, but may still contain issues, or is not fully integrated with YunoHost, or it does not respect the good practices.",
|
"app_state_lowquality_explanation": "This app may be functional, but may still contain issues, or is not fully integrated with YunoHost, or it does not respect the good practices.",
|
||||||
"app_state_highquality": "high quality",
|
|
||||||
"app_state_highquality_explanation": "This app is well-integrated with YunoHost since at least a year.",
|
"app_state_highquality_explanation": "This app is well-integrated with YunoHost since at least a year.",
|
||||||
"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.",
|
|
||||||
"applications": "Applications",
|
"applications": "Applications",
|
||||||
"archive_empty": "Empty archive",
|
"archive_empty": "Empty archive",
|
||||||
"backup": "Backup",
|
"backup": "Backup",
|
||||||
|
@ -537,8 +532,6 @@
|
||||||
"unignore": "Unignore",
|
"unignore": "Unignore",
|
||||||
"uninstall": "Uninstall",
|
"uninstall": "Uninstall",
|
||||||
"unknown": "Unknown",
|
"unknown": "Unknown",
|
||||||
"unmaintained": "Unmaintained",
|
|
||||||
"unmaintained_details": "This app has not been updated for quite a while and the previous maintainer has gone away or does not have time to maintain this app. Feel free to check the app repository to provide your help",
|
|
||||||
"upnp": "UPnP",
|
"upnp": "UPnP",
|
||||||
"upnp_disabled": "UPnP is disabled.",
|
"upnp_disabled": "UPnP is disabled.",
|
||||||
"upnp_enabled": "UPnP is enabled.",
|
"upnp_enabled": "UPnP is enabled.",
|
||||||
|
|
|
@ -70,27 +70,28 @@
|
||||||
<b-card-title class="d-flex mb-2">
|
<b-card-title class="d-flex mb-2">
|
||||||
{{ app.manifest.name }}
|
{{ app.manifest.name }}
|
||||||
|
|
||||||
<small v-if="app.state !== 'working'" class="d-flex align-items-center ml-2">
|
<small v-if="app.state !== 'working' || app.high_quality" class="d-flex align-items-center ml-2">
|
||||||
<b-badge
|
<b-badge
|
||||||
v-if="app.state !== 'highquality'"
|
v-if="app.state !== 'working'"
|
||||||
:variant="(app.color === 'danger' && app.state === 'lowquality') ? 'warning' : app.color"
|
:variant="app.color"
|
||||||
v-b-popover.hover.bottom="$t(`app_state_${app.state}_explanation`)"
|
v-b-popover.hover.bottom="$t(`app_state_${app.state}_explanation`)"
|
||||||
>
|
>
|
||||||
|
<!-- app.state can be 'lowquality' or 'inprogress' -->
|
||||||
{{ $t('app_state_' + app.state) }}
|
{{ $t('app_state_' + app.state) }}
|
||||||
</b-badge>
|
</b-badge>
|
||||||
|
|
||||||
<icon
|
<icon
|
||||||
v-else iname="star" class="star"
|
v-if="app.high_quality" iname="star" class="star"
|
||||||
v-b-popover.hover.bottom="$t(`app_state_${app.state}_explanation`)"
|
v-b-popover.hover.bottom="$t(`app_state_highquality_explanation`)"
|
||||||
/>
|
/>
|
||||||
</small>
|
</small>
|
||||||
</b-card-title>
|
</b-card-title>
|
||||||
|
|
||||||
<b-card-text>{{ app.manifest.description }}</b-card-text>
|
<b-card-text>{{ app.manifest.description }}</b-card-text>
|
||||||
|
|
||||||
<b-card-text v-if="app.maintained === 'orphaned'" class="align-self-end mt-auto">
|
<b-card-text v-if="!app.maintained" class="align-self-end mt-auto">
|
||||||
<span class="alert-warning p-1" v-b-popover.hover.top="$t('orphaned_details')">
|
<span class="alert-warning p-1" v-b-popover.hover.top="$t('orphaned_details')">
|
||||||
<icon iname="warning" /> {{ $t(app.maintained) }}
|
<icon iname="warning" /> {{ $t('orphaned') }}
|
||||||
</span>
|
</span>
|
||||||
</b-card-text>
|
</b-card-text>
|
||||||
</b-card-body>
|
</b-card-body>
|
||||||
|
@ -182,9 +183,9 @@ export default {
|
||||||
|
|
||||||
// Filtering options
|
// Filtering options
|
||||||
qualityOptions: [
|
qualityOptions: [
|
||||||
{ value: 'isHighQuality', text: this.$i18n.t('only_highquality_apps') },
|
{ value: 'high_quality', text: this.$i18n.t('only_highquality_apps') },
|
||||||
{ value: 'isDecentQuality', text: this.$i18n.t('only_decent_quality_apps') },
|
{ value: 'decent_quality', text: this.$i18n.t('only_decent_quality_apps') },
|
||||||
{ value: 'isWorking', text: this.$i18n.t('only_working_apps') },
|
{ value: 'working', text: this.$i18n.t('only_working_apps') },
|
||||||
{ value: 'all', text: this.$i18n.t('all_apps') }
|
{ value: 'all', text: this.$i18n.t('all_apps') }
|
||||||
],
|
],
|
||||||
categories: [
|
categories: [
|
||||||
|
@ -197,7 +198,7 @@ export default {
|
||||||
search: '',
|
search: '',
|
||||||
category: null,
|
category: null,
|
||||||
subtag: 'all',
|
subtag: 'all',
|
||||||
quality: 'isDecentQuality',
|
quality: 'decent_quality',
|
||||||
|
|
||||||
// Custom install form
|
// Custom install form
|
||||||
customInstall: {
|
customInstall: {
|
||||||
|
@ -264,51 +265,26 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
formatQuality (app) {
|
|
||||||
const filters = {
|
|
||||||
isHighQuality: false,
|
|
||||||
isDecentQuality: false,
|
|
||||||
isWorking: false,
|
|
||||||
state: 'inprogress'
|
|
||||||
}
|
|
||||||
if (app.state === 'inprogress') return filters
|
|
||||||
if (app.state === 'working' && app.level > 0) {
|
|
||||||
filters.state = 'working'
|
|
||||||
filters.isWorking = true
|
|
||||||
}
|
|
||||||
if (app.level <= 4 || app.level === '?') {
|
|
||||||
filters.state = 'lowquality'
|
|
||||||
return filters
|
|
||||||
} else {
|
|
||||||
filters.isDecentQuality = true
|
|
||||||
}
|
|
||||||
if (app.level >= 8) {
|
|
||||||
filters.state = 'highquality'
|
|
||||||
filters.isHighQuality = true
|
|
||||||
}
|
|
||||||
return filters
|
|
||||||
},
|
|
||||||
|
|
||||||
formatColor (app) {
|
|
||||||
if (app.isDecentQuality || app.isHighQuality) return 'success'
|
|
||||||
if (app.isWorking) return 'warning'
|
|
||||||
return 'danger'
|
|
||||||
},
|
|
||||||
|
|
||||||
onQueriesResponse (data) {
|
onQueriesResponse (data) {
|
||||||
// APPS
|
|
||||||
const apps = []
|
const apps = []
|
||||||
for (const key in data.apps) {
|
for (const key in data.apps) {
|
||||||
const app = data.apps[key]
|
const app = data.apps[key]
|
||||||
if (app.state === 'notworking') continue
|
app.isInstallable = !app.installed || app.manifest.integration.multi_instance
|
||||||
|
app.working = app.state === 'working'
|
||||||
Object.assign(app, this.formatQuality(app))
|
app.decent_quality = app.working && app.level > 4
|
||||||
app.isInstallable = !app.installed || app.manifest.multi_instance
|
app.color = app.high_quality || app.level > 4
|
||||||
if (app.maintained !== 'request_adoption') {
|
? 'success'
|
||||||
app.maintained = app.maintained ? 'maintained' : 'orphaned'
|
: app.working ? 'warning' : 'danger'
|
||||||
|
if (app.working && app.level <= 4) {
|
||||||
|
app.state = 'lowquality'
|
||||||
}
|
}
|
||||||
app.color = this.formatColor(app)
|
app.searchValues = [
|
||||||
app.searchValues = [app.id, app.state, app.manifest.name.toLowerCase(), app.manifest.description.toLowerCase()].join(' ')
|
app.id,
|
||||||
|
app.state,
|
||||||
|
app.manifest.name,
|
||||||
|
app.manifest.description,
|
||||||
|
app.potential_alternative_to.join(' ')
|
||||||
|
].join(' ').toLowerCase()
|
||||||
apps.push(app)
|
apps.push(app)
|
||||||
}
|
}
|
||||||
this.apps = apps.sort((a, b) => a.id > b.id ? 1 : -1)
|
this.apps = apps.sort((a, b) => a.id > b.id ? 1 : -1)
|
||||||
|
@ -328,10 +304,8 @@ export default {
|
||||||
|
|
||||||
// INSTALL APP
|
// INSTALL APP
|
||||||
async onInstallClick (app) {
|
async onInstallClick (app) {
|
||||||
if (!app.isDecentQuality) {
|
if (!app.decent_quality) {
|
||||||
// Ask for confirmation
|
const confirmed = await this.$askConfirmation(this.$i18n.t('confirm_install_app_' + app.state))
|
||||||
const state = app.color === 'danger' ? 'inprogress' : app.state
|
|
||||||
const confirmed = await this.$askConfirmation(this.$i18n.t('confirm_install_app_' + state))
|
|
||||||
if (!confirmed) return
|
if (!confirmed) return
|
||||||
}
|
}
|
||||||
this.$router.push({ name: 'app-install', params: { id: app.id } })
|
this.$router.push({ name: 'app-install', params: { id: app.id } })
|
||||||
|
|
Loading…
Add table
Reference in a new issue