@cccsaurora/howler-ui 2.17.0-dev.545 → 2.17.0-dev.547
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.
|
@@ -17,7 +17,7 @@ const PivotLink = ({ pivot, hit, compact = false }) => {
|
|
|
17
17
|
if (!pivot || pivot.format !== 'link' || !flatHit || isEmpty(flatHit)) {
|
|
18
18
|
return '';
|
|
19
19
|
}
|
|
20
|
-
const templateObject = Object.fromEntries(pivot.mappings.map(mapping => {
|
|
20
|
+
const templateObject = Object.fromEntries((pivot.mappings ?? []).map(mapping => {
|
|
21
21
|
const result = [mapping.key];
|
|
22
22
|
if (mapping.field === 'custom') {
|
|
23
23
|
result.push(mapping.custom_value);
|
|
@@ -83,7 +83,7 @@ const PivotForm = ({ dossier, setDossier, loading }) => {
|
|
|
83
83
|
..._dossier,
|
|
84
84
|
pivots: [
|
|
85
85
|
...(_dossier.pivots ?? []),
|
|
86
|
-
{ icon: 'material-symbols:add-ad', label: { en: 'New Pivot', fr: 'Nouvelle pivot' } }
|
|
86
|
+
{ icon: 'material-symbols:add-ad', label: { en: 'New Pivot', fr: 'Nouvelle pivot' }, mappings: [] }
|
|
87
87
|
]
|
|
88
88
|
}));
|
|
89
89
|
}, disabled: !dossier || loading, children: _jsx(Add, {}) })] }), _jsxs(Stack, { spacing: 2, children: [_jsxs(Stack, { direction: "row", alignItems: "center", position: "relative", children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.icon'), value: icon, disabled: !pivot, fullWidth: true, error: !iconExists(icon), sx: { '& input': { paddingLeft: '2.25rem' } }, onChange: ev => update({ icon: ev.target.value }) }), _jsx(Icon, { fontSize: "1.75rem", icon: icon, style: { position: 'absolute', left: '0.5rem' } }), _jsx(Button, { variant: "outlined", color: "error", disabled: !pivot, sx: { minWidth: '0 !important', ml: 1 }, onClick: () => update(null), children: _jsx(Delete, {}) })] }), _jsxs(Stack, { direction: "row", spacing: 0.5, alignItems: "center", sx: { mt: `${theme.spacing(0.5)} !important` }, children: [_jsx(Typography, { color: "text.secondary", children: t('route.dossiers.manager.icon.description') }), _jsx(IconButton, { size: "small", component: "a", href: "https://icon-sets.iconify.design/", children: _jsx(OpenInNew, { fontSize: "small" }) })] }), _jsxs(Stack, { direction: "row", spacing: 2, children: [_jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.label.en'), disabled: !pivot, value: pivot?.label?.en ?? '', fullWidth: true, onChange: ev => update({ label: { en: ev.target.value } }) }), _jsx(TextField, { size: "small", label: t('route.dossiers.manager.pivot.label.fr'), disabled: !pivot, value: pivot?.label?.fr ?? '', fullWidth: true, onChange: ev => update({ label: { fr: ev.target.value } }) })] }), _jsx(Autocomplete, { disabled: !pivot, options: ['link', ...howlerPluginStore.pivotFormats], renderInput: params => (_jsx(TextField, { ...params, size: "small", label: t('route.dossiers.manager.pivot.format') })), value: pivot?.format ?? null, onChange: (_ev, format) => update({ format, value: '', mappings: [] }) }), !!pivot?.format &&
|
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ const CluePivot = ({ pivot, hit, compact }) => {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
setLoading(true);
|
|
75
|
-
const data = Object.fromEntries(pivot.mappings.map(_mapping => {
|
|
75
|
+
const data = Object.fromEntries((pivot.mappings ?? []).map(_mapping => {
|
|
76
76
|
const value = getValue(pivot.value, _mapping);
|
|
77
77
|
if (['selector', 'selectors'].includes(_mapping.key)) {
|
|
78
78
|
if (!value) {
|