@solidstarters/solid-core-ui 1.1.66 → 1.1.68

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.
Files changed (61) hide show
  1. package/dist/components/Svg/FileSvg.d.ts.map +1 -1
  2. package/dist/components/Svg/FileSvg.js +1 -1
  3. package/dist/components/Svg/FileSvg.js.map +1 -1
  4. package/dist/components/core/common/FilterComponent.d.ts.map +1 -1
  5. package/dist/components/core/common/FilterComponent.js +1 -1
  6. package/dist/components/core/common/FilterComponent.js.map +1 -1
  7. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  8. package/dist/components/core/common/SolidGlobalSearchElement.js +26 -13
  9. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  10. package/dist/components/core/list/ListViewRowActionPopup.d.ts.map +1 -1
  11. package/dist/components/core/list/ListViewRowActionPopup.js +21 -5
  12. package/dist/components/core/list/ListViewRowActionPopup.js.map +1 -1
  13. package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
  14. package/dist/components/core/list/columns/SolidShortTextColumn.js +12 -1
  15. package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
  16. package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.d.ts +2 -0
  17. package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.d.ts.map +1 -0
  18. package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.js +7 -0
  19. package/dist/components/core/list/widgets/SolidShortTextFieldTextRenderModeWidget.js.map +1 -0
  20. package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.d.ts +2 -0
  21. package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.d.ts.map +1 -0
  22. package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.js +36 -0
  23. package/dist/components/core/list/widgets/SolidUserNameAvatarWidget.js.map +1 -0
  24. package/dist/components/core/model/CreateModel.js +1 -1
  25. package/dist/components/core/model/CreateModel.js.map +1 -1
  26. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  27. package/dist/components/core/model/FieldMetaDataForm.js +73 -50
  28. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  29. package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
  30. package/dist/components/core/model/ModelMetaData.js +17 -15
  31. package/dist/components/core/model/ModelMetaData.js.map +1 -1
  32. package/dist/components/core/users/CreateUser.d.ts.map +1 -1
  33. package/dist/components/core/users/CreateUser.js +9 -3
  34. package/dist/components/core/users/CreateUser.js.map +1 -1
  35. package/dist/helpers/registry.d.ts.map +1 -1
  36. package/dist/helpers/registry.js +8 -1
  37. package/dist/helpers/registry.js.map +1 -1
  38. package/dist/redux/api/modelApi.js +1 -1
  39. package/dist/redux/api/modelApi.js.map +1 -1
  40. package/dist/resources/globals.css +17 -69
  41. package/dist/resources/stylesheets/_menu.scss +0 -5
  42. package/dist/resources/themes/solid-dark-purple/theme.css +844 -741
  43. package/dist/resources/themes/solid-light-purple/theme.css +109 -3
  44. package/package.json +1 -1
  45. package/src/components/Svg/FileSvg.tsx +13 -12
  46. package/src/components/core/common/FilterComponent.tsx +3 -7
  47. package/src/components/core/common/SolidGlobalSearchElement.tsx +23 -15
  48. package/src/components/core/list/ListViewRowActionPopup.tsx +9 -2
  49. package/src/components/core/list/columns/SolidShortTextColumn.tsx +11 -2
  50. package/src/components/core/list/widgets/SolidUserNameAvatarWidget.tsx +52 -0
  51. package/src/components/core/model/CreateModel.tsx +1 -1
  52. package/src/components/core/model/FieldMetaDataForm.tsx +86 -12
  53. package/src/components/core/model/ModelMetaData.tsx +22 -9
  54. package/src/components/core/users/CreateUser.tsx +10 -6
  55. package/src/helpers/registry.ts +11 -1
  56. package/src/redux/api/modelApi.ts +1 -1
  57. package/src/resources/globals.css +17 -69
  58. package/src/resources/stylesheets/_menu.scss +0 -5
  59. package/src/resources/themes/solid-dark-purple/theme.css +844 -741
  60. package/src/resources/themes/solid-light-purple/theme.css +109 -3
  61. /package/src/components/core/list/widgets/{SolidShortTextFieldTextRenderModeWidget copy.tsx → SolidShortTextFieldTextRenderModeWidget.tsx} +0 -0
@@ -43,6 +43,7 @@
43
43
  --maskbg: rgba(0, 0, 0, 0.4);
44
44
  --primary-light-color: #D8E2EA;
45
45
  --highlight-bg: #F5F5F5;
46
+ --hightlight-bg-secondary: #FAFAFA;
46
47
  --highlight-text-color: #4C1D95;
47
48
  --icon-color: #000000E0;
48
49
  --auth-title-color: #000000;
@@ -59,6 +60,13 @@
59
60
  --solid-stepper-border: #CFD6DC;
60
61
  --solid-setting-title: rgba(0, 0, 0, 0.88);
61
62
  --solid-dark-title: rgba(0, 0, 0, 0.88);
63
+ --solid-dropzone-bg: rgba(255, 255, 255, 0.60);
64
+ --solid-file-wrapper: #E0E0E0;
65
+ --solid-chatter-dash: #00000026;
66
+ --solid-chatter-date-border: rgba(0, 0, 0, 0.15);
67
+ --solid-chatter-input-bg: #FEFCFF;
68
+ --solid-chatter-input-placeholder: rgba(51, 51, 51, 0.20);
69
+ --solid-kanban-wrapper: #E0E0E0;
62
70
  color-scheme: light;
63
71
  }
64
72
 
@@ -337,6 +345,7 @@
337
345
  /* box-shadow: 0 0 0 0.2rem #d3b5f5; */
338
346
  border-color: #722ED1;
339
347
  }
348
+
340
349
  .p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-input-token input {
341
350
  font-family: var(--font-family);
342
351
  font-feature-settings: var(--font-feature-settings, normal);
@@ -1686,7 +1695,7 @@
1686
1695
  box-shadow: 0 0 0 0.2rem #d3b5f5;
1687
1696
  }
1688
1697
 
1689
-
1698
+
1690
1699
  .p-treeselect-panel .p-treeselect-items-wrapper .p-treeselect-empty-message {
1691
1700
  padding: 0.75rem 1.25rem;
1692
1701
  color: #4b5563;
@@ -3443,7 +3452,7 @@
3443
3452
  border-bottom: 0 none;
3444
3453
  }
3445
3454
 
3446
-
3455
+
3447
3456
  .p-picklist .p-picklist-filter-container .p-picklist-filter-icon {
3448
3457
  right: 0.75rem;
3449
3458
  color: #6b7280;
@@ -4546,7 +4555,7 @@
4546
4555
  border-top-left-radius: 6px;
4547
4556
  }
4548
4557
 
4549
-
4558
+
4550
4559
  .p-megamenu .p-submenu-list .p-menuitem-separator {
4551
4560
  border-top: 1px solid #CED0D6;
4552
4561
  margin: 0.25rem 0;
@@ -6126,4 +6135,101 @@
6126
6135
  .solid-custom-title {
6127
6136
  color: var(--solid-form-title);
6128
6137
  }
6138
+
6139
+
6140
+ .solid-global-search-element {
6141
+ border: 1px solid #d1d5db;
6142
+ }
6143
+
6144
+ .custom-filter-button {
6145
+ border-left: 1px solid #d1d5db;
6146
+ }
6147
+
6148
+ .solid-layout-accordion label {
6149
+ color: #000;
6150
+ }
6151
+
6152
+ .primary-filter-fieldset {
6153
+ background-color: #F8F7FC;
6154
+ }
6155
+
6156
+ .nested-custom-filter .primary-filter-fieldset {
6157
+ background-color: #FFF;
6158
+ }
6159
+
6160
+ .solid-column-panel.p-panel .p-panel-header {
6161
+ background: #F9F9F9;
6162
+ }
6163
+
6164
+ .solid-column-panel.p-panel .p-panel-header,
6165
+ .solid-column-panel.p-panel .p-panel-content {
6166
+ border: 1px solid rgba(216, 226, 234, 0.40);
6167
+ }
6168
+
6169
+ .form-field-label {
6170
+ color: rgba(0, 0, 0, 0.88) !important;
6171
+ }
6172
+
6173
+ .solid-standard-autocomplete .p-autocomplete-dropdown.p-button {
6174
+ background-color: #fff;
6175
+ border-color: #d1d5db;
6176
+ color: rgba(0, 0, 0, 0.60);
6177
+ }
6178
+
6179
+
6180
+ .solid-standard-autocomplete .p-inputtext:focus+.p-button {
6181
+ border-color: #d1d5db !important;
6182
+ }
6183
+
6184
+ .solid-custom-editor .ql-toolbar.ql-snow {
6185
+ border: 1px solid #d1d5db;
6186
+ }
6187
+
6188
+ .solid-custom-editor .ql-container.ql-snow {
6189
+ border: 1px solid #d1d5db;
6190
+ }
6191
+
6192
+ .view-widget-chip.p-chip {
6193
+ background-color: #f9f9f9 !important;
6194
+ }
6195
+
6196
+ .solid-step-button.p-button.p-button-text,
6197
+ .solid-step-button.p-button.p-button-text:not(:disabled):active,
6198
+ .solid-step-button.p-button.p-button-text:not(:disabled):hover,
6199
+ .solid-step-button.btn-step-first,
6200
+ .solid-step-button.btn-step-last {
6201
+ color: #0D0B26 !important;
6202
+ }
6203
+
6204
+ .active-menu-image {
6205
+ background-color: #EFF1F4;
6206
+ }
6207
+
6208
+ .solid-kanban-card,
6209
+ .solid-media-card {
6210
+ border: 1px solid var(--solid-kanban-wrapper);
6211
+ background: var(--hightlight-bg-secondary);
6212
+ }
6213
+
6214
+ .solid-kanban-card:hover,
6215
+ .solid-media-card:hover {
6216
+ border: 1px solid #722ED1;
6217
+ background: #F9F0FF;
6218
+ }
6219
+
6220
+
6221
+ .solid-mimetype-chip {
6222
+ background: #F0F0F0;
6223
+ }
6224
+
6225
+ .kanban-image-preview,
6226
+ .kanban-media-image-preview,
6227
+ .kanban-media-view-card {
6228
+ background-color: #fff;
6229
+ }
6230
+
6231
+ .kanban-count-badge {
6232
+ background: #F6FAFF;
6233
+ color: var(--primary-color);
6234
+ }
6129
6235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidstarters/solid-core-ui",
3
- "version": "1.1.66",
3
+ "version": "1.1.68",
4
4
  "scripts": {
5
5
  "prebuild": "npm run copy-styles",
6
6
  "build": "tsc && tsc-alias",
@@ -2,17 +2,18 @@ import * as React from "react"
2
2
  import { SVGProps } from "react"
3
3
  const FileSvg = (props: SVGProps<SVGSVGElement>) => (
4
4
  <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- width={64}
7
- height={64}
8
- fill="none"
9
- {...props}
10
- >
11
- <path
12
- fill="#F9F0FF"
13
- d="M36.03 25.291a2 2 0 0 1-2-2V6.271H16a6 6 0 0 0-6 6v40.08a6 6 0 0 0 6 6h31.06a6.01 6.01 0 0 0 6-6v-27.06H36.03Z"
14
- />
15
- <path fill="#722ED1" d="M51.88 21.291 38.03 7.441v13.85h13.85Z" />
16
- </svg>
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ width={64}
7
+ height={64}
8
+ fill="none"
9
+ {...props}
10
+ className="solid-file-reader"
11
+ >
12
+ <path
13
+ fill="#F9F0FF"
14
+ d="M36.03 25.291a2 2 0 0 1-2-2V6.271H16a6 6 0 0 0-6 6v40.08a6 6 0 0 0 6 6h31.06a6.01 6.01 0 0 0 6-6v-27.06H36.03Z"
15
+ />
16
+ <path fill="#722ED1" d="M51.88 21.291 38.03 7.441v13.85h13.85Z" />
17
+ </svg>
17
18
  )
18
19
  export default FileSvg
@@ -144,11 +144,7 @@ const FilterRuleComponent = ({ viewData, fields, rule, onChange, onAddRule, onAd
144
144
  <Button text severity='secondary' icon="pi pi-plus" size='small' onClick={() => onAddRule(rule.parentRule)} className='solid-filter-action-btn' />
145
145
  </div>
146
146
  <div className='col-4 px-0 flex align-items-center'>
147
- <Button text severity='secondary' icon={
148
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
149
- <path d="M11.6665 13.334H13.3332V11.6673H14.9998V10.0007H13.3332V8.33398H11.6665V10.0007H9.99984V11.6673H11.6665V13.334ZM3.33317 16.6673C2.87484 16.6673 2.48248 16.5041 2.15609 16.1777C1.8297 15.8513 1.6665 15.459 1.6665 15.0007V5.00065C1.6665 4.54232 1.8297 4.14996 2.15609 3.82357C2.48248 3.49718 2.87484 3.33398 3.33317 3.33398H8.33317L9.99984 5.00065H16.6665C17.1248 5.00065 17.5172 5.16385 17.8436 5.49023C18.17 5.81662 18.3332 6.20898 18.3332 6.66732V15.0007C18.3332 15.459 18.17 15.8513 17.8436 16.1777C17.5172 16.5041 17.1248 16.6673 16.6665 16.6673H3.33317ZM3.33317 15.0007H16.6665V6.66732H9.31234L7.64567 5.00065H3.33317V15.0007Z" fill="#4B4D52" />
150
- </svg>
151
- } size='small' onClick={() => onAddGroup(rule.id)} className='solid-filter-action-btn p-0' />
147
+ <Button text severity='secondary' icon={"pi pi-folder-plus"} size='small' onClick={() => onAddGroup(rule.id)} className='solid-filter-action-btn' />
152
148
  </div>
153
149
  <div className='col-4 px-0 flex align-items-center'>
154
150
  <Button text severity='secondary' icon="pi pi-trash" size='small' onClick={() => onDelete(rule.id)} className='solid-filter-action-btn' />
@@ -352,7 +348,7 @@ const FilterComponent = ({ viewData, fields, filterRules, setFilterRules, transf
352
348
  // };
353
349
 
354
350
 
355
- const removeEmptyGroups = (rule) => {
351
+ const removeEmptyGroups = (rule) => {
356
352
  if (rule.type === "rule_group" && rule.children.length === 0) {
357
353
  return null;
358
354
  }
@@ -366,7 +362,7 @@ const FilterComponent = ({ viewData, fields, filterRules, setFilterRules, transf
366
362
 
367
363
 
368
364
  const handleDeleteRule = (id) => {
369
- if(filterRules[0].children.length === 1 && filterRules[0].children[0].id === id ){
365
+ if (filterRules[0].children.length === 1 && filterRules[0].children[0].id === id) {
370
366
  return
371
367
  }
372
368
  const deleteRecursively = (rules, id, isRoot = false) => {
@@ -157,22 +157,30 @@ const transformRulesToFilters = (input: any) => {
157
157
  }
158
158
 
159
159
  const tranformSearchToFilters = (input: any) => {
160
+ if (!input || !input.$and) return input;
160
161
 
161
- if (!input || !input.$and) return input; // Return as-is if invalid
162
+ const grouped: Record<string, string[]> = {};
162
163
 
163
- return {
164
- $and: input.$and.map((condition: any) => {
165
- const { fieldName, matchMode, value } = condition;
164
+ input.$and.forEach(({ fieldName, value }: any) => {
165
+ const val = Array.isArray(value) && value.length === 1 ? value[0] : value;
166
166
 
167
- // Ensure value is a single string (if it's an array with one element, extract it)
168
- const formattedValue = Array.isArray(value) && value.length === 1 ? value[0] : value;
167
+ if (!grouped[fieldName]) {
168
+ grouped[fieldName] = [];
169
+ }
169
170
 
170
- return {
171
- [fieldName]: {
172
- [matchMode]: formattedValue
173
- }
174
- };
175
- })
171
+ if (Array.isArray(val)) {
172
+ grouped[fieldName].push(...val);
173
+ } else {
174
+ grouped[fieldName].push(val);
175
+ }
176
+ });
177
+
178
+ return {
179
+ $and: Object.entries(grouped).map(([fieldName, values]) => ({
180
+ [fieldName]: {
181
+ $containsi: values.length === 1 ? values[0] : values
182
+ }
183
+ }))
176
184
  };
177
185
  }
178
186
 
@@ -683,7 +691,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
683
691
  <span key={index} className="custom-chip-value">{value}
684
692
  </span>
685
693
  {values.length > 1 &&
686
- <span className="custom-chip-or">and</span>
694
+ <span className="custom-chip-or">or</span>
687
695
  }
688
696
  </React.Fragment>
689
697
  ))}
@@ -742,7 +750,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
742
750
  </div>
743
751
 
744
752
  {showOverlay && (
745
- <div className="absolute w-full z-5 bg-white border-round border-1 border-300 shadow-2" style={{ top: 35 }}>
753
+ <div className="absolute w-full z-5 surface-0 border-round border-1 border-300 shadow-2" style={{ top: 35 }}>
746
754
  {inputValue ? (
747
755
  <>
748
756
  <div className="custom-filter-search-options px-2 py-2 flex flex-column">
@@ -757,7 +765,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
757
765
  size="small"
758
766
  >
759
767
  Search <strong>{value}</strong> for :
760
- <span className="font-bold" style={{ color: '#000' }}>{inputValue}</span>
768
+ <span className="font-bold text-color">{inputValue}</span>
761
769
  </Button>
762
770
  ))
763
771
  }
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { Button } from "primereact/button"
3
- import { LoadDynamicJsxComponent } from "../common/LoadDynamicJsxComponent";
3
+ import { getExtensionComponent } from "@/helpers/registry";
4
4
 
5
5
 
6
6
  export const ListViewRowActionPopup = ({ context }: any) => {
@@ -13,11 +13,18 @@ export const ListViewRowActionPopup = ({ context }: any) => {
13
13
 
14
14
  }
15
15
 
16
+ let DynamicWidget = getExtensionComponent(context?.rowAction?.action?.customComponent);
17
+ const widgetProps = {
18
+ context: context
19
+ }
20
+
16
21
  return (
17
22
  <div>
18
23
  {
19
24
  context?.rowAction?.action?.customComponent ?
20
- <LoadDynamicJsxComponent context={context}></LoadDynamicJsxComponent>
25
+ DynamicWidget && <DynamicWidget {...widgetProps} />
26
+
27
+ // <LoadDynamicJsxComponent context={context}></LoadDynamicJsxComponent>
21
28
  :
22
29
  <>
23
30
  <h1>{context?.modelName}</h1>
@@ -39,7 +39,7 @@ const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column, se
39
39
  )
40
40
  };
41
41
 
42
- const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter
42
+ const truncateAfter = solidListViewMetaData?.data?.solidView?.layout?.attrs?.truncateAfter;
43
43
  const header = column.attrs.label ?? fieldMetadata.displayName;
44
44
 
45
45
  return (
@@ -63,7 +63,16 @@ const SolidShortTextColumn = ({ solidListViewMetaData, fieldMetadata, column, se
63
63
  body={(rowData) => {
64
64
  const renderMode = column.attrs.renderMode || "text";
65
65
  const data = rowData;
66
- const widgetName = renderMode == "text" ? "SolidShortTextFieldTextRenderModeWidget" : "SolidShortTextFieldImageRenderModeWidget";
66
+ let widgetName = column?.attrs?.widget;
67
+ if (renderMode === "image") {
68
+ widgetName = "SolidShortTextFieldImageRenderModeWidget"
69
+ }
70
+ if (renderMode === "text") {
71
+ widgetName = "SolidShortTextFieldTextRenderModeWidget"
72
+ };
73
+ if (column?.attrs?.widget) {
74
+ widgetName = column?.attrs?.widget;
75
+ }
67
76
  let DynamicWidget = getExtensionComponent(widgetName);
68
77
  const widgetProps = {
69
78
  value: data[fieldMetadata.name],
@@ -0,0 +1,52 @@
1
+
2
+ export const SolidUserNameAvatarWidget = ({ value }: any) => {
3
+
4
+ // use "widget": "SolidUserNameAvatarWidget" in the list view field
5
+
6
+ const getInitials = (fullName: string) => {
7
+ const names = fullName.trim().split(' ');
8
+ const initials =
9
+ names.length === 1
10
+ ? names[0][0]
11
+ : names[0][0] + names[names.length - 1][0];
12
+ return initials.toUpperCase();
13
+ };
14
+
15
+ const getColorFromInitials = (initials: string) => {
16
+ let hash = 0;
17
+ for (let i = 0; i < initials.length; i++) {
18
+ hash = initials.charCodeAt(i) + ((hash << 5) - hash);
19
+ }
20
+ const hue = Math.abs(hash) % 360;
21
+ return `hsl(${hue}, 60%, 60%)`; // nice pastel color
22
+ };
23
+
24
+ const initials = getInitials(value);
25
+ const bgColor = getColorFromInitials(initials);
26
+
27
+ return (
28
+ <div className="solid-table-row">
29
+ <div style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
30
+ <div
31
+ style={{
32
+ width: 25,
33
+ height: 25,
34
+ borderRadius: '50%',
35
+ backgroundColor: bgColor,
36
+ color: 'white',
37
+ display: 'flex',
38
+ alignItems: 'center',
39
+ justifyContent: 'center',
40
+ fontWeight: 600,
41
+ fontSize: 25 * 0.4,
42
+ boxShadow: '0 0 0 2px rgba(0,0,0,0.1)',
43
+ }}
44
+ >
45
+ {initials}
46
+ </div>
47
+ <span>{value}</span>
48
+ </div>
49
+ </div>
50
+ );
51
+ };
52
+
@@ -72,7 +72,7 @@ const CreateModel = ({ data, params }: any) => {
72
72
  useEffect(() => {
73
73
  if (data) {
74
74
  const modelData = {
75
- ...data, moduleId: data?.module?.id
75
+ ...data, moduleId: data?.module?.id,parentModelId: data?.parentModel
76
76
  }
77
77
 
78
78
  setIsLoadingData(false);
@@ -394,16 +394,26 @@ const createValidationSchema = (currentFields: any, selectedType: any, allFields
394
394
  "Relation Model Singular Name is required"
395
395
  ),
396
396
  }),
397
- // ...(currentFields.includes("relationCoModelFieldName") && {
398
- // relationCoModelFieldName: Yup.string()
399
- // // .required(
400
- // // "Relation Model Field Name is required"
401
- // // ),
402
- // }),
403
-
397
+ ...(currentFields.includes("relationCoModelFieldName") && {
398
+ relationCoModelFieldName: Yup.string()
399
+ // .required(
400
+ // "Relation Model Field Name is required"
401
+ // ),
402
+ }),
404
403
  ...(currentFields.includes("relationCreateInverse") && {
405
404
  relationCreateInverse: Yup.boolean(),
406
405
  }),
406
+ ...(currentFields.includes("relationCoModelFieldName") && {
407
+ relationCoModelFieldName: Yup.string().when("relationCreateInverse", (relationCreateInverse: any, schema) => {
408
+ console.log("relationCreateInverse", relationCreateInverse);
409
+ if (relationCreateInverse.length > 0 && relationCreateInverse[0] == true) {
410
+ return schema.required("Relation Co Model Field Name is required")
411
+ } else {
412
+ return schema.notRequired();
413
+ }
414
+ }),
415
+ }),
416
+
407
417
  // ...(currentFields.includes("relationCascade") && {
408
418
  // relationCascade: Yup.string().required(
409
419
  // "Relation Cascade Value is required"
@@ -425,6 +435,11 @@ const createValidationSchema = (currentFields: any, selectedType: any, allFields
425
435
  "Relation Model Module Name Value is required"
426
436
  ),
427
437
  }),
438
+
439
+ ...(currentFields.includes("relationFieldFixedFilter") && {
440
+ relationFieldFixedFilter: Yup.string().nullable(),
441
+ }),
442
+
428
443
  ...(currentFields.includes("selectionDynamicProvider") && {
429
444
  selectionDynamicProvider: Yup.string().required(
430
445
  "Selection Dynamic Provider Value is required"
@@ -898,6 +913,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
898
913
  relationCreateInverse: fieldMetaData ? fieldMetaData?.relationCreateInverse : false,
899
914
  relationCascade: fieldMetaData ? fieldMetaData?.relationCascade : 'cascade',
900
915
  relationModelModuleName: fieldMetaData ? fieldMetaData?.relationModelModuleName : modelMetaData?.module.name,
916
+ relationFieldFixedFilter: fieldMetaData ? fieldMetaData?.relationFieldFixedFilter : "",
901
917
  selectionDynamicProvider: fieldMetaData ? fieldMetaData?.selectionDynamicProvider : null,
902
918
  selectionDynamicProviderCtxt: fieldMetaData ? fieldMetaData?.selectionDynamicProviderCtxt : "",
903
919
  selectionStaticValues: fieldMetaData ? fieldMetaData?.selectionStaticValues : [""],
@@ -1705,8 +1721,12 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
1705
1721
  <SelectButton
1706
1722
  value={formik.values.relationType}
1707
1723
  options={fieldDefaultMetaData.data.relationTypes}
1708
- onChange={(e) =>
1709
- formik.setFieldValue("relationType", e.value)
1724
+ onChange={(e) => {
1725
+ formik.setFieldValue("relationType", e.value);
1726
+ if (e.value === "one-to-many") {
1727
+ formik.setFieldValue("relationCreateInverse", true);
1728
+ }
1729
+ }
1710
1730
  }
1711
1731
  className={classNames("", {
1712
1732
  "p-invalid": isFormFieldValid(formik, "relationType"),
@@ -1869,6 +1889,56 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
1869
1889
  </div>
1870
1890
  )}
1871
1891
 
1892
+ {currentFields.includes(
1893
+ "relationFieldFixedFilter"
1894
+ ) && (
1895
+ <div className="field col-6 flex-flex-column gap-2 mt-3">
1896
+ <label
1897
+ htmlFor="relationFieldFixedFilter"
1898
+ className="form-field-label"
1899
+ >
1900
+ Relation Field Fixed Filter
1901
+ </label>
1902
+
1903
+ <InputTextarea
1904
+ aria-describedby="Fixed Filter"
1905
+ id="relationFieldFixedFilter"
1906
+ name="relationFieldFixedFilter"
1907
+ onChange={formik.handleChange}
1908
+ value={formik.values.relationFieldFixedFilter}
1909
+ rows={5}
1910
+ cols={30}
1911
+ className={classNames("", {
1912
+ "p-invalid": isFormFieldValid(
1913
+ formik,
1914
+ "relationFieldFixedFilter"
1915
+ ),
1916
+ })}
1917
+ />
1918
+ {/*
1919
+ <InputText
1920
+ type="text"
1921
+ id="relationFieldFixedFilter"
1922
+ name="relationFieldFixedFilter"
1923
+ onChange={formik.handleChange}
1924
+ disabled={fieldMetaData?.id}
1925
+ value={formik.values.relationFieldFixedFilter}
1926
+ className={classNames("", {
1927
+ "p-invalid": isFormFieldValid(
1928
+ formik,
1929
+ "relationFieldFixedFilter"
1930
+ ),
1931
+ })}
1932
+ /> */}
1933
+ {isFormFieldValid(formik, "relationFieldFixedFilter") && (
1934
+ <Message
1935
+ severity="error"
1936
+ text={formik?.errors?.relationFieldFixedFilter?.toString()}
1937
+ />
1938
+ )}
1939
+
1940
+ </div>
1941
+ )}
1872
1942
  {isUserKeyFields && (
1873
1943
  <div className="field col-6 flex-flex-column gap-2 mt-3">
1874
1944
  <label
@@ -1902,7 +1972,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
1902
1972
  </div>
1903
1973
  )}
1904
1974
 
1905
- {currentFields.includes("relationCreateInverse") && (formik.values.relationType === "many-to-many" || formik.values.relationType === "many-to-one") && (
1975
+ {currentFields.includes("relationCreateInverse") && (
1906
1976
  <div className="field col-6 flex flex-column gap-2 mt-3">
1907
1977
  <label htmlFor="relationCreateInverse" className="form-field-label">
1908
1978
  Relation Create Inverse
@@ -1912,6 +1982,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
1912
1982
  inputId="relationCreateInverse"
1913
1983
  name="relationCreateInverse"
1914
1984
  checked={formik.values.relationCreateInverse}
1985
+ disabled={formik.values.relationType === "one-to-many" ? true : false}
1915
1986
  onChange={(e) => formik.setFieldValue("relationCreateInverse", e.checked)}
1916
1987
  />
1917
1988
  <label htmlFor="relationCreateInverse" className="ml-2">Create Inverse</label>
@@ -1935,6 +2006,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
1935
2006
  id="relationCoModelFieldName"
1936
2007
  name="relationCoModelFieldName"
1937
2008
  onChange={formik.handleChange}
2009
+ disabled={fieldMetaData?.id}
1938
2010
  value={formik.values.relationCoModelFieldName}
1939
2011
  className={classNames("", {
1940
2012
  "p-invalid": isFormFieldValid(
@@ -1997,6 +2069,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
1997
2069
  id="relationCoModelColumnName"
1998
2070
  name="relationCoModelColumnName"
1999
2071
  onChange={formik.handleChange}
2072
+ disabled={fieldMetaData?.id}
2000
2073
  value={formik.values.relationCoModelColumnName}
2001
2074
  className={classNames("", {
2002
2075
  "p-invalid": isFormFieldValid(
@@ -2028,6 +2101,7 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
2028
2101
  id="relationJoinTableName"
2029
2102
  name="relationJoinTableName"
2030
2103
  onChange={formik.handleChange}
2104
+ disabled={fieldMetaData?.id}
2031
2105
  value={formik.values.relationJoinTableName}
2032
2106
  className={classNames("", {
2033
2107
  "p-invalid": isFormFieldValid(
@@ -2927,10 +3001,10 @@ const FieldMetaDataForm = ({ setIsDirty, modelMetaData, fieldMetaData, setFieldM
2927
3001
  </TabView>
2928
3002
  <div className="flex gap-3">
2929
3003
  <div>
2930
- <Button label="Finish" size="small" onClick={() => showError()} type="submit" />
3004
+ <Button label="Finish" size="small" onClick={() => showError()} type="submit" />
2931
3005
  </div>
2932
3006
  <div>
2933
- <Button label="Cancel" size="small" severity="secondary" type="reset" onClick={() => setVisiblePopup(false)} outlined />
3007
+ <Button label="Cancel" size="small" severity="secondary" type="reset" onClick={() => setVisiblePopup(false)} outlined />
2934
3008
  </div>
2935
3009
  </div>
2936
3010
  </div>
@@ -56,7 +56,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
56
56
  enableSoftDelete: modelMetaData ? modelMetaData?.enableSoftDelete : "",
57
57
  enableAuditTracking: modelMetaData ? modelMetaData?.enableAuditTracking : "",
58
58
  internationalisation: modelMetaData ? modelMetaData?.internationalisation : "",
59
- isChild: modelMetaData ? modelMetaData?.isChild : false,
59
+ isChild: modelMetaData ? modelMetaData?.isChild : "",
60
60
  parentModelId: modelMetaData ? modelMetaData?.parentModel?.id : "",
61
61
  parentModel: modelMetaData ? modelMetaData?.parentModel : "",
62
62
 
@@ -138,7 +138,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
138
138
  enableSoftDelete: values.enableSoftDelete === true ? true : '',
139
139
  enableAuditTracking: values.enableAuditTracking === true ? true : '',
140
140
  internationalisation: values.internationalisation === true ? true : '',
141
- isChild: values.isChild ? values.isChild === true : '',
141
+ isChild: values.isChild === true ? true : '',
142
142
  ...(values.isChild == true && {
143
143
  parentModelId: values.parentModelId,
144
144
  parentModel: values.parentModel,
@@ -455,14 +455,27 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
455
455
  />
456
456
  )}
457
457
 
458
- <div className="mt-4">
459
- <div className="flex align-items-center gap-2">
460
- <Checkbox onChange={e => { setShowParentModel(e.checked) }} checked={showParentModel} disabled={params.id !== 'new'}></Checkbox>
461
- <label htmlFor="ingredient1" className="form-field-label">
462
- isChild
463
- </label>
464
- </div>
458
+ <div className="flex align-items-center gap-2 mt-3">
459
+ <Checkbox
460
+ name="isChild"
461
+ onChange={(e) => {
462
+ formik.setFieldValue("isChild", e.checked);
463
+ }}
464
+ disabled={params.id !== 'new'}
465
+ checked={formik.values.isChild}
466
+ ></Checkbox>
467
+ <label htmlFor="isChild" className="form-field-label">
468
+ Is Child
469
+ </label>
465
470
  </div>
471
+ {params.id !== 'new' && <p className="form-field-label mt-1 text-sm">Is Current Model child of another Model</p>}
472
+ {(isFormFieldValid(formik, "isChild") || (formErrors["isChild"])) && (
473
+ <Message
474
+ severity="error"
475
+ text={formik?.errors?.isChild?.toString()}
476
+ className="mt-2"
477
+ />
478
+ )}
466
479
  {showParentModel &&
467
480
  <div className="flex flex-column gap-2 mt-3">
468
481
  <label htmlFor="type" className="form-field-label">