From abbe1804e2febac2b1e477ca361264ddfc34a781 Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Sun, 17 Dec 2017 16:08:52 +0100 Subject: [PATCH] Workspaces (part 2) --- src/components/App.vue | 6 + src/components/Explorer.vue | 6 +- src/components/Layout.vue | 2 +- src/components/NavigationBar.vue | 2 +- src/components/Preview.vue | 2 +- src/components/ProviderName.vue | 22 ++ src/components/common/variables.scss | 3 +- src/components/gutters/NewComment.vue | 2 +- src/components/gutters/StickyComment.vue | 4 + src/components/menus/ExportMenu.vue | 4 +- src/components/menus/HistoryMenu.vue | 6 +- src/components/menus/MainMenu.vue | 53 +++-- src/components/menus/MoreMenu.vue | 33 ++- src/components/menus/SyncMenu.vue | 6 +- src/components/menus/WorkspacesMenu.vue | 16 +- src/components/menus/common/MenuEntry.vue | 22 +- src/components/modals/PandocExportModal.vue | 8 +- src/components/modals/PdfExportModal.vue | 8 +- src/components/modals/SponsorModal.vue | 6 +- .../modals/WorkspaceManagementModal.vue | 48 ++-- src/components/modals/common/ModalInner.vue | 6 +- .../providers/GoogleDriveWorkspaceModal.vue | 9 +- src/data/defaultLocalSettings.js | 1 + src/data/defaultSettings.yml | 2 + src/data/defaultWorkspaces.js | 1 + src/icons/Provider.vue | 1 + src/index.js | 2 +- src/services/localDbSvc.js | 90 +++++--- src/services/networkSvc.js | 10 +- .../providers/googleDriveAppDataProvider.js | 23 +- .../providers/googleDriveWorkspaceProvider.js | 207 ++++++------------ .../providers/helpers/googleHelper.js | 70 +++--- src/services/sponsorSvc.js | 4 +- src/services/syncSvc.js | 118 +++++----- src/services/utils.js | 43 +++- src/store/data.js | 30 +-- src/store/discussion.js | 2 +- src/store/index.js | 6 +- src/store/modal.js | 7 +- src/store/workspace.js | 48 ++-- 40 files changed, 532 insertions(+), 407 deletions(-) create mode 100644 src/components/ProviderName.vue diff --git a/src/components/App.vue b/src/components/App.vue index 1b93dccd..dbff177f 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -82,6 +82,12 @@ export default { networkSvc.init(); sponsorSvc.init(); this.ready = true; + }) + .catch((err) => { + if (err && err.message !== 'reload') { + console.error(err); // eslint-disable-line no-console + this.$store.dispatch('notification/error', err); + } }); }, }; diff --git a/src/components/Explorer.vue b/src/components/Explorer.vue index c2e3bd47..08253e59 100644 --- a/src/components/Explorer.vue +++ b/src/components/Explorer.vue @@ -8,12 +8,12 @@ - + @@ -79,7 +79,7 @@ export default { let revisionContentPromise = revisionContentPromises[revision.id]; if (!revisionContentPromise) { revisionContentPromise = new Promise((resolve, reject) => { - const loginToken = this.$store.getters['data/loginToken']; + const loginToken = this.$store.getters['workspace/loginToken']; const currentFile = this.$store.getters['file/current']; this.$store.dispatch('queue/enqueue', () => Promise.resolve() @@ -133,7 +133,7 @@ export default { this.setRevisionContent(); cachedFileId = id; revisionContentPromises = {}; - const loginToken = this.$store.getters['data/loginToken']; + const loginToken = this.$store.getters['workspace/loginToken']; const currentFile = this.$store.getters['file/current']; revisionsPromise = new Promise((resolve, reject) => { this.$store.dispatch('queue/enqueue', diff --git a/src/components/menus/MainMenu.vue b/src/components/menus/MainMenu.vue index 7ade6617..c8b6116d 100644 --- a/src/components/menus/MainMenu.vue +++ b/src/components/menus/MainMenu.vue @@ -1,15 +1,31 @@