diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-06-02 09:51:14 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-06 11:40:09 +0200 |
commit | a5509aa2539e37deb067b2d870666f5869a53bab (patch) | |
tree | 40ba22a90ed88117043c374b82a019fa89c32495 /settings/src/store | |
parent | 64c2e946f4d17e877105116ddc6e02f9c2aa042b (diff) | |
download | nextcloud-server-a5509aa2539e37deb067b2d870666f5869a53bab.tar.gz nextcloud-server-a5509aa2539e37deb067b2d870666f5869a53bab.zip |
Move filtering to javascript
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/src/store')
-rw-r--r-- | settings/src/store/apps.js | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js index 97d7aaa6cb0..2247e68996c 100644 --- a/settings/src/store/apps.js +++ b/settings/src/store/apps.js @@ -26,7 +26,6 @@ import Vue from 'vue'; const state = { apps: [], - allApps: [], categories: [], updateCount: 0, loading: {}, @@ -58,12 +57,8 @@ const mutations = { state.categories = categoriesArray; }, - setApps(state, apps) { - state.apps = apps; - }, - setAllApps(state, apps) { - state.allApps = apps; + state.apps = apps; }, setError(state, {appId, error}) { @@ -145,19 +140,8 @@ const getters = { getCategories(state) { return state.categories; }, - getApps(state) { - return state.apps.concat([]).sort(function (a, b) { - if (a.active !== b.active) { - return (a.active ? -1 : 1) - } - if (a.update !== b.update) { - return (a.update ? -1 : 1) - } - return OC.Util.naturalSortCompare(a.name, b.name); - }); - }, getAllApps(state) { - return state.allApps; + return state.apps; }, getUpdateCount(state) { return state.updateCount; @@ -279,23 +263,12 @@ const actions = { }).catch((error) => context.commit('API_FAILURE', { appId, error })); }, - getApps(context, { category }) { - context.commit('startLoading', 'list'); - return api.get(OC.generateUrl(`settings/apps/list?category=${category}`)) - .then((response) => { - context.commit('setApps', response.data.apps); - context.commit('stopLoading', 'list'); - return true; - }) - .catch((error) => context.commit('API_FAILURE', error)) - }, - getAllApps(context) { - context.commit('startLoading', 'all'); + context.commit('startLoading', 'list'); return api.get(OC.generateUrl(`settings/apps/list`)) .then((response) => { context.commit('setAllApps', response.data.apps); - context.commit('stopLoading', 'all'); + context.commit('stopLoading', 'list'); return true; }) .catch((error) => context.commit('API_FAILURE', error)) |