From fcee4c094591b647fdcdece6abf0d61547928156 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Mon, 24 Dec 2018 01:03:10 -0500 Subject: [PATCH] feat: admin general + verify account --- client/client-app.js | 2 +- client/components/admin/admin-general.vue | 162 +++++++++++++----- client/components/admin/admin-locale.vue | 1 + client/components/common/loader.vue | 14 ++ client/components/register.vue | 19 +- .../admin/site/site-mutation-save-config.gql | 38 ++++ client/graph/admin/site/site-query-config.gql | 18 ++ client/static/svg/icon-checkmark.svg | 14 ++ package.json | 1 + server/controllers/auth.js | 12 ++ server/core/mail.js | 4 +- server/db/migrations/2.0.0.js | 2 +- server/graph/resolvers/authentication.js | 6 - server/graph/resolvers/site.js | 56 ++++++ server/graph/schemas/site.graphql | 59 +++++++ server/helpers/error.js | 4 + server/models/authentication.js | 2 +- server/models/settings.js | 2 +- server/models/userKeys.js | 74 ++++++++ server/models/users.js | 12 +- server/setup.js | 70 ++++++-- server/templates/account-verify.html | 2 +- 22 files changed, 494 insertions(+), 80 deletions(-) create mode 100644 client/graph/admin/site/site-mutation-save-config.gql create mode 100644 client/graph/admin/site/site-query-config.gql create mode 100644 client/static/svg/icon-checkmark.svg create mode 100644 server/graph/resolvers/site.js create mode 100644 server/graph/schemas/site.graphql create mode 100644 server/models/userKeys.js diff --git a/client/client-app.js b/client/client-app.js index 30f1f120..f41981cb 100644 --- a/client/client-app.js +++ b/client/client-app.js @@ -80,7 +80,7 @@ const graphQLLink = ApolloLink.from([ }) } }), - createPersistedQueryLink(), + // createPersistedQueryLink(), new BatchHttpLink({ includeExtensions: true, uri: graphQLEndpoint, diff --git a/client/components/admin/admin-general.vue b/client/components/admin/admin-general.vue index c660a2dd..ff92b9c6 100644 --- a/client/components/admin/admin-general.vue +++ b/client/components/admin/admin-general.vue @@ -22,11 +22,21 @@ v-subheader General .px-3.pb-3 v-text-field( + outline + label='Site URL' + required + :counter='255' + v-model='config.host' + prepend-icon='label_important' + hint='Full URL to your wiki, without the trailing slash. (e.g. https://wiki.example.com)' + persistent-hint + ) + v-text-field.mt-2( outline label='Site Title' required :counter='50' - v-model='siteTitle' + v-model='config.title' prepend-icon='public' ) v-divider @@ -36,22 +46,28 @@ outline label='Site Description' :counter='255' - prepend-icon='public' + v-model='config.description' + prepend-icon='explore' ) v-text-field( outline label='Site Keywords' :counter='255' - prepend-icon='public' + v-model='config.keywords' + prepend-icon='explore' + hint='Comma-separated list of keywords.' + persistent-hint ) - v-select( + v-select.mt-2( outline label='Meta Robots' - chips - tags + multiple :items='metaRobots' - v-model='metaRobotsSelection' - prepend-icon='public' + v-model='config.robots' + prepend-icon='explore' + :return-object='false' + hint='Default: Index, Follow' + persistent-hint ) v-divider v-subheader Analytics @@ -60,30 +76,20 @@ outline label='Google Analytics ID' :counter='255' + v-model='config.ga' prepend-icon='timeline' persistent-hint - hint='Property tracking ID for Google Analytics.' - ) - v-divider - v-subheader Footer Copyright - .px-3.pb-3 - v-text-field( - outline - label='Company / Organization Name' - v-model='company' - :counter='255' - prepend-icon='business' - persistent-hint - hint='Name to use when displaying copyright notice in the footer. Leave empty to hide.' + hint='Property tracking ID for Google Analytics. Leave empty to disable.' ) v-flex(lg6 xs12) v-card.wiki-form v-toolbar(color='primary', dark, dense, flat) v-toolbar-title .subheading {{ $t('admin:general.siteBranding') }} + v-subheader Logo v-card-text - v-layout.pa-3(row, align-center) - v-avatar(size='120', color='grey lighten-3', :tile='useSquareLogo') + v-layout.px-3(row, align-center) + v-avatar(size='120', color='grey lighten-3', :tile='config.logoIsSquare') .ml-4 v-layout(row, align-center) v-btn(color='teal', depressed, dark) @@ -95,19 +101,23 @@ .caption.grey--text An image of 120x120 pixels is recommended for best results. .caption.grey--text SVG, PNG or JPG files only. v-switch( - v-model='useSquareLogo' + v-model='config.logoIsSquare' label='Use Square Logo Frame' color='primary' persistent-hint hint='Check this option if a round logo frame doesn\'t work with your logo.' ) - v-divider.mt-3 - v-switch( - v-model='displayMascot' - label='Display Wiki.js Mascot' - color='primary' + v-divider + v-subheader Footer Copyright + .px-3.pb-3 + v-text-field( + outline + label='Company / Organization Name' + v-model='config.company' + :counter='255' + prepend-icon='business' persistent-hint - hint='Uncheck this box if you don\'t want Henry, Wiki.js mascot, to be displayed on client-facing pages.' + hint='Name to use when displaying copyright notice in the footer. Leave empty to hide.' ) v-card.wiki-form.mt-3 @@ -116,17 +126,25 @@ .subheading Features v-card-text v-switch( - v-model='featurePageRatings' label='Page Ratings' color='primary' + v-model='config.featurePageRatings' persistent-hint hint='Allow users to rate pages.' ) v-divider.mt-3 v-switch( - v-model='featurePersonalWiki' + label='Page Comments' + color='primary' + v-model='config.featurePageComments' + persistent-hint + hint='Allow users to leave comments on pages.' + ) + v-divider.mt-3 + v-switch( label='Personal Wikis' color='primary' + v-model='config.featurePersonalWikis' persistent-hint hint='Allow users to have their own personal wiki.' ) @@ -134,18 +152,34 @@