@m4l/components 0.0.39 → 0.0.42
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.
|
@@ -61,7 +61,7 @@ const ALL_FIELDS = {
|
|
|
61
61
|
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg",
|
|
62
62
|
type: "string",
|
|
63
63
|
multiple: true,
|
|
64
|
-
|
|
64
|
+
presence: "optional"
|
|
65
65
|
};
|
|
66
66
|
const WrapperStringFilter$1 = styled("div")(({
|
|
67
67
|
theme
|
|
@@ -788,7 +788,7 @@ const getInitialFilters = (fields, filters, getFieldByName, getLabel) => {
|
|
|
788
788
|
add = false;
|
|
789
789
|
}
|
|
790
790
|
if (add) {
|
|
791
|
-
if (field.fixed) {
|
|
791
|
+
if (field.presence === "fixed") {
|
|
792
792
|
if (fixedFields.findIndex((f) => f === field.name) === -1) {
|
|
793
793
|
filter.fixed = true;
|
|
794
794
|
fixedFields.push(field.name);
|
|
@@ -804,9 +804,9 @@ const getInitialFilters = (fields, filters, getFieldByName, getLabel) => {
|
|
|
804
804
|
}
|
|
805
805
|
for (let index = 0; index < fields.length; index++) {
|
|
806
806
|
const field = fields[index];
|
|
807
|
-
if (field.fixed) {
|
|
807
|
+
if (field.presence === "initialized" || field.presence === "fixed") {
|
|
808
808
|
if (!filters.find((f) => f.n === field.name)) {
|
|
809
|
-
const newFilter = getDefaultFilterValues(field,
|
|
809
|
+
const newFilter = getDefaultFilterValues(field, field.presence === "fixed", getLabel);
|
|
810
810
|
newFilter.id = newFilters.length + 1;
|
|
811
811
|
newFilters.push(newFilter);
|
|
812
812
|
}
|
|
@@ -11,12 +11,13 @@ export declare type BooleanOperator = 'e' | 'ne';
|
|
|
11
11
|
export declare const BOOLEAN_OPERATORS: Array<BooleanOperator>;
|
|
12
12
|
export declare type DateTimeOperator = 'b' | 'e' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
13
13
|
export declare const DATE_TIME_OPERATORS: Array<DateTimeOperator>;
|
|
14
|
+
export declare type FieldPresence = 'initialized' | 'fixed' | 'optional';
|
|
14
15
|
export interface Field {
|
|
15
16
|
name: string;
|
|
16
17
|
label: string;
|
|
17
18
|
type: FieldType;
|
|
18
19
|
multiple?: boolean;
|
|
19
|
-
|
|
20
|
+
presence?: FieldPresence;
|
|
20
21
|
urlIcon: string;
|
|
21
22
|
defaultOperand1?: Maybe<OperandType>;
|
|
22
23
|
defaultOperand2?: Maybe<OperandType>;
|
|
@@ -178,22 +178,28 @@ function ObjectLogs(props) {
|
|
|
178
178
|
rows,
|
|
179
179
|
onPageChange,
|
|
180
180
|
onRowsPerPageChange,
|
|
181
|
-
clearRows
|
|
181
|
+
clearRows,
|
|
182
|
+
Refresh
|
|
182
183
|
} = usePaginate({
|
|
183
184
|
endPoint: "logs",
|
|
184
|
-
|
|
185
|
+
fireOnChangeParms: false,
|
|
185
186
|
queryParams
|
|
186
187
|
});
|
|
187
188
|
useEffect(() => {
|
|
188
189
|
clearRows();
|
|
190
|
+
setQueryParams((oldParms) => ({
|
|
191
|
+
...oldParms,
|
|
192
|
+
object_id
|
|
193
|
+
}));
|
|
189
194
|
}, [object_id]);
|
|
190
|
-
const onChangeFilter = (_initFilters, rawFilters) => {
|
|
195
|
+
const onChangeFilter = useCallback((_initFilters, rawFilters) => {
|
|
191
196
|
setQueryParams({
|
|
192
197
|
resource_id,
|
|
193
198
|
object_id,
|
|
194
199
|
f: rawFilters
|
|
195
200
|
});
|
|
196
|
-
|
|
201
|
+
Refresh();
|
|
202
|
+
}, [object_id]);
|
|
197
203
|
return /* @__PURE__ */ jsxs(Container$1, {
|
|
198
204
|
children: [/* @__PURE__ */ jsx(Actions, {
|
|
199
205
|
id: "objectLogsActions",
|
|
@@ -206,14 +212,14 @@ function ObjectLogs(props) {
|
|
|
206
212
|
label: getLabel("object_logs.date"),
|
|
207
213
|
type: "datetime",
|
|
208
214
|
multiple: false,
|
|
209
|
-
|
|
215
|
+
presence: "optional",
|
|
210
216
|
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
|
|
211
217
|
}, {
|
|
212
218
|
name: "user_logs.log_detail",
|
|
213
219
|
label: getLabel("object_logs.log_detail"),
|
|
214
220
|
type: "string",
|
|
215
221
|
multiple: false,
|
|
216
|
-
|
|
222
|
+
presence: "optional",
|
|
217
223
|
urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg"
|
|
218
224
|
}],
|
|
219
225
|
initialFilters: []
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"format": "npm run prettier:fix && npm run lint:fix"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@m4l/graphics": "^0.0.
|
|
17
|
+
"@m4l/graphics": "^0.0.31",
|
|
18
18
|
"react": "^17.0.0 || 18.x",
|
|
19
19
|
"react-dom": "^18.0.0",
|
|
20
20
|
"react-draggable": "^4.4.5"
|