@arquimedes.co/eureka-forms 3.0.52-test → 3.0.53-claude-evlog-migration
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.
- package/dist/App/App.stories.js +3 -2
- package/dist/App/AppHooks.js +2 -3
- package/dist/Form/Form.js +2 -1
- package/dist/Form/FormFunctions.js +3 -2
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +2 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +2 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +2 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +3 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +2 -1
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +2 -1
- package/dist/FormSteps/Step.js +2 -1
- package/dist/FormSteps/StepFunctions.js +2 -1
- package/dist/Login/LoginPage.js +2 -1
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +4 -4
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +3 -3
- package/dist/Shared/Navbar/Navbar.js +2 -1
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +2 -2
- package/dist/Utils/Logger.d.ts +10 -0
- package/dist/Utils/Logger.js +31 -0
- package/dist/Utils/PhoneFunctions.js +3 -2
- package/dist/main.js +2 -1
- package/package.json +8 -7
package/dist/App/App.stories.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import App from './App';
|
|
3
|
+
import { log } from '../Utils/Logger';
|
|
3
4
|
/**
|
|
4
5
|
* Stories to test full forms from a `{ form, values }` payload:
|
|
5
6
|
*
|
|
@@ -149,8 +150,8 @@ const meta = {
|
|
|
149
150
|
idOrganization: 'storybook',
|
|
150
151
|
valuesData: {},
|
|
151
152
|
customSubmit: (values) => {
|
|
152
|
-
//
|
|
153
|
-
|
|
153
|
+
// Storybook fixtures only — real submissions must never log field values.
|
|
154
|
+
log.info({ form: { id: 'storybook' }, action: { name: 'submit' }, fields: Object.keys(values) });
|
|
154
155
|
return Promise.resolve();
|
|
155
156
|
},
|
|
156
157
|
},
|
package/dist/App/AppHooks.js
CHANGED
|
@@ -11,6 +11,7 @@ import { calcDependencies } from '../Form/FormFunctions';
|
|
|
11
11
|
import { iterateNestedSteps } from '../FormSteps/StepFunctions';
|
|
12
12
|
import { createNextState } from '@reduxjs/toolkit';
|
|
13
13
|
import { BaseConfirmationMessage } from '../Contexts/FormContext';
|
|
14
|
+
import { errorFields, log } from '../Utils/Logger';
|
|
14
15
|
export const useSetupApp = (isEmbedded, props) => {
|
|
15
16
|
const { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, idCurrentAgent, ...others } = props;
|
|
16
17
|
const [form, setForm] = useState(undefined);
|
|
@@ -136,8 +137,6 @@ export const useSetupApp = (isEmbedded, props) => {
|
|
|
136
137
|
};
|
|
137
138
|
useEffect(() => {
|
|
138
139
|
void loadData();
|
|
139
|
-
// eslint-disable-next-line no-console
|
|
140
|
-
console.log('Form props Changed!');
|
|
141
140
|
return () => {
|
|
142
141
|
dispatch({ type: 'CLEAR' });
|
|
143
142
|
};
|
|
@@ -189,7 +188,7 @@ export const useLogRocket = (organization, form, { apiKey, internal, postview, p
|
|
|
189
188
|
});
|
|
190
189
|
}
|
|
191
190
|
catch (error) {
|
|
192
|
-
|
|
191
|
+
log.warn({ session: { provider: 'logrocket' }, error: errorFields(error) });
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
194
|
};
|
package/dist/Form/Form.js
CHANGED
|
@@ -19,6 +19,7 @@ import FormContext, { IdFormContext } from '../Contexts/FormContext';
|
|
|
19
19
|
import { getAppState } from '../Utils/store';
|
|
20
20
|
import LoginPage from '../Login/LoginPage';
|
|
21
21
|
import { focusStep } from '../States/SiteSlice';
|
|
22
|
+
import { errorFields, log } from '../Utils/Logger';
|
|
22
23
|
function FormComponent({ form, apiKey, reload, isWidget, branding, setSubmit, scrollToTop, customSteps, containerRef, customSubmit, customSubmitBtns, customConfirmation, }) {
|
|
23
24
|
const { idOrganization, internal, postview, user } = useAppSelector((state) => state.global);
|
|
24
25
|
const formMethods = useForm({
|
|
@@ -76,7 +77,7 @@ function FormComponent({ form, apiKey, reload, isWidget, branding, setSubmit, sc
|
|
|
76
77
|
setShowConfirmation(resp?.data);
|
|
77
78
|
}
|
|
78
79
|
catch (error) {
|
|
79
|
-
|
|
80
|
+
log.error({ form: { step: 'submit' }, error: errorFields(error) });
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -3,6 +3,7 @@ import FormStepTypes, { EntityValueDataTypes } from '../constants/FormStepTypes'
|
|
|
3
3
|
import { calcStepDeps } from '../FormSteps/StepHooks';
|
|
4
4
|
import { calcRecursiveData } from '../Utils/FormStepFunctions';
|
|
5
5
|
import { isValidPhoneNumber } from '../Utils/PhoneFunctions';
|
|
6
|
+
import { log } from '../Utils/Logger';
|
|
6
7
|
/**
|
|
7
8
|
* Function that cals the value of a step to output on submit
|
|
8
9
|
*/
|
|
@@ -166,7 +167,7 @@ function calcStepDependency(idStep, steps, values, customSteps) {
|
|
|
166
167
|
if (!depStep) {
|
|
167
168
|
const originalValue = values.global[idStep];
|
|
168
169
|
if (!originalValue)
|
|
169
|
-
|
|
170
|
+
log.warn({ form: { step: idStep }, dependency: { resolved: false } });
|
|
170
171
|
return {
|
|
171
172
|
idOriginal: idStep,
|
|
172
173
|
type: originalValue ? 'ORIGINAL' : 'MISSING',
|
|
@@ -176,7 +177,7 @@ function calcStepDependency(idStep, steps, values, customSteps) {
|
|
|
176
177
|
}
|
|
177
178
|
const originalValue = values.sections[depStep.idSection]?.[depStep.id] ?? values.global[depStep.id];
|
|
178
179
|
if (!depStep.stepPath)
|
|
179
|
-
|
|
180
|
+
log.warn({ form: { step: depStep.id, type: depStep.type }, dependency: { stepPath: false } });
|
|
180
181
|
return {
|
|
181
182
|
type: depStep.type,
|
|
182
183
|
idOriginal: depStep.stepPath?.[0] ?? [idStep],
|
|
@@ -11,6 +11,7 @@ import CustomBtn from '../../../Shared/CustomBtn/CustomBtn';
|
|
|
11
11
|
import FormContext, { IdFormContext } from '../../../Contexts/FormContext';
|
|
12
12
|
import { addPagedValues } from '../../../States/SiteSlice';
|
|
13
13
|
import { getAppState } from '../../../Utils/store';
|
|
14
|
+
import { log } from '../../../Utils/Logger';
|
|
14
15
|
function ColumnForm({ onSubmit, customSubmitBtns, ...props }) {
|
|
15
16
|
const [loading, setLoading] = useState(false);
|
|
16
17
|
const { postview, editable, formStyle } = useAppSelector((state) => state.global);
|
|
@@ -29,7 +30,7 @@ function ColumnForm({ onSubmit, customSubmitBtns, ...props }) {
|
|
|
29
30
|
}, [props.setSubmit]);
|
|
30
31
|
/** Esto se usa para no tener que escuchar todo el tiempo los errores del formulario */
|
|
31
32
|
const handleErrors = handleSubmit(() => { }, (errors) => {
|
|
32
|
-
|
|
33
|
+
log.warn({ form: { type: 'column' }, validation: { fields: Object.keys(errors) } });
|
|
33
34
|
});
|
|
34
35
|
const submit = useCallback(async () => {
|
|
35
36
|
setLoading(true);
|
|
@@ -11,6 +11,7 @@ import { getAppState } from '../../../Utils/store';
|
|
|
11
11
|
import CustomBtn from '../../../Shared/CustomBtn/CustomBtn';
|
|
12
12
|
import FormContext, { IdFormContext } from '../../../Contexts/FormContext';
|
|
13
13
|
import { addPagedValues } from '../../../States/SiteSlice';
|
|
14
|
+
import { log } from '../../../Utils/Logger';
|
|
14
15
|
function StepperForm({ onSubmit, scrollToTop }) {
|
|
15
16
|
const [loading, setLoading] = useState(undefined);
|
|
16
17
|
const { postview, editable, formStyle } = useAppSelector((state) => state.global);
|
|
@@ -24,7 +25,7 @@ function StepperForm({ onSubmit, scrollToTop }) {
|
|
|
24
25
|
const next = useAppSelector((state) => state.site.nextSections);
|
|
25
26
|
/** Esto se usa para no tener que escuchar todo el tiempo los errores del formulario */
|
|
26
27
|
const handleErrors = handleSubmit(() => { }, (errors) => {
|
|
27
|
-
|
|
28
|
+
log.warn({ form: { type: 'stepper' }, validation: { fields: Object.keys(errors) } });
|
|
28
29
|
});
|
|
29
30
|
const handlePrevious = useCallback(() => {
|
|
30
31
|
dispatch(SiteReducer.handlePrevious({ values: getValues(), form }));
|
|
@@ -6,6 +6,7 @@ import FileIcon from '../../../../Icons/FileIcon';
|
|
|
6
6
|
import ErrorIcon from '../../../../Icons/ErrorIcon';
|
|
7
7
|
import CloseIcon from '../../../../Icons/CloseIcon';
|
|
8
8
|
import { isUploadedFileObject } from '../FileFunctions';
|
|
9
|
+
import { errorFields, log } from '../../../../Utils/Logger';
|
|
9
10
|
function FileUploadComponent({ file, formStyle, error, editable, handleRemove, fetchDownloadUrl, }) {
|
|
10
11
|
const [downloading, setDownloading] = useState(false);
|
|
11
12
|
if (!file) {
|
|
@@ -23,7 +24,7 @@ function FileUploadComponent({ file, formStyle, error, editable, handleRemove, f
|
|
|
23
24
|
setDownloading(false);
|
|
24
25
|
}
|
|
25
26
|
catch (error) {
|
|
26
|
-
|
|
27
|
+
log.error({ upload: { operation: 'download' }, error: errorFields(error) });
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
};
|
|
@@ -10,6 +10,7 @@ import maxSize from '../../../constants/Files/FileMaxSize';
|
|
|
10
10
|
import { useAppSelector } from '../../../hooks';
|
|
11
11
|
import CustomContext from '../../../Contexts/CustomContext';
|
|
12
12
|
import { useFormStep } from '../../StepHooks';
|
|
13
|
+
import { errorFields, log } from '../../../Utils/Logger';
|
|
13
14
|
function FileUploadStep({ step, editable }) {
|
|
14
15
|
const { ref, value, onChange, error: fieldError, } = useFormStep(step, {
|
|
15
16
|
defaultValue: [],
|
|
@@ -65,7 +66,7 @@ function FileUploadStep({ step, editable }) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
catch (error) {
|
|
68
|
-
|
|
69
|
+
log.error({ upload: { operation: 'validate' }, error: errorFields(error) });
|
|
69
70
|
}
|
|
70
71
|
}, [idOrganization]);
|
|
71
72
|
const uploadFile = useCallback(async (pFile) => {
|
|
@@ -77,7 +78,7 @@ function FileUploadStep({ step, editable }) {
|
|
|
77
78
|
setFileChange((prev) => prev.map((f) => (f.file === pFile.file ? { ...f, state: 'DONE', ...resp[0] } : f)));
|
|
78
79
|
}
|
|
79
80
|
catch (error) {
|
|
80
|
-
|
|
81
|
+
log.error({ upload: { operation: 'upload' }, error: errorFields(error) });
|
|
81
82
|
}
|
|
82
83
|
}, []);
|
|
83
84
|
useEffect(() => {
|
|
@@ -10,6 +10,7 @@ import DeleteIcon from '../../../../../Icons/DeleteIcon';
|
|
|
10
10
|
import { MobileStepper, styled } from '@mui/material';
|
|
11
11
|
import ArrowRightIcon from '../../../../../Icons/ArrowRightIcon';
|
|
12
12
|
import ArrowLeftIcon from '../../../../../Icons/ArrowLeftIcon';
|
|
13
|
+
import { log } from '../../../../../Utils/Logger';
|
|
13
14
|
function PagedMapperElement({ step, num, loading, element, children, editable, onChange, value, handleDelete, customElementModifiers, customElementRender, }) {
|
|
14
15
|
const deletable = step.deletable ?? true;
|
|
15
16
|
const { size } = useContext(FormContext);
|
|
@@ -43,7 +44,7 @@ function PagedMapperElement({ step, num, loading, element, children, editable, o
|
|
|
43
44
|
}, [value]);
|
|
44
45
|
/** Esto se usa para no tener que escuchar todo el tiempo los errores del formulario */
|
|
45
46
|
const handleErrors = handleSubmit(() => { }, (errors) => {
|
|
46
|
-
|
|
47
|
+
log.warn({ form: { type: 'mapper' }, validation: { fields: Object.keys(errors) } });
|
|
47
48
|
});
|
|
48
49
|
const handleChangePage = useCallback(async (index) => {
|
|
49
50
|
const valid = await trigger(undefined, { shouldFocus: true });
|
|
@@ -10,6 +10,7 @@ import { selectDependencies, selectStepDependencies, useFormStep } from '../../S
|
|
|
10
10
|
import { shallowEqual } from 'react-redux';
|
|
11
11
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
12
12
|
import { FormTypes } from '../../../constants/FormStepTypes';
|
|
13
|
+
import { errorFields, log } from '../../../Utils/Logger';
|
|
13
14
|
function SmartSelectStep({ step, editable, getOptions, calcDepError, defaultValue, filterOptions, IconComponent, valueOverwrite, getValueString, changeListener, getValueWarning, getOptionSelected, getOptionalDependencies = () => [], getOptionsConditionsIdSteps = () => [], renderNestedSteps, }) {
|
|
14
15
|
const { ref, value, error, field, onChange: handleChange, } = useFormStep(step, {
|
|
15
16
|
sizeChange: true,
|
|
@@ -82,7 +83,7 @@ function SmartSelectStep({ step, editable, getOptions, calcDepError, defaultValu
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
catch (error) {
|
|
85
|
-
|
|
86
|
+
log.error({ api: { endpoint: 'smartSelect' }, error: errorFields(error) });
|
|
86
87
|
setOptions(null);
|
|
87
88
|
}
|
|
88
89
|
setLoading(false);
|
package/dist/FormSteps/Step.js
CHANGED
|
@@ -24,13 +24,14 @@ import CustomContext from '../Contexts/CustomContext';
|
|
|
24
24
|
import { selectOriginalValue, useCondition } from './StepHooks';
|
|
25
25
|
import TimePickerStep from './TimePickerStep/TimePickerStep';
|
|
26
26
|
import PhoneInputStep from './PhoneInputStep/PhoneInputStep';
|
|
27
|
+
import { log } from '../Utils/Logger';
|
|
27
28
|
function StepComponent({ step, ...props }) {
|
|
28
29
|
const { postview, partial } = useAppSelector((state) => state.global);
|
|
29
30
|
const { customSteps, customClientInfoStep } = useContext(CustomContext);
|
|
30
31
|
const originalValue = useAppSelector((state) => selectOriginalValue(state, step));
|
|
31
32
|
const showStep = useCondition(step.condition);
|
|
32
33
|
if (!step) {
|
|
33
|
-
|
|
34
|
+
log.error({ form: { step }, render: { component: 'Step', reason: 'step_not_found' } });
|
|
34
35
|
return _jsx("div", {});
|
|
35
36
|
}
|
|
36
37
|
if (!showStep)
|
|
@@ -4,6 +4,7 @@ import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
|
4
4
|
import { getRawText } from '../Utils/DraftFunctions';
|
|
5
5
|
import ConditionTypes, { ExpressionTypes, OperatorTypes } from '../constants/ConditionTypes';
|
|
6
6
|
import EntityPropertyTypes from '../constants/EntityPropertyTypes';
|
|
7
|
+
import { log } from '../Utils/Logger';
|
|
7
8
|
export function calcFillerSize(step, steps, values, size) {
|
|
8
9
|
const maxSize = step.maxSize ?? size.blockNum;
|
|
9
10
|
if (maxSize < size.blockNum) {
|
|
@@ -138,7 +139,7 @@ export const calcDefaultValue = (step) => {
|
|
|
138
139
|
export const iterateNestedSteps = (idStep, steps, iteration, path = []) => {
|
|
139
140
|
const step = steps[idStep];
|
|
140
141
|
if (!step) {
|
|
141
|
-
|
|
142
|
+
log.warn({ form: { step: idStep }, reason: 'missing_step' });
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
145
|
iteration(step, path);
|
package/dist/Login/LoginPage.js
CHANGED
|
@@ -11,6 +11,7 @@ import { setUser } from '../States/GlobalSlice';
|
|
|
11
11
|
import { jwtDecode } from 'jwt-decode';
|
|
12
12
|
import LoginTextField from './LoginTextField';
|
|
13
13
|
import MaterialProviders from '../Utils/MaterialProviders';
|
|
14
|
+
import { errorFields, log } from '../Utils/Logger';
|
|
14
15
|
const EMAIL_REGEX =
|
|
15
16
|
// eslint-disable-next-line no-control-regex
|
|
16
17
|
/^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
|
|
@@ -51,7 +52,7 @@ function LoginPage({ form }) {
|
|
|
51
52
|
catch (err) {
|
|
52
53
|
setLoading(false);
|
|
53
54
|
if (err?.response?.status !== 400) {
|
|
54
|
-
|
|
55
|
+
log.error({ action: { name: 'login' }, error: errorFields(err) });
|
|
55
56
|
}
|
|
56
57
|
if (err?.response?.data === 'Invalid Organization') {
|
|
57
58
|
setError('password', {
|
|
@@ -128,10 +128,10 @@ const StyledDay = styled(MuiPickerDay)(({ theme }) => ({
|
|
|
128
128
|
fontWeight: 500,
|
|
129
129
|
fontSize: '0.9rem',
|
|
130
130
|
lineHeight: 'normal',
|
|
131
|
-
'&.Erk-
|
|
131
|
+
'&.Erk-MuiPickerDay-today': {
|
|
132
132
|
backgroundColor: theme.palette.primary.main + '33',
|
|
133
133
|
},
|
|
134
|
-
'&.Erk-
|
|
134
|
+
'&.Erk-MuiPickerDay-dayOutsideMonth': {
|
|
135
135
|
color: 'rgb(0,0,0,0.4)',
|
|
136
136
|
'&.Mui-selected': {
|
|
137
137
|
color: theme.palette.primary.contrastText,
|
|
@@ -171,7 +171,7 @@ function CustomDatePicker({ error, required, disabled, readOnly, helperText, siz
|
|
|
171
171
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
172
172
|
orientation: _orientation, ...others }) {
|
|
173
173
|
if (pickTime) {
|
|
174
|
-
return (_jsx(StyledDateTimePicker, { ampm: true, size: size, reduceAnimations: true, ...others, label: label, disabled: disabled, readOnly: readOnly, showDaysOutsideCurrentMonth: true, slotProps: {
|
|
174
|
+
return (_jsx(StyledDateTimePicker, { ampm: true, size: size, reduceAnimations: true, orientation: "portrait", ...others, label: label, disabled: disabled, readOnly: readOnly, showDaysOutsideCurrentMonth: true, slotProps: {
|
|
175
175
|
actionBar: {
|
|
176
176
|
actions: ['clear', 'accept'],
|
|
177
177
|
},
|
|
@@ -231,7 +231,7 @@ orientation: _orientation, ...others }) {
|
|
|
231
231
|
} }));
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
|
-
return (_jsx(StyledDatePicker, { ...others, label: label, size: size, reduceAnimations: true, readOnly: readOnly, disabled: disabled, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
|
|
234
|
+
return (_jsx(StyledDatePicker, { ...others, label: label, size: size, reduceAnimations: true, orientation: "portrait", readOnly: readOnly, disabled: disabled, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
|
|
235
235
|
actionBar: {
|
|
236
236
|
actions: ['clear', 'accept'],
|
|
237
237
|
},
|
|
@@ -71,10 +71,10 @@ const StyledDay = styled(MuiDateRangePickerDay)(({ theme }) => ({
|
|
|
71
71
|
fontWeight: 500,
|
|
72
72
|
fontSize: '0.9rem',
|
|
73
73
|
lineHeight: 'normal',
|
|
74
|
-
'&.Erk-
|
|
74
|
+
'&.Erk-MuiDateRangePickerDay-today:not(.Erk-MuiDateRangePickerDay-rangeIntervalDayHighlight)': {
|
|
75
75
|
backgroundColor: theme.palette.primary.main + '33',
|
|
76
76
|
},
|
|
77
|
-
'&.Erk-
|
|
77
|
+
'&.Erk-MuiDateRangePickerDay-dayOutsideMonth': {
|
|
78
78
|
color: 'rgb(0,0,0,0.4)',
|
|
79
79
|
'&.Mui-selected': {
|
|
80
80
|
color: theme.palette.primary.contrastText,
|
|
@@ -84,7 +84,7 @@ const StyledDay = styled(MuiDateRangePickerDay)(({ theme }) => ({
|
|
|
84
84
|
backgroundColor: theme.palette.primary.main + '1a',
|
|
85
85
|
},
|
|
86
86
|
}));
|
|
87
|
-
const CustomRangePickerField = React.forwardRef(function CustomRangePickerField({ error, required, helperText, size = 'small', labelMargin = 5, fullWidth = true, inputRef
|
|
87
|
+
const CustomRangePickerField = React.forwardRef(function CustomRangePickerField({ error, required, helperText, size = 'small', labelMargin = 5, fullWidth = true, inputRef }, ref) {
|
|
88
88
|
const { value, fieldFormat, setOpen, disabled, readOnly, label } = usePickerContext();
|
|
89
89
|
const { displayValue, isInvalid } = useMemo(() => {
|
|
90
90
|
const [startDate, endDate] = value ?? [null, null];
|
|
@@ -4,6 +4,7 @@ import styles from './Navbar.module.css';
|
|
|
4
4
|
import { IconButton, Avatar, Menu, MenuItem } from '@mui/material';
|
|
5
5
|
import { logout } from '../../Services/UserService';
|
|
6
6
|
import { useAppSelector } from '../../hooks';
|
|
7
|
+
import { errorFields, log } from '../../Utils/Logger';
|
|
7
8
|
function Navbar({ logo, color, apiKey }) {
|
|
8
9
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
9
10
|
const user = useAppSelector((state) => state.global.user);
|
|
@@ -14,7 +15,7 @@ function Navbar({ logo, color, apiKey }) {
|
|
|
14
15
|
await logout(apiKey);
|
|
15
16
|
}
|
|
16
17
|
catch (err) {
|
|
17
|
-
|
|
18
|
+
log.error({ action: { name: 'logout' }, error: errorFields(err) });
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
localStorage.removeItem('token');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { errorFields, log } from '../../Utils/Logger';
|
|
2
3
|
export function LinkComponent({ children, decoratedText }) {
|
|
3
4
|
// Add protocol if missing
|
|
4
5
|
const getHref = (url) => {
|
|
@@ -38,8 +39,7 @@ export function findLinkEntities(contentBlock, callback) {
|
|
|
38
39
|
}
|
|
39
40
|
catch (error) {
|
|
40
41
|
// Fail silently to avoid breaking the editor
|
|
41
|
-
|
|
42
|
-
console.warn('LinkDecorator: Error finding link entities:', error);
|
|
42
|
+
log.warn({ render: { component: 'LinkDecorator' }, error: errorFields(error) });
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
export const linkDecorator = {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { log, parseError } from 'evlog';
|
|
2
|
+
/**
|
|
3
|
+
* Loggable fields for a caught value. The global `log` API takes plain objects, not `Error`s, and a stack
|
|
4
|
+
* trace adds nothing in a published form — the message and the class are what identify the failure.
|
|
5
|
+
*/
|
|
6
|
+
export declare function errorFields(error: unknown): {
|
|
7
|
+
message: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
};
|
|
10
|
+
export { log, parseError };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { initLogger, log, parseError } from 'evlog';
|
|
2
|
+
/**
|
|
3
|
+
* Local runs are detected from the hostname rather than a build-time flag: this package ships through both
|
|
4
|
+
* the Vite app build and the webpack `Embeddables` build, and only one of them defines `import.meta.env`.
|
|
5
|
+
*/
|
|
6
|
+
const isLocal = typeof window !== 'undefined' && /^(localhost|127\.0\.0\.1|\[::1\])$/.test(window.location.hostname);
|
|
7
|
+
/**
|
|
8
|
+
* Configure evlog for the form renderer. Runs on first import of this module, so every entry point (the
|
|
9
|
+
* Vite app, the webpack embeddable, and the published library) is covered without touching each one.
|
|
10
|
+
*
|
|
11
|
+
* `redact` stays on everywhere. These forms collect third parties' personal data on third parties' sites,
|
|
12
|
+
* so the redaction pass is the last line of defence behind the rule that field values are never logged at
|
|
13
|
+
* all — see `docs/CONVENCIONES_LOGS.md` §3 in the Eureka-All workspace.
|
|
14
|
+
*/
|
|
15
|
+
initLogger({
|
|
16
|
+
env: { service: 'eureka-forms' },
|
|
17
|
+
pretty: isLocal,
|
|
18
|
+
redact: true,
|
|
19
|
+
// `debug` never reaches a published form.
|
|
20
|
+
minLevel: 'info',
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Loggable fields for a caught value. The global `log` API takes plain objects, not `Error`s, and a stack
|
|
24
|
+
* trace adds nothing in a published form — the message and the class are what identify the failure.
|
|
25
|
+
*/
|
|
26
|
+
export function errorFields(error) {
|
|
27
|
+
if (error instanceof Error)
|
|
28
|
+
return { message: error.message, name: error.name };
|
|
29
|
+
return { message: String(error) };
|
|
30
|
+
}
|
|
31
|
+
export { log, parseError };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as libphonenumber from 'libphonenumber-js/max';
|
|
2
|
-
import { guessCountryByPartialPhoneNumber, removeDialCode
|
|
2
|
+
import { guessCountryByPartialPhoneNumber, removeDialCode } from 'react-international-phone';
|
|
3
|
+
import { log } from './Logger';
|
|
3
4
|
export function isValidPhoneNumber(phone) {
|
|
4
5
|
if (!phone.startsWith('+'))
|
|
5
6
|
phone = '+' + phone;
|
|
@@ -19,7 +20,7 @@ export function isEmptyPhoneNumber(phone) {
|
|
|
19
20
|
return true;
|
|
20
21
|
}
|
|
21
22
|
if (!country) {
|
|
22
|
-
|
|
23
|
+
log.warn({ validation: { field: 'phone', reason: 'country_not_found' } });
|
|
23
24
|
return true;
|
|
24
25
|
}
|
|
25
26
|
return false;
|
package/dist/main.js
CHANGED
|
@@ -5,6 +5,7 @@ import styles from './index.module.css';
|
|
|
5
5
|
import App from './App/App';
|
|
6
6
|
import './index.css';
|
|
7
7
|
import './Utils/MuiClassnameSetup';
|
|
8
|
+
import { errorFields, log } from './Utils/Logger';
|
|
8
9
|
const urlParams = new URLSearchParams(window.location.search);
|
|
9
10
|
const values = urlParams.get('data-values');
|
|
10
11
|
let dataValues = undefined;
|
|
@@ -13,7 +14,7 @@ if (values) {
|
|
|
13
14
|
dataValues = JSON.parse(decodeURIComponent(values));
|
|
14
15
|
}
|
|
15
16
|
catch (error) {
|
|
16
|
-
|
|
17
|
+
log.error({ form: { source: 'data-values' }, error: errorFields(error) });
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
const idOrganization = urlParams.get('idOrganization') ?? undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version":"3.0.
|
|
4
|
+
"version":"3.0.53-claude-evlog-migration",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"watch": "tsgo --noEmit --watch --project tsconfig.app.json",
|
|
7
7
|
"start": "vite",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"axios": "1.16.0",
|
|
21
21
|
"date-fns": "4.1.0",
|
|
22
22
|
"draft-js": "0.11.7",
|
|
23
|
+
"evlog": "^2.22.4",
|
|
23
24
|
"i18n-iso-countries": "7.14.0",
|
|
24
25
|
"jwt-decode": "4.0.0",
|
|
25
26
|
"libphonenumber-js": "1.12.42",
|
|
@@ -50,10 +51,10 @@
|
|
|
50
51
|
"@eslint/eslintrc": "3.3.3",
|
|
51
52
|
"@eslint/js": "9.39.1",
|
|
52
53
|
"@faker-js/faker": "10.1.0",
|
|
53
|
-
"@mui/material": "^9.0
|
|
54
|
-
"@mui/x-data-grid-pro": "^9.
|
|
55
|
-
"@mui/x-date-pickers": "^9.
|
|
56
|
-
"@mui/x-date-pickers-pro": "^9.
|
|
54
|
+
"@mui/material": "^9.2.0",
|
|
55
|
+
"@mui/x-data-grid-pro": "^9.10.1",
|
|
56
|
+
"@mui/x-date-pickers": "^9.10.1",
|
|
57
|
+
"@mui/x-date-pickers-pro": "^9.10.1",
|
|
57
58
|
"@storybook/addon-docs": "^10.4.0",
|
|
58
59
|
"@storybook/addon-onboarding": "^10.4.0",
|
|
59
60
|
"@storybook/addon-themes": "^10.4.0",
|
|
@@ -97,8 +98,8 @@
|
|
|
97
98
|
"peerDependencies": {
|
|
98
99
|
"@emotion/react": "11.x.x",
|
|
99
100
|
"@emotion/styled": "11.x.x",
|
|
100
|
-
"@mui/material": "^9.0
|
|
101
|
-
"@mui/x-date-pickers": "^9.
|
|
101
|
+
"@mui/material": "^9.2.0",
|
|
102
|
+
"@mui/x-date-pickers": "^9.10.1",
|
|
102
103
|
"react": "18 || 19",
|
|
103
104
|
"react-dom": "18 || 19"
|
|
104
105
|
},
|