This commit is contained in:
David Arranz 2024-08-29 16:36:05 +02:00
parent 65ea9f212c
commit e6cd348c13
4 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,4 @@
import { t } from "i18next";
import { useCallback, useEffect } from "react";
import { useBlocker } from "react-router-dom";
import { useWarnAboutChange } from "./useWarnAboutChange";
@ -14,10 +15,10 @@ export type UnsavedChangesNotifierProps = {
export const useUnsavedChangesNotifier = ({
isDirty = false,
title = "Se han detectado cambios",
subtitle = "Atención, hay cambios pendientes de guardar en esta página.\nSi continúa, perderá los cambios.",
confirmText = "Continuar",
cancelText = "No continuar",
title = t("hooks.use_unsaved_changes_notifier.title"),
subtitle = t("hooks.use_unsaved_changes_notifier.subtitle"),
confirmText = t("hooks.use_unsaved_changes_notifier.confirm_text"),
cancelText = t("hooks.use_unsaved_changes_notifier.cancel_text"),
onConfirm,
onCancel,
type = "warning",

View File

@ -68,6 +68,14 @@
"subtitle": "This may take a few seconds. Please do not close this page."
}
},
"hooks": {
"use_unsaved_changes_notifier": {
"title": "Changes detected",
"subtitle": "Caution, there are pending changes to save on this page.\nIf you continue, you will lose the changes.",
"confirm_text": "Continue",
"cancel_text": "Cancel"
}
},
"main_menu": {
"home": "Home",
"settings": "Settings",

View File

@ -68,6 +68,14 @@
"subtitle": "Esto puede tardar unos segundos. Por favor, no cierre esta página."
}
},
"hooks": {
"use_unsaved_changes_notifier": {
"title": "Se han detectado cambios",
"subtitle": "Atención, hay cambios pendientes de guardar en esta página.\nSi continúa, perderá los cambios.",
"confirm_text": "Continuar",
"cancel_text": "No continuar"
}
},
"main_menu": {
"home": "Inicio",
"settings": "Ajustes",

View File

@ -29,7 +29,7 @@ export class QuoteStatus extends ValueObject<string> {
QUOTE_STATUS.DELIVERED,
QUOTE_STATUS.ACCEPTED,
QUOTE_STATUS.REJECTED,
QUOTE_STATUS.DRAFT
QUOTE_STATUS.ARCHIVED
)
.label(options.label ? options.label : "status");