@m4l/components 9.3.6 → 9.3.8-BE190825-beta.1
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 +25 -0
- package/components/DataGrid/Datagrid.styles.js +2 -2
- 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/FormContainer/FormContainer.d.ts +7 -0
- package/components/FormContainer/FormContainer.js +21 -0
- package/components/FormContainer/FormContainer.styles.d.ts +2 -0
- package/components/FormContainer/FormContainer.styles.js +27 -0
- package/components/FormContainer/constants.d.ts +2 -0
- package/components/FormContainer/constants.js +8 -0
- package/components/FormContainer/index.d.ts +1 -0
- package/components/FormContainer/index.js +1 -0
- package/components/FormContainer/slots/FormContainerEnum.d.ts +5 -0
- package/components/FormContainer/slots/FormContainerEnum.js +9 -0
- package/components/FormContainer/slots/FormContainerSlots.d.ts +9 -0
- package/components/FormContainer/slots/FormContainerSlots.js +22 -0
- package/components/FormContainer/test/FormContainer.test.d.ts +1 -0
- package/components/FormContainer/types.d.ts +11 -0
- 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/ObjectLogsByM4L/ObjectLogsByM4L.js +39 -88
- package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +30 -104
- package/components/PaperForm/PaperForm.js +6 -4
- package/components/PaperForm/index.js +1 -0
- package/components/PaperForm/styles.js +21 -10
- package/components/PaperForm/types.d.ts +3 -2
- package/components/PropertyValue/PropertyValue.styles.js +2 -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/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 +4 -1
- 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 +44 -32
- package/package.json +1 -1
- package/storybook/components/FormContainer/FormContainer.stories.d.ts +13 -0
- package/storybook/components/NoItemPrivileges/NoItemPrivileges.stories.d.ts +12 -0
- package/storybook/components/NoItemSelect/NoItemSelect.stories.d.ts +1 -1
- package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +7 -0
- package/storybook/components/paperForm/PaperForm.stories.d.ts +5 -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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Theme, PaletteColor } from '@mui/material';
|
|
2
2
|
import { M4LOverridesStyleRules } from '../../@types/augmentations';
|
|
3
|
-
import {
|
|
3
|
+
import { NO_ITEM_SELECTED_KEY_COMPONENT } from './constant';
|
|
4
4
|
import { Sizes } from '@m4l/styles';
|
|
5
5
|
import { NoItemSelectedSlots } from './slots/NoItemSelectedEnum';
|
|
6
|
-
import { LabelProps } from '../Label';
|
|
6
|
+
import { LabelProps } from '../Label/types';
|
|
7
7
|
export interface NoItemSelectedProps extends Pick<LabelProps, 'label'> {
|
|
8
8
|
image?: string;
|
|
9
|
+
title?: string;
|
|
9
10
|
message?: string;
|
|
10
11
|
paletteColor?: PaletteColor;
|
|
11
12
|
dictionaryId?: string;
|
|
@@ -13,8 +14,6 @@ export interface NoItemSelectedProps extends Pick<LabelProps, 'label'> {
|
|
|
13
14
|
dataTestId?: string;
|
|
14
15
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
15
16
|
}
|
|
16
|
-
export
|
|
17
|
-
size: Extract<Sizes, 'small' | 'medium'>;
|
|
18
|
-
}
|
|
17
|
+
export type NoItemSelectedOwnerState = {};
|
|
19
18
|
export type NoItemSelectedSlotsType = keyof typeof NoItemSelectedSlots;
|
|
20
|
-
export type NoItemSelectedStyles = M4LOverridesStyleRules<NoItemSelectedSlotsType, typeof
|
|
19
|
+
export type NoItemSelectedStyles = M4LOverridesStyleRules<NoItemSelectedSlotsType, typeof NO_ITEM_SELECTED_KEY_COMPONENT, Theme>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { endOfDay, startOfDay, startOfMonth } from "date-fns";
|
|
2
|
+
import { D as DICTIONARY } from "../../dictionary.js";
|
|
3
|
+
const filterFieldsGenerator = (urlAssetsPrefix, otherApp) => {
|
|
4
|
+
if (otherApp) {
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
name: "createdAt",
|
|
8
|
+
dictionaryId: DICTIONARY.LABEL_CREATED_AT,
|
|
9
|
+
type: "datetime",
|
|
10
|
+
multiple: false,
|
|
11
|
+
presence: "initialized",
|
|
12
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`,
|
|
13
|
+
defaultOperand1: startOfDay(/* @__PURE__ */ new Date()),
|
|
14
|
+
defaultOperand2: endOfDay(/* @__PURE__ */ new Date())
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "userId",
|
|
18
|
+
dictionaryId: DICTIONARY.LABEL_USER,
|
|
19
|
+
type: "string",
|
|
20
|
+
multiple: true,
|
|
21
|
+
presence: "optional",
|
|
22
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "logPreview",
|
|
26
|
+
dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
|
|
27
|
+
type: "string",
|
|
28
|
+
multiple: true,
|
|
29
|
+
presence: "optional",
|
|
30
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_preview.svg`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "logDetail",
|
|
34
|
+
dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
|
|
35
|
+
type: "string",
|
|
36
|
+
multiple: true,
|
|
37
|
+
presence: "optional",
|
|
38
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_detail.svg`
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
name: "user_logs.created_at",
|
|
45
|
+
dictionaryId: DICTIONARY.LABEL_CREATED_AT,
|
|
46
|
+
type: "datetime",
|
|
47
|
+
multiple: false,
|
|
48
|
+
presence: "fixed",
|
|
49
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`,
|
|
50
|
+
defaultOperand1: startOfMonth(/* @__PURE__ */ new Date()),
|
|
51
|
+
defaultOperand2: endOfDay(/* @__PURE__ */ new Date())
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "users.email",
|
|
55
|
+
dictionaryId: DICTIONARY.LABEL_USER,
|
|
56
|
+
type: "string",
|
|
57
|
+
multiple: true,
|
|
58
|
+
presence: "optional",
|
|
59
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/email.svg`
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "user_logs.log_preview",
|
|
63
|
+
dictionaryId: DICTIONARY.LABEL_LOG_PREVIEW,
|
|
64
|
+
type: "string",
|
|
65
|
+
multiple: true,
|
|
66
|
+
presence: "optional",
|
|
67
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_preview.svg`
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "user_logs.log_detail",
|
|
71
|
+
dictionaryId: DICTIONARY.LABEL_LOG_DETAIL,
|
|
72
|
+
type: "string",
|
|
73
|
+
multiple: true,
|
|
74
|
+
presence: "optional",
|
|
75
|
+
urlIcon: `${urlAssetsPrefix}/frontend/components/object_logs/assets/icons/log_detail.svg`
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
filterFieldsGenerator as f
|
|
81
|
+
};
|
|
@@ -14,9 +14,9 @@ const useDetailFormatter = (type) => {
|
|
|
14
14
|
(rowProps) => {
|
|
15
15
|
let logId;
|
|
16
16
|
if (type === "m4l") {
|
|
17
|
-
logId = rowProps.
|
|
17
|
+
logId = rowProps.id;
|
|
18
18
|
} else {
|
|
19
|
-
logId = rowProps.
|
|
19
|
+
logId = rowProps.uuid;
|
|
20
20
|
}
|
|
21
21
|
const iconConfig = {
|
|
22
22
|
iconUrl: `${host_static_assets}/${environment_assets}/frontend/components/object_logs/assets/icons/search.svg`,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectLogsByOtherProps } from '../subcomponents/ObjectLogsByOthers/ObjectLogsByOthers';
|
|
2
|
+
interface UseFilterAndSortProps extends Partial<ObjectLogsByOtherProps> {
|
|
3
|
+
setBackendQueryParams: React.Dispatch<React.SetStateAction<Record<string, any>>>;
|
|
4
|
+
Refresh: () => void;
|
|
5
|
+
otherApp?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hook para obtener DynamicFilter and Sort
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFilterAndSort(props: UseFilterAndSortProps): {
|
|
11
|
+
leftActions: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
visibleCustomHeader: boolean;
|
|
13
|
+
customHeaderComponent: import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -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,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
|
}
|
|
@@ -24,7 +24,8 @@ function PaperForm(props) {
|
|
|
24
24
|
color = "default",
|
|
25
25
|
size = "medium",
|
|
26
26
|
isForm = false,
|
|
27
|
-
variant = "standard"
|
|
27
|
+
variant = "standard",
|
|
28
|
+
height = "auto"
|
|
28
29
|
} = props;
|
|
29
30
|
const { currentSize } = useComponentSize(size);
|
|
30
31
|
const paperFormRef = useRef(null);
|
|
@@ -33,7 +34,8 @@ function PaperForm(props) {
|
|
|
33
34
|
size: currentSize,
|
|
34
35
|
color,
|
|
35
36
|
isForm,
|
|
36
|
-
paperFormVariant: variant
|
|
37
|
+
paperFormVariant: variant,
|
|
38
|
+
height
|
|
37
39
|
};
|
|
38
40
|
return /* @__PURE__ */ jsxs(
|
|
39
41
|
PaperFormRootStyled,
|
|
@@ -43,8 +45,8 @@ function PaperForm(props) {
|
|
|
43
45
|
ownerState: { ...ownerState },
|
|
44
46
|
...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {},
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
|
|
47
|
-
/* @__PURE__ */ jsx(ContentStyled, { ownerState: {
|
|
48
|
+
variant !== "text" && /* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
|
|
49
|
+
/* @__PURE__ */ jsx(ContentStyled, { ownerState: { ...ownerState }, children: renderChildren(children) })
|
|
48
50
|
]
|
|
49
51
|
}
|
|
50
52
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
2
|
const paperFormStyles = {
|
|
3
3
|
/**
|
|
4
4
|
*************************************************************
|
|
@@ -6,14 +6,25 @@ const paperFormStyles = {
|
|
|
6
6
|
* @param theme
|
|
7
7
|
***********************************************************
|
|
8
8
|
*/
|
|
9
|
-
paperFormRoot: ({ theme }) => ({
|
|
10
|
-
borderRadius: theme.size.borderRadius.r1,
|
|
9
|
+
paperFormRoot: ({ theme, ownerState }) => ({
|
|
11
10
|
background: theme.vars.palette.background.default,
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
...ownerState?.paperFormVariant !== "text" && {
|
|
12
|
+
borderRadius: theme.size.borderRadius.r1,
|
|
13
|
+
border: `${theme.size.borderStroke.container}`,
|
|
14
|
+
borderColor: theme.vars.palette.border.default
|
|
15
|
+
},
|
|
14
16
|
overflow: "hidden",
|
|
15
17
|
width: "100%",
|
|
16
|
-
height
|
|
18
|
+
...ownerState?.height === "full" && {
|
|
19
|
+
flexGrow: 1,
|
|
20
|
+
overflow: "auto",
|
|
21
|
+
display: "flex",
|
|
22
|
+
flexDirection: "column"
|
|
23
|
+
},
|
|
24
|
+
...ownerState?.height === "auto" && {
|
|
25
|
+
height: "auto"
|
|
26
|
+
},
|
|
27
|
+
flexShrink: 0,
|
|
17
28
|
container: "container / inline-size"
|
|
18
29
|
}),
|
|
19
30
|
/**
|
|
@@ -32,8 +43,8 @@ const paperFormStyles = {
|
|
|
32
43
|
borderRadius: `${theme.vars.size.borderRadius.r1} ${theme.vars.size.borderRadius.r1} 0 0`,
|
|
33
44
|
background: theme.vars.palette[ownerState?.color ?? "default"].hoverOpacity,
|
|
34
45
|
alignSelf: "stretch",
|
|
35
|
-
...
|
|
36
|
-
theme
|
|
46
|
+
...getSizeStyles(
|
|
47
|
+
theme,
|
|
37
48
|
ownerState?.size || "medium",
|
|
38
49
|
"container"
|
|
39
50
|
)
|
|
@@ -67,14 +78,14 @@ const paperFormStyles = {
|
|
|
67
78
|
*/
|
|
68
79
|
containerContent: ({ theme, ownerState }) => ({
|
|
69
80
|
width: "100%",
|
|
70
|
-
height: "auto",
|
|
81
|
+
height: ownerState?.height === "full" ? "100%" : "auto",
|
|
71
82
|
display: "flex",
|
|
72
83
|
flexDirection: ownerState?.isForm ? "row" : "column",
|
|
73
84
|
alignItems: ownerState?.isForm ? "flex-start" : "center",
|
|
74
85
|
justifyContent: ownerState?.isForm ? "flex-start" : "center",
|
|
75
86
|
gap: ownerState?.isForm ? theme.vars.size.baseSpacings.sp3 : theme.vars.size.baseSpacings.sp0,
|
|
76
87
|
flexWrap: ownerState?.isForm ? "wrap" : "nowrap",
|
|
77
|
-
padding: theme.vars.size.baseSpacings.sp3,
|
|
88
|
+
padding: ownerState?.paperFormVariant === "text" ? "0px" : theme.vars.size.baseSpacings.sp3,
|
|
78
89
|
background: theme.vars.palette.background.default
|
|
79
90
|
})
|
|
80
91
|
};
|
|
@@ -9,11 +9,12 @@ export interface PaperFormProps {
|
|
|
9
9
|
urlIcon?: string;
|
|
10
10
|
title: string;
|
|
11
11
|
children?: ReactNode | PropertyValueProps[];
|
|
12
|
-
variant?: 'standard';
|
|
12
|
+
variant?: 'standard' | 'text';
|
|
13
13
|
color?: Extract<ComponentPalletColor, 'default'>;
|
|
14
14
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
15
15
|
isForm?: boolean;
|
|
16
16
|
dataTestId?: string;
|
|
17
|
+
height?: 'auto' | 'full';
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* ***************************************
|
|
@@ -25,7 +26,7 @@ interface CommonsProps {
|
|
|
25
26
|
paperFormVariant?: PaperFormProps['variant'];
|
|
26
27
|
}
|
|
27
28
|
export type HeaderProps = Omit<PaperFormProps, 'children' | 'isForm' | 'variant'> & CommonsProps;
|
|
28
|
-
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size'> & CommonsProps;
|
|
29
|
+
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size' | 'height'> & CommonsProps;
|
|
29
30
|
/**
|
|
30
31
|
* ***********************************
|
|
31
32
|
* Slots para los estilos utilizados
|