@solidxai/core-ui 0.1.3 → 0.1.4-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/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +0 -5
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.tsx +0 -5
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +7 -5
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +10 -8
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +48 -47
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +41 -10
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/FilterComponent.tsx +1 -1
- package/dist/components/core/common/GroupingComponent.d.ts +54 -0
- package/dist/components/core/common/GroupingComponent.d.ts.map +1 -0
- package/dist/components/core/common/GroupingComponent.js +196 -0
- package/dist/components/core/common/GroupingComponent.js.map +1 -0
- package/dist/components/core/common/GroupingComponent.tsx +452 -0
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts +18 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +152 -52
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +212 -35
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.d.ts +19 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.js +90 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.tsx +59 -0
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js +17 -28
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx +71 -56
- package/dist/components/core/filter/SolidOneToManyFilterElement.d.ts +2 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.d.ts.map +1 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.js +86 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.js.map +1 -0
- package/dist/components/core/filter/SolidOneToManyFilterElement.tsx +62 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.d.ts +1 -0
- package/dist/components/core/filter/SolidVarInputsFilterElement.d.ts.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.js +4 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.js.map +1 -1
- package/dist/components/core/filter/SolidVarInputsFilterElement.tsx +10 -0
- package/dist/components/core/filter/fields/SolidRelationField.d.ts.map +1 -1
- package/dist/components/core/filter/fields/SolidRelationField.js +4 -2
- package/dist/components/core/filter/fields/SolidRelationField.js.map +1 -1
- package/dist/components/core/filter/fields/SolidRelationField.tsx +4 -2
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.d.ts +4 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.js +25 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.js.map +1 -0
- package/dist/components/core/filter/fields/relations/SolidRelationOneToManyField.tsx +60 -0
- package/dist/components/core/form/SolidFormFooter.js +4 -4
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +4 -4
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +11 -8
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.tsx +20 -8
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts +40 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +317 -157
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +463 -243
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +46 -95
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +57 -113
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.d.ts +15 -4
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.js +220 -33
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.js.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/useRelationEntityHandler.ts +167 -36
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +13 -12
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +8 -7
- package/dist/components/core/list/SolidListView.d.ts +18 -10
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +176 -177
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +130 -143
- package/dist/components/core/list/SolidListViewConfigure.d.ts +7 -0
- package/dist/components/core/list/SolidListViewConfigure.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.js +6 -5
- package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
- package/dist/components/core/list/SolidListViewConfigure.tsx +21 -12
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +1 -37
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.tsx +0 -41
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +9 -5
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +14 -3
- package/dist/components/core/list/listViewRegistry.js.map +1 -1
- package/dist/components/core/list/listViewRegistry.ts +1 -2
- package/dist/components/core/tree/SolidTreeView.d.ts +38 -0
- package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -0
- package/dist/components/core/tree/SolidTreeView.js +1179 -0
- package/dist/components/core/tree/SolidTreeView.js.map +1 -0
- package/dist/components/core/tree/SolidTreeView.tsx +1637 -0
- package/dist/components/core/tree/treeViewRegistry.d.ts +7 -0
- package/dist/components/core/tree/treeViewRegistry.d.ts.map +1 -0
- package/dist/components/core/tree/treeViewRegistry.js +17 -0
- package/dist/components/core/tree/treeViewRegistry.js.map +1 -0
- package/dist/components/core/tree/treeViewRegistry.ts +23 -0
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +19 -6
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +39 -0
- package/dist/helpers/helpers.d.ts +2 -0
- package/dist/helpers/helpers.d.ts.map +1 -1
- package/dist/helpers/helpers.js +3 -1
- package/dist/helpers/helpers.js.map +1 -1
- package/dist/helpers/helpers.ts +4 -1
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +5 -1
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +7 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +6 -1
- package/dist/resources/globals.css +32 -4
- package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.js +2 -2
- package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
- package/dist/routes/pages/admin/core/ListPage.tsx +3 -2
- package/dist/routes/pages/admin/core/ModuleHomePage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/ModuleHomePage.js +4 -15
- package/dist/routes/pages/admin/core/ModuleHomePage.js.map +1 -1
- package/dist/routes/pages/admin/core/ModuleHomePage.tsx +4 -3
- package/dist/routes/pages/admin/core/TreePage.d.ts +2 -0
- package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/TreePage.js +37 -0
- package/dist/routes/pages/admin/core/TreePage.js.map +1 -0
- package/dist/routes/pages/admin/core/TreePage.tsx +30 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +3 -1
- package/dist/routes/types.d.ts +1 -1
- package/dist/routes/types.d.ts.map +1 -1
- package/dist/routes/types.js.map +1 -1
- package/dist/routes/types.ts +1 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/solid-core.d.ts +40 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { Divider } from "primereact/divider";
|
|
|
6
6
|
import { usePathname } from "../../../hooks/usePathname";
|
|
7
7
|
import { useRouter } from "../../../hooks/useRouter";
|
|
8
8
|
import { useSearchParams } from "../../../hooks/useSearchParams";
|
|
9
|
-
import {
|
|
9
|
+
import { getFilterObjectFromLocalStorage } from "../list/SolidListView";
|
|
10
10
|
import { InputText } from "primereact/inputtext";
|
|
11
11
|
import { createSolidEntityApi } from "../../../redux/api/solidEntityApi";
|
|
12
12
|
import qs from "qs";
|
|
@@ -14,6 +14,8 @@ import { SolidSaveCustomFilterForm } from "./SolidSaveCustomFilterForm";
|
|
|
14
14
|
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
15
15
|
import { hydrateRelationRules } from "../../../helpers/hydrateRelationRules";
|
|
16
16
|
import { useSession } from '../../../hooks/useSession'
|
|
17
|
+
import GroupingComponent, { AggregationRule, GroupingRule, DateGroupingFormat } from "./GroupingComponent";
|
|
18
|
+
|
|
17
19
|
|
|
18
20
|
const getRandomInt = (min: number, max: number) => {
|
|
19
21
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
@@ -25,6 +27,24 @@ interface PredefinedSearch {
|
|
|
25
27
|
filters: Record<string, any>;
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
export type SearchableField = {
|
|
31
|
+
fieldName: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
searchField: string;
|
|
34
|
+
matchMode: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type GroupableField = {
|
|
38
|
+
fieldName: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
searchField: string;
|
|
41
|
+
matchMode: string;
|
|
42
|
+
type: string;
|
|
43
|
+
ormType: string;
|
|
44
|
+
relationType: string;
|
|
45
|
+
computedFieldValueType: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
28
48
|
const extractFields = (nodes: any[] = []): any[] => {
|
|
29
49
|
const result: any[] = [];
|
|
30
50
|
|
|
@@ -354,7 +374,7 @@ export const mergeSearchAndCustomFilters = (transformedFilter: any, newFilter: a
|
|
|
354
374
|
}
|
|
355
375
|
|
|
356
376
|
|
|
357
|
-
export const mergeAllDiffFilters = (customFilter: any, searchFilter: any, savedFilter: any, preDefinedFilter?: any) => {
|
|
377
|
+
export const mergeAllDiffFilters = (customFilter: any, searchFilter: any, savedFilter: any, preDefinedFilter?: any, groupingRules?: GroupingRule[], aggregationRules?: AggregationRule[]) => {
|
|
358
378
|
const filters: any = {};
|
|
359
379
|
|
|
360
380
|
// Add only non-null filters
|
|
@@ -370,6 +390,12 @@ export const mergeAllDiffFilters = (customFilter: any, searchFilter: any, savedF
|
|
|
370
390
|
if (preDefinedFilter && Object.keys(preDefinedFilter).length > 0) {
|
|
371
391
|
filters["predefined_search_predicate"] = preDefinedFilter;
|
|
372
392
|
}
|
|
393
|
+
if (groupingRules && Object.keys(groupingRules).length > 0) {
|
|
394
|
+
filters["grouping_rules"] = groupingRules;
|
|
395
|
+
}
|
|
396
|
+
if (aggregationRules && Object.keys(aggregationRules).length > 0) {
|
|
397
|
+
filters["aggregation_rules"] = aggregationRules;
|
|
398
|
+
}
|
|
373
399
|
// Return the combined filters object
|
|
374
400
|
return filters;
|
|
375
401
|
}
|
|
@@ -388,24 +414,28 @@ const SavedFilterList = ({ savedfilter, activeSavedFilter, applySavedFilter, ope
|
|
|
388
414
|
{/* {savedfilter?.description && <p className="text-xs pl-3">{savedfilter?.description}</p>} */}
|
|
389
415
|
</div>
|
|
390
416
|
<div className="flex align-items-center gap-2">
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
417
|
+
{savedfilter.isSeeded !== true &&
|
|
418
|
+
<>
|
|
419
|
+
<Button
|
|
420
|
+
icon="pi pi-pencil"
|
|
421
|
+
style={{ fontSize: 10 }}
|
|
422
|
+
severity="secondary"
|
|
423
|
+
outlined size="small"
|
|
424
|
+
onClick={() => openSavedCustomFilter(savedfilter)}
|
|
425
|
+
/>
|
|
426
|
+
<Button
|
|
427
|
+
icon="pi pi-trash"
|
|
428
|
+
style={{ fontSize: 10 }}
|
|
429
|
+
severity="secondary"
|
|
430
|
+
outlined size="small"
|
|
431
|
+
onClick={() => {
|
|
432
|
+
setSavedFilterTobeDeleted(savedfilter.id),
|
|
433
|
+
setIsDeleteSQDialogVisible(true);
|
|
434
|
+
}}
|
|
435
|
+
/>
|
|
436
|
+
</>
|
|
437
|
+
}
|
|
406
438
|
|
|
407
|
-
}}
|
|
408
|
-
/>
|
|
409
439
|
</div>
|
|
410
440
|
</div>
|
|
411
441
|
)
|
|
@@ -479,11 +509,13 @@ const extractChips = (node: any): any[] => {
|
|
|
479
509
|
return [];
|
|
480
510
|
};
|
|
481
511
|
|
|
512
|
+
|
|
513
|
+
|
|
482
514
|
type RelationCache = Map<string, { label: string; value: number }>;
|
|
483
515
|
|
|
484
516
|
|
|
485
517
|
|
|
486
|
-
export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCustomFilter, showSaveFilterPopup, setShowSaveFilterPopup, filterPredicates }: any, ref) => {
|
|
518
|
+
export const SolidGlobalSearchElement = forwardRef(({ viewData, viewType, handleApplyCustomFilter, showSaveFilterPopup, setShowSaveFilterPopup, filterPredicates }: any, ref) => {
|
|
487
519
|
const defaultState: FilterRule[] = [
|
|
488
520
|
{
|
|
489
521
|
id: 1,
|
|
@@ -512,6 +544,20 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
512
544
|
]
|
|
513
545
|
}
|
|
514
546
|
];
|
|
547
|
+
|
|
548
|
+
const defaultAggregationRules: AggregationRule[] = [
|
|
549
|
+
{
|
|
550
|
+
id: 1,
|
|
551
|
+
operator: "count",
|
|
552
|
+
fieldName: "id",
|
|
553
|
+
locked: true
|
|
554
|
+
}
|
|
555
|
+
];
|
|
556
|
+
|
|
557
|
+
const defaultGroupingRules: GroupingRule[] = [
|
|
558
|
+
{ id: 1, fieldName: null, dateGrouping: null }
|
|
559
|
+
];
|
|
560
|
+
|
|
515
561
|
const [initialState, setInitialState] = useState(defaultState);
|
|
516
562
|
const pathname = usePathname();
|
|
517
563
|
|
|
@@ -530,6 +576,10 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
530
576
|
|
|
531
577
|
const [fields, setFields] = useState<any[]>([]);
|
|
532
578
|
const [searchableFields, setSearchableFields] = useState<any[]>([]);
|
|
579
|
+
const [groupableFields, setGroupableFields] = useState<GroupableField[]>([]);
|
|
580
|
+
|
|
581
|
+
const [groupingRules, setGroupingRules] = useState<GroupingRule[]>(defaultGroupingRules);
|
|
582
|
+
const [aggregationRules, setAggregationRules] = useState<AggregationRule[]>(defaultAggregationRules);
|
|
533
583
|
|
|
534
584
|
// used to show the list of predefined searches
|
|
535
585
|
const [predefinedSearches, setPredefinedSearches] = useState<PredefinedSearch[]>([]);
|
|
@@ -537,6 +587,10 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
537
587
|
// used to open / close the custom fitler popup
|
|
538
588
|
const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
|
|
539
589
|
|
|
590
|
+
// used to open / close the group fitler popup
|
|
591
|
+
const [showGroupFilterElement, setShowGroupFilterElement] = useState<boolean>(false);
|
|
592
|
+
|
|
593
|
+
|
|
540
594
|
// searchChips maintain the ui to display searched query
|
|
541
595
|
// searchFilter maintain the transformed filter of the searched query
|
|
542
596
|
const [searchChips, setSearchChips] = useState<{ columnName?: string; value: string }[]>([]);
|
|
@@ -670,7 +724,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
670
724
|
|
|
671
725
|
if (activeSavedFilter && savedFilters.length === 0) return;
|
|
672
726
|
|
|
673
|
-
const queryObject =
|
|
727
|
+
const queryObject = getFilterObjectFromLocalStorage();
|
|
674
728
|
// const savedQuery = parsedSearchParams?.get("savedQuery");
|
|
675
729
|
if (activeSavedFilter) {
|
|
676
730
|
const currentSavedFilterId = Number(activeSavedFilter);
|
|
@@ -717,6 +771,31 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
717
771
|
const hydratedRules = await hydrateRelationRules([rules], viewData);
|
|
718
772
|
setFilterRules(hydratedRules);
|
|
719
773
|
}
|
|
774
|
+
const hasGroupingRules = (queryObject?.grouping_rules?.some((rule: any) => rule.fieldName !== null));
|
|
775
|
+
|
|
776
|
+
if (hasGroupingRules) {
|
|
777
|
+
setGroupingRules(queryObject?.grouping_rules);
|
|
778
|
+
} else {
|
|
779
|
+
// If no grouping rules in localStorage check layout
|
|
780
|
+
const layoutGroupBy = viewData?.data?.solidView?.layout?.attrs?.groupBy;
|
|
781
|
+
|
|
782
|
+
if (Array.isArray(layoutGroupBy) && layoutGroupBy.length > 0) {
|
|
783
|
+
const initialGroupingRules: GroupingRule[] = layoutGroupBy.map((groupStr: string, index: number) => {
|
|
784
|
+
const [fieldName, dateGrouping] = groupStr.split(":");
|
|
785
|
+
return {
|
|
786
|
+
id: Date.now() + index,
|
|
787
|
+
fieldName: fieldName || null,
|
|
788
|
+
dateGrouping: (dateGrouping as DateGroupingFormat) || null
|
|
789
|
+
};
|
|
790
|
+
});
|
|
791
|
+
setGroupingRules(initialGroupingRules);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
if (queryObject?.aggregation_rules && queryObject?.aggregation_rules !== aggregationRules) {
|
|
796
|
+
setAggregationRules(queryObject?.aggregation_rules);
|
|
797
|
+
}
|
|
798
|
+
|
|
720
799
|
|
|
721
800
|
setRefreshKey((prev) => prev + 1)
|
|
722
801
|
setHasSearched(true);
|
|
@@ -791,6 +870,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
791
870
|
matchMode: viewFieldElement?.attrs?.searchMatchMode,
|
|
792
871
|
searchField: viewFieldElement?.attrs?.searchField ?? null,
|
|
793
872
|
isSearchable: viewFieldElement?.attrs?.isSearchable ?? false,
|
|
873
|
+
relationType: value?.relationType ?? null,
|
|
794
874
|
};
|
|
795
875
|
});
|
|
796
876
|
|
|
@@ -816,8 +896,30 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
816
896
|
}
|
|
817
897
|
});
|
|
818
898
|
|
|
819
|
-
|
|
820
|
-
|
|
899
|
+
const groupableFieldsList = fieldsList.filter((field: any) => {
|
|
900
|
+
switch (field.type) {
|
|
901
|
+
case "relation":
|
|
902
|
+
// Only include relation if searchField is present
|
|
903
|
+
if (field.relationType === "many-to-one")
|
|
904
|
+
return true;
|
|
905
|
+
return false;
|
|
906
|
+
case "longText":
|
|
907
|
+
case "shortText":
|
|
908
|
+
case "selectionStatic":
|
|
909
|
+
case "selectionDynamic":
|
|
910
|
+
case "int":
|
|
911
|
+
case "float":
|
|
912
|
+
case "boolean":
|
|
913
|
+
case "date":
|
|
914
|
+
case "datetime":
|
|
915
|
+
return true;
|
|
916
|
+
// case "selectionStatic":
|
|
917
|
+
case "computed":
|
|
918
|
+
return field.ormType === "varchar";
|
|
919
|
+
default:
|
|
920
|
+
return false;
|
|
921
|
+
}
|
|
922
|
+
});
|
|
821
923
|
|
|
822
924
|
// Optionally map to a minimal structure if needed for UI
|
|
823
925
|
let finalSearchableFieldsList: any = searchableFieldsList.map((field: any) => ({
|
|
@@ -827,10 +929,21 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
827
929
|
matchMode: field.matchMode
|
|
828
930
|
}));
|
|
829
931
|
|
|
830
|
-
// console.log("finalSearchableFieldsList", finalSearchableFieldsList);
|
|
831
|
-
|
|
832
932
|
setSearchableFields(finalSearchableFieldsList);
|
|
833
933
|
|
|
934
|
+
let finalGroupableFieldsList: any = groupableFieldsList.map((field: any) => ({
|
|
935
|
+
fieldName: field.value,
|
|
936
|
+
displayName: field.name,
|
|
937
|
+
searchField: field.searchField ?? "",
|
|
938
|
+
matchMode: field.matchMode,
|
|
939
|
+
type: field.type,
|
|
940
|
+
ormType: field.ormType,
|
|
941
|
+
relationType: field.relationType,
|
|
942
|
+
computedFieldValueType: field.computedFieldValueType
|
|
943
|
+
}));
|
|
944
|
+
|
|
945
|
+
setGroupableFields(finalGroupableFieldsList)
|
|
946
|
+
|
|
834
947
|
const predefinedSearchesList = viewData?.data?.solidView?.layout?.attrs?.predefinedSearches || [];
|
|
835
948
|
setPredefinedSearches(predefinedSearchesList);
|
|
836
949
|
}
|
|
@@ -922,10 +1035,16 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
922
1035
|
|
|
923
1036
|
}
|
|
924
1037
|
|
|
1038
|
+
const applyGrouping = (groupingRules: GroupingRule[], aggregationRules: AggregationRule[]) => {
|
|
1039
|
+
setHasSearched(true)
|
|
1040
|
+
setShowGroupFilterElement(false);
|
|
1041
|
+
setGroupingRules(groupingRules);
|
|
1042
|
+
setAggregationRules(aggregationRules);
|
|
1043
|
+
setRefreshKey((prev) => prev + 1)
|
|
1044
|
+
}
|
|
1045
|
+
|
|
925
1046
|
useEffect(() => {
|
|
926
1047
|
if (refreshKey > 0 && hasSearched) {
|
|
927
|
-
console.log("refres", refreshKey);
|
|
928
|
-
console.log("hasSearched", hasSearched);
|
|
929
1048
|
|
|
930
1049
|
const formattedChips = {
|
|
931
1050
|
$and: searchChips.map((chip: any) => ({
|
|
@@ -944,7 +1063,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
944
1063
|
const finalPredefinedFilter = predefinedSearchBaseFilter
|
|
945
1064
|
|
|
946
1065
|
const finalCustomFilter = customFilter
|
|
947
|
-
const finalFilter = mergeAllDiffFilters(finalCustomFilter, finalSearchFilter, finalSavedFilter, finalPredefinedFilter)
|
|
1066
|
+
const finalFilter = mergeAllDiffFilters(finalCustomFilter, finalSearchFilter, finalSavedFilter, finalPredefinedFilter, groupingRules, aggregationRules)
|
|
948
1067
|
handleApplyCustomFilter(finalFilter, true);
|
|
949
1068
|
setHasSearched(false)
|
|
950
1069
|
// }
|
|
@@ -1006,8 +1125,8 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1006
1125
|
} else {
|
|
1007
1126
|
console.error(ERROR_MESSAGES.SAVE_FILTER_UNDEFINED_NULL);
|
|
1008
1127
|
}
|
|
1009
|
-
|
|
1010
1128
|
}
|
|
1129
|
+
|
|
1011
1130
|
const deleteSavedFilter = async () => {
|
|
1012
1131
|
// delte the saved filter with id
|
|
1013
1132
|
await deleteEntity(savedFilterTobeDeleted);
|
|
@@ -1170,7 +1289,6 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1170
1289
|
}
|
|
1171
1290
|
}
|
|
1172
1291
|
|
|
1173
|
-
|
|
1174
1292
|
const SavedFiltersChip = () => {
|
|
1175
1293
|
|
|
1176
1294
|
return (
|
|
@@ -1212,6 +1330,40 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1212
1330
|
)
|
|
1213
1331
|
};
|
|
1214
1332
|
|
|
1333
|
+
const removeGrouping = () => {
|
|
1334
|
+
setGroupingRules(defaultGroupingRules);
|
|
1335
|
+
setAggregationRules(defaultAggregationRules);
|
|
1336
|
+
setHasSearched(true);
|
|
1337
|
+
setRefreshKey((prev) => prev + 1)
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
const GroupingChip = () => {
|
|
1341
|
+
return (
|
|
1342
|
+
<li className="solid-global-search-chip">
|
|
1343
|
+
<div className="flex align-items-center gap-2">
|
|
1344
|
+
<div className="flex align-items-center gap-2">
|
|
1345
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
1346
|
+
|
|
1347
|
+
onClick={() => setShowGroupFilterElement(true)}
|
|
1348
|
+
>
|
|
1349
|
+
<rect width="20" height="20" rx="4" fill="#722ED1" />
|
|
1350
|
+
<path d="M8.66667 15V13.3333H11.3333V15H8.66667ZM6 10.8333V9.16667H14V10.8333H6ZM4 6.66667V5H16V6.66667H4Z"
|
|
1351
|
+
fill="white" />
|
|
1352
|
+
</svg>
|
|
1353
|
+
<span><strong>{groupingRules.length}</strong> Grouping rules applied</span>
|
|
1354
|
+
</div>
|
|
1355
|
+
|
|
1356
|
+
{/* button to clear filter */}
|
|
1357
|
+
<a onClick={removeGrouping}
|
|
1358
|
+
style={{ cursor: "pointer" }}
|
|
1359
|
+
>
|
|
1360
|
+
<i className="pi pi-times ml-1">
|
|
1361
|
+
</i></a>
|
|
1362
|
+
</div>
|
|
1363
|
+
</li>
|
|
1364
|
+
)
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1215
1367
|
|
|
1216
1368
|
|
|
1217
1369
|
|
|
@@ -1312,7 +1464,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1312
1464
|
}
|
|
1313
1465
|
|
|
1314
1466
|
try {
|
|
1315
|
-
// Replace {{search}} placeholders with actual search value
|
|
1467
|
+
// Replace {{ search }} placeholders with actual search value
|
|
1316
1468
|
const processedFilter = replacePlaceholders(predefinedSearch.filters, inputValue.trim());
|
|
1317
1469
|
|
|
1318
1470
|
// Clear all existing filters and searches
|
|
@@ -1383,6 +1535,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1383
1535
|
{currentSavedFilterData && <SavedFiltersChip />}
|
|
1384
1536
|
{predefinedSearchChip && <PredefinedSearchChip />}
|
|
1385
1537
|
{customFilter && <CustomChip />}
|
|
1538
|
+
{groupingRules.length > 0 && groupingRules.some(r => r.fieldName !== null) && <GroupingChip />}
|
|
1386
1539
|
<SearchChip />
|
|
1387
1540
|
<li ref={chipsRef}>
|
|
1388
1541
|
<div className="relative solid-global-search-element-wrapper">
|
|
@@ -1509,8 +1662,11 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1509
1662
|
<Divider className="m-0" />
|
|
1510
1663
|
</>
|
|
1511
1664
|
}
|
|
1512
|
-
<div className="px-2 py-1">
|
|
1665
|
+
<div className="px-2 py-1 flex justify-content-between">
|
|
1513
1666
|
<Button text size="small" label="Custom Filter" iconPos="left" icon='pi pi-plus' onClick={() => setShowGlobalSearchElement(true)} className="font-bold" />
|
|
1667
|
+
{viewType === "tree" &&
|
|
1668
|
+
<Button text size="small" label="Grouping" iconPos="left" icon='pi pi-plus' onClick={() => setShowGroupFilterElement(true)} className="font-bold" />
|
|
1669
|
+
}
|
|
1514
1670
|
</div>
|
|
1515
1671
|
</div>
|
|
1516
1672
|
)
|
|
@@ -1521,19 +1677,40 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1521
1677
|
<Button icon="pi pi-times" rounded text aria-label="Cancel" type="reset" size="small" onClick={() => setShowGlobalSearchElement(false)} />
|
|
1522
1678
|
</div>
|
|
1523
1679
|
<Divider className="m-0" />
|
|
1524
|
-
<div className="p-
|
|
1680
|
+
<div className="p-2 lg:p-2">
|
|
1525
1681
|
{fields.length > 0 &&
|
|
1526
1682
|
<FilterComponent viewData={viewData} fields={fields} filterRules={filterRules} setFilterRules={setFilterRules} transformFilterRules={transformCustomFilterRules} closeDialog={() => setShowGlobalSearchElement(false)}></FilterComponent>
|
|
1527
1683
|
}
|
|
1528
1684
|
</div>
|
|
1529
1685
|
</Dialog>
|
|
1686
|
+
<Dialog header={false} className="solid-global-search-filter" showHeader={false} visible={showGroupFilterElement} style={{ width: '20vw' }} breakpoints={{ '1024px': '75vw', '991px': '90vw', '767px': '94w', '250px': '96vw' }} onHide={() => { if (!showGroupFilterElement) return; setShowGroupFilterElement(false); }}>
|
|
1687
|
+
<div className="flex align-items-center justify-content-between px-3">
|
|
1688
|
+
<h5 className="solid-custom-title m-0"></h5>
|
|
1689
|
+
<Button icon="pi pi-times" rounded text aria-label="Cancel" type="reset" size="small" onClick={() => setShowGroupFilterElement(false)} />
|
|
1690
|
+
</div>
|
|
1691
|
+
<Divider className="m-0" />
|
|
1692
|
+
<div className="p-2 lg:p-2">
|
|
1693
|
+
{groupableFields.length > 0 &&
|
|
1694
|
+
<GroupingComponent
|
|
1695
|
+
viewData={viewData}
|
|
1696
|
+
fields={groupableFields}
|
|
1697
|
+
groupingRules={groupingRules}
|
|
1698
|
+
setGroupingRules={setGroupingRules}
|
|
1699
|
+
aggregationRules={aggregationRules}
|
|
1700
|
+
setAggregationRules={setAggregationRules}
|
|
1701
|
+
applyGrouping={applyGrouping}
|
|
1702
|
+
closeDialog={() => setShowGroupFilterElement(false)}
|
|
1703
|
+
></GroupingComponent>
|
|
1704
|
+
}
|
|
1705
|
+
</div>
|
|
1706
|
+
</Dialog >
|
|
1530
1707
|
<Dialog header={false} className="solid-global-search-filter" showHeader={false} visible={showSavedFilterComponent} style={{ width: '65vw' }} breakpoints={{ '1024px': '75vw', '991px': '90vw', '767px': '94w', '250px': '96vw' }} onHide={() => { if (!showSavedFilterComponent) return; setShowSavedFilterComponent(false); }}>
|
|
1531
1708
|
<div className="flex align-items-center justify-content-between px-3">
|
|
1532
1709
|
<h5 className="solid-custom-title m-0">Saved Filter</h5>
|
|
1533
1710
|
<Button icon="pi pi-times" rounded text aria-label="Cancel" type="reset" size="small" onClick={() => setShowSavedFilterComponent(false)} />
|
|
1534
1711
|
</div>
|
|
1535
1712
|
<Divider className="m-0" />
|
|
1536
|
-
<div className="p-
|
|
1713
|
+
<div className="p-2 lg:p-2">
|
|
1537
1714
|
{fields.length > 0 &&
|
|
1538
1715
|
<FilterComponent viewData={viewData} fields={fields} filterRules={currentSavedFilterRules} setFilterRules={setCurrentSavedFilterRules} transformFilterRules={transformSavedFilterRules} closeDialog={() => setShowSavedFilterComponent(false)}></FilterComponent>
|
|
1539
1716
|
}
|
|
@@ -1558,7 +1735,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
1558
1735
|
>
|
|
1559
1736
|
<p>Are you sure you want to delete the {currentSavedFilterData?.name} saved query?</p>
|
|
1560
1737
|
</Dialog>
|
|
1561
|
-
</div>
|
|
1738
|
+
</div >
|
|
1562
1739
|
{/* <div>
|
|
1563
1740
|
<Button
|
|
1564
1741
|
icon="pi pi-save"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const hanldeModelSequenceFormViewChange: (event: any) => Promise<{
|
|
2
|
+
layoutChanged: boolean;
|
|
3
|
+
dataChanged: boolean;
|
|
4
|
+
newFormData: {
|
|
5
|
+
model: null;
|
|
6
|
+
field: null;
|
|
7
|
+
};
|
|
8
|
+
newLayout: import("../../../../..").LayoutNode;
|
|
9
|
+
} | {
|
|
10
|
+
layoutChanged: boolean;
|
|
11
|
+
dataChanged: boolean;
|
|
12
|
+
newFormData: {
|
|
13
|
+
field: null;
|
|
14
|
+
model?: undefined;
|
|
15
|
+
};
|
|
16
|
+
newLayout: import("../../../../..").LayoutNode;
|
|
17
|
+
} | undefined>;
|
|
18
|
+
export default hanldeModelSequenceFormViewChange;
|
|
19
|
+
//# sourceMappingURL=modelSequenceFormViewChangeHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelSequenceFormViewChangeHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,iCAAiC,UAAiB,GAAG;;;;;;;;;;;;;;;;cAuD1D,CAAA;AACD,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { SolidViewLayoutManager } from "../../../../../components/core/common/SolidViewLayoutManager";
|
|
38
|
+
var hanldeModelSequenceFormViewChange = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
39
|
+
var modifiedField, modifiedFieldValue, formViewLayout, layout, layoutManager, modelWhereClause, fieldWhereClauseOnModule, fieldWhereClauseOnModel;
|
|
40
|
+
return __generator(this, function (_a) {
|
|
41
|
+
console.log("event", event);
|
|
42
|
+
modifiedField = event.modifiedField, modifiedFieldValue = event.modifiedFieldValue, formViewLayout = event.formViewLayout;
|
|
43
|
+
layout = formViewLayout;
|
|
44
|
+
layoutManager = new SolidViewLayoutManager(layout);
|
|
45
|
+
if (modifiedField === 'module') {
|
|
46
|
+
modelWhereClause = {
|
|
47
|
+
module: {
|
|
48
|
+
id: { $eq: modifiedFieldValue.id }
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
fieldWhereClauseOnModule = {
|
|
52
|
+
model: {
|
|
53
|
+
module: {
|
|
54
|
+
id: { $eq: modifiedFieldValue.id }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
layoutManager.updateNodeAttributes('model', { "whereClause": JSON.stringify(modelWhereClause) });
|
|
59
|
+
layoutManager.updateNodeAttributes('field', { "whereClause": JSON.stringify(fieldWhereClauseOnModule) });
|
|
60
|
+
return [2 /*return*/, {
|
|
61
|
+
layoutChanged: true,
|
|
62
|
+
dataChanged: true,
|
|
63
|
+
newFormData: {
|
|
64
|
+
model: null,
|
|
65
|
+
field: null
|
|
66
|
+
},
|
|
67
|
+
newLayout: layoutManager.getLayout(),
|
|
68
|
+
}];
|
|
69
|
+
}
|
|
70
|
+
if (modifiedField === 'model') {
|
|
71
|
+
fieldWhereClauseOnModel = {
|
|
72
|
+
model: {
|
|
73
|
+
id: { $eq: modifiedFieldValue.id }
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
layoutManager.updateNodeAttributes('field', { "whereClause": JSON.stringify(fieldWhereClauseOnModel) });
|
|
77
|
+
return [2 /*return*/, {
|
|
78
|
+
layoutChanged: true,
|
|
79
|
+
dataChanged: true,
|
|
80
|
+
newFormData: {
|
|
81
|
+
field: null
|
|
82
|
+
},
|
|
83
|
+
newLayout: layoutManager.getLayout(),
|
|
84
|
+
}];
|
|
85
|
+
}
|
|
86
|
+
return [2 /*return*/];
|
|
87
|
+
});
|
|
88
|
+
}); };
|
|
89
|
+
export default hanldeModelSequenceFormViewChange;
|
|
90
|
+
//# sourceMappingURL=modelSequenceFormViewChangeHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelSequenceFormViewChangeHandler.js","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/modelSequence/modelSequenceFormViewChangeHandler.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,IAAM,iCAAiC,GAAG,UAAO,KAAU;;;QAEvD,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAEnB,aAAa,GAAyC,KAAK,cAA9C,EAAE,kBAAkB,GAAqB,KAAK,mBAA1B,EAAE,cAAc,GAAK,KAAK,eAAV,CAAW;QAE9D,MAAM,GAAG,cAAc,CAAC;QACxB,aAAa,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,aAAa,KAAK,QAAQ,EAAE;YAEtB,gBAAgB,GAAG;gBACrB,MAAM,EAAE;oBACJ,EAAE,EAAE,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,EAAE;iBACrC;aACJ,CAAC;YACI,wBAAwB,GAAG;gBAC7B,KAAK,EAAE;oBACH,MAAM,EAAE;wBACJ,EAAE,EAAE,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,EAAE;qBACrC;iBACJ;aACJ,CAAC;YAEF,aAAa,CAAC,oBAAoB,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACjG,aAAa,CAAC,oBAAoB,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;YAEzG,sBAAO;oBACH,aAAa,EAAE,IAAI;oBACnB,WAAW,EAAE,IAAI;oBACjB,WAAW,EAAE;wBACT,KAAK,EAAE,IAAI;wBACX,KAAK,EAAE,IAAI;qBACd;oBACD,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE;iBACvC,EAAA;SACJ;QACD,IAAI,aAAa,KAAK,OAAO,EAAE;YAErB,uBAAuB,GAAG;gBAC5B,KAAK,EAAE;oBACH,EAAE,EAAE,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,EAAE;iBACrC;aACJ,CAAC;YAEF,aAAa,CAAC,oBAAoB,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;YAExG,sBAAO;oBACH,aAAa,EAAE,IAAI;oBACnB,WAAW,EAAE,IAAI;oBACjB,WAAW,EAAE;wBACT,KAAK,EAAE,IAAI;qBACd;oBACD,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE;iBACvC,EAAA;SACJ;;;KACJ,CAAA;AACD,eAAe,iCAAiC,CAAC","sourcesContent":["import { SolidViewLayoutManager } from \"../../../../../components/core/common/SolidViewLayoutManager\";\n\nconst hanldeModelSequenceFormViewChange = async (event: any) => {\n\n console.log(\"event\", event)\n\n const { modifiedField, modifiedFieldValue, formViewLayout } = event;\n\n const layout = formViewLayout;\n const layoutManager = new SolidViewLayoutManager(layout);\n if (modifiedField === 'module') {\n // module change\n const modelWhereClause = {\n module: {\n id: { $eq: modifiedFieldValue.id }\n }\n };\n const fieldWhereClauseOnModule = {\n model: {\n module: {\n id: { $eq: modifiedFieldValue.id }\n }\n }\n };\n\n layoutManager.updateNodeAttributes('model', { \"whereClause\": JSON.stringify(modelWhereClause) });\n layoutManager.updateNodeAttributes('field', { \"whereClause\": JSON.stringify(fieldWhereClauseOnModule) });\n\n return {\n layoutChanged: true,\n dataChanged: true,\n newFormData: {\n model: null,\n field: null\n },\n newLayout: layoutManager.getLayout(),\n }\n }\n if (modifiedField === 'model') {\n // model change\n const fieldWhereClauseOnModel = {\n model: {\n id: { $eq: modifiedFieldValue.id }\n }\n };\n\n layoutManager.updateNodeAttributes('field', { \"whereClause\": JSON.stringify(fieldWhereClauseOnModel) });\n\n return {\n layoutChanged: true,\n dataChanged: true,\n newFormData: {\n field: null\n },\n newLayout: layoutManager.getLayout(),\n }\n }\n}\nexport default hanldeModelSequenceFormViewChange;"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SolidViewLayoutManager } from "../../../../../components/core/common/SolidViewLayoutManager";
|
|
2
|
+
|
|
3
|
+
const hanldeModelSequenceFormViewChange = async (event: any) => {
|
|
4
|
+
|
|
5
|
+
console.log("event", event)
|
|
6
|
+
|
|
7
|
+
const { modifiedField, modifiedFieldValue, formViewLayout } = event;
|
|
8
|
+
|
|
9
|
+
const layout = formViewLayout;
|
|
10
|
+
const layoutManager = new SolidViewLayoutManager(layout);
|
|
11
|
+
if (modifiedField === 'module') {
|
|
12
|
+
// module change
|
|
13
|
+
const modelWhereClause = {
|
|
14
|
+
module: {
|
|
15
|
+
id: { $eq: modifiedFieldValue.id }
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const fieldWhereClauseOnModule = {
|
|
19
|
+
model: {
|
|
20
|
+
module: {
|
|
21
|
+
id: { $eq: modifiedFieldValue.id }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
layoutManager.updateNodeAttributes('model', { "whereClause": JSON.stringify(modelWhereClause) });
|
|
27
|
+
layoutManager.updateNodeAttributes('field', { "whereClause": JSON.stringify(fieldWhereClauseOnModule) });
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
layoutChanged: true,
|
|
31
|
+
dataChanged: true,
|
|
32
|
+
newFormData: {
|
|
33
|
+
model: null,
|
|
34
|
+
field: null
|
|
35
|
+
},
|
|
36
|
+
newLayout: layoutManager.getLayout(),
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (modifiedField === 'model') {
|
|
40
|
+
// model change
|
|
41
|
+
const fieldWhereClauseOnModel = {
|
|
42
|
+
model: {
|
|
43
|
+
id: { $eq: modifiedFieldValue.id }
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
layoutManager.updateNodeAttributes('field', { "whereClause": JSON.stringify(fieldWhereClauseOnModel) });
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
layoutChanged: true,
|
|
51
|
+
dataChanged: true,
|
|
52
|
+
newFormData: {
|
|
53
|
+
field: null
|
|
54
|
+
},
|
|
55
|
+
newLayout: layoutManager.getLayout(),
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export default hanldeModelSequenceFormViewChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RolePermissionsManyToManyFieldWidget.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RolePermissionsManyToManyFieldWidget.d.ts","sourceRoot":"","sources":["../../../../../../src/components/core/extension/solid-core/roleMetadata/RolePermissionsManyToManyFieldWidget.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAe5E,eAAO,MAAM,oCAAoC,6BAA8B,yBAAyB,4CA2HvG,CAAC"}
|