Taichi Masuyama 4 лет назад
Родитель
Сommit
4907def2a9

+ 8 - 0
packages/app/resource/locales/en_US/admin/admin.json

@@ -19,6 +19,14 @@
     "bug_report": "Submitting a bug report",
     "bug_report": "Submitting a bug report",
     "submit_bug_report": "<a href='https://github.com/weseek/growi/issues/new?assignees=&labels=bug&template=bug-report.md&title=Bug%3A' target='_blank' rel='noreferrer'>then submit your issue to GitHub.</a>"
     "submit_bug_report": "<a href='https://github.com/weseek/growi/issues/new?assignees=&labels=bug&template=bug-report.md&title=Bug%3A' target='_blank' rel='noreferrer'>then submit your issue to GitHub.</a>"
   },
   },
+  "v5_page_migration": {
+    "migration_desc": "Some of the public pages have the old schema.<br/>To take advantage of new features such as page trees and easy renaming, please upgrade the schema of all your pages.<br/><br/>",
+    "migration_note": "Note: You will lose unique constraints from the page paths.",
+    "upgrade_to_v5": "Upgrade to V5",
+    "modal_migration_warning": "This process may take long.<br/>It is highly recommended that administrators tell users not to create, modify, or delete pages during migration.<br/><br/>Note: You will lose unique constraints from the page paths.",
+    "start_upgrading": "Start upgrading",
+    "successfully_started": "Succeeded to start migration"
+  },
   "app_setting": {
   "app_setting": {
     "site_name": "Site name",
     "site_name": "Site name",
     "sitename_change": "You can change site name which is used for header and HTML title.",
     "sitename_change": "You can change site name which is used for header and HTML title.",

+ 1 - 0
packages/app/resource/locales/en_US/translation.json

@@ -106,6 +106,7 @@
   "Create under": "Create page under below:",
   "Create under": "Create page under below:",
   "Wiki Management Home Page": "Wiki Management Home Page",
   "Wiki Management Home Page": "Wiki Management Home Page",
   "App Settings": "App Settings",
   "App Settings": "App Settings",
+  "V5 Page Migration": "V5 Page Migration",
   "Site URL settings": "Site URL settings",
   "Site URL settings": "Site URL settings",
   "Markdown Settings": "Markdown Settings",
   "Markdown Settings": "Markdown Settings",
   "Customize": "Customize",
   "Customize": "Customize",

+ 8 - 0
packages/app/resource/locales/ja_JP/admin/admin.json

@@ -19,6 +19,14 @@
     "bug_report": "バグを報告する",
     "bug_report": "バグを報告する",
     "submit_bug_report": "<a href='https://github.com/weseek/growi/issues/new?assignees=&labels=bug&template=bug-report.md&title=Bug%3A' target='_blank' rel='noreferrer'>次に GitHub で Issue を投稿してください。</a>"
     "submit_bug_report": "<a href='https://github.com/weseek/growi/issues/new?assignees=&labels=bug&template=bug-report.md&title=Bug%3A' target='_blank' rel='noreferrer'>次に GitHub で Issue を投稿してください。</a>"
   },
   },
+  "v5_page_migration": {
+    "migration_desc": "公開されているページに古いスキーマのものが存在します。<br/>ページツリーや簡単なリネームなどの新機能を利用するには、全てのページのスキーマをアップグレードしてください。<br/><br />",
+    "migration_note": "注意: ページパスからユニーク制約が失われます。",
+    "upgrade_to_v5": "V5 にアップグレード",
+    "modal_migration_warning": "管理者はユーザーに、マイグレーション中はページを作成・変更・削除しないように伝えることを強くお勧めします。<br/><br/>注意: アップグレードが終了するとページパスからユニーク制約が失われます。",
+    "start_upgrading": "アップグレードを開始",
+    "successfully_started": "正常にマイグレーションが開始されました"
+  },
   "app_setting": {
   "app_setting": {
     "site_name": "サイト名",
     "site_name": "サイト名",
     "sitename_change": "ヘッダーや HTML タイトルに使用されるサイト名を変更できます。",
     "sitename_change": "ヘッダーや HTML タイトルに使用されるサイト名を変更できます。",

+ 1 - 0
packages/app/resource/locales/ja_JP/translation.json

@@ -106,6 +106,7 @@
   "Create under": "ページを以下に作成",
   "Create under": "ページを以下に作成",
   "Wiki Management Home Page": "Wiki管理トップ",
   "Wiki Management Home Page": "Wiki管理トップ",
   "App Settings": "アプリ設定",
   "App Settings": "アプリ設定",
+  "V5 Page Migration": "V5 ページマイグレーション",
   "Site URL settings": "サイトURL設定",
   "Site URL settings": "サイトURL設定",
   "Markdown Settings": "マークダウン設定",
   "Markdown Settings": "マークダウン設定",
   "Customize": "カスタマイズ",
   "Customize": "カスタマイズ",

+ 8 - 0
packages/app/resource/locales/zh_CN/admin/admin.json

@@ -19,6 +19,14 @@
     "bug_report": "提交一个错误报告",
     "bug_report": "提交一个错误报告",
     "submit_bug_report": "<a href='https://github.com/weseek/growi/issues/new?assignees=&labels=bug&template=bug-report.md&title=Bug%3A' target='_blank' rel='noreferrer'>然后提交你的问题到GitHub。</a>"
     "submit_bug_report": "<a href='https://github.com/weseek/growi/issues/new?assignees=&labels=bug&template=bug-report.md&title=Bug%3A' target='_blank' rel='noreferrer'>然后提交你的问题到GitHub。</a>"
   },
   },
+  "v5_page_migration": {
+    "migration_desc": "Some of the public pages have the old schema.<br/>To take advantage of new features such as page trees and easy renaming, please upgrade the schema of all your pages.<br/><br/>",
+    "migration_note": "Note: You will lose unique constraints from the page paths.",
+    "upgrade_to_v5": "Upgrade to V5",
+    "modal_migration_warning": "This process may take long.<br/>It is highly recommended that administrators tell users not to create, modify, or delete pages during migration.<br/><br/>Note: You will lose unique constraints from the page paths.",
+    "start_upgrading": "Start upgrading",
+    "successfully_started": "Succeeded to start migration"
+  },
   "app_setting": {
   "app_setting": {
     "site_name": "网站名称 ",
     "site_name": "网站名称 ",
     "sitename_change": "您可以更改用于标题和HTML标题的网站名称。",
     "sitename_change": "您可以更改用于标题和HTML标题的网站名称。",

+ 1 - 0
packages/app/resource/locales/zh_CN/translation.json

@@ -114,6 +114,7 @@
 	"Create under": "Create page under below:",
 	"Create under": "Create page under below:",
 	"Wiki Management Home Page": "Wiki管理首页",
 	"Wiki Management Home Page": "Wiki管理首页",
 	"App Settings": "系统设置",
 	"App Settings": "系统设置",
+  "V5 Page Migration": "V5 Page Migration",
 	"Site URL settings": "主页URL设置",
 	"Site URL settings": "主页URL设置",
 	"Markdown Settings": "Markdown设置",
 	"Markdown Settings": "Markdown设置",
 	"Customize": "页面定制",
 	"Customize": "页面定制",

+ 2 - 2
packages/app/src/components/Admin/AdminHome/AdminHome.jsx

@@ -46,10 +46,10 @@ class AdminHome extends React.Component {
           !isV5Compatible
           !isV5Compatible
           && (
           && (
             <div className={`alert ${alertStyle}`}>
             <div className={`alert ${alertStyle}`}>
-              GROWI is running with v4 compatible pages. To use new features such as Page tree or easy renaming, please migrate page schema to v5.<br />
+              {t('v5_page_migration.migration_desc')}
               <a className="btn-link" href="/admin/app" rel="noopener noreferrer">
               <a className="btn-link" href="/admin/app" rel="noopener noreferrer">
                 <i className="fa fa-link ml-1" aria-hidden="true"></i>
                 <i className="fa fa-link ml-1" aria-hidden="true"></i>
-                <strong>Upgrade to v5</strong>
+                <strong>{t('v5_page_migration.upgrade_to_v5')}</strong>
               </a>
               </a>
             </div>
             </div>
           )
           )

+ 1 - 1
packages/app/src/components/Admin/App/AppSettingsPageContents.jsx

@@ -25,7 +25,7 @@ class AppSettingsPageContents extends React.Component {
           && (
           && (
             <div className="row">
             <div className="row">
               <div className="col-lg-12">
               <div className="col-lg-12">
-                <h2 className="admin-setting-header">V5 Page Migration</h2>
+                <h2 className="admin-setting-header">{t('V5 Page Migration')}</h2>
                 <V5PageMigration />
                 <V5PageMigration />
               </div>
               </div>
             </div>
             </div>

+ 10 - 5
packages/app/src/components/Admin/App/V5PageMigration.tsx

@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
 import { V5PageMigrationModal } from './V5PageMigrationModal';
 import { V5PageMigrationModal } from './V5PageMigrationModal';
 import AdminAppContainer from '../../../client/services/AdminAppContainer';
 import AdminAppContainer from '../../../client/services/AdminAppContainer';
 import { withUnstatedContainers } from '../../UnstatedUtils';
 import { withUnstatedContainers } from '../../UnstatedUtils';
+import { toastSuccess, toastError } from '../../../client/util/apiNotification';
 
 
 
 
 const V5PageMigration: FC<any> = (props) => {
 const V5PageMigration: FC<any> = (props) => {
@@ -14,7 +15,13 @@ const V5PageMigration: FC<any> = (props) => {
 
 
   const onConfirm = async() => {
   const onConfirm = async() => {
     setIsV5PageMigrationModalShown(false);
     setIsV5PageMigrationModalShown(false);
-    await adminAppContainer.v5PageMigrationHandler('upgrade');
+    try {
+      await adminAppContainer.v5PageMigrationHandler('upgrade');
+      toastSuccess(t('v5_page_migration.successfully_started'));
+    }
+    catch (err) {
+      toastError(err);
+    }
   };
   };
 
 
   const onNotNowClicked = async() => {
   const onNotNowClicked = async() => {
@@ -29,12 +36,10 @@ const V5PageMigration: FC<any> = (props) => {
         onCancel={() => setIsV5PageMigrationModalShown(false)}
         onCancel={() => setIsV5PageMigrationModalShown(false)}
       />
       />
       <p className="card well">
       <p className="card well">
-        GROWI is running with v4 compatible pages.<br />
-        To use new features such as Page tree or easy renaming, please migrate page schema to v5.<br />
-        <br />
+        {t('v5_page_migration.migration_desc')}
         <span className="text-danger">
         <span className="text-danger">
           <i className="icon-exclamation icon-fw"></i>
           <i className="icon-exclamation icon-fw"></i>
-          Note: You will lose unique constraint from page path.
+          {t('v5_page_migration.migration_note')}
         </span>
         </span>
       </p>
       </p>
       <div className="row my-3">
       <div className="row my-3">

+ 2 - 5
packages/app/src/components/Admin/App/V5PageMigrationModal.tsx

@@ -25,10 +25,7 @@ export const V5PageMigrationModal: FC<V5PageMigrationModalProps> = (props) => {
         Warning
         Warning
       </ModalHeader>
       </ModalHeader>
       <ModalBody>
       <ModalBody>
-        TODO: tell user
-        that this process may take long,
-        that the admin user is responsible for telling users not to do important interaction until it ends,
-        and that Page schema will no longer have a unique constraint in page path.
+        {t('v5_page_migration.modal_migration_warning')}
       </ModalBody>
       </ModalBody>
       <ModalFooter>
       <ModalFooter>
         <button
         <button
@@ -43,7 +40,7 @@ export const V5PageMigrationModal: FC<V5PageMigrationModalProps> = (props) => {
           className="btn btn-outline-primary ml-3"
           className="btn btn-outline-primary ml-3"
           onClick={props.onConfirm}
           onClick={props.onConfirm}
         >
         >
-          Start Upgrading
+          {t('v5_page_migration.start_upgrading')}
         </button>
         </button>
       </ModalFooter>
       </ModalFooter>
     </Modal>
     </Modal>