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

View File

@ -68,6 +68,14 @@
"subtitle": "This may take a few seconds. Please do not close this page." "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": { "main_menu": {
"home": "Home", "home": "Home",
"settings": "Settings", "settings": "Settings",

View File

@ -68,6 +68,14 @@
"subtitle": "Esto puede tardar unos segundos. Por favor, no cierre esta página." "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": { "main_menu": {
"home": "Inicio", "home": "Inicio",
"settings": "Ajustes", "settings": "Ajustes",

View File

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