Browse Source

fix(app): clarify reload prompt modal title and cancel label

The reload prompt reused ConfirmModal, whose hardcoded "Warning" header and
"Cancel" label were misleading: the setting is already saved when the modal
appears, so "Cancel" only skips the reload rather than reverting the change.

Add backward-compatible overrides (title / cancelButtonTitle / headerClassName
/ iconName) to ConfirmModal and use them for a calmer prompt: title "Reload
page" with a refresh icon, and a "Not now" dismiss button.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tomoyuki-t 1 day ago
parent
commit
5991165d27

+ 2 - 0
apps/app/public/static/locales/en_US/admin.json

@@ -376,7 +376,9 @@
     "page_bulk_export_explanation": "Enables a feature that allows all users to export a page and all it's child pages at once from the menu. Exported data will be automatically deleted after the storage period has passed.",
     "page_bulk_export_explanation": "Enables a feature that allows all users to export a page and all it's child pages at once from the menu. Exported data will be automatically deleted after the storage period has passed.",
     "page_bulk_export_warning": "The bulk page export feature is available to all users. In order to maintain system resources, we ask for your cooperation in using the minimum amount necessary. If you are an administrator, please inform all users of this.",
     "page_bulk_export_warning": "The bulk page export feature is available to all users. In order to maintain system resources, we ask for your cooperation in using the minimum amount necessary. If you are an administrator, please inform all users of this.",
     "page_bulk_export_storage_period": "Storage period",
     "page_bulk_export_storage_period": "Storage period",
+    "page_bulk_export_reload_title": "Reload page",
     "page_bulk_export_reload_prompt": "You need to reload the page to reflect the setting change. Reload now?",
     "page_bulk_export_reload_prompt": "You need to reload the page to reflect the setting change. Reload now?",
+    "page_bulk_export_reload_dismiss": "Not now",
     "reload_page": "Reload",
     "reload_page": "Reload",
     "update": "Update",
     "update": "Update",
     "mail_settings": "E-mail Settings",
     "mail_settings": "E-mail Settings",

+ 2 - 0
apps/app/public/static/locales/fr_FR/admin.json

@@ -376,7 +376,9 @@
     "page_bulk_export_explanation": "Active une fonctionnalité qui permet à tous les utilisateurs d'exporter simultanément toutes les pages sélectionnées dans le menu des pages et leurs pages subordonnées. Les données exportées seront automatiquement supprimées une fois la période de conservation écoulée.",
     "page_bulk_export_explanation": "Active une fonctionnalité qui permet à tous les utilisateurs d'exporter simultanément toutes les pages sélectionnées dans le menu des pages et leurs pages subordonnées. Les données exportées seront automatiquement supprimées une fois la période de conservation écoulée.",
     "page_bulk_export_warning": "La fonctionnalité d’exportation de pages en masse est disponible pour tous les utilisateurs. Afin de maintenir les ressources du système, nous demandons votre coopération pour utiliser le montant minimum nécessaire. Si vous êtes administrateur, veuillez en informer tous les utilisateurs.",
     "page_bulk_export_warning": "La fonctionnalité d’exportation de pages en masse est disponible pour tous les utilisateurs. Afin de maintenir les ressources du système, nous demandons votre coopération pour utiliser le montant minimum nécessaire. Si vous êtes administrateur, veuillez en informer tous les utilisateurs.",
     "page_bulk_export_storage_period": "Date limite de téléchargement",
     "page_bulk_export_storage_period": "Date limite de téléchargement",
+    "page_bulk_export_reload_title": "Recharger la page",
     "page_bulk_export_reload_prompt": "Un rechargement de la page est nécessaire pour appliquer le changement de paramètre. Recharger maintenant ?",
     "page_bulk_export_reload_prompt": "Un rechargement de la page est nécessaire pour appliquer le changement de paramètre. Recharger maintenant ?",
+    "page_bulk_export_reload_dismiss": "Pas maintenant",
     "reload_page": "Recharger",
     "reload_page": "Recharger",
     "update": "Sauvegarder",
     "update": "Sauvegarder",
     "mail_settings": "SMTP",
     "mail_settings": "SMTP",

+ 2 - 0
apps/app/public/static/locales/ja_JP/admin.json

@@ -385,7 +385,9 @@
     "page_bulk_export_explanation": "すべてのユーザーが、ページメニューから選択したページとその配下ページをまとめてエクスポートできる機能を有効化します。エクスポートされたデータは保存期間経過後に自動的に削除されます。",
     "page_bulk_export_explanation": "すべてのユーザーが、ページメニューから選択したページとその配下ページをまとめてエクスポートできる機能を有効化します。エクスポートされたデータは保存期間経過後に自動的に削除されます。",
     "page_bulk_export_warning": "ページ一括エクスポート機能は全ユーザーが利用可能です。システムリソースの維持のため、必要最小限の利用にご協力をお願いいたします。管理者の方は、この旨をユーザーの皆様にご周知ください。",
     "page_bulk_export_warning": "ページ一括エクスポート機能は全ユーザーが利用可能です。システムリソースの維持のため、必要最小限の利用にご協力をお願いいたします。管理者の方は、この旨をユーザーの皆様にご周知ください。",
     "page_bulk_export_storage_period": "保存期間",
     "page_bulk_export_storage_period": "保存期間",
+    "page_bulk_export_reload_title": "ページの再読み込み",
     "page_bulk_export_reload_prompt": "設定を反映するにはページの再読み込みが必要です。今すぐ再読み込みしますか?",
     "page_bulk_export_reload_prompt": "設定を反映するにはページの再読み込みが必要です。今すぐ再読み込みしますか?",
+    "page_bulk_export_reload_dismiss": "今はしない",
     "reload_page": "再読み込み",
     "reload_page": "再読み込み",
     "update": "更新",
     "update": "更新",
     "mail_settings": "メールの設定",
     "mail_settings": "メールの設定",

+ 2 - 0
apps/app/public/static/locales/ko_KR/admin.json

@@ -376,7 +376,9 @@
     "page_bulk_export_explanation": "모든 사용자가 메뉴에서 한 번에 페이지와 모든 하위 페이지를 내보낼 수 있는 기능을 활성화합니다. 내보낸 데이터는 저장 기간이 지나면 자동으로 삭제됩니다.",
     "page_bulk_export_explanation": "모든 사용자가 메뉴에서 한 번에 페이지와 모든 하위 페이지를 내보낼 수 있는 기능을 활성화합니다. 내보낸 데이터는 저장 기간이 지나면 자동으로 삭제됩니다.",
     "page_bulk_export_warning": "대량 페이지 내보내기 기능은 모든 사용자에게 제공됩니다. 시스템 리소스 유지를 위해 최소한의 사용을 부탁드립니다. 관리자라면 모든 사용자에게 이 사실을 알려주십시오.",
     "page_bulk_export_warning": "대량 페이지 내보내기 기능은 모든 사용자에게 제공됩니다. 시스템 리소스 유지를 위해 최소한의 사용을 부탁드립니다. 관리자라면 모든 사용자에게 이 사실을 알려주십시오.",
     "page_bulk_export_storage_period": "저장 기간",
     "page_bulk_export_storage_period": "저장 기간",
+    "page_bulk_export_reload_title": "페이지 다시 로드",
     "page_bulk_export_reload_prompt": "설정을 반영하려면 페이지를 다시 로드해야 합니다. 지금 다시 로드하시겠습니까?",
     "page_bulk_export_reload_prompt": "설정을 반영하려면 페이지를 다시 로드해야 합니다. 지금 다시 로드하시겠습니까?",
+    "page_bulk_export_reload_dismiss": "지금 하지 않음",
     "reload_page": "다시 로드",
     "reload_page": "다시 로드",
     "update": "업데이트",
     "update": "업데이트",
     "mail_settings": "이메일 설정",
     "mail_settings": "이메일 설정",

+ 2 - 0
apps/app/public/static/locales/zh_CN/admin.json

@@ -385,7 +385,9 @@
     "page_bulk_export_explanation": "启用一项功能,允许所有用户一次性导出从页面菜单中选择的所有页面及其下级页面。保留期限过后,导出的数据将自动删除。",
     "page_bulk_export_explanation": "启用一项功能,允许所有用户一次性导出从页面菜单中选择的所有页面及其下级页面。保留期限过后,导出的数据将自动删除。",
     "page_bulk_export_warning": "批量页面导出功能可供所有用户使用。为了维护系统资源,请您配合使用最低限度的资源。如果您是管理员,请将此事实告知所有用户。",
     "page_bulk_export_warning": "批量页面导出功能可供所有用户使用。为了维护系统资源,请您配合使用最低限度的资源。如果您是管理员,请将此事实告知所有用户。",
     "page_bulk_export_storage_period": "储存期限",
     "page_bulk_export_storage_period": "储存期限",
+    "page_bulk_export_reload_title": "重新加载页面",
     "page_bulk_export_reload_prompt": "您需要重新加载页面以反映设置更改。现在重新加载吗?",
     "page_bulk_export_reload_prompt": "您需要重新加载页面以反映设置更改。现在重新加载吗?",
+    "page_bulk_export_reload_dismiss": "暂不",
     "reload_page": "重新加载",
     "reload_page": "重新加载",
     "update": "更新",
     "update": "更新",
     "mail_settings": "邮件设置",
     "mail_settings": "邮件设置",

+ 17 - 4
apps/app/src/client/components/Admin/App/ConfirmModal.tsx

@@ -8,6 +8,12 @@ type ConfirmModalProps = {
   warningMessage: string;
   warningMessage: string;
   supplymentaryMessage: string | null;
   supplymentaryMessage: string | null;
   confirmButtonTitle: string;
   confirmButtonTitle: string;
+  // Optional overrides; defaults keep the original "Warning" appearance so
+  // existing callers are unaffected.
+  title?: string;
+  cancelButtonTitle?: string;
+  headerClassName?: string;
+  iconName?: string;
   onConfirm?: () => Promise<void>;
   onConfirm?: () => Promise<void>;
   onCancel?: () => void;
   onCancel?: () => void;
 };
 };
@@ -17,6 +23,13 @@ export const ConfirmModal: FC<ConfirmModalProps> = (
 ) => {
 ) => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
+  const {
+    title,
+    cancelButtonTitle,
+    headerClassName = 'text-danger',
+    iconName = 'warning',
+  } = props;
+
   const onCancel = () => {
   const onCancel = () => {
     if (props.onCancel != null) {
     if (props.onCancel != null) {
       props.onCancel();
       props.onCancel();
@@ -31,9 +44,9 @@ export const ConfirmModal: FC<ConfirmModalProps> = (
 
 
   return (
   return (
     <Modal isOpen={props.isModalOpen} toggle={onCancel}>
     <Modal isOpen={props.isModalOpen} toggle={onCancel}>
-      <ModalHeader tag="h4" toggle={onCancel} className="text-danger">
-        <span className="material-symbols-outlined me-1">warning</span>
-        {t('Warning')}
+      <ModalHeader tag="h4" toggle={onCancel} className={headerClassName}>
+        <span className="material-symbols-outlined me-1">{iconName}</span>
+        {title ?? t('Warning')}
       </ModalHeader>
       </ModalHeader>
       <ModalBody>
       <ModalBody>
         {props.warningMessage}
         {props.warningMessage}
@@ -56,7 +69,7 @@ export const ConfirmModal: FC<ConfirmModalProps> = (
           className="btn btn-outline-secondary"
           className="btn btn-outline-secondary"
           onClick={onCancel}
           onClick={onCancel}
         >
         >
-          {t('Cancel')}
+          {cancelButtonTitle ?? t('Cancel')}
         </button>
         </button>
         <button
         <button
           type="button"
           type="button"

+ 6 - 0
apps/app/src/client/components/Admin/App/PageBulkExportSettings.tsx

@@ -172,9 +172,15 @@ const PageBulkExportSettings = (): JSX.Element => {
 
 
       <ConfirmModal
       <ConfirmModal
         isModalOpen={isReloadModalOpen}
         isModalOpen={isReloadModalOpen}
+        title={t('admin:app_setting.page_bulk_export_reload_title')}
+        headerClassName="text-primary"
+        iconName="refresh"
         warningMessage={t('admin:app_setting.page_bulk_export_reload_prompt')}
         warningMessage={t('admin:app_setting.page_bulk_export_reload_prompt')}
         supplymentaryMessage={null}
         supplymentaryMessage={null}
         confirmButtonTitle={t('admin:app_setting.reload_page')}
         confirmButtonTitle={t('admin:app_setting.reload_page')}
+        cancelButtonTitle={t(
+          'admin:app_setting.page_bulk_export_reload_dismiss',
+        )}
         onConfirm={() => {
         onConfirm={() => {
           window.location.reload();
           window.location.reload();
           return Promise.resolve();
           return Promise.resolve();