Explorar o código

refactor confirm modal

yuken %!s(int64=3) %!d(string=hai) anos
pai
achega
8c5030a5ae

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

@@ -663,7 +663,7 @@
     },
     "by_path_modal": {
       "title": "Convert to new v5 compatible format",
-      "notice": "",
+      "alert": "",
       "description": "Enter a path and all pages under that path will be converted to v5 compatible format.",
       "button_label": "Convert",
       "success": "Successfully requested conversion.",

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

@@ -663,7 +663,7 @@
     },
     "by_path_modal": {
       "title": "新しい v5 互換形式への変換",
-      "notice": "後で文言は考える",
+      "alert": "後で文言は考える",
       "description": "パスを入力することで、そのパスの配下のページを全て v5 互換形式に変換します",
       "button_label": "変換",
       "success": "正常に変換を開始しました",

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

@@ -950,7 +950,7 @@
     },
     "by_path_modal": {
       "title": "转换为新的v5兼容格式",
-      "notice": "",
+      "alert": "",
       "description": "输入一个路径,该路径下的所有页面将被转换为v5兼容格式。",
       "button_label": "转换",
       "success": "成功地请求转换。",

+ 2 - 1
packages/app/src/components/PrivateLegacyPages.tsx

@@ -148,7 +148,6 @@ const ConvertByPathModal = React.memo((props: ConvertByPathModalProps): JSX.Elem
       </ModalHeader>
       <ModalBody>
         <p>{t('private_legacy_pages.by_path_modal.description')}</p>
-        <p className="text-danger">{ t('private_legacy_pages.by_path_modal.notice') }</p>
         <input type="text" className="form-control" placeholder="/" value={currentInput} onChange={e => setInput(e.target.value)} />
       </ModalBody>
       <ModalFooter>
@@ -184,6 +183,7 @@ const ConvertByPathConfirmModal = React.memo((props: ConvertByPathConfirmModalPr
       </ModalHeader>
       <ModalBody>
         <p> {props.confirmModalData.path} 以下のページを全て変換します。よろしいですか?</p>
+        <p className="text-danger">{ t('private_legacy_pages.by_path_modal.alert') }</p>
       </ModalBody>
       <ModalFooter>
         <button type="button" className="btn btn-primary" onClick={() => props.onSubmit?.(props.confirmModalData.path)}>
@@ -359,6 +359,7 @@ const PrivateLegacyPages = (props: Props): JSX.Element => {
   }, [isAdmin]);
 
   const openConvertConfirmModalHandler = useCallback((path: string) => {
+    if (path === '') { return }
     setOpenConvertModal(false);
     const confirmModalData: ConfirmModalData = {
       isOpen: true,