From 62d1d7a1df052514068245afdf8a725a1a4a3d57 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 13 Oct 2019 19:59:50 -0400 Subject: [PATCH] feat: move page --- .../admin/admin-groups-edit-permissions.vue | 5 +- client/components/admin/admin-pages-edit.vue | 2 +- .../admin/admin-utilities-content.vue | 34 ++++- client/components/common/nav-header.vue | 24 ++- client/components/common/page-selector.vue | 19 ++- client/components/editor.vue | 5 + .../editor/editor-modal-properties.vue | 9 +- ...utilities-mutation-content-rebuildtree.gql | 12 ++ .../common/common-pages-mutation-move.gql | 12 ++ client/themes/default/scss/app.scss | 41 +++-- server/core/auth.js | 2 +- server/graph/resolvers/page.js | 125 ++++++++++++--- server/graph/schemas/page.graphql | 10 +- server/helpers/error.js | 20 +++ server/models/pages.js | 144 +++++++++++++++++- server/modules/search/algolia/engine.js | 4 +- server/modules/search/aws/engine.js | 4 +- server/modules/search/azure/engine.js | 4 +- server/modules/search/elasticsearch/engine.js | 4 +- server/modules/search/postgres/engine.js | 2 +- server/modules/storage/disk/storage.js | 25 +-- server/modules/storage/git/storage.js | 26 ++-- server/modules/storage/s3/common.js | 17 ++- 23 files changed, 451 insertions(+), 99 deletions(-) create mode 100644 client/graph/admin/utilities/utilities-mutation-content-rebuildtree.gql create mode 100644 client/graph/common/common-pages-mutation-move.gql diff --git a/client/components/admin/admin-groups-edit-permissions.vue b/client/components/admin/admin-groups-edit-permissions.vue index 9d516b6d..aa2512cb 100644 --- a/client/components/admin/admin-groups-edit-permissions.vue +++ b/client/components/admin/admin-groups-edit-permissions.vue @@ -24,6 +24,7 @@ v-card-text.pt-0 template(v-for='(pm, idx) in pmGroup.items') v-checkbox.pt-0( + style='justify-content: space-between;' :key='pm.permission' :label='pm.permission' :hint='pm.hint' @@ -60,14 +61,14 @@ export default { }, { permission: 'write:pages', - hint: 'Can create new pages, as specified in the Page Rules', + hint: 'Can create / edit pages, as specified in the Page Rules', warning: false, restrictedForSystem: false, disabled: false }, { permission: 'manage:pages', - hint: 'Can edit and move existing pages as specified in the Page Rules', + hint: 'Can move existing pages as specified in the Page Rules', warning: false, restrictedForSystem: false, disabled: false diff --git a/client/components/admin/admin-pages-edit.vue b/client/components/admin/admin-pages-edit.vue index c328c881..93cc9aa7 100644 --- a/client/components/admin/admin-pages-edit.vue +++ b/client/components/admin/admin-pages-edit.vue @@ -105,7 +105,7 @@ v-icon(left) mdi-code-tags span Source v-divider.mx-2(vertical) - v-btn(color='primary', text, :href='`/h/` + page.locale + `/` + page.path') + v-btn(color='primary', text, :href='`/h/` + page.locale + `/` + page.path', disabled) v-icon(left) mdi-history span History v-spacer diff --git a/client/components/admin/admin-utilities-content.vue b/client/components/admin/admin-utilities-content.vue index d6589033..c99491ba 100644 --- a/client/components/admin/admin-utilities-content.vue +++ b/client/components/admin/admin-utilities-content.vue @@ -3,6 +3,12 @@ v-toolbar(flat, color='primary', dark, dense) .subtitle-1 {{ $t('admin:utilities.contentTitle') }} v-card-text + .subtitle-1.pb-3.primary--text Rebuild Page Tree + .body-2 The virtual structure of your wiki is automatically inferred from all page paths. You can trigger a full rebuild of the tree if some virtual folders are missing or not valid anymore. + v-btn(outlined, color='primary', @click='rebuildTree', :disabled='loading').ml-0.mt-3 + v-icon(left) mdi-gesture-double-tap + span Proceed + v-divider.my-5 .subtitle-1.pb-3.pl-0.primary--text Migrate all pages to target locale .body-2 If you created content before selecting a different locale and activating the namespacing capabilities, you may want to transfer all content to the base locale. .body-2.red--text: strong This operation is destructive and cannot be reversed! Make sure you have proper backups! @@ -35,6 +41,7 @@