From 7e323beee6ed97ab225cbaa023c4e38250808e79 Mon Sep 17 00:00:00 2001 From: feysalikbal Date: Fri, 26 Oct 2018 19:22:40 +0300 Subject: [PATCH 1/4] Added missing translation key in JA language --- packages/strapi-admin/admin/src/translations/ja.json | 5 +++-- .../admin/src/translations/ja.json | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/strapi-admin/admin/src/translations/ja.json b/packages/strapi-admin/admin/src/translations/ja.json index 2cc9b560ed..dc940acb2f 100644 --- a/packages/strapi-admin/admin/src/translations/ja.json +++ b/packages/strapi-admin/admin/src/translations/ja.json @@ -90,9 +90,10 @@ "app.components.listPlugins.title.plural": "{number} 個のプラグインがインストールされました", "app.components.listPlugins.title.singular": "{number} 個のプラグインがインストールされました", "app.components.listPluginsPage.deletePlugin.error": "アンインストール中にエラーが発生しました", - "app.utils.SelectOption.defaultMessage": " ", "app.utils.defaultMessage": " ", + "app.utils.delete": "削除", "app.utils.placeholder.defaultMessage": " ", + "app.utils.SelectOption.defaultMessage": " ", "components.AutoReloadBlocker.description": "以下のファイルを開いて、有効化してください", "components.AutoReloadBlocker.header": "プラグインを有効化するにはリロードが必要です", "components.ErrorBoundary.title": "なにかが間違っています...", @@ -137,4 +138,4 @@ "notification.error": "エラーが発生しました", "notification.error.layout": "レイアウトを復旧できませんでした", "request.error.model.unknown": "modelが存在しません" -} \ No newline at end of file +} diff --git a/packages/strapi-plugin-content-manager/admin/src/translations/ja.json b/packages/strapi-plugin-content-manager/admin/src/translations/ja.json index 40c37989cf..db504a5779 100644 --- a/packages/strapi-plugin-content-manager/admin/src/translations/ja.json +++ b/packages/strapi-plugin-content-manager/admin/src/translations/ja.json @@ -18,7 +18,7 @@ "components.FiltersPickWrapper.PluginHeader.actions.clearAll": "すべてクリア", "components.FiltersPickWrapper.PluginHeader.description": "エントリをフィルタリングするための条件を設定する", "components.FiltersPickWrapper.PluginHeader.title.filter": "フィルタ", - "components.filterspickwrapper.hide": "隠す", + "components.FiltersPickWrapper.hide": "隠す", "components.LimitSelect.itemsPerPage": "ページあたりのアイテム数", "components.Search.placeholder": "エントリを検索する...", "components.TableDelete.delete": "すべて削除", @@ -111,4 +111,4 @@ "popUpWarning.warning.updateAllSettings": "これにより、すべての設定が変更されます", "success.record.delete": "削除", "success.record.save": "保存" -} \ No newline at end of file +} From ed924b057a813c099b7533bc426e5ae1cea53e87 Mon Sep 17 00:00:00 2001 From: Javier Castro Date: Fri, 26 Oct 2018 13:49:14 -0300 Subject: [PATCH 2/4] Fix #2211: Content-Manager: save not handling beforeSave hook throw error --- packages/strapi-hook-mongoose/lib/index.js | 5 ++++- .../config/queries/mongoose.js | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/strapi-hook-mongoose/lib/index.js b/packages/strapi-hook-mongoose/lib/index.js index 3829faed44..b2cc899a6a 100644 --- a/packages/strapi-hook-mongoose/lib/index.js +++ b/packages/strapi-hook-mongoose/lib/index.js @@ -174,7 +174,10 @@ module.exports = function (strapi) { _.forEach(postLifecycle, (fn, key) => { if (_.isFunction(target[model.toLowerCase()][fn])) { collection.schema.post(key, function (doc, next) { - target[model.toLowerCase()][fn](this, doc).then(next).catch(err => strapi.log.error(err)); + target[model.toLowerCase()][fn](this, doc).then(next).catch(err => { + strapi.log.error(err); + next(err); + }); }); } }); diff --git a/packages/strapi-plugin-content-manager/config/queries/mongoose.js b/packages/strapi-plugin-content-manager/config/queries/mongoose.js index e5efe8f7db..b6104c9cac 100644 --- a/packages/strapi-plugin-content-manager/config/queries/mongoose.js +++ b/packages/strapi-plugin-content-manager/config/queries/mongoose.js @@ -106,11 +106,13 @@ module.exports = { const request = await this.create(values) .catch((err) => { - const message = err.message.split('index:'); - const field = _.words(_.last(message).split('_')[0]); - const error = { message: `This ${field} is already taken`, field }; - - throw error; + if (err.message) + { + const message = err.message.split('index:'); + const field = _.words(_.last(message).split('_')[0]); + err = { message: `This ${field} is already taken`, field }; + } + throw err; }); // Transform to JSON object. From 7c583b726805a483bf707ba0062d0780d6148161 Mon Sep 17 00:00:00 2001 From: Jim LAURIE Date: Sat, 27 Oct 2018 18:13:54 +0200 Subject: [PATCH 3/4] Update code style --- .../strapi-plugin-content-manager/config/queries/mongoose.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/strapi-plugin-content-manager/config/queries/mongoose.js b/packages/strapi-plugin-content-manager/config/queries/mongoose.js index b6104c9cac..c80dbd7fbe 100644 --- a/packages/strapi-plugin-content-manager/config/queries/mongoose.js +++ b/packages/strapi-plugin-content-manager/config/queries/mongoose.js @@ -106,8 +106,7 @@ module.exports = { const request = await this.create(values) .catch((err) => { - if (err.message) - { + if (err.message) { const message = err.message.split('index:'); const field = _.words(_.last(message).split('_')[0]); err = { message: `This ${field} is already taken`, field }; From f5780683ce7f08f9a888b20dd7f67ce398238179 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Sun, 28 Oct 2018 08:15:31 +0100 Subject: [PATCH 4/4] Improve documentation --- docs/.vuepress/config.js | 96 ++++--- docs/.vuepress/theme/Layout.vue | 9 +- docs/.vuepress/theme/NavLinks.vue | 28 +- docs/.vuepress/theme/Navbar.vue | 15 ++ docs/.vuepress/theme/SearchBox.vue | 4 +- docs/.vuepress/theme/SidebarGroup.vue | 2 +- docs/.vuepress/theme/SidebarLink.vue | 17 +- docs/.vuepress/theme/styles/config.styl | 2 +- docs/.vuepress/theme/styles/theme.styl | 3 +- .../assets/getting-started_add_entry-.png | Bin 0 -> 266458 bytes .../assets/getting-started_add_entry.png | Bin 125813 -> 615497 bytes .../assets/getting-started_allow_access.png | Bin 294849 -> 66880 bytes .../getting-started_create_content_type.png | Bin 148411 -> 104770 bytes .../assets/getting-started_list_fields.png | Bin 138253 -> 78833 bytes .../getting-started_manage_role_home.png | Bin 122683 -> 473269 bytes .../getting-started_no_content_type.png | Bin 130776 -> 451064 bytes .../3.x.x/assets/getting-started_no_entry.png | Bin 124676 -> 441996 bytes .../assets/getting-started_no_entry_.png | Bin 0 -> 445489 bytes .../assets/getting-started_with_entry.png | Bin 133700 -> 465647 bytes .../assets/getting-started_with_entry_.png | Bin 0 -> 133700 bytes docs/3.x.x/assets/terminal_new.png | Bin 149517 -> 107495 bytes docs/3.x.x/assets/terminal_start.png | Bin 260253 -> 65636 bytes docs/3.x.x/getting-started/installation.md | 17 +- docs/3.x.x/getting-started/quick-start.md | 243 ++++++++++-------- docs/3.x.x/guides/authentication.md | 154 ++++++----- docs/3.x.x/tutorials/README.md | 4 +- docs/README.md | 2 +- packages/strapi-generate-new/lib/index.js | 2 +- .../lib/internals/prettier/index.js | 2 +- 29 files changed, 360 insertions(+), 240 deletions(-) create mode 100644 docs/3.x.x/assets/getting-started_add_entry-.png create mode 100644 docs/3.x.x/assets/getting-started_no_entry_.png create mode 100644 docs/3.x.x/assets/getting-started_with_entry_.png diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 440f241fb3..22c6590950 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,12 +1,11 @@ const container = require('markdown-it-container') -let ogprefix = 'og: http://ogp.me/ns#' -let title = 'Strapi Documentation' -let description = 'API creation made simple, secure and fast.' -let color = '#2F80ED' -let author = 'Strapi' -let url = 'https://strapi.io/documentation/' - +const ogprefix = 'og: http://ogp.me/ns#' +const title = 'Strapi Documentation' +const description = 'API creation made simple, secure and fast.' +const color = '#2F80ED' +const author = 'Strapi' +const url = 'https://strapi.io/documentation/' module.exports = { head: [ @@ -47,15 +46,20 @@ module.exports = { ['Version 1.x.x', '/1.x.x/'], ], repo: 'strapi/strapi', + website: 'https://strapi.io', docsDir: 'docs', editLinks: true, editLinkText: 'Improve this page', serviceWorker: true, + hiddenLinks: [ + '/3.x.x/cli/CLI.html', + '/3.x.x/api-reference/reference.html', + ], sidebar: { '/3.x.x/': [ { collapsable: false, - title: 'Getting started', + title: '🚀 Getting started', children: [ '/3.x.x/getting-started/installation', '/3.x.x/getting-started/quick-start', @@ -63,39 +67,30 @@ module.exports = { ], }, { - collapsable: false, - title: 'Guides', + collapsable: true, + title: '💡 Guides', children: [ - '/3.x.x/guides/authentication.md', - '/3.x.x/configurations/configurations.md', - '/3.x.x/guides/controllers.md', - '/3.x.x/guides/deployment.md', - '/3.x.x/guides/email.md', - '/3.x.x/guides/upload.md', - '/3.x.x/guides/filters.md', - '/3.x.x/guides/graphql.md', - '/3.x.x/guides/i18n.md', - '/3.x.x/guides/models.md', - '/3.x.x/guides/policies.md', - '/3.x.x/guides/public-assets.md', - '/3.x.x/guides/requests.md', - '/3.x.x/guides/responses.md', - '/3.x.x/guides/routing.md', - '/3.x.x/guides/services.md', - ], - }, - { - collapsable: false, - title: 'Globals', - children: [ - '/3.x.x/api-reference/reference', - '/3.x.x/cli/CLI', + '/3.x.x/guides/authentication', '/3.x.x/configurations/configurations', + '/3.x.x/guides/controllers', + '/3.x.x/guides/deployment', + '/3.x.x/guides/email', + '/3.x.x/guides/upload', + '/3.x.x/guides/filters', + '/3.x.x/guides/graphql', + '/3.x.x/guides/i18n', + '/3.x.x/guides/models', + '/3.x.x/guides/policies', + '/3.x.x/guides/public-assets', + '/3.x.x/guides/requests', + '/3.x.x/guides/responses', + '/3.x.x/guides/routing', + '/3.x.x/guides/services', ], }, { - collapsable: false, - title: 'Advanced', + collapsable: true, + title: '⚙️️ Advanced', children: [ '/3.x.x/advanced/customize-admin', '/3.x.x/advanced/hooks', @@ -104,9 +99,36 @@ module.exports = { '/3.x.x/advanced/usage-tracking', ], }, + { + collapsable: true, + title: '🔌 Plugin Development', + children: [ + '/3.x.x/plugin-development/quick-start', + '/3.x.x/plugin-development/plugin-architecture', + '/3.x.x/plugin-development/backend-development', + '/3.x.x/plugin-development/frontend-development', + '/3.x.x/plugin-development/frontend-use-cases', + '/3.x.x/plugin-development/utils', + // '/3.x.x/plugin-development/ui-components', TODO: Add this file + ], + }, + { + collapsable: true, + title: '💻 Command Line Interface', + children: [ + '/3.x.x/cli/CLI', + ], + }, + { + collapsable: true, + title: '🏗 API Reference', + children: [ + '/3.x.x/api-reference/reference', + ], + }, { collapsable: false, - title: 'Resources', + title: '📚 Resources', children: [ ['https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', 'Contributing guide'], ['https://github.com/strapi/strapi/wiki', 'Migration guides'], diff --git a/docs/.vuepress/theme/Layout.vue b/docs/.vuepress/theme/Layout.vue index f15c97bb11..b3797fd98a 100644 --- a/docs/.vuepress/theme/Layout.vue +++ b/docs/.vuepress/theme/Layout.vue @@ -5,14 +5,7 @@ @touchend="onTouchEnd"> - -
- -
- -
+
diff --git a/docs/.vuepress/theme/NavLinks.vue b/docs/.vuepress/theme/NavLinks.vue index f29ee0acd5..38dcfd773f 100644 --- a/docs/.vuepress/theme/NavLinks.vue +++ b/docs/.vuepress/theme/NavLinks.vue @@ -9,11 +9,19 @@ - + Website + + + {{ repoLabel }} @@ -92,6 +100,22 @@ export default { } return 'Source' + }, + websiteLink () { + const { website } = this.$site.themeConfig + if (website) { + return /^https?:/.test(website) + ? website + : `https://${website}` + } + }, + slackLink () { + const { slack } = this.$site.themeConfig + if (slack) { + return /^https?:/.test(slack) + ? slack + : `https://${slack}` + } } } } diff --git a/docs/.vuepress/theme/Navbar.vue b/docs/.vuepress/theme/Navbar.vue index f4a9002a37..1e8fa90e13 100644 --- a/docs/.vuepress/theme/Navbar.vue +++ b/docs/.vuepress/theme/Navbar.vue @@ -11,6 +11,9 @@ {{ $siteTitle }} +