From 1ca963faf1e25da9aa49f942713ecc1a5120985e Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Thu, 2 Nov 2017 14:00:50 +0100 Subject: [PATCH 01/12] Add initial notice --- src/App.vue | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/App.vue b/src/App.vue index 6f8a67f8..545de057 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,6 +7,28 @@ main.uk-width-expand router-view + + #scaleout-notice-modal(uk-modal="bg-close : false") + .uk-modal-dialog.uk-margin-auto-vertical + button.uk-modal-close-default(type='button', uk-close) + .uk-modal-header + h2.uk-modal-title Important notice + .uk-modal-body + .uk-alert-danger(uk-alert) + p.uk-h5.uk-text-danger Concerning cluster-setup! + p We highly recommend disabling the market app if this ownCloud instance is hosted in a clustered environment. Installing and updating applications via the market app may lead to unforeseen consequences. + p If you would like to know more, please visit  + a.uk-text-primary(href="#") this Website + | . + + .uk-modal-footer.uk-flex.uk-flex-middle + .uk-width-1-2.uk-text-left + label + input.uk-checkbox(type="checkbox", v-model="showOnStartup").uk-margin-small-right + | Show message on startup + .uk-width-1-2.uk-text-right + button.uk-button.uk-button-default.uk-modal-close(type='button') Close + diff --git a/src/store.js b/src/store.js index 973316b8..cdac199f 100644 --- a/src/store.js +++ b/src/store.js @@ -6,6 +6,9 @@ import _ from "underscore"; Vue.use(Vuex); const state = { + + config: {}, + categories: { loading: false, failed: false, @@ -31,18 +34,17 @@ const state = { changeable : false }, - licenseKey : { - exists : false, - loading : false, - unborn: true - }, - processing: [], installed: [] }; // Retrieve computed values from state. const getters = { + + config (state) { + return state.config; + }, + categories (state) { return state.categories.records; }, @@ -98,6 +100,11 @@ const getters = { // Manipulate from the current state. const mutations = { + + CONFIG (state, changes) { + _.extend(state["config"], changes); + }, + LOADING_APPLICATIONS (state) { _.extend(state["applications"], { loading: true, @@ -120,10 +127,6 @@ const mutations = { }) }, - LICENSE_KEY (state, changes) { - _.extend(state["licenseKey"], changes); - }, - SET_APPLICATIONS (state, content) { _.extend(state["applications"], { records: content @@ -281,16 +284,6 @@ const actions = { }); }, - CHECK_LICENSE_KEY (context) { - Axios.get(OC.generateUrl("/apps/market/has-license-key")) - .then(() => { - context.commit("LICENSE_KEY", { "exists" : true, "unborn" : false }); - }) - .catch(() => { - context.commit("LICENSE_KEY", { "exists" : false, "unborn" : false }); - }); - }, - REQUEST_LICENSE_KEY (context) { context.commit("LICENSE_KEY", {"loading": true }); @@ -389,6 +382,17 @@ const actions = { }); }, + FETCH_CONFIG (context) { + // context.commit("CONFIG", {"loading": true }); + Axios.get(OC.generateUrl("/apps/market/config")) + .then((response) => { + context.commit("CONFIG", response.data); + }) + .catch((error) => { + // context.commit("APIKEY", {"loading": false }); + }); + }, + WRITE_APIKEY (context, payload) { let key = payload; context.commit("APIKEY", {"loading": true }); From 8483caa57cb6a74b88782518a85eb4cdeace3fd1 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Wed, 8 Nov 2017 12:53:50 +0100 Subject: [PATCH 07/12] Update notice text --- src/App.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index e5748fb7..cff67f8d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,14 +9,12 @@ .uk-card.uk-card-default.uk-card-body.uk-width-xlarge.uk-align-center h1.uk-card-title Notice .uk-alert-danger(uk-alert) - p We recommend disabling the market app in a clustered environment. + p You're running ownCloud in a clustered setup. Installing or upgrading apps via the Market app is currently not supported. - p - | Installing and updating applications via the market app is not supportet. - br - | For more details, please visit  - a.uk-text-primary(href="#") this Website - | . + p Please follow the  + a(href="https://doc.owncloud.com/server/latest/admin_manual/upgrading/marketplace_apps.html#clustered-multi-server-environment") manual process + + p You can however browse the available apps and will receive update notifications. hr.uk-hr .uk-flex.uk-flex-middle From 646a591ea8fb0324e450aa8f2f9e382f41e16b8a Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 8 Nov 2017 11:19:25 +0100 Subject: [PATCH 08/12] Use MarketService::canInstall from MarketController --- lib/Controller/MarketController.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/Controller/MarketController.php b/lib/Controller/MarketController.php index 6a157a53..c84029bf 100644 --- a/lib/Controller/MarketController.php +++ b/lib/Controller/MarketController.php @@ -30,7 +30,6 @@ use OCP\IL10N; use OCP\IRequest; use OCP\IConfig; -use OCP\App\IAppManager; class MarketController extends Controller { @@ -43,20 +42,15 @@ class MarketController extends Controller { /** @var IConfig */ private $config; - /** @var IAppManager */ - private $appManager; - public function __construct($appName, IRequest $request, MarketService $marketService, IL10N $l10n, - IAppManager $appManager, IConfig $config) { parent::__construct($appName, $request); $this->marketService = $marketService; $this->l10n = $l10n; $this->config = $config; - $this->appManager = $appManager; } /** @@ -278,7 +272,7 @@ public function getConfig() { } $config = [ - 'canInstall' => $this->appManager->canInstall(), + 'canInstall' => $this->marketService->canInstall(), 'hasInternetConnection' => $this->config->getSystemValue('has_internet_connection', true), 'licenseKeyAvailable' => $licenseKeyAvailable, 'licenseMessage' => $licenseMessage From 5ec66fe16b57f5b2ae59023e17db823347891a37 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Thu, 9 Nov 2017 18:57:14 +0100 Subject: [PATCH 09/12] Update notice position and content, bump Uikit version --- npm-shrinkwrap.json | 6 +-- package.json | 2 +- src/App.vue | 113 ++++++++++++++++++-------------------------- src/store.js | 2 +- 4 files changed, 52 insertions(+), 71 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index dd10b872..fe1f6502 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4596,9 +4596,9 @@ "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz" }, "uikit": { - "version": "3.0.0-beta.30", - "from": "uikit@3.0.0-beta.30", - "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.0.0-beta.30.tgz" + "version": "3.0.0-beta.34", + "from": "uikit@latest", + "resolved": "https://registry.npmjs.org/uikit/-/uikit-3.0.0-beta.34.tgz" }, "undefsafe": { "version": "0.0.3", diff --git a/package.json b/package.json index 9e544802..0fba7c50 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "showdown": "^1.7.6", "style-loader": "0.16.1", "uglify-js": "3.1.3", - "uikit": "3.0.0-beta.30", + "uikit": "3.0.0-beta.34", "underscore": "1.8.3", "vue": "2.4.4", "vue-gettext": "2.0.23", diff --git a/src/App.vue b/src/App.vue index cff67f8d..6abba0bb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,75 +1,56 @@ \ No newline at end of file diff --git a/src/store.js b/src/store.js index cdac199f..80ebadb6 100644 --- a/src/store.js +++ b/src/store.js @@ -102,7 +102,7 @@ const getters = { const mutations = { CONFIG (state, changes) { - _.extend(state["config"], changes); + state["config"] = changes; }, LOADING_APPLICATIONS (state) { From cdfee0fed9fc84bef5d46a37750aa20af99eb065 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Thu, 9 Nov 2017 19:01:02 +0100 Subject: [PATCH 10/12] Notice appears only if config.canInstall is false --- src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 6abba0bb..1f186c71 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,7 +34,7 @@ return this.$store.getters.config }, showNotice() { - return this.noticeDismissed === false && this.config.canInstall === true + return this.noticeDismissed === false && this.config.canInstall === false } }, methods: { }, From 1e2b6596a178ae560082c12b5c3421adad36c2e6 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Fri, 10 Nov 2017 12:38:02 +0100 Subject: [PATCH 11/12] Make sure to node.js LTS --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08fe22d8..5da0c874 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,7 @@ branches: - /^stable\d+(\.\d+)?$/ before_install: - - nvm install node - - npm install -g npm@latest + - nvm install --lts - composer install - wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB From 0be56b7b30d17fc06dba534a58c3e245779ceae2 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Fri, 10 Nov 2017 15:25:23 +0100 Subject: [PATCH 12/12] Fix Trail starter. Read license_key status from config --- src/components/Trial.vue | 10 +++++----- src/store.js | 25 ++++++++++--------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/components/Trial.vue b/src/components/Trial.vue index 91a43a7c..83d6b6f0 100644 --- a/src/components/Trial.vue +++ b/src/components/Trial.vue @@ -1,6 +1,6 @@ @@ -56,7 +56,7 @@ .then(this.$router.push({ name: 'Bundles' })) .catch(() => { console.warn('REQUEST_LICENSE_KEY failed') - }) + }); } }, computed : { diff --git a/src/store.js b/src/store.js index 80ebadb6..d54071a0 100644 --- a/src/store.js +++ b/src/store.js @@ -285,25 +285,18 @@ const actions = { }, REQUEST_LICENSE_KEY (context) { - context.commit("LICENSE_KEY", {"loading": true }); - return Axios.get(OC.generateUrl("/apps/market/request-license-key-from-market")) .then((response) => { - context.commit("LICENSE_KEY", { - "loading": false, - "exists" : true, - "unborn" : false + context.dispatch('FETCH_CONFIG'); + UIkit.notification(error.response.data.message, { + status : "success", + pos : "bottom-right" }); }) .catch((error) => { - context.commit("LICENSE_KEY", { - "loading": false, - "exists" : false, - "unborn" : false - }); UIkit.notification(error.response.data.message, { - status:"danger", - pos: "bottom-right" + status : "danger", + pos : "bottom-right" }); return Promise.reject(error.response); @@ -383,13 +376,15 @@ const actions = { }, FETCH_CONFIG (context) { - // context.commit("CONFIG", {"loading": true }); Axios.get(OC.generateUrl("/apps/market/config")) .then((response) => { context.commit("CONFIG", response.data); }) .catch((error) => { - // context.commit("APIKEY", {"loading": false }); + UIkit.notification(error.response.data.message, { + status:"danger", + pos: "bottom-right" + }); }); },