From 3b285c5074c3cec08ab36ad5570b7a306f5f4eb1 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Tue, 1 Jan 2019 01:40:31 -0500 Subject: [PATCH] feat: beta preparation + utf16 editor fix --- client/components/admin/admin-api.vue | 27 ++++++- client/components/admin/admin-auth.vue | 9 ++- client/components/admin/admin-dashboard.vue | 77 ++++++++----------- client/components/admin/admin-dev.vue | 6 +- client/components/admin/admin-editor.vue | 29 ++++--- client/components/admin/admin-general.vue | 2 + client/components/admin/admin-groups.vue | 1 + client/components/admin/admin-logging.vue | 6 +- client/components/admin/admin-rendering.vue | 20 ++++- client/components/admin/admin-search.vue | 17 ++-- client/components/admin/admin-storage.vue | 6 +- client/components/admin/admin-theme.vue | 7 ++ .../admin/admin-users-authorize.vue | 54 ++++--------- client/components/admin/admin-users-edit.vue | 2 +- client/components/admin/admin-users.vue | 2 +- client/components/admin/admin-utilities.vue | 31 +++++++- client/components/common/nav-header.vue | 21 ++++- client/components/editor.vue | 31 ++++++-- client/static/svg/icon-news.svg | 44 +++++++++++ client/static/svg/icon-table.svg | 46 +++++++++++ package.json | 1 + server/graph/resolvers/authentication.js | 2 +- server/graph/resolvers/user.js | 6 +- server/models/users.js | 49 ++++++------ 24 files changed, 342 insertions(+), 154 deletions(-) create mode 100644 client/static/svg/icon-news.svg create mode 100644 client/static/svg/icon-table.svg diff --git a/client/components/admin/admin-api.vue b/client/components/admin/admin-api.vue index 5d3276e7..7202522f 100644 --- a/client/components/admin/admin-api.vue +++ b/client/components/admin/admin-api.vue @@ -8,12 +8,12 @@ .headline.blue--text.text--darken-2 API .subheading.grey--text Manage keys to access the API v-spacer - v-btn(outline, color='grey', large) + v-btn(outline, color='grey', large, @click='refresh') v-icon refresh - v-btn(color='green', dark, depressed, large) + v-btn(color='green', dark, depressed, large, @click='globalSwitch') v-icon(left) power_settings_new | Enable API - v-btn(color='primary', depressed, large) + v-btn(color='primary', depressed, large, @click='newKey') v-icon(left) add | New API Key v-card.mt-3 @@ -104,6 +104,27 @@ export default { } else { this.selected = this.items.slice() } + }, + async refresh() { + this.$store.commit('showNotification', { + style: 'indigo', + message: `Coming soon...`, + icon: 'directions_boat' + }) + }, + async globalSwitch() { + this.$store.commit('showNotification', { + style: 'indigo', + message: `Coming soon...`, + icon: 'directions_boat' + }) + }, + async newKey() { + this.$store.commit('showNotification', { + style: 'indigo', + message: `Coming soon...`, + icon: 'directions_boat' + }) } } } diff --git a/client/components/admin/admin-auth.vue b/client/components/admin/admin-auth.vue index ce568a26..4250fb4f 100644 --- a/client/components/admin/admin-auth.vue +++ b/client/components/admin/admin-auth.vue @@ -10,9 +10,9 @@ v-spacer v-btn(outline, color='grey', @click='refresh', large) v-icon refresh - v-btn(color='primary', @click='save', depressed, large) - v-icon(left) chevron_right - span Apply Configuration + v-btn(color='success', @click='save', depressed, large) + v-icon(left) check + span {{$t('common:actions.apply')}} v-card.mt-3 v-tabs(color='grey darken-2', fixed-tabs, slider-color='white', show-arrows, dark) @@ -26,13 +26,14 @@ .body-2.grey--text.text--darken-1 Select which authentication strategies to enable: .caption.grey--text.pb-2 Some strategies require additional configuration in their dedicated tab (when selected). v-form + //- TODO - Prevent crash on unfinished strategies v-checkbox.my-0( v-for='strategy in strategies' v-model='strategy.isEnabled' :key='strategy.key' :label='strategy.title' color='primary' - :disabled='strategy.key === `local`' + :disabled='strategy.key === `local` || true' hide-details ) v-flex(xs12, md6) diff --git a/client/components/admin/admin-dashboard.vue b/client/components/admin/admin-dashboard.vue index 935d79f3..b7832e46 100644 --- a/client/components/admin/admin-dashboard.vue +++ b/client/components/admin/admin-dashboard.vue @@ -8,53 +8,38 @@ .headline.primary--text {{ $t('admin:dashboard.title') }} .subheading.grey--text {{ $t('admin:dashboard.subtitle') }} v-flex(xs12 md6 lg4 xl3 d-flex) - v-hover - v-card.primary.dashboard-card( - dark - slot-scope='{ hover }' - :class='hover ? `elevation-10` : `elevation-2`' - ) - v-card-text - v-icon.dashboard-icon insert_drive_file - .subheading Pages - animated-number.display-1( - :value='info.pagesTotal' - :duration='2000' - :formatValue='round' - easing='easeOutQuint' - ) + v-card.primary.dashboard-card(dark) + v-card-text + v-icon.dashboard-icon insert_drive_file + .subheading Pages + animated-number.display-1( + :value='info.pagesTotal' + :duration='2000' + :formatValue='round' + easing='easeOutQuint' + ) v-flex(xs12 md6 lg4 xl3 d-flex) - v-hover - v-card.indigo.lighten-1.dashboard-card( - dark - slot-scope='{ hover }' - :class='hover ? `elevation-10` : `elevation-2`' - ) - v-card-text - v-icon.dashboard-icon person - .subheading Users - animated-number.display-1( - :value='info.usersTotal' - :duration='2000' - :formatValue='round' - easing='easeOutQuint' - ) + v-card.indigo.lighten-1.dashboard-card(dark) + v-card-text + v-icon.dashboard-icon person + .subheading Users + animated-number.display-1( + :value='info.usersTotal' + :duration='2000' + :formatValue='round' + easing='easeOutQuint' + ) v-flex(xs12 md6 lg4 xl3 d-flex) - v-hover - v-card.indigo.lighten-2.dashboard-card( - dark - slot-scope='{ hover }' - :class='hover ? `elevation-10` : `elevation-2`' - ) - v-card-text - v-icon.dashboard-icon people - .subheading Groups - animated-number.display-1( - :value='info.groupsTotal' - :duration='2000' - :formatValue='round' - easing='easeOutQuint' - ) + v-card.indigo.lighten-2.dashboard-card(dark) + v-card-text + v-icon.dashboard-icon people + .subheading Groups + animated-number.display-1( + :value='info.groupsTotal' + :duration='2000' + :formatValue='round' + easing='easeOutQuint' + ) v-flex(xs12 md6 lg12 xl3 d-flex) v-card.dashboard-card( :class='isLatestVersion ? "teal lighten-2" : "red lighten-2"' @@ -65,7 +50,7 @@ v-icon(v-else, color='red darken-4') get_app v-card-text v-icon.dashboard-icon blur_on - .subheading Wiki.js {{info.currentVersion}} + .subheading Wiki.js {{info.currentVersion}} BETA .body-2(v-if='isLatestVersion') You are running the latest version. .body-2(v-else) A new version is available: {{info.latestVersion}} v-flex(xs12) diff --git a/client/components/admin/admin-dev.vue b/client/components/admin/admin-dev.vue index 784af487..750113b6 100644 --- a/client/components/admin/admin-dev.vue +++ b/client/components/admin/admin-dev.vue @@ -16,7 +16,7 @@ slider-color='white' show-arrows dark - @input='tabChanged' + @change='tabChanged' ) v-tab(key='0') Graph API Playground v-tab(key='1') Graph API Map @@ -67,7 +67,7 @@ let graphiQLInstance export default { data() { return { - selectedTab: '0' + selectedTab: 0 } }, mounted() { @@ -76,7 +76,7 @@ export default { methods: { tabChanged (tabId) { switch (tabId) { - case '1': + case 1: this.renderVoyager() break } diff --git a/client/components/admin/admin-editor.vue b/client/components/admin/admin-editor.vue index fa1d4ff2..6acb5757 100644 --- a/client/components/admin/admin-editor.vue +++ b/client/components/admin/admin-editor.vue @@ -6,13 +6,13 @@ img(src='/svg/icon-web-design.svg', alt='Editor', style='width: 80px;') .admin-header-title .headline.primary--text Editor - .subheading.grey--text Configure the content editor + .subheading.grey--text Configure the content editors v-spacer v-btn(outline, color='grey', @click='refresh', large) v-icon refresh - v-btn(color='primary', @click='save', depressed, large) - v-icon(left) chevron_right - span Apply Configuration + v-btn(color='success', @click='save', depressed, large) + v-icon(left) check + span {{$t('common:actions.apply')}} v-card.mt-3 v-tabs(color='grey darken-2', fixed-tabs, slider-color='white', show-arrows, dark) @@ -24,8 +24,15 @@ .body-2.grey--text.text--darken-1 Select which editors to enable: .caption.grey--text.pb-2 Some editors require additional configuration in their dedicated tab (when selected). v-form - v-radio-group(v-model='selectedEditor') - v-radio(v-for='(editor, n) in editors', :key='n', :label='editor.text', :value='editor.value', color='primary') + v-checkbox.my-0( + v-for='editor in editors' + v-model='editor.isEnabled' + :key='editor.key' + :label='editor.title' + color='primary' + disabled + hide-details + ) v-tab-item(key='code', :transition='false', :reverse-transition='false') v-card.wiki-form.pa-3(flat, tile) v-form @@ -38,9 +45,13 @@ export default { data() { return { editors: [ - { text: 'Markdown (default)', value: 'code' } - ], - selectedEditor: 'code' + { title: 'API Docs', key: 'api', isEnabled: false }, + { title: 'Code', key: 'code', isEnabled: true }, + { title: 'Markdown', key: 'markdown', isEnabled: true }, + { title: 'Tabular', key: 'tabular', isEnabled: false }, + { title: 'Visual Builder', key: 'visual', isEnabled: false }, + { title: 'WikiText', key: 'wikitext', isEnabled: false } + ] } }, methods: { diff --git a/client/components/admin/admin-general.vue b/client/components/admin/admin-general.vue index ef3dece9..1ddcf341 100644 --- a/client/components/admin/admin-general.vue +++ b/client/components/admin/admin-general.vue @@ -77,6 +77,8 @@ v-toolbar(color='primary', dark, dense, flat) v-toolbar-title .subheading {{ $t('admin:general.siteBranding') }} + v-spacer + v-chip(label, color='white', small).primary--text coming soon v-subheader Logo v-card-text v-layout.px-3(row, align-center) diff --git a/client/components/admin/admin-groups.vue b/client/components/admin/admin-groups.vue index ad56fe52..12009a15 100644 --- a/client/components/admin/admin-groups.vue +++ b/client/components/admin/admin-groups.vue @@ -25,6 +25,7 @@ label='Group Name' counter='255' @keyup.enter='createGroup' + @keyup.esc='newGroupDialog = false' ref='groupNameIpt' ) v-card-chin diff --git a/client/components/admin/admin-logging.vue b/client/components/admin/admin-logging.vue index 7244cd85..9bd8be2f 100644 --- a/client/components/admin/admin-logging.vue +++ b/client/components/admin/admin-logging.vue @@ -13,9 +13,9 @@ v-btn(color='black', dark, depressed, @click='toggleConsole', large) ConsoleLineIcon.mr-3 span Live Trail - v-btn.mr-0(color='primary', @click='save', depressed, large) - v-icon(left) chevron_right - span Apply Configuration + v-btn(color='success', @click='save', depressed, large) + v-icon(left) check + span {{$t('common:actions.apply')}} v-card.mt-3 v-tabs(color='grey darken-2', fixed-tabs, slider-color='white', show-arrows, dark) diff --git a/client/components/admin/admin-rendering.vue b/client/components/admin/admin-rendering.vue index 7fedc7da..9d6af0fe 100644 --- a/client/components/admin/admin-rendering.vue +++ b/client/components/admin/admin-rendering.vue @@ -10,9 +10,9 @@ v-spacer v-btn(outline, color='grey', @click='refresh', large) v-icon refresh - v-btn(color='primary', @click='save', depressed, large) - v-icon(left) chevron_right - span Apply Configuration + v-btn(color='success', @click='save', depressed, large) + v-icon(left) check + span {{$t('common:actions.apply')}} v-flex(lg3, xs12) v-toolbar( @@ -155,6 +155,20 @@ export default { this.currentRenderer = _.find(rdr.children, ['key', key]) } }) + }, + async refresh () { + this.$store.commit('showNotification', { + style: 'indigo', + message: `Coming soon...`, + icon: 'directions_boat' + }) + }, + async save () { + this.$store.commit('showNotification', { + style: 'indigo', + message: `Coming soon...`, + icon: 'directions_boat' + }) } }, apollo: { diff --git a/client/components/admin/admin-search.vue b/client/components/admin/admin-search.vue index c97a77c5..07f1d241 100644 --- a/client/components/admin/admin-search.vue +++ b/client/components/admin/admin-search.vue @@ -10,12 +10,12 @@ v-spacer v-btn(outline, color='grey', @click='refresh', large) v-icon refresh - v-btn(color='black', dark, large, depressed) + v-btn(color='black', dark, large, depressed, @click='rebuild') v-icon(left) cached span Rebuild Index - v-btn(color='primary', @click='save', depressed, large) - v-icon(left) chevron_right - span Apply Configuration + v-btn(color='success', @click='save', depressed, large) + v-icon(left) check + span {{$t('common:actions.apply')}} v-card.mt-3 v-tabs(color='grey darken-2', fixed-tabs, slider-color='white', show-arrows, dark) @@ -137,11 +137,18 @@ export default { } }) this.$store.commit('showNotification', { - message: 'Logging configuration saved successfully.', + message: 'Search engine configuration saved successfully.', style: 'success', icon: 'check' }) this.$store.commit(`loadingStop`, 'admin-search-saveengines') + }, + async rebuild () { + this.$store.commit('showNotification', { + style: 'indigo', + message: `Coming soon...`, + icon: 'directions_boat' + }) } }, apollo: { diff --git a/client/components/admin/admin-storage.vue b/client/components/admin/admin-storage.vue index c2412ccf..66e008c8 100644 --- a/client/components/admin/admin-storage.vue +++ b/client/components/admin/admin-storage.vue @@ -10,9 +10,9 @@ v-spacer v-btn(outline, color='grey', @click='refresh', large) v-icon refresh - v-btn(color='primary', @click='save', depressed, large) - v-icon(left) chevron_right - span Apply Configuration + v-btn(color='success', @click='save', depressed, large) + v-icon(left) check + span {{$t('common:actions.apply')}} v-card.mt-3 v-tabs(color='grey darken-2', fixed-tabs, slider-color='white', show-arrows, dark) diff --git a/client/components/admin/admin-theme.vue b/client/components/admin/admin-theme.vue index 1428c1c3..20aaa80d 100644 --- a/client/components/admin/admin-theme.vue +++ b/client/components/admin/admin-theme.vue @@ -47,6 +47,8 @@ v-toolbar(color='primary', dark, dense, flat) v-toolbar-title .subheading Code Injection + v-spacer + v-chip(label, color='white', small).primary--text coming soon v-card-text v-textarea( v-model='injectCSS' @@ -57,6 +59,7 @@ persistent-hint hint='CSS code to inject after system default CSS' auto-grow + disabled ) v-textarea.mt-2( v-model='injectHeader' @@ -67,6 +70,7 @@ persistent-hint hint='HTML code to be injected just before the closing head tag' auto-grow + disabled ) v-textarea.mt-2( v-model='injectFooter' @@ -77,12 +81,15 @@ persistent-hint hint='HTML code to be injected just before the closing body tag' auto-grow + disabled ) v-flex(lg6 xs12) v-card v-toolbar(color='teal', dark, dense, flat) v-toolbar-title .subheading Download Themes + v-spacer + v-chip(label, color='white', small).teal--text coming soon v-card-text.caption -- Coming soon -- diff --git a/client/components/admin/admin-users-authorize.vue b/client/components/admin/admin-users-authorize.vue index 32469570..8fdd7775 100644 --- a/client/components/admin/admin-users-authorize.vue +++ b/client/components/admin/admin-users-authorize.vue @@ -1,62 +1,44 @@