diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-10-03 17:08:39 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-12 13:21:50 +0200 |
commit | c2e882134526816e224bb408e42f4953f385c917 (patch) | |
tree | 1c28c5e3bdd08dafa3369225365a1fee7dcda88b /apps/workflowengine/src | |
parent | 7f8ff16c76ae31b0bcb2f62cc58ed89e7f2fbb22 (diff) | |
download | nextcloud-server-c2e882134526816e224bb408e42f4953f385c917.tar.gz nextcloud-server-c2e882134526816e224bb408e42f4953f385c917.zip |
Use the external initial state implementation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/workflowengine/src')
-rw-r--r-- | apps/workflowengine/src/helpers/api.js | 4 | ||||
-rw-r--r-- | apps/workflowengine/src/store.js | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/workflowengine/src/helpers/api.js b/apps/workflowengine/src/helpers/api.js index a6dc3a3d03a..2b2bb40a7e2 100644 --- a/apps/workflowengine/src/helpers/api.js +++ b/apps/workflowengine/src/helpers/api.js @@ -20,8 +20,10 @@ * */ +import { loadState } from '@nextcloud/initial-state' + const getApiUrl = (url) => { - const scopeValue = OCP.InitialState.loadState('workflowengine', 'scope') === 0 ? 'global' : 'user' + const scopeValue = loadState('workflowengine', 'scope') === 0 ? 'global' : 'user' return OC.linkToOCS('apps/workflowengine/api/v1/workflows', 2) + scopeValue + url + '?format=json' } diff --git a/apps/workflowengine/src/store.js b/apps/workflowengine/src/store.js index 41e170c0541..cbd9b29c81c 100644 --- a/apps/workflowengine/src/store.js +++ b/apps/workflowengine/src/store.js @@ -25,22 +25,23 @@ import Vuex from 'vuex' import axios from '@nextcloud/axios' import { getApiUrl } from './helpers/api' import confirmPassword from 'nextcloud-password-confirmation' +import { loadState } from '@nextcloud/initial-state' Vue.use(Vuex) const store = new Vuex.Store({ state: { rules: [], - scope: OCP.InitialState.loadState('workflowengine', 'scope'), - operations: OCP.InitialState.loadState('workflowengine', 'operators'), + scope: loadState('workflowengine', 'scope'), + operations: loadState('workflowengine', 'operators'), plugins: Vue.observable({ checks: {}, operators: {} }), - entities: OCP.InitialState.loadState('workflowengine', 'entities'), - events: OCP.InitialState.loadState('workflowengine', 'entities') + entities: loadState('workflowengine', 'entities'), + events: loadState('workflowengine', 'entities') .map((entity) => entity.events.map(event => { return { id: `${entity.id}::${event.eventName}`, @@ -48,7 +49,7 @@ const store = new Vuex.Store({ ...event } })).flat(), - checks: OCP.InitialState.loadState('workflowengine', 'checks') + checks: loadState('workflowengine', 'checks') }, mutations: { addRule(state, rule) { |