Browse Source

Merge remote-tracking branch 'origin/feat/77515-display-search-result-with-snippet' into feat/77523-get-snippet-that-set-in-elasticsearch

zahmis 4 years ago
parent
commit
933301fdaa

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

@@ -566,7 +566,9 @@
     "delete": "Delete",
     "check_all": "Check all",
     "deletion_modal_header": "Delete page",
-    "delete_completely": "Delete completely"
+    "delete_completely": "Delete completely",
+    "include_certain_path" : "Include {{pathToInclude}} path ",
+    "delete_all_selected_page" : "Delete All"
   },
   "security_setting": {
     "Guest Users Access": "Guest users access",

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

@@ -567,7 +567,9 @@
     "delete": "削除",
     "check_all": "すべてチェック",
     "deletion_modal_header": "以下のページを削除",
-    "delete_completely": "完全に削除する"
+    "delete_completely": "完全に削除する",
+    "include_certain_path": "{{pathToInclude}}下を含む ",
+    "delete_all_selected_page" : "一括削除"
   },
   "security_setting": {
     "Guest Users Access": "ゲストユーザーのアクセス",

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

@@ -839,7 +839,9 @@
 		"delete": "删除",
 		"check_all": "全部检查",
 		"deletion_modal_header": "删除页",
-		"delete_completely": "完全删除"
+		"delete_completely": "完全删除",
+    "include_certain_path": "包含 {{pathToInclude}} 路径 ",
+    "delete_all_selected_page": "删除所有"
 	},
 	"to_cloud_settings": "進入 GROWI.cloud 的管理界面",
 	"login": {

+ 39 - 0
packages/app/src/components/SearchPage/DeleteAllButton.jsx

@@ -0,0 +1,39 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { useTranslation } from 'react-i18next';
+
+const DeleteAllButton = (props) => {
+  const { selectedPage, checked } = props;
+  const { t } = useTranslation();
+  function deleteAllSelectedPage(pagesToDelete) {
+    // TODO: implement this function
+    // https://estoc.weseek.co.jp/redmine/issues/77543
+    // do something with pagesDelete to delete them.
+  }
+  return (
+    <div>
+      <label>
+        <input
+          type="checkbox"
+          name="check-delte-all"
+          onChange={() => {
+            if (checked) {
+              deleteAllSelectedPage(selectedPage);
+            }
+          }}
+        />
+        <span className="text-danger font-weight-light">
+          <i className="icon-trash ml-3"></i>
+          {t('search_result.delete_all_selected_page')}
+        </span>
+      </label>
+    </div>
+  );
+
+};
+
+DeleteAllButton.propTypes = {
+  selectedPage: PropTypes.array.isRequired,
+  checked: PropTypes.bool.isRequired,
+};
+export default DeleteAllButton;

+ 42 - 0
packages/app/src/components/SearchPage/IncludeSpecificPathButton.jsx

@@ -0,0 +1,42 @@
+import React, { useState } from 'react';
+import PropTypes from 'prop-types';
+import { useTranslation } from 'react-i18next';
+
+const IncludeSpecificPathButton = (props) => {
+  const { pathToInclude, checked } = props;
+  const { t } = useTranslation();
+
+  // TODO : implement this function
+  // 77526 story https://estoc.weseek.co.jp/redmine/issues/77526
+  // 77535 stroy https://estoc.weseek.co.jp/redmine/issues/77535
+  function includeSpecificPathInSearchResult(pathToInclude) {
+    console.log(`now including ${pathToInclude} in search result`);
+  }
+  return (
+    <div className="border px-2 btn btn-outline-secondary">
+      <label className="mb-0">
+        <span className="font-weight-light">
+          {pathToInclude === '/user'
+            ? t('search_result.include_certain_path', { pathToInclude: '/user' }) : t('search_result.include_certain_path', { pathToInclude: '/trash' })}
+        </span>
+        <input
+          type="checkbox"
+          name="check-include-specific-path"
+          onChange={() => {
+            if (checked) {
+              includeSpecificPathInSearchResult(pathToInclude);
+            }
+          }}
+        />
+      </label>
+    </div>
+  );
+
+};
+
+IncludeSpecificPathButton.propTypes = {
+  pathToInclude: PropTypes.string.isRequired,
+  checked: PropTypes.bool.isRequired,
+};
+
+export default IncludeSpecificPathButton;