@m4l/components 9.3.5 → 9.3.7
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/@types/types.d.ts +16 -0
- package/components/DataGrid/Datagrid.styles.js +1 -1
- package/components/DragResizeWindowRND/constants.d.ts +44 -0
- package/components/DragResizeWindowRND/constants.js +46 -1
- package/components/DragResizeWindowRND/index.d.ts +1 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +8 -4
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +3 -0
- package/components/DynamicSort/DynamicSort.styles.js +8 -4
- package/components/ImageText/ImageText.d.ts +7 -0
- package/components/ImageText/ImageText.js +62 -0
- package/components/ImageText/ImageText.styles.d.ts +2 -0
- package/components/ImageText/ImageText.styles.js +79 -0
- package/components/ImageText/constants.d.ts +16 -0
- package/components/ImageText/constants.js +10 -0
- package/components/ImageText/index.d.ts +1 -0
- package/components/ImageText/index.js +1 -0
- package/components/ImageText/slots/ImageTextEnum.d.ts +8 -0
- package/components/ImageText/slots/ImageTextEnum.js +12 -0
- package/components/ImageText/slots/ImageTextSlots.d.ts +18 -0
- package/components/ImageText/slots/ImageTextSlots.js +38 -0
- package/components/ImageText/types.d.ts +40 -0
- package/components/NoItemPrivileges/NoItemPrivileges.d.ts +7 -0
- package/components/NoItemPrivileges/NoItemPrivileges.js +33 -0
- package/components/NoItemPrivileges/NoItemPrivilegesStyles.d.ts +5 -0
- package/components/NoItemPrivileges/NoItemPrivilegesStyles.js +6 -0
- package/components/NoItemPrivileges/constants.d.ts +3 -0
- package/components/NoItemPrivileges/constants.js +10 -0
- package/components/NoItemPrivileges/dictionary.d.ts +5 -0
- package/components/NoItemPrivileges/dictionary.js +12 -0
- package/components/NoItemPrivileges/index.d.ts +3 -0
- package/components/NoItemPrivileges/index.js +1 -0
- package/components/NoItemPrivileges/slots/NoItemPrivilegesEnum.d.ts +3 -0
- package/components/NoItemPrivileges/slots/NoItemPrivilegesEnum.js +7 -0
- package/components/NoItemPrivileges/slots/NoItemPrivilegesSlots.d.ts +3 -0
- package/components/NoItemPrivileges/slots/NoItemPrivilegesSlots.js +12 -0
- package/components/NoItemPrivileges/test/NoItemPrivileges.test.d.ts +1 -0
- package/components/NoItemPrivileges/types.d.ts +36 -0
- package/components/NoItemSelected/NoItemSelected.js +16 -59
- package/components/NoItemSelected/NoItemSelected.styles.js +1 -100
- package/components/NoItemSelected/constant.d.ts +2 -2
- package/components/NoItemSelected/constant.js +4 -4
- package/components/NoItemSelected/dictionary.d.ts +0 -2
- package/components/NoItemSelected/dictionary.js +4 -3
- package/components/NoItemSelected/slots/NoItemSelectedEnum.d.ts +1 -7
- package/components/NoItemSelected/slots/NoItemSelectedEnum.js +0 -6
- package/components/NoItemSelected/slots/NoItemSelectedSlots.d.ts +1 -19
- package/components/NoItemSelected/slots/NoItemSelectedSlots.js +5 -37
- package/components/NoItemSelected/test/NoItemSelected.test.d.ts +1 -0
- package/components/NoItemSelected/types.d.ts +5 -6
- package/components/ObjectLogs/helpers/Fields/filterFields.d.ts +5 -0
- package/components/ObjectLogs/helpers/Fields/filterFields.js +81 -0
- package/components/ObjectLogs/hooks/useDetailFormatter.js +2 -2
- package/components/ObjectLogs/hooks/useFilterAndSort.d.ts +15 -0
- package/components/ObjectLogs/hooks/useFilterAndSort.js +52 -0
- package/components/ObjectLogs/slots/ObjectLogsSlots.js +1 -2
- package/components/ObjectLogs/subcomponents/DetailDialog/index.js +3 -8
- package/components/ObjectLogs/subcomponents/ObjectLogsByM4L/ObjectLogsByM4L.js +39 -88
- package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +30 -104
- package/components/ObjectLogs/types.d.ts +0 -2
- package/components/PropertyValue/PropertyValue.styles.js +1 -1
- package/components/SideBar/subcomponents/ContentComponent/style.js +3 -0
- package/components/SideBar/subcomponents/TreeGroupItems/styles.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +1 -1
- package/components/extended/React-Json-Viewer/ReactJsonViewer.d.ts +7 -0
- package/components/extended/React-Json-Viewer/ReactJsonViewer.js +31 -0
- package/components/extended/React-Json-Viewer/ReactJsonViewer.styles.d.ts +2 -0
- package/components/extended/React-Json-Viewer/ReactJsonViewer.styles.js +12 -0
- package/components/extended/React-Json-Viewer/constants.d.ts +2 -0
- package/components/extended/React-Json-Viewer/constants.js +8 -0
- package/components/extended/React-Json-Viewer/helpers/getReactJsonViewerTheme/getReactJsonViewerTheme.d.ts +8 -0
- package/components/extended/React-Json-Viewer/helpers/getReactJsonViewerTheme/getReactJsonViewerTheme.js +23 -0
- package/components/extended/React-Json-Viewer/helpers/getReactJsonViewerTheme/index.d.ts +1 -0
- package/components/extended/React-Json-Viewer/index.d.ts +1 -0
- package/components/extended/React-Json-Viewer/index.js +1 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerEnum.d.ts +3 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerEnum.js +7 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerSlots.d.ts +1 -0
- package/components/extended/React-Json-Viewer/slots/ReactJsonViewerSlots.js +11 -0
- package/components/extended/React-Json-Viewer/test/ReactJsonViewer.test.d.ts +1 -0
- package/components/extended/React-Json-Viewer/types.d.ts +12 -0
- package/components/extended/index.d.ts +1 -0
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -0
- package/components/hook-form/RHFTextField/RHFTextField.js +5 -3
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js +63 -55
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +1 -1
- package/components/index.d.ts +2 -0
- package/components/mui_extended/Autocomplete/Autocomplete.js +2 -1
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +1 -0
- package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +4 -2
- package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +1 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +1 -1
- package/components/mui_extended/Tab/Tab.styles.js +7 -7
- package/components/mui_extended/TabContent/TabContent.styles.js +1 -1
- package/components/mui_extended/TextField/TextField.js +13 -2
- package/components/mui_extended/TextField/TextField.styles.js +40 -3
- package/components/mui_extended/TextField/constants.d.ts +4 -0
- package/components/mui_extended/TextField/index.d.ts +1 -0
- package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +5 -1
- package/components/mui_extended/TextField/slots/TextFieldEnum.js +4 -0
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +18 -0
- package/components/mui_extended/TextField/slots/TextFieldSlots.js +22 -2
- package/components/mui_extended/TextField/types.d.ts +9 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/types.d.ts +2 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +5 -3
- package/hooks/useIsVisible/constants.d.ts +1 -0
- package/hooks/useIsVisible/constants.js +4 -0
- package/hooks/useIsVisible/index.d.ts +1 -0
- package/hooks/useIsVisible/index.js +1 -0
- package/hooks/useIsVisible/useIsVisible.d.ts +28 -0
- package/hooks/useIsVisible/useIsVisible.js +25 -0
- package/index.js +82 -70
- package/package.json +1 -1
- package/storybook/components/NoItemPrivileges/NoItemPrivileges.stories.d.ts +12 -0
- package/storybook/components/NoItemSelect/NoItemSelect.stories.d.ts +1 -1
- package/storybook/components/extended/React-Json-Viewer/ReactJsonViewer.stories.d.ts +9 -0
- package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +7 -0
- package/storybook/hook-form/RHFTextField/RHFTextField.stories.d.ts +4 -0
- package/storybook/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.stories.d.ts +19 -0
- package/utils/getLimitCharacters/getLimitCharacters.d.ts +7 -0
- package/utils/getLimitCharacters/getLimitCharacters.js +11 -0
- package/utils/getLimitCharacters/index.d.ts +1 -0
- package/utils/getLimitCharacters/index.js +1 -0
- package/utils/getLimitCharacters/test/getLimitCharacters.test.d.ts +1 -0
- package/utils/getLimitCharacters/types.d.ts +11 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useEnvironment } from "@m4l/core";
|
|
3
|
+
import { f as filterFieldsGenerator } from "../helpers/Fields/filterFields.js";
|
|
4
|
+
import { g as getRawFiltersForNetwork } from "../../DynamicFilter/helpers/getRawFiltersForNetwork.js";
|
|
5
|
+
import { u as useDynamicFilterAndSort } from "../../../hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js";
|
|
6
|
+
function useFilterAndSort(props) {
|
|
7
|
+
const { setBackendQueryParams, Refresh, otherApp = false, resourceTypeId, resourceSerialId } = props;
|
|
8
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
9
|
+
const onChangeFilterSort = useCallback((params) => {
|
|
10
|
+
const fixedFields = [
|
|
11
|
+
{
|
|
12
|
+
n: "resourceTypeId",
|
|
13
|
+
o: "c",
|
|
14
|
+
o1: resourceTypeId,
|
|
15
|
+
ft: "string"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
n: "resourceSerialId",
|
|
19
|
+
o: "c",
|
|
20
|
+
o1: resourceSerialId,
|
|
21
|
+
ft: "string"
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
const allFields = [...fixedFields, ...params.eventFilters?.rawFilters || []];
|
|
25
|
+
if (otherApp) {
|
|
26
|
+
setBackendQueryParams({
|
|
27
|
+
f: getRawFiltersForNetwork(allFields, "snakeCase")
|
|
28
|
+
});
|
|
29
|
+
} else {
|
|
30
|
+
setBackendQueryParams((prevParams) => ({
|
|
31
|
+
...prevParams,
|
|
32
|
+
f: getRawFiltersForNetwork(prevParams.eventFilters?.rawFilters || [], "snakeCase")
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
Refresh();
|
|
36
|
+
}, [Refresh, setBackendQueryParams, otherApp, resourceTypeId, resourceSerialId]);
|
|
37
|
+
const { leftActions, visibleCustomHeader, customHeaderComponent } = useDynamicFilterAndSort({
|
|
38
|
+
onChangeFilterSort,
|
|
39
|
+
fields: filterFieldsGenerator(`${host_static_assets}/${environment_assets}`, otherApp),
|
|
40
|
+
withAllField: true,
|
|
41
|
+
visibleRefresh: true,
|
|
42
|
+
filterSortAutomatic: false
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
leftActions,
|
|
46
|
+
visibleCustomHeader,
|
|
47
|
+
customHeaderComponent
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
useFilterAndSort as u
|
|
52
|
+
};
|
|
@@ -13,7 +13,7 @@ const ContainerWrapperStyled = styled("div", {
|
|
|
13
13
|
name: OBJECT_LOGS_KEY_COMPONENT,
|
|
14
14
|
slot: ObjectLogsSlots.root
|
|
15
15
|
})(objectLogsStyles?.root);
|
|
16
|
-
|
|
16
|
+
styled("div", {
|
|
17
17
|
name: OBJECT_LOGS_KEY_COMPONENT,
|
|
18
18
|
slot: ObjectLogsSlots.actionsWrapperStyled
|
|
19
19
|
})(objectLogsStyles?.actionsWrapperStyled);
|
|
@@ -54,7 +54,6 @@ styled(ReactJson, {
|
|
|
54
54
|
slot: ObjectLogsSlots.reactJsonSlot
|
|
55
55
|
})(objectLogsStyles?.reactJsonSlot);
|
|
56
56
|
export {
|
|
57
|
-
ActionsWrapperStyled as A,
|
|
58
57
|
ContainerWrapperStyled as C,
|
|
59
58
|
DetailDialogComponent as D,
|
|
60
59
|
GridWrapperStyled as G,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { useNetwork } from "@m4l/core";
|
|
4
|
-
import { useHostTheme } from "@m4l/graphics";
|
|
5
|
-
import ReactJson from "@microlink/react-json-view";
|
|
6
4
|
import { a as OBJECT_LOGS_M4L_END_POINT, b as OBJECT_LOGS_OTHERS_END_POINT } from "../../constants.js";
|
|
5
|
+
import { R as ReactJsonViewer } from "../../../extended/React-Json-Viewer/ReactJsonViewer.js";
|
|
7
6
|
function DetailDialog(props) {
|
|
8
|
-
const { logId,
|
|
7
|
+
const { logId, type } = props;
|
|
9
8
|
const { networkOperation } = useNetwork();
|
|
10
|
-
const { hostThemeOptions } = useHostTheme();
|
|
11
9
|
const [detail, setDetail] = useState({});
|
|
12
10
|
useEffect(() => {
|
|
13
11
|
let mounted = true;
|
|
@@ -27,12 +25,9 @@ function DetailDialog(props) {
|
|
|
27
25
|
mounted = false;
|
|
28
26
|
};
|
|
29
27
|
}, []);
|
|
30
|
-
const modeTheme = hostThemeOptions.palette?.mode;
|
|
31
|
-
const appliedTheme = theme || (modeTheme === "dark" ? "summerfruit" : "rjv-default");
|
|
32
28
|
return /* @__PURE__ */ jsx(
|
|
33
|
-
|
|
29
|
+
ReactJsonViewer,
|
|
34
30
|
{
|
|
35
|
-
theme: appliedTheme,
|
|
36
31
|
name: null,
|
|
37
32
|
sortKeys: true,
|
|
38
33
|
displayDataTypes: false,
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { D as DataGrid } from "../../../DataGrid/DataGrid.js";
|
|
4
|
-
import { useEnvironment } from "@m4l/core";
|
|
5
|
-
import { D as DynamicFilter } from "../../../DynamicFilter/DynamicFilter.js";
|
|
6
4
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
7
|
-
import { C as ContainerWrapperStyled,
|
|
8
|
-
import { D as DICTIONARY } from "../../dictionary.js";
|
|
5
|
+
import { C as ContainerWrapperStyled, G as GridWrapperStyled } from "../../slots/ObjectLogsSlots.js";
|
|
9
6
|
import { usePaginate } from "@m4l/graphics";
|
|
10
7
|
import { u as useObjectLogsColumns } from "../../hooks/useObjectLogsColumns.js";
|
|
11
8
|
import { a as OBJECT_LOGS_M4L_END_POINT, O as OBJECT_LOGS_KEY_COMPONENT } from "../../constants.js";
|
|
12
9
|
import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
13
|
-
import {
|
|
10
|
+
import { u as useFilterAndSort } from "../../hooks/useFilterAndSort.js";
|
|
14
11
|
import { O as ObjectLogsSlots } from "../../slots/ObjectLogsEnum.js";
|
|
15
12
|
function ObjectLogsByM4L(props) {
|
|
16
13
|
const { resourceId, objectId, dataTestId = "" } = props;
|
|
17
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
18
14
|
const [backendQueryParams, setBackendQueryParams] = useState(() => {
|
|
19
15
|
return { resource_id: resourceId, object_id: objectId };
|
|
20
16
|
});
|
|
@@ -31,92 +27,47 @@ function ObjectLogsByM4L(props) {
|
|
|
31
27
|
clearRows();
|
|
32
28
|
setBackendQueryParams({ resource_id: resourceId, object_id: objectId });
|
|
33
29
|
}, [resourceId, objectId]);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
Refresh();
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ jsxs(
|
|
30
|
+
const { leftActions, visibleCustomHeader, customHeaderComponent } = useFilterAndSort({ setBackendQueryParams, Refresh, otherApp: false });
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
39
32
|
ContainerWrapperStyled,
|
|
40
33
|
{
|
|
41
34
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: `m4ldatagrid-${dataTestId}` } : {},
|
|
42
35
|
...getPropDataTestId(OBJECT_LOGS_KEY_COMPONENT, ObjectLogsSlots.root, dataTestId),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
|
|
72
|
-
type: "string",
|
|
73
|
-
multiple: true,
|
|
74
|
-
presence: "optional",
|
|
75
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/log_preview.svg`
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "user_logs.log_detail",
|
|
79
|
-
dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
|
|
80
|
-
type: "string",
|
|
81
|
-
multiple: true,
|
|
82
|
-
presence: "optional",
|
|
83
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/log_detail.svg`
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
initialAppliedFilters: []
|
|
87
|
-
}
|
|
88
|
-
) }),
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
GridWrapperStyled,
|
|
91
|
-
{
|
|
92
|
-
children: /* @__PURE__ */ jsx(
|
|
93
|
-
DataGrid,
|
|
94
|
-
{
|
|
95
|
-
id: "users_logs_list",
|
|
96
|
-
dataTestId,
|
|
97
|
-
columns,
|
|
98
|
-
rows,
|
|
99
|
-
rowKeyGetter: (row) => row.id,
|
|
100
|
-
withActions: true,
|
|
101
|
-
actionsProps: {
|
|
102
|
-
withPager: true,
|
|
103
|
-
withLocalFilters: true,
|
|
104
|
-
pagerOptions: {
|
|
105
|
-
records: rows.length,
|
|
106
|
-
totalRecords: pagerState.totalRecords,
|
|
107
|
-
rowsPerPageOptions: [1, 2, 3, 4, 5, 10, 25],
|
|
108
|
-
page: pagerState.page,
|
|
109
|
-
rowsPerPage: pagerState.rowsPerPage,
|
|
110
|
-
onPageChange,
|
|
111
|
-
onRowsPerPageChange
|
|
112
|
-
}
|
|
36
|
+
role: "grid",
|
|
37
|
+
"aria-label": "object-logs",
|
|
38
|
+
children: /* @__PURE__ */ jsx(
|
|
39
|
+
GridWrapperStyled,
|
|
40
|
+
{
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
42
|
+
DataGrid,
|
|
43
|
+
{
|
|
44
|
+
id: "users_logs_list",
|
|
45
|
+
dataTestId,
|
|
46
|
+
columns,
|
|
47
|
+
rows,
|
|
48
|
+
rowKeyGetter: (row) => row.id,
|
|
49
|
+
visibleCustomHeader,
|
|
50
|
+
customHeader: customHeaderComponent,
|
|
51
|
+
withActions: true,
|
|
52
|
+
actionsProps: {
|
|
53
|
+
leftActions,
|
|
54
|
+
withPager: true,
|
|
55
|
+
withLocalFilters: true,
|
|
56
|
+
pagerOptions: {
|
|
57
|
+
records: rows.length,
|
|
58
|
+
totalRecords: pagerState.totalRecords,
|
|
59
|
+
rowsPerPageOptions: [1, 2, 3, 4, 5, 10, 25],
|
|
60
|
+
page: pagerState.page,
|
|
61
|
+
rowsPerPage: pagerState.rowsPerPage,
|
|
62
|
+
onPageChange,
|
|
63
|
+
onRowsPerPageChange
|
|
113
64
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"users_list_logs"
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
120
71
|
}
|
|
121
72
|
);
|
|
122
73
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import { endOfDay, startOfDay } from "date-fns";
|
|
4
3
|
import { D as DataGrid } from "../../../DataGrid/DataGrid.js";
|
|
5
|
-
import { useEnvironment } from "@m4l/core";
|
|
6
|
-
import { D as DynamicFilter } from "../../../DynamicFilter/DynamicFilter.js";
|
|
7
4
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
8
|
-
import { C as ContainerWrapperStyled,
|
|
9
|
-
import { D as DICTIONARY } from "../../dictionary.js";
|
|
5
|
+
import { C as ContainerWrapperStyled, G as GridWrapperStyled } from "../../slots/ObjectLogsSlots.js";
|
|
10
6
|
import { useRows } from "@m4l/graphics";
|
|
11
7
|
import { u as useObjectLogsColumns } from "../../hooks/useObjectLogsColumns.js";
|
|
12
8
|
import { b as OBJECT_LOGS_OTHERS_END_POINT, O as OBJECT_LOGS_KEY_COMPONENT } from "../../constants.js";
|
|
13
9
|
import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
14
|
-
import {
|
|
15
|
-
import { g as getRawSortsForNetwork } from "../../../DynamicSort/helpers/getRawSortsForNetwork.js";
|
|
10
|
+
import { u as useFilterAndSort } from "../../hooks/useFilterAndSort.js";
|
|
16
11
|
import { O as ObjectLogsSlots } from "../../slots/ObjectLogsEnum.js";
|
|
17
12
|
function ObjectLogsByOthers(props) {
|
|
18
13
|
const { dataTestId = "", resourceSerialId, resourceTypeId } = props;
|
|
19
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
20
14
|
const [backendQueryParams, setBackendQueryParams] = useState({});
|
|
21
15
|
const columns = useObjectLogsColumns("other");
|
|
22
16
|
const { rows, clearRows, refresh } = useRows({
|
|
@@ -30,106 +24,38 @@ function ObjectLogsByOthers(props) {
|
|
|
30
24
|
useEffect(() => {
|
|
31
25
|
clearRows();
|
|
32
26
|
}, [resourceSerialId, resourceTypeId]);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
n: "resourceTypeId",
|
|
37
|
-
o: "c",
|
|
38
|
-
o1: resourceTypeId,
|
|
39
|
-
ft: "string"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
n: "resourceSerialId",
|
|
43
|
-
o: "c",
|
|
44
|
-
o1: resourceSerialId,
|
|
45
|
-
ft: "string"
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
const sortFields = [
|
|
49
|
-
// {
|
|
50
|
-
// n: 'created_at',
|
|
51
|
-
// o: 'desc',
|
|
52
|
-
// ft: 'string',
|
|
53
|
-
// } ,
|
|
54
|
-
];
|
|
55
|
-
const allFields = [...fixedFields, ...rawFilters];
|
|
56
|
-
const parms = {
|
|
57
|
-
f: getRawFiltersForNetwork(allFields, "snakeCase"),
|
|
58
|
-
s: getRawSortsForNetwork(sortFields, "snakeCase")
|
|
59
|
-
};
|
|
60
|
-
setBackendQueryParams(parms);
|
|
61
|
-
refresh();
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
+
const { leftActions, visibleCustomHeader, customHeaderComponent } = useFilterAndSort({ setBackendQueryParams, Refresh: refresh, otherApp: true, resourceTypeId, resourceSerialId });
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
64
29
|
ContainerWrapperStyled,
|
|
65
30
|
{
|
|
66
31
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: `m4ldatagrid-${dataTestId}` } : {},
|
|
67
32
|
...getPropDataTestId(OBJECT_LOGS_KEY_COMPONENT, ObjectLogsSlots.root, dataTestId),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
dictionaryId: DICTIONARY.LABEL_USER,
|
|
89
|
-
type: "string",
|
|
90
|
-
multiple: true,
|
|
91
|
-
presence: "optional",
|
|
92
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/email.svg`
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "logPreview",
|
|
96
|
-
dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
|
|
97
|
-
type: "string",
|
|
98
|
-
multiple: true,
|
|
99
|
-
presence: "optional",
|
|
100
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/log_preview.svg`
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: "logDetail",
|
|
104
|
-
dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
|
|
105
|
-
type: "string",
|
|
106
|
-
multiple: true,
|
|
107
|
-
presence: "optional",
|
|
108
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/log_detail.svg`
|
|
33
|
+
role: "grid",
|
|
34
|
+
"aria-label": "object-logs",
|
|
35
|
+
children: /* @__PURE__ */ jsx(
|
|
36
|
+
GridWrapperStyled,
|
|
37
|
+
{
|
|
38
|
+
children: /* @__PURE__ */ jsx(
|
|
39
|
+
DataGrid,
|
|
40
|
+
{
|
|
41
|
+
id: "users_logs_list",
|
|
42
|
+
dataTestId,
|
|
43
|
+
columns,
|
|
44
|
+
rows,
|
|
45
|
+
rowKeyGetter: (row) => row.id,
|
|
46
|
+
withActions: true,
|
|
47
|
+
visibleCustomHeader,
|
|
48
|
+
customHeader: customHeaderComponent,
|
|
49
|
+
actionsProps: {
|
|
50
|
+
leftActions,
|
|
51
|
+
withPager: false,
|
|
52
|
+
withLocalFilters: false
|
|
109
53
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
GridWrapperStyled,
|
|
116
|
-
{
|
|
117
|
-
children: /* @__PURE__ */ jsx(
|
|
118
|
-
DataGrid,
|
|
119
|
-
{
|
|
120
|
-
id: "users_logs_list",
|
|
121
|
-
dataTestId,
|
|
122
|
-
columns,
|
|
123
|
-
rows,
|
|
124
|
-
rowKeyGetter: (row) => row.id,
|
|
125
|
-
withActions: true,
|
|
126
|
-
actionsProps: {}
|
|
127
|
-
},
|
|
128
|
-
"users_list_logs"
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
]
|
|
54
|
+
},
|
|
55
|
+
"users_list_logs"
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
133
59
|
}
|
|
134
60
|
);
|
|
135
61
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Maybe } from '@m4l/core';
|
|
2
|
-
import { ThemeKeys, ThemeObject } from '@microlink/react-json-view';
|
|
3
2
|
import { Theme } from '@mui/material';
|
|
4
3
|
import { ObjectLogsSlots } from './slots/ObjectLogsEnum';
|
|
5
4
|
import { OBJECT_LOGS_KEY_COMPONENT } from './constants';
|
|
@@ -35,7 +34,6 @@ export interface ObjectLogsQueryParams {
|
|
|
35
34
|
export interface DetailDialogProps {
|
|
36
35
|
type: 'm4l' | 'other';
|
|
37
36
|
logId: number | string;
|
|
38
|
-
theme?: ThemeKeys | ThemeObject;
|
|
39
37
|
}
|
|
40
38
|
export type ObjectLogsSlotsType = keyof typeof ObjectLogsSlots;
|
|
41
39
|
export type ObjectLogsOwnerState = {};
|
|
@@ -44,7 +44,7 @@ const propertyValueStyles = {
|
|
|
44
44
|
containerType: "inline-size",
|
|
45
45
|
display: "flex",
|
|
46
46
|
flexDirection: ownerState?.isForm ? "column" : "row",
|
|
47
|
-
justifyContent:
|
|
47
|
+
justifyContent: "flex-start",
|
|
48
48
|
alignItems: "center",
|
|
49
49
|
gap: theme.vars.size.baseSpacings["sp1"],
|
|
50
50
|
width: ownerState?.semanticWidth ? "auto" : "200px",
|
|
@@ -142,6 +142,9 @@ const contentComponentStyles = {
|
|
|
142
142
|
[`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}.${CLASS_NAME_ITEM_IN_TREE_ACTIVE} > .M4LSideBar-wrapperMenuItem`]: {
|
|
143
143
|
backgroundColor: theme.vars.palette.primary.opacity
|
|
144
144
|
},
|
|
145
|
+
[`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE} > .M4LSideBar-wrapperMenuItem`]: {
|
|
146
|
+
backgroundColor: theme.vars.palette.primary.opacity
|
|
147
|
+
},
|
|
145
148
|
[`&.${CLASS_NAME_IS_ROOT} > .M4LSideBar-wrapperMenuItem`]: {
|
|
146
149
|
paddingRight: "7px",
|
|
147
150
|
paddingTop: theme.vars.size.baseSpacings.sp1,
|
|
@@ -46,7 +46,7 @@ function NodeMenuItem(props) {
|
|
|
46
46
|
),
|
|
47
47
|
label: item.title,
|
|
48
48
|
selected: item.active,
|
|
49
|
-
startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: isRoot && item.itemInTreeActive ? "root" : item.active ? "itemActive" : "normal" }),
|
|
49
|
+
startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: isRoot && item.itemInTreeActive || isRoot && item.active ? "root" : item.active ? "itemActive" : "normal" }),
|
|
50
50
|
endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
51
51
|
onClick: () => handlerClick(),
|
|
52
52
|
size: currentSize
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactJsonViewerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente para visualizar datos en formato JSON.
|
|
4
|
+
* @param props - Props del componente.
|
|
5
|
+
* @returns Componente ReactJsonViewer.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ReactJsonViewer: (props: ReactJsonViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import ReactJson from "@microlink/react-json-view";
|
|
4
|
+
import { R as ReactJsonViewerRootStyled } from "./slots/ReactJsonViewerSlots.js";
|
|
5
|
+
import { R as REACT_JSON_VIEWER_CLASSES } from "./constants.js";
|
|
6
|
+
import { useTheme } from "@mui/material";
|
|
7
|
+
import { g as getReactJsonViewerTheme } from "./helpers/getReactJsonViewerTheme/getReactJsonViewerTheme.js";
|
|
8
|
+
const ReactJsonViewer = (props) => {
|
|
9
|
+
const { className, dataTestId, ...others } = props;
|
|
10
|
+
const muiTheme = useTheme();
|
|
11
|
+
const theme = getReactJsonViewerTheme(muiTheme);
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
ReactJsonViewerRootStyled,
|
|
14
|
+
{
|
|
15
|
+
className: clsx(REACT_JSON_VIEWER_CLASSES.root, className),
|
|
16
|
+
dataTestId,
|
|
17
|
+
role: "application",
|
|
18
|
+
"aria-label": "JSON data viewer",
|
|
19
|
+
children: /* @__PURE__ */ jsx(
|
|
20
|
+
ReactJson,
|
|
21
|
+
{
|
|
22
|
+
theme,
|
|
23
|
+
...others
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
ReactJsonViewer as R
|
|
31
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { R as ReactJsonViewerSlots } from "./slots/ReactJsonViewerEnum.js";
|
|
3
|
+
const REACT_JSON_VIEWER_KEY_COMPONENT = "M4LReactJsonViewer";
|
|
4
|
+
const REACT_JSON_VIEWER_CLASSES = getComponentClasses(REACT_JSON_VIEWER_KEY_COMPONENT, ReactJsonViewerSlots);
|
|
5
|
+
export {
|
|
6
|
+
REACT_JSON_VIEWER_CLASSES as R,
|
|
7
|
+
REACT_JSON_VIEWER_KEY_COMPONENT as a
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ThemeObject } from '@microlink/react-json-view';
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* Función para obtener los colores del tema de MUI.
|
|
5
|
+
* @param muiTheme - Tema de MUI.
|
|
6
|
+
* @returns Colores del tema.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getReactJsonViewerTheme: (muiTheme: Theme) => ThemeObject;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const getReactJsonViewerTheme = (muiTheme) => {
|
|
2
|
+
return {
|
|
3
|
+
base00: muiTheme?.vars?.palette?.background?.default,
|
|
4
|
+
base01: muiTheme?.vars?.palette?.background?.base,
|
|
5
|
+
base02: muiTheme?.vars?.palette?.background?.neutral,
|
|
6
|
+
base03: muiTheme?.vars?.palette?.text?.disabled,
|
|
7
|
+
base04: muiTheme?.vars?.palette?.text?.secondary,
|
|
8
|
+
base05: muiTheme?.vars?.palette?.text?.primary,
|
|
9
|
+
base06: muiTheme?.vars?.palette?.text?.primary,
|
|
10
|
+
base07: muiTheme?.vars?.palette?.text?.primary,
|
|
11
|
+
base08: muiTheme?.vars?.palette?.chips?.error?.outlined?.colorTone,
|
|
12
|
+
base09: muiTheme?.vars?.palette?.chips?.orange?.outlined?.color,
|
|
13
|
+
base0A: muiTheme?.vars?.palette?.chips?.warning?.outlined?.colorTone,
|
|
14
|
+
base0B: muiTheme?.vars?.palette?.chips?.forest?.outlined?.color,
|
|
15
|
+
base0C: muiTheme?.vars?.palette?.chips?.aqua?.outlined?.colorTone,
|
|
16
|
+
base0D: muiTheme?.vars?.palette?.chips?.info?.outlined?.colorTone,
|
|
17
|
+
base0E: muiTheme?.vars?.palette?.chips?.pink?.outlined?.colorTone,
|
|
18
|
+
base0F: muiTheme?.vars?.palette?.chips?.persianGreen?.outlined?.colorTone
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
getReactJsonViewerTheme as g
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getReactJsonViewerTheme } from './getReactJsonViewerTheme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactJsonViewer } from './ReactJsonViewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ReactJsonViewerRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { a as REACT_JSON_VIEWER_KEY_COMPONENT } from "../constants.js";
|
|
3
|
+
import { R as ReactJsonViewerSlots } from "./ReactJsonViewerEnum.js";
|
|
4
|
+
import { r as reactJsonViewerStyles } from "../ReactJsonViewer.styles.js";
|
|
5
|
+
const ReactJsonViewerRootStyled = styled("div", {
|
|
6
|
+
name: REACT_JSON_VIEWER_KEY_COMPONENT,
|
|
7
|
+
slot: ReactJsonViewerSlots.root
|
|
8
|
+
})(reactJsonViewerStyles?.root);
|
|
9
|
+
export {
|
|
10
|
+
ReactJsonViewerRootStyled as R
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactJsonViewProps } from '@microlink/react-json-view';
|
|
2
|
+
import { ReactJsonViewerSlots } from './slots/ReactJsonViewerEnum';
|
|
3
|
+
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
4
|
+
import { REACT_JSON_VIEWER_KEY_COMPONENT } from './constants';
|
|
5
|
+
import { Theme } from '@mui/material';
|
|
6
|
+
export interface ReactJsonViewerProps extends Omit<ReactJsonViewProps, 'theme'> {
|
|
7
|
+
className?: string;
|
|
8
|
+
dataTestId?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ReactJsonViewerOwnerState = {};
|
|
11
|
+
export type ReactJsonViewerSlotsType = keyof typeof ReactJsonViewerSlots;
|
|
12
|
+
export type ReactJsonViewerStyles = M4LOverridesStyleRules<ReactJsonViewerSlotsType, typeof REACT_JSON_VIEWER_KEY_COMPONENT, Theme>;
|