瀏覽代碼

notify user of export start

Futa Arai 2 年之前
父節點
當前提交
532f3c8d04

+ 2 - 1
apps/app/public/static/locales/en_US/translation.json

@@ -604,7 +604,8 @@
     "bulk_export": "Export page and all child pages",
     "bulk_export_notice": "Once a download link is ready, a notification will be sent. If the number of pages is large, it may take a while for preparation.",
     "markdown": "Markdown",
-    "choose_export_format": "Select export format"
+    "choose_export_format": "Select export format",
+    "bulk_export_started": "Please wait a moment..."
   },
   "message": {
     "successfully_connected": "Successfully Connected!",

+ 2 - 1
apps/app/public/static/locales/ja_JP/translation.json

@@ -637,7 +637,8 @@
     "bulk_export": "ページとその配下のページを全てエクスポート",
     "bulk_export_notice": "ダウンロードの準備が完了すると、通知が届きます。ページ数が多いと、準備に時間がかかる場合があります。",
     "markdown": "マークダウン",
-    "choose_export_format": "エクスポート形式を選択してください"
+    "choose_export_format": "エクスポート形式を選択してください",
+    "bulk_export_started": "ただいま準備中です..."
   },
   "message": {
     "successfully_connected": "接続に成功しました!",

+ 2 - 1
apps/app/public/static/locales/zh_CN/translation.json

@@ -607,7 +607,8 @@
     "bulk_export": "导出页面及其下的所有页面",
     "bulk_export_notice": "下载链接准备好后,将发送通知。如果页数较多,则可能需要一段时间准备。",
     "markdown": "Markdown",
-    "choose_export_format": "选择导出格式"
+    "choose_export_format": "选择导出格式",
+    "bulk_export_started": "目前我们正在准备..."
   },
 	"message": {
 		"successfully_connected": "连接成功!",

+ 8 - 2
apps/app/src/components/PageBulkExportSelectModal.tsx

@@ -1,12 +1,18 @@
 import { useTranslation } from 'next-i18next';
 import { Modal, ModalHeader, ModalBody } from 'reactstrap';
 
+import { toastSuccess } from '~/client/util/toastr';
 import { usePageBulkExportSelectModal } from '~/stores/modal';
 
 const PageBulkExportSelectModal = (): JSX.Element => {
   const { t } = useTranslation();
   const { data: status, close } = usePageBulkExportSelectModal();
 
+  const startBulkExport = () => {
+    close();
+    toastSuccess(t('page_export.bulk_export_started'));
+  };
+
   return (
     <>
       {status != null && (
@@ -22,8 +28,8 @@ const PageBulkExportSelectModal = (): JSX.Element => {
             </div>
             {t('page_export.choose_export_format')}:
             <div className="d-flex justify-content-center mt-2">
-              <button className="btn btn-primary" type="button">{t('page_export.markdown')}</button>
-              <button className="btn btn-primary ml-2" type="button">PDF</button>
+              <button className="btn btn-primary" type="button" onClick={startBulkExport}>{t('page_export.markdown')}</button>
+              <button className="btn btn-primary ml-2" type="button" onClick={startBulkExport}>PDF</button>
             </div>
           </ModalBody>
         </Modal>