Просмотр исходного кода

Merge branch 'master' into imprv/kibela-like-theme

# Conflicts:
#	config/webpack.common.js
#	src/client/styles/agile-admin/inverse/widgets.scss
mayu morita 7 лет назад
Родитель
Сommit
10c8ce385b
100 измененных файлов с 146 добавлено и 99 удалено
  1. 1 1
      .eslintignore
  2. 20 1
      CHANGES.md
  3. 8 6
      bin/generate-plugin-definitions-source.js
  4. 4 2
      bin/shrink-emojione-strategy.js
  5. 1 0
      config/logger/config.dev.js
  6. 1 1
      config/logger/config.prod.js
  7. 27 26
      config/webpack.common.js
  8. 4 4
      config/webpack.dev.js
  9. 1 1
      config/webpack.dll.js
  10. 2 3
      config/webpack.prod.js
  11. 0 13
      lib/util/fileUploader.js
  12. 19 15
      package.json
  13. 0 0
      resource/locales/en-US/notifications/comment.txt
  14. 0 0
      resource/locales/en-US/notifications/pageCreate.txt
  15. 0 0
      resource/locales/en-US/notifications/pageDelete.txt
  16. 0 0
      resource/locales/en-US/notifications/pageEdit.txt
  17. 0 0
      resource/locales/en-US/notifications/pageLike.txt
  18. 0 0
      resource/locales/en-US/notifications/pageMove.txt
  19. 0 0
      resource/locales/en-US/sandbox-bootstrap3.md
  20. 0 0
      resource/locales/en-US/sandbox.md
  21. 19 5
      resource/locales/en-US/translation.json
  22. 0 0
      resource/locales/en-US/welcome.md
  23. 0 0
      resource/locales/index.js
  24. 0 0
      resource/locales/ja/notifications/comment.txt
  25. 0 0
      resource/locales/ja/notifications/pageCreate.txt
  26. 0 0
      resource/locales/ja/notifications/pageDelete.txt
  27. 0 0
      resource/locales/ja/notifications/pageEdit.txt
  28. 0 0
      resource/locales/ja/notifications/pageLike.txt
  29. 0 0
      resource/locales/ja/notifications/pageMove.txt
  30. 0 0
      resource/locales/ja/sandbox.md
  31. 26 11
      resource/locales/ja/translation.json
  32. 0 0
      resource/locales/ja/welcome.md
  33. 4 1
      src/client/js/app.js
  34. 0 0
      src/client/js/components/Admin/CustomCssEditor.js
  35. 0 0
      src/client/js/components/Admin/CustomHeaderEditor.js
  36. 0 0
      src/client/js/components/Admin/CustomScriptEditor.js
  37. 0 0
      src/client/js/components/BookmarkButton.js
  38. 0 0
      src/client/js/components/Common/UserDate.js
  39. 0 0
      src/client/js/components/CopyButton.js
  40. 0 0
      src/client/js/components/HeaderSearchBox.js
  41. 1 1
      src/client/js/components/HeaderSearchBox/SearchForm.js
  42. 0 0
      src/client/js/components/HeaderSearchBox/SearchSuggest.js
  43. 0 0
      src/client/js/components/NewPageNameInput.js
  44. 0 0
      src/client/js/components/Page.js
  45. 0 0
      src/client/js/components/Page/PagePath.js
  46. 0 0
      src/client/js/components/Page/RevisionBody.js
  47. 0 0
      src/client/js/components/Page/RevisionPath.js
  48. 0 0
      src/client/js/components/Page/RevisionUrl.js
  49. 0 0
      src/client/js/components/PageAttachment.js
  50. 0 0
      src/client/js/components/PageAttachment/Attachment.js
  51. 0 0
      src/client/js/components/PageAttachment/DeleteAttachmentModal.js
  52. 0 0
      src/client/js/components/PageAttachment/PageAttachmentList.js
  53. 0 0
      src/client/js/components/PageComment/Comment.js
  54. 0 0
      src/client/js/components/PageComment/CommentForm.js
  55. 0 0
      src/client/js/components/PageComment/CommentPreview.js
  56. 0 0
      src/client/js/components/PageComment/DeleteCommentModal.js
  57. 0 0
      src/client/js/components/PageComments.js
  58. 0 0
      src/client/js/components/PageEditor.js
  59. 0 0
      src/client/js/components/PageEditor/AbstractEditor.js
  60. 3 3
      src/client/js/components/PageEditor/CodeMirrorEditor.js
  61. 0 0
      src/client/js/components/PageEditor/Editor.js
  62. 0 0
      src/client/js/components/PageEditor/EmojiAutoCompleteHelper.js
  63. 0 0
      src/client/js/components/PageEditor/MarkdownListUtil.js
  64. 0 0
      src/client/js/components/PageEditor/MarkdownTableInterceptor.js
  65. 0 0
      src/client/js/components/PageEditor/MarkdownTableUtil.js
  66. 0 0
      src/client/js/components/PageEditor/OptionsSelector.js
  67. 0 0
      src/client/js/components/PageEditor/PasteHelper.js
  68. 0 0
      src/client/js/components/PageEditor/PreventMarkdownListInterceptor.js
  69. 0 0
      src/client/js/components/PageEditor/Preview.js
  70. 0 0
      src/client/js/components/PageEditor/ScrollSyncHelper.js
  71. 2 2
      src/client/js/components/PageEditor/TextAreaEditor.js
  72. 0 0
      src/client/js/components/PageEditorByHackmd.jsx
  73. 0 0
      src/client/js/components/PageEditorByHackmd/HackmdEditor.jsx
  74. 0 0
      src/client/js/components/PageHistory.js
  75. 0 0
      src/client/js/components/PageHistory/PageRevisionList.js
  76. 0 0
      src/client/js/components/PageHistory/Revision.js
  77. 0 0
      src/client/js/components/PageHistory/RevisionDiff.js
  78. 0 0
      src/client/js/components/PageList/ListView.js
  79. 0 0
      src/client/js/components/PageList/Page.js
  80. 1 1
      src/client/js/components/PageList/PageListMeta.js
  81. 0 0
      src/client/js/components/PageList/PagePath.js
  82. 0 0
      src/client/js/components/PageListSearch.js
  83. 0 0
      src/client/js/components/PageStatusAlert.jsx
  84. 0 0
      src/client/js/components/ReactUtils.js
  85. 0 0
      src/client/js/components/SavePageControls.jsx
  86. 0 0
      src/client/js/components/SavePageControls/GrantSelector.jsx
  87. 0 0
      src/client/js/components/SearchPage.js
  88. 0 0
      src/client/js/components/SearchPage/DeletePageListModal.js
  89. 0 0
      src/client/js/components/SearchPage/SearchForm.js
  90. 0 0
      src/client/js/components/SearchPage/SearchResult.js
  91. 0 0
      src/client/js/components/SearchPage/SearchResultList.js
  92. 0 0
      src/client/js/components/SearchTypeahead.js
  93. 0 0
      src/client/js/components/SeenUserList.js
  94. 0 0
      src/client/js/components/SeenUserList/UserList.js
  95. 0 0
      src/client/js/components/SlackNotification.jsx
  96. 0 0
      src/client/js/components/User/User.js
  97. 0 0
      src/client/js/components/User/UserPicture.js
  98. 0 0
      src/client/js/dev.js
  99. 1 1
      src/client/js/hackmd-agent.js
  100. 1 1
      src/client/js/hackmd-styles.js

+ 1 - 1
.eslintignore

@@ -2,6 +2,6 @@
 /.vscode/**
 /node_modules/**
 /public/**
-/resource/js/legacy/thirdparty-js/**
+/src/client/js/legacy/thirdparty-js/**
 /test/**
 /tmp/**

+ 20 - 1
CHANGES.md

@@ -1,7 +1,26 @@
 CHANGES
 ========
 
-## 3.2.0-RC
+## 3.2.2-RC
+
+* 
+
+## 3.2.1
+
+* Feature: Import data from esa.io
+* Feature: Import data from Qiita:Team
+* Feature: Add the endpoint for health check
+* Improvement: Adjust styles when printing
+* Fix: Renaming page doesn't work if the page was saved with shortcut
+* Support: Refactor directory structure
+* Support Upgrade libs
+    * file-loader
+    * googleapis
+    * postcss-loader
+    * sass-loader
+    * style-loader
+
+## 3.2.0
 
 * Feature: HackMD integration so that user will be able to simultaneously edit with multiple people
 * Feature: Login with Twitter Account

+ 8 - 6
bin/generate-plugin-definitions-source.js

@@ -3,17 +3,19 @@
  *
  * @author Yuki Takei <yuki@weseek.co.jp>
  */
+require('module-alias/register');
+
 const fs = require('graceful-fs');
 const normalize = require('normalize-path');
 const swig = require('swig-templates');
-const helpers = require('../config/helpers');
+
+const helpers = require('@commons/util/helpers');
+const PluginUtils = require('../src/server/plugins/plugin-utils');
+const pluginUtils = new PluginUtils();
 
 const TEMPLATE = helpers.root('bin/templates/plugin-definitions.js.swig');
 const OUT = helpers.root('tmp/plugins/plugin-definitions.js');
 
-const PluginUtils = require('../lib/plugins/plugin-utils');
-const pluginUtils = new PluginUtils();
-
 
 // list plugin names
 let pluginNames = pluginUtils.listPluginNames(helpers.root());
@@ -45,8 +47,8 @@ const definitions = pluginNames
     return definition;
   });
 
-var compiledTemplate = swig.compileFile(TEMPLATE);
-var code = compiledTemplate({definitions});
+const compiledTemplate = swig.compileFile(TEMPLATE);
+const code = compiledTemplate({definitions});
 
 // write
 fs.writeFileSync(OUT, code);

+ 4 - 2
bin/shrink-emojione-strategy.js

@@ -3,13 +3,15 @@
  *
  * @author Yuki Takei <yuki@weseek.co.jp>
  */
+require('module-alias/register');
+
 const fs = require('graceful-fs');
-const helpers = require('../config/helpers');
 
-const OUT = helpers.root('tmp/emoji_strategy_shrinked.json');
+const helpers = require('@commons/util/helpers');
 
 const emojiStrategy = require('emojione/emoji_strategy.json');
 const markdownItEmojiFull = require('markdown-it-emoji/lib/data/full.json');
+const OUT = helpers.root('tmp/emoji_strategy_shrinked.json');
 
 let shrinkedMap = {};
 for (let unicode in emojiStrategy) {

+ 1 - 0
config/logger/config.dev.js

@@ -11,6 +11,7 @@ module.exports = {
   // 'growi:routes:login': 'debug',
   'growi:routes:login-passport': 'debug',
   'growi:service:PassportService': 'debug',
+  // 'growi:lib:importer': 'debug',
   // 'growi:routes:page': 'debug',
   // 'growi-plugin:*': 'debug',
   // 'growi:InterceptorManager': 'debug',

+ 1 - 1
config/logger/config.prod.js

@@ -1,3 +1,3 @@
 module.exports = {
-  default: 'warn',
+  default: 'info',
 };

+ 27 - 26
config/webpack.common.js

@@ -1,9 +1,8 @@
 /**
  * @author: Yuki Takei <yuki@weseek.co.jp>
  */
-
 const webpack = require('webpack');
-const helpers = require('./helpers');
+const helpers = require('../src/lib/util/helpers');
 
 /*
  * Webpack Plugins
@@ -20,27 +19,27 @@ module.exports = (options) => {
   return {
     mode: options.mode,
     entry: Object.assign({
-      'js/app':                   './resource/js/app',
-      'js/legacy':                './resource/js/legacy/crowi',
-      'js/legacy-admin':          './resource/js/legacy/crowi-admin',
-      'js/legacy-presentation':   './resource/js/legacy/crowi-presentation',
-      'js/plugin':                './resource/js/plugin',
-      'js/ie11-polyfill':         './resource/js/ie11-polyfill',
-      'js/hackmd-agent':          './resource/js/hackmd-agent',
-      'js/hackmd-styles':         './resource/js/hackmd-styles',
+      'js/app':                       './src/client/js/app',
+      'js/legacy':                    './src/client/js/legacy/crowi',
+      'js/legacy-admin':              './src/client/js/legacy/crowi-admin',
+      'js/legacy-presentation':       './src/client/js/legacy/crowi-presentation',
+      'js/plugin':                    './src/client/js/plugin',
+      'js/ie11-polyfill':             './src/client/js/ie11-polyfill',
+      'js/hackmd-agent':              './src/client/js/hackmd-agent',
+      'js/hackmd-styles':             './src/client/js/hackmd-styles',
       // styles
-      'styles/style':                './resource/styles/scss/style.scss',
-      'styles/style-presentation':   './resource/styles/scss/style-presentation.scss',
+      'styles/style':                 './src/client/styles/scss/style.scss',
+      'styles/style-presentation':    './src/client/styles/scss/style-presentation.scss',
       // themes
-      'styles/theme-default':        './resource/styles/scss/theme/default.scss',
-      'styles/theme-default-dark':   './resource/styles/scss/theme/default-dark.scss',
-      'styles/theme-nature':         './resource/styles/scss/theme/nature.scss',
-      'styles/theme-mono-blue':      './resource/styles/scss/theme/mono-blue.scss',
-      'styles/theme-future':         './resource/styles/scss/theme/future.scss',
-      'styles/theme-blue-night':     './resource/styles/scss/theme/blue-night.scss',
-      'styles/theme-kibela':         './resource/styles/scss/theme/kibela.scss',
+      'styles/theme-default':         './src/client/styles/scss/theme/default.scss',
+      'styles/theme-default-dark':    './src/client/styles/scss/theme/default-dark.scss',
+      'styles/theme-nature':          './src/client/styles/scss/theme/nature.scss',
+      'styles/theme-mono-blue':       './src/client/styles/scss/theme/mono-blue.scss',
+      'styles/theme-future':          './src/client/styles/scss/theme/future.scss',
+      'styles/theme-blue-night':      './src/client/styles/scss/theme/blue-night.scss',
+      'styles/theme-kibela':          './src/client/styles/scss/theme/kibela.scss',
       // styles for external services
-      'styles/style-hackmd':         './resource/styles/hackmd/style.scss',
+      'styles/style-hackmd':          './src/client/styles/hackmd/style.scss',
     }, options.entry || {}),  // Merge with env dependent settings
     output: Object.assign({
       path: helpers.root('public'),
@@ -56,11 +55,13 @@ module.exports = (options) => {
     },
     resolve: {
       extensions: ['.js', '.jsx', '.json'],
-      modules: [helpers.root('src'), helpers.root('node_modules')],
+      modules: [helpers.root('node_modules')],
       alias: {
         '@root': helpers.root('/'),
-        '@alias/logger': helpers.root('lib/service/logger'),
-        '@alias/locales': helpers.root('lib/locales'),
+        '@commons': helpers.root('src/lib'),
+        '@tmp': helpers.root('tmp'),
+        '@alias/logger': helpers.root('src/lib/service/logger'),
+        '@alias/locales': helpers.root('resource/locales'),
         // replace bunyan
         'bunyan': 'browser-bunyan',
       }
@@ -94,12 +95,12 @@ module.exports = (options) => {
         {
           test: /\.css$/,
           use: ['style-loader', 'css-loader'],
-          exclude: [helpers.root('resource/styles')]
+          exclude: [helpers.root('src/client/styles')]
         },
         {
           test: /\.scss$/,
           use: ['style-loader', 'css-loader', 'sass-loader'],
-          exclude: [helpers.root('resource/styles')]
+          exclude: [helpers.root('src/client/styles')]
         },
         /*
          * File loader for supporting images, for example, in CSS files.
@@ -145,7 +146,7 @@ module.exports = (options) => {
       splitChunks: {
         cacheGroups: {
           commons: {
-            test: /resource/,
+            test: /src/,
             chunks: 'initial',
             name: 'js/commons',
             minChunks: 2,

+ 4 - 4
config/webpack.dev.js

@@ -4,7 +4,7 @@
 
 const path = require('path');
 const webpack = require('webpack');
-const helpers = require('./helpers');
+const helpers = require('../src/lib/util/helpers');
 
 /*
  * Webpack Plugins
@@ -21,7 +21,7 @@ module.exports = require('./webpack.common')({
   mode: 'development',
   devtool: 'cheap-module-eval-source-map',
   entry: {
-    'js/dev': './resource/js/dev',
+    'js/dev': './src/client/js/dev',
   },
   resolve: {
     // TODO merge in webpack.common.js
@@ -36,7 +36,7 @@ module.exports = require('./webpack.common')({
           { loader: 'css-loader', options: { sourceMap: true } },
           { loader: 'sass-loader', options: { sourceMap: true } },
         ],
-        include: [helpers.root('resource/styles/scss')]
+        include: [helpers.root('src/client/styles/scss')]
       },
       { // Dump CSS for HackMD
         test: /\.scss$/,
@@ -46,7 +46,7 @@ module.exports = require('./webpack.common')({
             'sass-loader'
           ]
         }),
-        include: [helpers.root('resource/styles/hackmd')]
+        include: [helpers.root('src/client/styles/hackmd')]
       },
     ],
   },

+ 1 - 1
config/webpack.dll.js

@@ -2,7 +2,7 @@
  * @author: Yuki Takei <yuki@weseek.co.jp>
  */
 const webpack = require('webpack');
-const helpers = require('./helpers');
+const helpers = require('../src/lib/util/helpers');
 
 
 module.exports = {

+ 2 - 3
config/webpack.prod.js

@@ -1,8 +1,7 @@
 /**
  * @author: Yuki Takei <yuki@weseek.co.jp>
  */
-
-const helpers = require('./helpers');
+const helpers = require('../src/lib/util/helpers');
 
 /**
  * Webpack Plugins
@@ -40,7 +39,7 @@ module.exports = require('./webpack.common')({
             'sass-loader'
           ]
         }),
-        include: [helpers.root('resource/styles/scss'), helpers.root('resource/styles/hackmd')]
+        include: [helpers.root('src/client/styles/scss'), helpers.root('src/client/styles/hackmd')]
       }
     ]
   },

+ 0 - 13
lib/util/fileUploader.js

@@ -1,13 +0,0 @@
-/**
- * fileUploader
- */
-
-module.exports = function(crowi) {
-  'use strict';
-
-  var debug = require('debug')('growi:lib:fileUploader')
-    , method = crowi.env.FILE_UPLOAD || 'aws'
-    , lib = '../../local_modules/crowi-fileupload-' + method;
-
-  return require(lib)(crowi);
-};

+ 19 - 15
package.json

@@ -1,6 +1,6 @@
 {
   "name": "growi",
-  "version": "3.2.0-RC6",
+  "version": "3.2.2-RC",
   "description": "Team collaboration software using markdown",
   "tags": [
     "wiki",
@@ -42,13 +42,13 @@
     "prebuild:dev:app": "env-cmd config/env.dev.js npm run plugin:def",
     "prebuild:prod": "npm run plugin:def",
     "prestart": "npm run build:prod",
-    "server:debug": "env-cmd config/env.dev.js node-dev --inspect app.js",
-    "server:dev": "env-cmd config/env.dev.js node-dev --respawn app.js",
+    "server:debug": "env-cmd config/env.dev.js node-dev --inspect src/server/app.js",
+    "server:dev": "env-cmd config/env.dev.js node-dev --respawn src/server/app.js",
     "server:prod:ci": "npm run server:prod -- --ci",
-    "server:prod": "env-cmd config/env.prod.js node app.js",
+    "server:prod": "env-cmd config/env.prod.js node src/server/app.js",
     "server": "npm run server:dev",
     "start": "npm run server:prod",
-    "test": "mocha --timeout 10000 -r test/bootstrap.js test/**/*.js",
+    "test": "mocha --timeout 10000 -r src/test/bootstrap.js src/test/**/*.js",
     "version": "node -p \"require('./package.json').version\"",
     "webpack": "webpack"
   },
@@ -71,6 +71,7 @@
     "elasticsearch": "^15.0.0",
     "entities": "^1.1.1",
     "env-cmd": "^8.0.1",
+    "esa-nodejs": "^0.0.7",
     "escape-string-regexp": "^1.0.5",
     "express": "^4.16.1",
     "express-bunyan-logger": "^1.3.3",
@@ -78,12 +79,13 @@
     "express-sanitizer": "^1.0.4",
     "express-session": "~1.15.0",
     "express-webpack-assets": "^0.1.0",
-    "googleapis": "^32.0.0",
+    "googleapis": "^33.0.0",
     "graceful-fs": "^4.1.11",
     "growi-pluginkit": "^1.1.0",
+    "helmet": "^3.13.0",
     "i18next": "^11.1.1",
     "i18next-express-middleware": "^1.1.1",
-    "i18next-node-fs-backend": "^1.0.0",
+    "i18next-node-fs-backend": "^2.0.0",
     "i18next-sprintf-postprocessor": "^0.2.2",
     "markdown-it-blockdiag": "^1.0.2",
     "md5": "^2.2.1",
@@ -140,7 +142,7 @@
     "eslint": "^5.0.0",
     "eslint-plugin-react": "^7.7.0",
     "extract-text-webpack-plugin": "^4.0.0-beta.0",
-    "file-loader": "^1.1.0",
+    "file-loader": "^2.0.0",
     "i18next-browser-languagedetector": "^2.2.0",
     "imports-loader": "^0.8.0",
     "jquery-slimscroll": "^1.3.8",
@@ -170,23 +172,23 @@
     "optimize-css-assets-webpack-plugin": "^5.0.0",
     "penpal": "^3.0.3",
     "plantuml-encoder": "^1.2.5",
-    "postcss-loader": "^2.1.3",
+    "postcss-loader": "^3.0.0",
     "react": "^16.4.1",
     "react-bootstrap": "^0.32.1",
     "react-bootstrap-typeahead": "^3.1.5",
     "react-clipboard.js": "^2.0.0",
     "react-codemirror2": "^5.0.4",
     "react-dom": "^16.4.1",
-    "react-dropzone": "^4.2.7",
+    "react-dropzone": "^5.0.1",
     "react-frame-component": "^4.0.0",
     "react-i18next": "^7.6.1",
     "reveal.js": "^3.5.0",
-    "sass-loader": "^7.0.1",
+    "sass-loader": "^7.1.0",
     "simple-load-script": "^1.0.2",
     "sinon": "^6.0.0",
     "sinon-chai": "^3.2.0",
     "socket.io-client": "^2.0.3",
-    "style-loader": "^0.21.0",
+    "style-loader": "^0.22.1",
     "throttle-debounce": "^2.0.0",
     "toastr": "^2.1.2",
     "uglifyjs-webpack-plugin": "^1.2.5",
@@ -199,8 +201,10 @@
   },
   "_moduleAliases": {
     "@root": ".",
-    "@alias/logger": "lib/service/logger",
-    "debug": "lib/service/logger/alias-for-debug"
+    "@commons": "src/lib",
+    "@server": "src/server",
+    "@alias/logger": "src/lib/service/logger",
+    "debug": "src/lib/service/logger/alias-for-debug"
   },
   "engines": {
     "node": ">=8.11.1 <9",
@@ -209,7 +213,7 @@
   },
   "config": {
     "blanket": {
-      "pattern": "./lib/**/*.js"
+      "pattern": "./src/lib/**/*.js"
     }
   }
 }

+ 0 - 0
lib/locales/en-US/notifications/comment.txt → resource/locales/en-US/notifications/comment.txt


+ 0 - 0
lib/locales/en-US/notifications/pageCreate.txt → resource/locales/en-US/notifications/pageCreate.txt


+ 0 - 0
lib/locales/en-US/notifications/pageDelete.txt → resource/locales/en-US/notifications/pageDelete.txt


+ 0 - 0
lib/locales/en-US/notifications/pageEdit.txt → resource/locales/en-US/notifications/pageEdit.txt


+ 0 - 0
lib/locales/en-US/notifications/pageLike.txt → resource/locales/en-US/notifications/pageLike.txt


+ 0 - 0
lib/locales/en-US/notifications/pageMove.txt → resource/locales/en-US/notifications/pageMove.txt


+ 0 - 0
lib/locales/en-US/sandbox-bootstrap3.md → resource/locales/en-US/sandbox-bootstrap3.md


+ 0 - 0
lib/locales/en-US/sandbox.md → resource/locales/en-US/sandbox.md


+ 19 - 5
lib/locales/en-US/translation.json → resource/locales/en-US/translation.json

@@ -309,11 +309,11 @@
     "recommended": "Recommended",
     "username_email_password": "Username, Email and Password authentication",
     "ldap_auth": "LDAP authentication",
-    "google_auth2": "Google OAuth2 authentication",
+    "google_auth2": "Google OAuth authentication",
     "google_auth2_by_crowi_desc": "However, this feature does not create new users, butit only makes it possible to login to the existing user who set up the association.",
-    "facebook_auth2": "Facebook OAuth2 authentication",
+    "facebook_auth2": "Facebook OAuth authentication",
     "twitter_auth2": "Twitter OAuth authentication",
-    "github_auth2": "GitHub OAuth2 authentication",
+    "github_auth2": "GitHub OAuth authentication",
     "crowi_auth": "Crowi classic authentication mechanism",
 		"require_server_restart": "Restarting the server is required.",
 		"server_on_passport_auth": "The server is running with Passport authentication mechanism.",
@@ -400,7 +400,7 @@
         "name": "GitHub OAuth",
         "register_1": "Access <a href=\"%s\" target=\"_blank\">%s</a>",
         "register_2": "Register your OAuth App with \"Authorization callback URL\" as <code>%s</code> (where <code>%s</code> is your hostname)",
-        "register_3": "Copy and paste your ClientID and Client Secret above"     
+        "register_3": "Copy and paste your ClientID and Client Secret above"
       },
       "how_to": {
         "google": "How to configure Google OAuth?",
@@ -488,6 +488,20 @@
     "your_own":"You cannot deactivate your own account",
     "Administrator menu":"Administrator menu",
     "cannot_remove":"You cannot remove yourself from administrator"
-  }
+  },
 
+  "importer_management": {
+    "import_from": "Import from %s",
+    "esa_settings": {
+      "team_name": "Team name",
+      "access_token": "Access token",
+      "test_connection": "Test connection to esa"
+    },
+    "qiita_settings": {
+      "team_name": "Team name",
+      "access_token": "Access token",
+      "test_connection": "Test connection to qiita:team"
+    },
+    "import": "Import"
+  }
 }

+ 0 - 0
lib/locales/en-US/welcome.md → resource/locales/en-US/welcome.md


+ 0 - 0
lib/locales/index.js → resource/locales/index.js


+ 0 - 0
lib/locales/ja/notifications/comment.txt → resource/locales/ja/notifications/comment.txt


+ 0 - 0
lib/locales/ja/notifications/pageCreate.txt → resource/locales/ja/notifications/pageCreate.txt


+ 0 - 0
lib/locales/ja/notifications/pageDelete.txt → resource/locales/ja/notifications/pageDelete.txt


+ 0 - 0
lib/locales/ja/notifications/pageEdit.txt → resource/locales/ja/notifications/pageEdit.txt


+ 0 - 0
lib/locales/ja/notifications/pageLike.txt → resource/locales/ja/notifications/pageLike.txt


+ 0 - 0
lib/locales/ja/notifications/pageMove.txt → resource/locales/ja/notifications/pageMove.txt


+ 0 - 0
lib/locales/ja/sandbox.md → resource/locales/ja/sandbox.md


+ 26 - 11
lib/locales/ja/translation.json → resource/locales/ja/translation.json

@@ -91,6 +91,7 @@
   "External Account management": "外部アカウント管理",
   "UserGroup management": "グループ管理",
   "Full Text Search management": "全文検索管理",
+  "Import Data": "データインポート",
   "Basic settings": "基本設定",
   "Basic authentication": "Basic認証",
   "Guest users access": "ゲストユーザーのアクセス",
@@ -327,11 +328,11 @@
     "recommended": "推奨",
     "username_email_password": "ユーザー名、Eメール、パスワードでの認証",
     "ldap_auth": "LDAP 認証",
-    "google_auth2": "Google OAuth2 認証",
+    "google_auth2": "Google OAuth 認証",
     "google_auth2_by_crowi_desc": "ただし、この機能では新たなユーザーは作成されず、関連付け設定を行った既存ユーザーをログインできるようにするだけです。",
-    "facebook_auth2": "Facebook OAuth2 認証",
+    "facebook_auth2": "Facebook OAuth 認証",
     "twitter_auth2": "Twitter OAuth 認証",
-    "github_auth2": "GitHub OAuth2 認証",
+    "github_auth2": "GitHub OAuth 認証",
     "require_server_restart": "サーバーを再起動してください。",
     "server_on_passport_auth": "Passport 認証機構でサーバーが稼働しています。",
     "server_on_crowi_auth": "Crowi Classic 認証機構でサーバーが稼働しています。",
@@ -395,7 +396,7 @@
       "register": "%sに登録",
       "change_redirect_url": "承認済みのリダイレクトURLに、 <code>%s</code> を入力<br>(<code>%s</code>は環境に合わせて変更してください)",
       "Google": {
-        "name": "Google OAuth認証",
+        "name": "Google OAuth",
         "register_1": "<a href=\"%s\" target=\"_blank\">%s</a>へアクセス",
         "register_2": "プロジェクトがない場合はプロジェクトを作成",
         "register_3": "認証情報を作成 &rightarrow; OAuthクライアントID &rightarrow; ウェブアプリケーションを選択",
@@ -403,10 +404,10 @@
         "register_5": "上記フォームにクライアントIDとクライアントシークレットを入力"
       },
       "Facebook": {
-        "name": "Facebook OAuth認証"
+        "name": "Facebook OAuth"
       },
       "Twitter": {
-        "name": "Twitter OAuth認証",
+        "name": "Twitter OAuth",
         "register_1": "<a href=\"%s\" target=\"_blank\">%s</a>へアクセス",
         "register_2": "Twitterにサインイン",
         "register_3": "Create New Appをクリック &rightarrow; Application Detailsの各項目を入力",
@@ -414,15 +415,15 @@
         "register_5": "上記フォームにクライアントIDとクライアントシークレットを入力"
       },
       "GitHub": {
-        "name": "GitHub OAuth認証",
+        "name": "GitHub OAuth",
         "register_1": "<a href=\"%s\" target=\"_blank\">%s</a>へアクセス",
         "register_2": "\"Authorization callback URL\"を<code>%s</code>としてGrowiを登録 (<code>%s</code>は環境に合わせて変更してください)",
         "register_3": "上記フォームにクライアントIDとクライアントシークレットを入力"
       },
       "how_to": {
-        "google": "Google OAuthの設定方法",
-        "github": "GitHub OAuthの設定方法",
-        "twitter": "Twitter OAuthの設定方法"
+        "google": "Google OAuth の設定方法",
+        "github": "GitHub OAuth の設定方法",
+        "twitter": "Twitter OAuth の設定方法"
       }
     }
   },
@@ -504,6 +505,20 @@
     "your_own": "自分自身のアカウントを停止することはできません",
     "Administrator menu": "管理者メニュー",
     "cannot_remove": "自分自身を管理者から外すことはできません"
-  }
+  },
 
+  "importer_management": {
+    "import_from": "%s からインポート",
+    "esa_settings": {
+      "team_name": "チーム名",
+      "access_token": "アクセストークン",
+      "test_connection": "接続テスト"
+    },
+    "qiita_settings": {
+      "team_name": "チーム名",
+      "access_token": "アクセストークン",
+      "test_connection": "接続テスト"
+    },
+    "import": "インポート"
+  }
 }

+ 0 - 0
lib/locales/ja/welcome.md → resource/locales/ja/welcome.md


+ 4 - 1
resource/js/app.js → src/client/js/app.js

@@ -8,7 +8,7 @@ import io from 'socket.io-client';
 import i18nFactory from './i18n';
 
 import loggerFactory from '@alias/logger';
-import Xss from '../../lib/util/xss';
+import Xss from '@commons/service/xss';
 
 import Crowi from './util/Crowi';
 // import CrowiRenderer from './util/CrowiRenderer';
@@ -209,6 +209,9 @@ const saveWithShortcutSuccessHandler = function(page) {
   if (componentInstances.pageStatusAlert != null) {
     pageStatusAlert.clearRevisionStatus(pageRevisionId, pageRevisionIdHackmdSynced);
   }
+
+  // hidden input
+  $('input[name="revision_id"]').val(pageRevisionId);
 };
 
 const errorHandler = function(error) {

+ 0 - 0
resource/js/components/Admin/CustomCssEditor.js → src/client/js/components/Admin/CustomCssEditor.js


+ 0 - 0
resource/js/components/Admin/CustomHeaderEditor.js → src/client/js/components/Admin/CustomHeaderEditor.js


+ 0 - 0
resource/js/components/Admin/CustomScriptEditor.js → src/client/js/components/Admin/CustomScriptEditor.js


+ 0 - 0
resource/js/components/BookmarkButton.js → src/client/js/components/BookmarkButton.js


+ 0 - 0
resource/js/components/Common/UserDate.js → src/client/js/components/Common/UserDate.js


+ 0 - 0
resource/js/components/CopyButton.js → src/client/js/components/CopyButton.js


+ 0 - 0
resource/js/components/HeaderSearchBox.js → src/client/js/components/HeaderSearchBox.js


+ 1 - 1
resource/js/components/HeaderSearchBox/SearchForm.js → src/client/js/components/HeaderSearchBox/SearchForm.js

@@ -82,7 +82,7 @@ export default class SearchForm extends React.Component {
       <form
         ref='form'
         action='/_search'
-        className='search-form form-group input-group search-input-group'
+        className='search-form form-group input-group search-input-group hidden-print'
       >
         <FormGroup>
           <InputGroup>

+ 0 - 0
resource/js/components/HeaderSearchBox/SearchSuggest.js → src/client/js/components/HeaderSearchBox/SearchSuggest.js


+ 0 - 0
resource/js/components/NewPageNameInput.js → src/client/js/components/NewPageNameInput.js


+ 0 - 0
resource/js/components/Page.js → src/client/js/components/Page.js


+ 0 - 0
resource/js/components/Page/PagePath.js → src/client/js/components/Page/PagePath.js


+ 0 - 0
resource/js/components/Page/RevisionBody.js → src/client/js/components/Page/RevisionBody.js


+ 0 - 0
resource/js/components/Page/RevisionPath.js → src/client/js/components/Page/RevisionPath.js


+ 0 - 0
resource/js/components/Page/RevisionUrl.js → src/client/js/components/Page/RevisionUrl.js


+ 0 - 0
resource/js/components/PageAttachment.js → src/client/js/components/PageAttachment.js


+ 0 - 0
resource/js/components/PageAttachment/Attachment.js → src/client/js/components/PageAttachment/Attachment.js


+ 0 - 0
resource/js/components/PageAttachment/DeleteAttachmentModal.js → src/client/js/components/PageAttachment/DeleteAttachmentModal.js


+ 0 - 0
resource/js/components/PageAttachment/PageAttachmentList.js → src/client/js/components/PageAttachment/PageAttachmentList.js


+ 0 - 0
resource/js/components/PageComment/Comment.js → src/client/js/components/PageComment/Comment.js


+ 0 - 0
resource/js/components/PageComment/CommentForm.js → src/client/js/components/PageComment/CommentForm.js


+ 0 - 0
resource/js/components/PageComment/CommentPreview.js → src/client/js/components/PageComment/CommentPreview.js


+ 0 - 0
resource/js/components/PageComment/DeleteCommentModal.js → src/client/js/components/PageComment/DeleteCommentModal.js


+ 0 - 0
resource/js/components/PageComments.js → src/client/js/components/PageComments.js


+ 0 - 0
resource/js/components/PageEditor.js → src/client/js/components/PageEditor.js


+ 0 - 0
resource/js/components/PageEditor/AbstractEditor.js → src/client/js/components/PageEditor/AbstractEditor.js


+ 3 - 3
resource/js/components/PageEditor/CodeMirrorEditor.js → src/client/js/components/PageEditor/CodeMirrorEditor.js

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 
 import Modal from 'react-bootstrap/es/Modal';
 
-import AbstractEditor from './AbstractEditor';
+import InterceptorManager from '@commons/service/interceptor-manager';
 
 import urljoin from 'url-join';
 const loadScript = require('simple-load-script');
@@ -41,11 +41,11 @@ require('codemirror/addon/display/placeholder');
 require('codemirror/mode/gfm/gfm');
 require('../../util/codemirror/autorefresh.ext');
 
+import AbstractEditor from './AbstractEditor';
+
 import pasteHelper from './PasteHelper';
 import EmojiAutoCompleteHelper from './EmojiAutoCompleteHelper';
 
-import InterceptorManager from '../../../../lib/util/interceptor-manager';
-
 import PreventMarkdownListInterceptor from './PreventMarkdownListInterceptor';
 import MarkdownTableInterceptor from './MarkdownTableInterceptor';
 import mtu from './MarkdownTableUtil';

+ 0 - 0
resource/js/components/PageEditor/Editor.js → src/client/js/components/PageEditor/Editor.js


+ 0 - 0
resource/js/components/PageEditor/EmojiAutoCompleteHelper.js → src/client/js/components/PageEditor/EmojiAutoCompleteHelper.js


+ 0 - 0
resource/js/components/PageEditor/MarkdownListUtil.js → src/client/js/components/PageEditor/MarkdownListUtil.js


+ 0 - 0
resource/js/components/PageEditor/MarkdownTableInterceptor.js → src/client/js/components/PageEditor/MarkdownTableInterceptor.js


+ 0 - 0
resource/js/components/PageEditor/MarkdownTableUtil.js → src/client/js/components/PageEditor/MarkdownTableUtil.js


+ 0 - 0
resource/js/components/PageEditor/OptionsSelector.js → src/client/js/components/PageEditor/OptionsSelector.js


+ 0 - 0
resource/js/components/PageEditor/PasteHelper.js → src/client/js/components/PageEditor/PasteHelper.js


+ 0 - 0
resource/js/components/PageEditor/PreventMarkdownListInterceptor.js → src/client/js/components/PageEditor/PreventMarkdownListInterceptor.js


+ 0 - 0
resource/js/components/PageEditor/Preview.js → src/client/js/components/PageEditor/Preview.js


+ 0 - 0
resource/js/components/PageEditor/ScrollSyncHelper.js → src/client/js/components/PageEditor/ScrollSyncHelper.js


+ 2 - 2
resource/js/components/PageEditor/TextAreaEditor.js → src/client/js/components/PageEditor/TextAreaEditor.js

@@ -3,13 +3,13 @@ import React from 'react';
 
 import FormControl from 'react-bootstrap/es/FormControl';
 
+import InterceptorManager from '@commons/service/interceptor-manager';
+
 import AbstractEditor from './AbstractEditor';
 
 import pasteHelper from './PasteHelper';
 import mlu from './MarkdownListUtil';
 
-import InterceptorManager from '../../../../lib/util/interceptor-manager';
-
 import PreventMarkdownListInterceptor from './PreventMarkdownListInterceptor';
 
 export default class TextAreaEditor extends AbstractEditor {

+ 0 - 0
resource/js/components/PageEditorByHackmd.jsx → src/client/js/components/PageEditorByHackmd.jsx


+ 0 - 0
resource/js/components/PageEditorByHackmd/HackmdEditor.jsx → src/client/js/components/PageEditorByHackmd/HackmdEditor.jsx


+ 0 - 0
resource/js/components/PageHistory.js → src/client/js/components/PageHistory.js


+ 0 - 0
resource/js/components/PageHistory/PageRevisionList.js → src/client/js/components/PageHistory/PageRevisionList.js


+ 0 - 0
resource/js/components/PageHistory/Revision.js → src/client/js/components/PageHistory/Revision.js


+ 0 - 0
resource/js/components/PageHistory/RevisionDiff.js → src/client/js/components/PageHistory/RevisionDiff.js


+ 0 - 0
resource/js/components/PageList/ListView.js → src/client/js/components/PageList/ListView.js


+ 0 - 0
resource/js/components/PageList/Page.js → src/client/js/components/PageList/Page.js


+ 1 - 1
resource/js/components/PageList/PageListMeta.js → src/client/js/components/PageList/PageListMeta.js

@@ -1,5 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
+import templateChecker from '@commons/util/template-checker';
 
 export default class PageListMeta extends React.Component {
 
@@ -14,7 +15,6 @@ export default class PageListMeta extends React.Component {
   render() {
     // TODO isPortal()
     const page = this.props.page;
-    const templateChecker = require('../../../../lib/util/templateChecker');
 
     // portal check
     let PortalLabel;

+ 0 - 0
resource/js/components/PageList/PagePath.js → src/client/js/components/PageList/PagePath.js


+ 0 - 0
resource/js/components/PageListSearch.js → src/client/js/components/PageListSearch.js


+ 0 - 0
resource/js/components/PageStatusAlert.jsx → src/client/js/components/PageStatusAlert.jsx


+ 0 - 0
resource/js/components/ReactUtils.js → src/client/js/components/ReactUtils.js


+ 0 - 0
resource/js/components/SavePageControls.jsx → src/client/js/components/SavePageControls.jsx


+ 0 - 0
resource/js/components/SavePageControls/GrantSelector.jsx → src/client/js/components/SavePageControls/GrantSelector.jsx


+ 0 - 0
resource/js/components/SearchPage.js → src/client/js/components/SearchPage.js


+ 0 - 0
resource/js/components/SearchPage/DeletePageListModal.js → src/client/js/components/SearchPage/DeletePageListModal.js


+ 0 - 0
resource/js/components/SearchPage/SearchForm.js → src/client/js/components/SearchPage/SearchForm.js


+ 0 - 0
resource/js/components/SearchPage/SearchResult.js → src/client/js/components/SearchPage/SearchResult.js


+ 0 - 0
resource/js/components/SearchPage/SearchResultList.js → src/client/js/components/SearchPage/SearchResultList.js


+ 0 - 0
resource/js/components/SearchTypeahead.js → src/client/js/components/SearchTypeahead.js


+ 0 - 0
resource/js/components/SeenUserList.js → src/client/js/components/SeenUserList.js


+ 0 - 0
resource/js/components/SeenUserList/UserList.js → src/client/js/components/SeenUserList/UserList.js


+ 0 - 0
resource/js/components/SlackNotification.jsx → src/client/js/components/SlackNotification.jsx


+ 0 - 0
resource/js/components/User/User.js → src/client/js/components/User/User.js


+ 0 - 0
resource/js/components/User/UserPicture.js → src/client/js/components/User/UserPicture.js


+ 0 - 0
resource/js/dev.js → src/client/js/dev.js


+ 1 - 1
resource/js/hackmd-agent.js → src/client/js/hackmd-agent.js

@@ -2,7 +2,7 @@
  * GROWI agent for HackMD
  *
  * This file will be transpiled as a single JS
- *  and should be load from HackMD head via 'lib/routes/hackmd.js' route
+ *  and should be load from HackMD head via 'routes/hackmd.js' route
  *
  * USAGE:
  *  <script src="${hostname of GROWI}/_hackmd/load-agent"></script>

+ 1 - 1
resource/js/hackmd-styles.js → src/client/js/hackmd-styles.js

@@ -2,7 +2,7 @@
  * GROWI styles loader for HackMD
  *
  * This file will be transpiled as a single JS
- *  and should be load from HackMD head via 'lib/routes/hackmd.js' route
+ *  and should be load from HackMD head via 'routes/hackmd.js' route
  *
  * USAGE:
  *  <script src="${hostname of GROWI}/_hackmd/load-styles"></script>

Некоторые файлы не были показаны из-за большого количества измененных файлов