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

Merge branch 'master' into support/apply-bootstrap4

# Conflicts:
#	src/client/js/components/Admin/ImportData/GrowiArchive/ImportForm.jsx
yusuketk 6 лет назад
Родитель
Сommit
745215c2d0

+ 5 - 0
.github/workflows/build-rc.yml

@@ -52,3 +52,8 @@ jobs:
         target: weseek/growi
         target: weseek/growi
         semver: ${{ env.SEMVER }}
         semver: ${{ env.SEMVER }}
         publish: true
         publish: true
+
+    - name: Check whether workspace is clean
+      run: |
+        STATUS=`git status --porcelain`
+        if [ -z "$STATUS" ]; then exit 0; else exit 1; fi

+ 5 - 0
.github/workflows/build.yml

@@ -66,6 +66,11 @@ jobs:
         additional-tags: 'latest'
         additional-tags: 'latest'
         publish: true
         publish: true
 
 
+    - name: Check whether workspace is clean
+      run: |
+        STATUS=`git status --porcelain`
+        if [ -z "$STATUS" ]; then exit 0; else exit 1; fi
+
   publish-desc:
   publish-desc:
 
 
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest

+ 7 - 2
resource/locales/en-US/admin/admin.json

@@ -105,7 +105,7 @@
     },
     },
     "behavior": "Behavior",
     "behavior": "Behavior",
     "behavior_desc": {
     "behavior_desc": {
-      "growi_text1": "Both of <code>/page</code> and <code>/page/</code> shows the same page",
+      "growi_text1": "Both of <code>/page</code> and <code>/page/</code> shows the same page.",
       "growi_text2": "<code>/nonexistent_page</code> shows editing form",
       "growi_text2": "<code>/nonexistent_page</code> shows editing form",
       "growi_text3": "All pages shows the list of sub pages <b>if using GROWI Enhanced Layout</b>",
       "growi_text3": "All pages shows the list of sub pages <b>if using GROWI Enhanced Layout</b>",
       "crowi_text1": "<code>/page</code> shows the page",
       "crowi_text1": "<code>/page</code> shows the page",
@@ -151,7 +151,12 @@
     "import_from": "Import from {{from}}",
     "import_from": "Import from {{from}}",
     "import_growi_archive": "Import GROWI Archive",
     "import_growi_archive": "Import GROWI Archive",
     "growi_settings": {
     "growi_settings": {
-      "overwrite_documents": "Imported documents will overwrite existing documents",
+      "description_of_import_mode": {
+        "about": "When you import data with the same name as an existing one, choose from the following three modes below.",
+        "insert": "Insert: Skip importing the data.",
+        "upsert": "Upsert: Overwrite and update the existing data with imported data.",
+        "flash_and_insert": "Flash and Insert: After deleting the existing data completely, import the data"
+      },
       "growi_archive_file": "GROWI Archive File",
       "growi_archive_file": "GROWI Archive File",
       "uploaded_data": "Uploaded Data",
       "uploaded_data": "Uploaded Data",
       "extracted_file": "Extracted File",
       "extracted_file": "Extracted File",

+ 6 - 1
resource/locales/ja/admin/admin.json

@@ -169,7 +169,12 @@
     "import_from": "{{from}} からインポート",
     "import_from": "{{from}} からインポート",
     "import_growi_archive": "GROWI アーカイブをインポート",
     "import_growi_archive": "GROWI アーカイブをインポート",
     "growi_settings": {
     "growi_settings": {
-      "overwrite_documents": "インポートされたドキュメントは既存のドキュメントを上書きします",
+      "description_of_import_mode": {
+        "about": "既存のデータと同名であるデータをインポートする際の挙動は以下の3つのモードから選べます。",
+        "insert": "Insert: 当該データのインポートをスキップします。",
+        "upsert": "Upsert: 既存のデータをインポートデータで上書き更新します。",
+        "flash_and_insert": "Flash and Insert: 既存のデータを完全に削除した後、インポートを行います。"
+      },
       "growi_archive_file": "GROWI アーカイブファイル",
       "growi_archive_file": "GROWI アーカイブファイル",
       "uploaded_data": "アップロードされたデータ",
       "uploaded_data": "アップロードされたデータ",
       "extracted_file": "展開されたファイル",
       "extracted_file": "展開されたファイル",

+ 17 - 15
src/client/js/components/Admin/ImportData/GrowiArchive/ImportForm.jsx

@@ -333,7 +333,7 @@ class ImportForm extends React.Component {
     );
     );
   }
   }
 
 
-  renderGroups(groupList, groupName, errors, { wellContent } = {}) {
+  renderGroups(groupList, groupName, errors) {
     const collectionNames = groupList.filter((collectionName) => {
     const collectionNames = groupList.filter((collectionName) => {
       return this.allCollectionNames.includes(collectionName);
       return this.allCollectionNames.includes(collectionName);
     });
     });
@@ -343,19 +343,10 @@ class ImportForm extends React.Component {
     }
     }
 
 
     return (
     return (
-      <div className="mt-4 row">
-        <div className="col-12">
-          <h3 className="admin-setting-header">{groupName} Collections</h3>
-          { wellContent != null && (
-            <div className="card well small" role="alert">
-              <ul>
-                <li>{wellContent}</li>
-              </ul>
-            </div>
-          )}
-          {this.renderImportItems(collectionNames)}
-          {this.renderWarnForGroups(errors, `warnFor${groupName}`)}
-        </div>
+      <div className="mt-4">
+        <legend>{groupName} Collections</legend>
+        {this.renderImportItems(collectionNames)}
+        {this.renderWarnForGroups(errors, `warnFor${groupName}`)}
       </div>
       </div>
     );
     );
   }
   }
@@ -466,7 +457,18 @@ class ImportForm extends React.Component {
           </div>
           </div>
         </form>
         </form>
 
 
-        {this.renderGroups(GROUPS_PAGE, 'Page', warnForPageGroups, { wellContent: t('admin:importer_management.growi_settings.overwrite_documents') })}
+        <div className="card well small my-4">
+          <ul>
+            <li>{t('admin:importer_management.growi_settings.description_of_import_mode.about')}</li>
+            <ul>
+              <li>{t('admin:importer_management.growi_settings.description_of_import_mode.insert')}</li>
+              <li>{t('admin:importer_management.growi_settings.description_of_import_mode.upsert')}</li>
+              <li>{t('admin:importer_management.growi_settings.description_of_import_mode.flash_and_insert')}</li>
+            </ul>
+          </ul>
+        </div>
+
+        {this.renderGroups(GROUPS_PAGE, 'Page', warnForPageGroups)}
         {this.renderGroups(GROUPS_USER, 'User', warnForUserGroups)}
         {this.renderGroups(GROUPS_USER, 'User', warnForUserGroups)}
         {this.renderGroups(GROUPS_CONFIG, 'Config', warnForConfigGroups)}
         {this.renderGroups(GROUPS_CONFIG, 'Config', warnForConfigGroups)}
         {this.renderOthers()}
         {this.renderOthers()}