pcm-shared-components 2.1.387 → 2.1.388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,7 @@ import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
|
8
8
|
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
9
9
|
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
|
10
10
|
import * as i18nextLocal from 'i18next';
|
|
11
|
+
import { classifyAnimalFieldValue } from '../animalFieldDrift';
|
|
11
12
|
|
|
12
13
|
// Every visible string this component owns lives under these two pre-existing i18next namespaces
|
|
13
14
|
// (already shared across both PitchCamp apps via pcm-shared-components' translations.json). Keyed
|
|
@@ -483,7 +484,72 @@ export const AnimalVehicleDetailsEditor = props => {
|
|
|
483
484
|
color: "error",
|
|
484
485
|
className: "block mt-4"
|
|
485
486
|
}, requiredErrorText(field.type)));
|
|
486
|
-
})))), (() => {
|
|
487
|
+
})))), selectedItem && (() => {
|
|
488
|
+
const liveKeys = new Set(fieldConfig.map(f => f.key));
|
|
489
|
+
const historicalEntries = Object.keys(selectedItem.values || {}).filter(k => !liveKeys.has(k)).map(k => ({
|
|
490
|
+
key: k,
|
|
491
|
+
value: selectedItem.values[k]
|
|
492
|
+
})).filter(entry => classifyAnimalFieldValue(null, entry.value) !== 'unanswered');
|
|
493
|
+
if (historicalEntries.length === 0) return null;
|
|
494
|
+
return /*#__PURE__*/React.createElement(Paper, {
|
|
495
|
+
variant: "outlined",
|
|
496
|
+
sx: {
|
|
497
|
+
mt: 1,
|
|
498
|
+
p: 1.5,
|
|
499
|
+
borderRadius: 2,
|
|
500
|
+
bgcolor: 'action.hover'
|
|
501
|
+
}
|
|
502
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
503
|
+
className: "flex items-center",
|
|
504
|
+
style: {
|
|
505
|
+
gap: 6,
|
|
506
|
+
marginBottom: 4
|
|
507
|
+
}
|
|
508
|
+
}, /*#__PURE__*/React.createElement(WarningAmberIcon, {
|
|
509
|
+
fontSize: "small",
|
|
510
|
+
color: "warning"
|
|
511
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
512
|
+
sx: {
|
|
513
|
+
fontWeight: 700
|
|
514
|
+
}
|
|
515
|
+
}, i18next.t('animal.historical_answers_title'))), /*#__PURE__*/React.createElement(Typography, {
|
|
516
|
+
variant: "caption",
|
|
517
|
+
color: "text.secondary",
|
|
518
|
+
sx: {
|
|
519
|
+
display: 'block',
|
|
520
|
+
mb: 1.5
|
|
521
|
+
}
|
|
522
|
+
}, i18next.t('animal.historical_answers_hint')), /*#__PURE__*/React.createElement("div", {
|
|
523
|
+
className: "grid grid-cols-2",
|
|
524
|
+
style: {
|
|
525
|
+
columnGap: 12,
|
|
526
|
+
rowGap: 12
|
|
527
|
+
}
|
|
528
|
+
}, historicalEntries.map(({
|
|
529
|
+
key: k,
|
|
530
|
+
value: v
|
|
531
|
+
}) => {
|
|
532
|
+
const displayText = typeof v === 'boolean' ? v ? i18next.t('common.app.yes') : i18next.t('common.app.no') : Array.isArray(v) ? v.join(', ') : String(v);
|
|
533
|
+
// No live config left to carry a real label -- same title-cased-slug fallback the
|
|
534
|
+
// read-only review screens use for a retired key.
|
|
535
|
+
const label = k.replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
|
|
536
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
537
|
+
key: k,
|
|
538
|
+
className: "flex flex-col"
|
|
539
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
540
|
+
variant: "body2",
|
|
541
|
+
sx: {
|
|
542
|
+
fontWeight: 500,
|
|
543
|
+
color: 'text.secondary'
|
|
544
|
+
}
|
|
545
|
+
}, label), /*#__PURE__*/React.createElement(Typography, {
|
|
546
|
+
variant: "body2",
|
|
547
|
+
sx: {
|
|
548
|
+
color: 'text.primary'
|
|
549
|
+
}
|
|
550
|
+
}, displayText));
|
|
551
|
+
})));
|
|
552
|
+
})(), (() => {
|
|
487
553
|
const incompleteCount = items.filter(item => missingRequiredFields(item).length > 0).length;
|
|
488
554
|
if (incompleteCount === 0) return null;
|
|
489
555
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"remove_confirm_message": "All information entered for this animal will be lost. This can't be undone.",
|
|
40
40
|
"field_drifted_hint": "This answer no longer matches this question's current setup.",
|
|
41
41
|
"field_drifted_replace": "Enter a new answer",
|
|
42
|
-
"field_removed": "This question no longer exists in this lot's setup."
|
|
42
|
+
"field_removed": "This question no longer exists in this lot's setup.",
|
|
43
|
+
"historical_answers_title": "Historical Answers",
|
|
44
|
+
"historical_answers_hint": "These questions are no longer part of this lot's setup and can't be edited."
|
|
43
45
|
},
|
|
44
46
|
"app": {
|
|
45
47
|
"common": {
|
|
@@ -2467,7 +2469,13 @@
|
|
|
2467
2469
|
"change_type_confirm_title": "Change field type?",
|
|
2468
2470
|
"change_type_confirm_text": "{{count}} reservation(s) already have an answer for \"{{label}}\". Changing its type may make that answer display incorrectly. Continue?",
|
|
2469
2471
|
"remove_option_confirm_title": "Remove option?",
|
|
2470
|
-
"remove_option_confirm_text": "{{count}} reservation(s) have an answer using an option you're removing from \"{{label}}\". Their answer will no longer match this field's choices. Continue?"
|
|
2472
|
+
"remove_option_confirm_text": "{{count}} reservation(s) have an answer using an option you're removing from \"{{label}}\". Their answer will no longer match this field's choices. Continue?",
|
|
2473
|
+
"visibility_hint": "Also controls whether this section appears in Online Booking → Online Checkout Options.",
|
|
2474
|
+
"hidden_from_guests_warning": "Guests won't see this until you turn it on.",
|
|
2475
|
+
"online_booking_title": "Animal details for online booking",
|
|
2476
|
+
"manage_fields": "Manage fields",
|
|
2477
|
+
"fields_configured_count_one": "{{count}} field configured",
|
|
2478
|
+
"fields_configured_count_other": "{{count}} fields configured"
|
|
2471
2479
|
},
|
|
2472
2480
|
"edit_lot": "Edit Lot",
|
|
2473
2481
|
"lot_id_exist": "Lot number already exist",
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"remove_confirm_message": "Toda la información ingresada para este animal se perderá. Esto no se puede deshacer.",
|
|
40
40
|
"field_drifted_hint": "Esta respuesta ya no coincide con la configuración actual de esta pregunta.",
|
|
41
41
|
"field_drifted_replace": "Ingrese una nueva respuesta",
|
|
42
|
-
"field_removed": "Esta pregunta ya no existe en la configuración de este lote."
|
|
42
|
+
"field_removed": "Esta pregunta ya no existe en la configuración de este lote.",
|
|
43
|
+
"historical_answers_title": "Respuestas Históricas",
|
|
44
|
+
"historical_answers_hint": "Estas preguntas ya no forman parte de la configuración de este lote y no se pueden editar."
|
|
43
45
|
},
|
|
44
46
|
"app": {
|
|
45
47
|
"common": {
|
|
@@ -2467,7 +2469,13 @@
|
|
|
2467
2469
|
"change_type_confirm_title": "¿Cambiar el tipo de campo?",
|
|
2468
2470
|
"change_type_confirm_text": "{{count}} reserva(s) ya tienen una respuesta para \"{{label}}\". Cambiar su tipo puede hacer que esa respuesta se muestre incorrectamente. ¿Continuar?",
|
|
2469
2471
|
"remove_option_confirm_title": "¿Eliminar la opción?",
|
|
2470
|
-
"remove_option_confirm_text": "{{count}} reserva(s) tienen una respuesta usando una opción que está eliminando de \"{{label}}\". Su respuesta ya no coincidirá con las opciones de este campo. ¿Continuar?"
|
|
2472
|
+
"remove_option_confirm_text": "{{count}} reserva(s) tienen una respuesta usando una opción que está eliminando de \"{{label}}\". Su respuesta ya no coincidirá con las opciones de este campo. ¿Continuar?",
|
|
2473
|
+
"visibility_hint": "También controla si esta sección aparece en Reserva en línea → Opciones de pago en línea.",
|
|
2474
|
+
"hidden_from_guests_warning": "Los huéspedes no verán esto hasta que lo actives.",
|
|
2475
|
+
"online_booking_title": "Detalles de los animales para la reserva en línea",
|
|
2476
|
+
"manage_fields": "Administrar campos",
|
|
2477
|
+
"fields_configured_count_one": "{{count}} campo configurado",
|
|
2478
|
+
"fields_configured_count_other": "{{count}} campos configurados"
|
|
2471
2479
|
},
|
|
2472
2480
|
"edit_lot": "Editar lote",
|
|
2473
2481
|
"lot_id_exist": "El número de lote ya existe",
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"remove_confirm_message": "Toutes les informations saisies pour cet animal seront perdues. Cela ne peut pas être annulé.",
|
|
40
40
|
"field_drifted_hint": "Cette réponse ne correspond plus à la configuration actuelle de cette question.",
|
|
41
41
|
"field_drifted_replace": "Entrez une nouvelle réponse",
|
|
42
|
-
"field_removed": "Cette question n'existe plus dans la configuration de ce terrain."
|
|
42
|
+
"field_removed": "Cette question n'existe plus dans la configuration de ce terrain.",
|
|
43
|
+
"historical_answers_title": "Réponses Historiques",
|
|
44
|
+
"historical_answers_hint": "Ces questions ne font plus partie de la configuration de ce terrain et ne peuvent pas être modifiées."
|
|
43
45
|
},
|
|
44
46
|
"app": {
|
|
45
47
|
"common": {
|
|
@@ -2467,7 +2469,13 @@
|
|
|
2467
2469
|
"change_type_confirm_title": "Changer le type de champ ?",
|
|
2468
2470
|
"change_type_confirm_text": "{{count}} réservation(s) ont déjà une réponse pour « {{label}} ». Modifier son type peut faire afficher incorrectement cette réponse. Continuer ?",
|
|
2469
2471
|
"remove_option_confirm_title": "Supprimer l'option ?",
|
|
2470
|
-
"remove_option_confirm_text": "{{count}} réservation(s) ont une réponse utilisant une option que vous supprimez de « {{label}} ». Leur réponse ne correspondra plus aux choix de ce champ. Continuer ?"
|
|
2472
|
+
"remove_option_confirm_text": "{{count}} réservation(s) ont une réponse utilisant une option que vous supprimez de « {{label}} ». Leur réponse ne correspondra plus aux choix de ce champ. Continuer ?",
|
|
2473
|
+
"visibility_hint": "Contrôle également l'affichage de cette section dans Réservation en ligne → Options de paiement en ligne.",
|
|
2474
|
+
"hidden_from_guests_warning": "Les clients ne verront cela que lorsque vous l'activerez.",
|
|
2475
|
+
"online_booking_title": "Détails sur les animaux pour la réservation en ligne",
|
|
2476
|
+
"manage_fields": "Gérer les champs",
|
|
2477
|
+
"fields_configured_count_one": "{{count}} champ configuré",
|
|
2478
|
+
"fields_configured_count_other": "{{count}} champs configurés"
|
|
2471
2479
|
},
|
|
2472
2480
|
"edit_lot": "Editer le lot",
|
|
2473
2481
|
"lot_id_exist": "Le numéro de lot existe déjà",
|