Merge pull request #10639 from nextcloud/bugfix/10607/appsettings-fixes

Fix apps management sorting and app removal
This commit is contained in:
Roeland Jago Douma 2018-08-10 16:18:46 +02:00 committed by GitHub
commit c2dfea57c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,7 @@
<div class="actions"> <div class="actions">
<div class="actions-buttons"> <div class="actions-buttons">
<input v-if="app.update" class="update" type="button" :value="t('settings', 'Update to {version}', {version: app.update})" :disabled="installing || loading(app.id)"/> <input v-if="app.update" class="update" type="button" :value="t('settings', 'Update to {version}', {version: app.update})" :disabled="installing || loading(app.id)"/>
<input v-if="app.canUnInstall" class="uninstall" type="button" :value="t('settings', 'Remove')" :disabled="installing || loading(app.id)"/> <input v-if="app.canUnInstall" class="uninstall" type="button" :value="t('settings', 'Remove')" v-on:click="remove(app.id)" :disabled="installing || loading(app.id)"/>
<input v-if="app.active" class="enable" type="button" :value="t('settings','Disable')" v-on:click="disable(app.id)" :disabled="installing || loading(app.id)" /> <input v-if="app.active" class="enable" type="button" :value="t('settings','Disable')" v-on:click="disable(app.id)" :disabled="installing || loading(app.id)" />
<input v-if="!app.active" class="enable" type="button" :value="enableButtonText" v-on:click="enable(app.id)" v-tooltip.auto="enableButtonTooltip" :disabled="!app.canInstall || installing || loading(app.id)" /> <input v-if="!app.active" class="enable" type="button" :value="enableButtonText" v-on:click="enable(app.id)" v-tooltip.auto="enableButtonTooltip" :disabled="!app.canInstall || installing || loading(app.id)" />
</div> </div>

View File

@ -92,13 +92,9 @@ export default {
let apps = this.$store.getters.getAllApps let apps = this.$store.getters.getAllApps
.filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1) .filter(app => app.name.toLowerCase().search(this.search.toLowerCase()) !== -1)
.sort(function (a, b) { .sort(function (a, b) {
if (a.active !== b.active) { const sortStringA = '' + (a.active ? 0 : 1) + (a.update ? 0 : 1) + a.name;
return (a.active ? -1 : 1) const sortStringB = '' + (b.active ? 0 : 1) + (b.update ? 0 : 1) + b.name;
} return OC.Util.naturalSortCompare(sortStringA, sortStringB);
if (a.update !== b.update) {
return (a.update ? -1 : 1)
}
return OC.Util.naturalSortCompare(a.name, b.name);
}); });
if (this.category === 'installed') { if (this.category === 'installed') {