aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-05-30 16:06:18 +0200
committerJulius Härtl <jus@bitgrid.net>2018-06-06 11:40:09 +0200
commit1a034ce6993373b35ac05fb7a7463fc5b55b69ae (patch)
tree550ea3696ecb236642cd28a831110d532d990dc2
parent5128f7ea30abea98d38033b79d57e980024deb17 (diff)
downloadnextcloud-server-1a034ce6993373b35ac05fb7a7463fc5b55b69ae.tar.gz
nextcloud-server-1a034ce6993373b35ac05fb7a7463fc5b55b69ae.zip
Implement update functionality
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--lib/private/App/AppManager.php1
-rw-r--r--lib/private/legacy/app.php1
-rw-r--r--settings/src/store/apps.js25
3 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index 4d0859b1988..94addb2b785 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -323,6 +323,7 @@ class AppManager implements IAppManager {
public function clearAppsCache() {
$settingsMemCache = $this->memCacheFactory->createDistributed('settings');
$settingsMemCache->clear('listApps');
+ $this->appInfos = [];
}
/**
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 70f1b16e3c6..d3c9859c68d 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -887,6 +887,7 @@ class OC_App {
}
self::registerAutoloading($appId, $appPath);
+ \OC::$server->getAppManager()->clearAppsCache();
$appData = self::getAppInfo($appId);
self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']);
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js
index f19f894309b..9fedabf0223 100644
--- a/settings/src/store/apps.js
+++ b/settings/src/store/apps.js
@@ -99,6 +99,15 @@ const mutations = {
state.apps.find(app => app.id === appId).canInstall = true;
},
+ updateApp(state, appId) {
+ let app = state.apps.find(app => app.id === appId);
+ let version = app.update;
+ app.update = null;
+ app.version = version;
+ state.updateCount--;
+
+ },
+
resetApps(state) {
state.apps = [];
},
@@ -246,6 +255,22 @@ const actions = {
}).catch((error) => context.commit('API_FAILURE', { appId, error }));
},
+ updateApp(context, { appId }) {
+ return api.requireAdmin().then((response) => {
+ context.commit('startLoading', appId);
+ return api.get(OC.generateUrl(`settings/apps/update/${appId}`))
+ .then((response) => {
+ context.commit('stopLoading', appId);
+ context.commit('updateApp', appId);
+ return true;
+ })
+ .catch((error) => {
+ context.commit('stopLoading', appId);
+ context.commit('APPS_API_FAILURE', { appId, error })
+ })
+ }).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}`))