@solidstarters/solid-core-ui 1.1.16 → 1.1.18
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/AuthLayout.d.ts +4 -0
- package/dist/components/auth/AuthLayout.d.ts.map +1 -0
- package/dist/components/auth/AuthLayout.js +80 -0
- package/dist/components/auth/AuthLayout.js.map +1 -0
- package/dist/components/auth/ForgotPasswordThankYou.d.ts +2 -0
- package/dist/components/auth/ForgotPasswordThankYou.d.ts.map +1 -0
- package/dist/components/auth/ForgotPasswordThankYou.js +16 -0
- package/dist/components/auth/ForgotPasswordThankYou.js.map +1 -0
- package/dist/components/auth/GoogleAuthChecking.d.ts +2 -0
- package/dist/components/auth/GoogleAuthChecking.d.ts.map +1 -0
- package/dist/components/auth/GoogleAuthChecking.js +99 -0
- package/dist/components/auth/GoogleAuthChecking.js.map +1 -0
- package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -1
- package/dist/components/auth/SolidChangeForcePassword.js +44 -39
- package/dist/components/auth/SolidChangeForcePassword.js.map +1 -1
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +1 -2
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.d.ts +1 -3
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +16 -12
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts +1 -3
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +16 -12
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +12 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +13 -9
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.d.ts +1 -4
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +14 -10
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts +1 -3
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +21 -18
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/NotFound.d.ts +2 -0
- package/dist/components/common/NotFound.d.ts.map +1 -0
- package/dist/components/common/NotFound.js +7 -0
- package/dist/components/common/NotFound.js.map +1 -0
- package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +1 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js +3 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js.map +1 -1
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +3 -2
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/common/SolidAdmin.d.ts +2 -0
- package/dist/components/common/SolidAdmin.d.ts.map +1 -0
- package/dist/components/common/SolidAdmin.js +5 -0
- package/dist/components/common/SolidAdmin.js.map +1 -0
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
- package/dist/components/common/SolidFormStepper.js +8 -1
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidThemeLink.d.ts +2 -0
- package/dist/components/common/SolidThemeLink.d.ts.map +1 -0
- package/dist/components/common/SolidThemeLink.js +5 -0
- package/dist/components/common/SolidThemeLink.js.map +1 -0
- package/dist/components/common/error.d.ts +9 -0
- package/dist/components/common/error.d.ts.map +1 -0
- package/dist/components/common/error.js +7 -0
- package/dist/components/common/error.js.map +1 -0
- package/dist/components/core/common/FilterComponent.js +7 -7
- package/dist/components/core/common/FilterComponent.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +4 -3
- package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +38 -18
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/form/SolidFormLayouts.d.ts +3 -0
- package/dist/components/core/form/SolidFormLayouts.d.ts.map +1 -0
- package/dist/components/core/form/SolidFormLayouts.js +57 -0
- package/dist/components/core/form/SolidFormLayouts.js.map +1 -0
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +13 -1
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidBooleanField.js +9 -7
- package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateField.js +7 -5
- package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +7 -5
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDecimalField.js +9 -7
- package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +9 -7
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidJsonField.js +6 -4
- package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidLongTextField.js +8 -6
- package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaMultipleField.js +29 -23
- package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidMediaSingleField.js +22 -19
- package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidRichTextField.js +9 -7
- package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +10 -8
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +10 -8
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +8 -6
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js +7 -5
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +16 -12
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -0
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +66 -7
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +12 -10
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +2 -2
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +48 -62
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +9 -2
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +10 -3
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +12 -1
- package/dist/components/core/model/CreateModel.js.map +1 -1
- package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaData.js +55 -2
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +128 -61
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +5 -5
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +7 -3
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/users/CreateUser.js +2 -2
- package/dist/components/layout/AdminLayout.d.ts +4 -0
- package/dist/components/layout/AdminLayout.d.ts.map +1 -0
- package/dist/components/layout/AdminLayout.js +86 -0
- package/dist/components/layout/AdminLayout.js.map +1 -0
- package/dist/components/layout/AppConfig.d.ts.map +1 -1
- package/dist/components/layout/AppConfig.js +4 -9
- package/dist/components/layout/AppConfig.js.map +1 -1
- package/dist/components/layout/user-profile-menu.js +1 -1
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/nextAuth/authProviders.d.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -0
- package/dist/nextAuth/authProviders.js +231 -0
- package/dist/nextAuth/authProviders.js.map +1 -0
- package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
- package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
- package/dist/nextAuth/refreshAccessToken.js +76 -0
- package/dist/nextAuth/refreshAccessToken.js.map +1 -0
- package/dist/redux/api/modelApi.d.ts +2 -1
- package/dist/redux/api/modelApi.d.ts.map +1 -1
- package/dist/redux/api/modelApi.js +9 -2
- package/dist/redux/api/modelApi.js.map +1 -1
- package/package.json +1 -1
- package/src/components/auth/AuthLayout.tsx +126 -0
- package/src/components/auth/ForgotPasswordThankYou.tsx +45 -0
- package/src/components/auth/GoogleAuthChecking.tsx +60 -0
- package/src/components/auth/SolidChangeForcePassword.tsx +21 -32
- package/src/components/auth/SolidForgotPassword.tsx +3 -2
- package/src/components/auth/SolidInitialLoginOtp.tsx +16 -8
- package/src/components/auth/SolidInitiateRegisterOtp.tsx +17 -9
- package/src/components/auth/SolidLogin.tsx +16 -10
- package/src/components/auth/SolidRegister.tsx +17 -9
- package/src/components/auth/SolidResetPassword.tsx +13 -6
- package/src/components/common/GeneralSettings.tsx +7 -2
- package/src/components/common/NotFound.tsx +22 -0
- package/src/components/common/SingleSelectAutoCompleteField.tsx +3 -1
- package/src/components/common/SocialMediaLogin.tsx +24 -25
- package/src/components/common/SolidAdmin.tsx +7 -0
- package/src/components/common/SolidFormStepper.tsx +55 -2
- package/src/components/common/SolidThemeLink.tsx +5 -0
- package/src/components/common/error.tsx +30 -0
- package/src/components/core/common/FilterComponent.tsx +70 -70
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +6 -1
- package/src/components/core/common/SolidGlobalSearchElement.tsx +48 -20
- package/src/components/core/form/SolidFormLayouts.tsx +93 -0
- package/src/components/core/form/SolidFormView.tsx +64 -3
- package/src/components/core/form/fields/SolidBooleanField.tsx +6 -3
- package/src/components/core/form/fields/SolidDateField.tsx +6 -3
- package/src/components/core/form/fields/SolidDateTimeField.tsx +6 -3
- package/src/components/core/form/fields/SolidDecimalField.tsx +6 -3
- package/src/components/core/form/fields/SolidIntegerField.tsx +6 -3
- package/src/components/core/form/fields/SolidJsonField.tsx +6 -3
- package/src/components/core/form/fields/SolidLongTextField.tsx +6 -3
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +20 -12
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +9 -6
- package/src/components/core/form/fields/SolidRichTextField.tsx +7 -3
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -3
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +6 -3
- package/src/components/core/form/fields/SolidShortTextField.tsx +8 -4
- package/src/components/core/form/fields/SolidTimeField.tsx +7 -4
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +14 -8
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +93 -3
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +5 -1
- package/src/components/core/kanban/SolidKanbanView.tsx +4 -4
- package/src/components/core/list/SolidListView.tsx +16 -64
- package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +18 -0
- package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +21 -0
- package/src/components/core/model/CreateModel.tsx +58 -0
- package/src/components/core/model/FieldMetaData.tsx +27 -1
- package/src/components/core/model/FieldMetaDataForm.tsx +134 -44
- package/src/components/core/model/ModelMetaData.tsx +5 -5
- package/src/components/core/module/CreateModule.tsx +12 -4
- package/src/components/core/users/CreateUser.tsx +2 -2
- package/src/components/layout/AdminLayout.tsx +62 -0
- package/src/components/layout/AppConfig.tsx +4 -3
- package/src/components/layout/user-profile-menu.tsx +1 -1
- package/src/index.ts +17 -1
- package/src/nextAuth/authProviders.tsx +220 -0
- package/src/nextAuth/refreshAccessToken.tsx +27 -0
- package/src/redux/api/modelApi.ts +9 -2
|
@@ -4,7 +4,7 @@ import { SingleSelectAutoCompleteField } from "@/components/common/SingleSelectA
|
|
|
4
4
|
import { getSingularAndPlural } from "@/helpers/helpers";
|
|
5
5
|
import { useGetFieldDefaultMetaDataQuery } from "@/redux/api/fieldApi";
|
|
6
6
|
import { useLazyGetMediaStorageProvidersQuery } from "@/redux/api/mediaStorageProviderApi";
|
|
7
|
-
import { useLazyGetModelsQuery } from "@/redux/api/modelApi";
|
|
7
|
+
import { useLazyGetModelsQuery, useUpdateUserKeyMutation } from "@/redux/api/modelApi";
|
|
8
8
|
import { useLazyGetmodulesQuery } from "@/redux/api/moduleApi";
|
|
9
9
|
import { useFormik } from "formik";
|
|
10
10
|
import { capitalize } from "lodash";
|
|
@@ -85,14 +85,14 @@ const SelectionStaticValues = ({ enumValue, onUpdate, onDelete, onAdd }: any) =>
|
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
|
-
<div className="flex align-items-center gap-2">
|
|
88
|
+
<div className="flex align-items-center gap-2 mt-2">
|
|
89
89
|
|
|
90
90
|
{/* Input field for Value */}
|
|
91
91
|
<InputText
|
|
92
92
|
value={value || ""}
|
|
93
93
|
onChange={(e) => handleValueChange(e.target.value)}
|
|
94
94
|
placeholder="Value"
|
|
95
|
-
className="
|
|
95
|
+
className="w-full"
|
|
96
96
|
/>
|
|
97
97
|
|
|
98
98
|
{/* Input field for Display */}
|
|
@@ -100,7 +100,7 @@ const SelectionStaticValues = ({ enumValue, onUpdate, onDelete, onAdd }: any) =>
|
|
|
100
100
|
value={display || ""}
|
|
101
101
|
onChange={(e) => handleDisplayChange(e.target.value)}
|
|
102
102
|
placeholder="Display"
|
|
103
|
-
className="
|
|
103
|
+
className="w-full"
|
|
104
104
|
/>
|
|
105
105
|
|
|
106
106
|
|
|
@@ -506,7 +506,7 @@ const createValidationSchema = (currentFields: any, selectedType: any, allFields
|
|
|
506
506
|
return Yup.object(schema);
|
|
507
507
|
};
|
|
508
508
|
|
|
509
|
-
const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, allFields, deleteModelFunction, setVisiblePopup, params, setIsRequiredPopUp }: any) => {
|
|
509
|
+
const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, allFields, deleteModelFunction, setVisiblePopup, params, setIsRequiredPopUp, showToaster }: any) => {
|
|
510
510
|
|
|
511
511
|
const booleanOptions = ["false", "true"];
|
|
512
512
|
const [isBackPopupVisible, setIsBackPopupVisible] = useState(false);
|
|
@@ -523,6 +523,10 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
523
523
|
const [triggerGetMediaStorageProvider, { data: MediaStorageProviderData, isFetching: isMediaStorageProviderFetching, error: MediaStorageProviderError }] = useLazyGetMediaStorageProvidersQuery();
|
|
524
524
|
const [triggerGetModules, { data: moduleData, isFetching: isModuleFetching, error: moduleError }] = useLazyGetmodulesQuery();
|
|
525
525
|
const [triggerGetModels, { data: modelData, isFetching: ismodelFetching, error: modelError }] = useLazyGetModelsQuery();
|
|
526
|
+
const [
|
|
527
|
+
updateUserKey,
|
|
528
|
+
{ isLoading: isUpdateUserKeyLoading, isSuccess: isUpdateUserKeySuccess, isError: isUpdateUserKeyError, error: UpdateUserKeyError, data: newModel },
|
|
529
|
+
] = useUpdateUserKeyMutation();
|
|
526
530
|
|
|
527
531
|
|
|
528
532
|
const [markdownText, setMarkdownText] = useState<string>();
|
|
@@ -543,7 +547,8 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
543
547
|
const [ormTypeOptions, setOrmTypeOptions] = useState([]);
|
|
544
548
|
const [selectedOrmType, setSelectedOrmType] = useState<any>(fieldMetaData?.ormType);
|
|
545
549
|
|
|
546
|
-
|
|
550
|
+
const [isUserKeyFields, setUserKeyFields] = useState(false);
|
|
551
|
+
const [userKeyData, setUserKeyData] = useState([]);
|
|
547
552
|
|
|
548
553
|
const [
|
|
549
554
|
filteredExternalIdProvider,
|
|
@@ -734,7 +739,9 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
734
739
|
}
|
|
735
740
|
};
|
|
736
741
|
|
|
737
|
-
|
|
742
|
+
const searchUserKeyField = () => {
|
|
743
|
+
return userKeyData;
|
|
744
|
+
}
|
|
738
745
|
|
|
739
746
|
const searchComputedFieldValueType = async (event: any) => {
|
|
740
747
|
const query = event.query;
|
|
@@ -904,7 +911,8 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
904
911
|
isUserKey: fieldMetaData ? fieldMetaData?.isUserKey : false,
|
|
905
912
|
relationJoinColumnName: fieldMetaData ? fieldMetaData?.relationJoinColumnName : null,
|
|
906
913
|
joinColumnName: fieldMetaData ? fieldMetaData?.joinColumnName : null,
|
|
907
|
-
relationJoinTableName: fieldMetaData ? fieldMetaData?.relationJoinTableName : null
|
|
914
|
+
relationJoinTableName: fieldMetaData ? fieldMetaData?.relationJoinTableName : null,
|
|
915
|
+
userKey: fieldMetaData ? fieldMetaData?.userKey : null
|
|
908
916
|
};
|
|
909
917
|
|
|
910
918
|
|
|
@@ -914,7 +922,6 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
914
922
|
enableReinitialize: true,
|
|
915
923
|
onSubmit: async (values) => {
|
|
916
924
|
try {
|
|
917
|
-
|
|
918
925
|
setFieldMetaData((prevItems: any) => {
|
|
919
926
|
const newFieldData = { ...values, isSystem: values.isSystem == true ? true : '' }
|
|
920
927
|
const formtatedFieldPayload = fieldBasedPayloadFormating(newFieldData, currentFields, fieldMetaData);
|
|
@@ -931,6 +938,13 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
931
938
|
return [...prevItems, formtatedFieldPayload]
|
|
932
939
|
}
|
|
933
940
|
});
|
|
941
|
+
if (values.userKey) {
|
|
942
|
+
const data = {
|
|
943
|
+
modelName: values.relationModelSingularName,
|
|
944
|
+
fieldName: values.userKey
|
|
945
|
+
}
|
|
946
|
+
updateUserKey(data);
|
|
947
|
+
}
|
|
934
948
|
// nextTab()
|
|
935
949
|
setVisiblePopup(false);
|
|
936
950
|
|
|
@@ -972,7 +986,13 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
972
986
|
}
|
|
973
987
|
};
|
|
974
988
|
|
|
975
|
-
|
|
989
|
+
useEffect(() => {
|
|
990
|
+
if (isUpdateUserKeySuccess) {
|
|
991
|
+
showToaster([newModel?.data?.message], "success");
|
|
992
|
+
} if (isUpdateUserKeyError) {
|
|
993
|
+
showToaster(UpdateUserKeyError, 'error')
|
|
994
|
+
}
|
|
995
|
+
}, [isUpdateUserKeySuccess, isUpdateUserKeyError])
|
|
976
996
|
|
|
977
997
|
const handleTypeSelect = (e: any, label: string) => {
|
|
978
998
|
|
|
@@ -1012,6 +1032,40 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1012
1032
|
}
|
|
1013
1033
|
}, [fieldMetaData])
|
|
1014
1034
|
|
|
1035
|
+
useEffect(() => {
|
|
1036
|
+
const fetchFields = async () => {
|
|
1037
|
+
const queryData: any = {
|
|
1038
|
+
limit: 10,
|
|
1039
|
+
offset: 0,
|
|
1040
|
+
filters: {
|
|
1041
|
+
singularName: {
|
|
1042
|
+
$eq: formik.values.relationModelSingularName
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
populate: ['fields']
|
|
1046
|
+
};
|
|
1047
|
+
const queryString = qs.stringify(queryData, {
|
|
1048
|
+
encodeValuesOnly: true,
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
const result = await triggerGetModels(queryString).unwrap();
|
|
1052
|
+
|
|
1053
|
+
if (result && result.records) {
|
|
1054
|
+
if (!result?.records[0]?.userKeyField) {
|
|
1055
|
+
setUserKeyFields(true);
|
|
1056
|
+
const fieldsWithUnique = result?.records[0]?.fields?.filter((field: any) => field?.unique === true);
|
|
1057
|
+
setUserKeyData(fieldsWithUnique)
|
|
1058
|
+
} else {
|
|
1059
|
+
setUserKeyFields(false);
|
|
1060
|
+
setUserKeyData([]);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
if (formik.values.relationModelSingularName) {
|
|
1065
|
+
fetchFields();
|
|
1066
|
+
}
|
|
1067
|
+
}, [formik.values.relationModelSingularName])
|
|
1068
|
+
|
|
1015
1069
|
const updateEnumValues = (index: number, updatedString: string) => {
|
|
1016
1070
|
const updatedValues = formik.values.selectionStaticValues.map((enumValue: string, i: number) =>
|
|
1017
1071
|
i === index ? updatedString : enumValue
|
|
@@ -1571,7 +1625,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1571
1625
|
)}
|
|
1572
1626
|
|
|
1573
1627
|
{currentFields.includes("mediaEmbedded") && (
|
|
1574
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1628
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1575
1629
|
<label
|
|
1576
1630
|
htmlFor="mediaEmbedded"
|
|
1577
1631
|
className="form-field-label"
|
|
@@ -1614,7 +1668,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1614
1668
|
</div>
|
|
1615
1669
|
)}
|
|
1616
1670
|
{currentFields.includes("relationType") && (
|
|
1617
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1671
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1618
1672
|
{/* <label
|
|
1619
1673
|
htmlFor="relationType"
|
|
1620
1674
|
className="form-field-label"
|
|
@@ -1650,7 +1704,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1650
1704
|
onChange={(e) =>
|
|
1651
1705
|
formik.setFieldValue("relationType", e.value)
|
|
1652
1706
|
}
|
|
1653
|
-
className={classNames("
|
|
1707
|
+
className={classNames("", {
|
|
1654
1708
|
"p-invalid": isFormFieldValid(formik, "relationType"),
|
|
1655
1709
|
})}
|
|
1656
1710
|
optionLabel="label"
|
|
@@ -1682,7 +1736,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1682
1736
|
</div>
|
|
1683
1737
|
)}
|
|
1684
1738
|
{currentFields.includes("relationType") && formik.values.relationType === "many-to-one" && (
|
|
1685
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1739
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1686
1740
|
<label
|
|
1687
1741
|
htmlFor="relationCascade"
|
|
1688
1742
|
className="form-field-label"
|
|
@@ -1701,7 +1755,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1701
1755
|
)
|
|
1702
1756
|
}
|
|
1703
1757
|
placeholder="Cascade"
|
|
1704
|
-
className={classNames("
|
|
1758
|
+
className={classNames("w-full", {
|
|
1705
1759
|
"p-invalid": isFormFieldValid(
|
|
1706
1760
|
formik,
|
|
1707
1761
|
"relationCascade"
|
|
@@ -1718,7 +1772,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1718
1772
|
)}
|
|
1719
1773
|
|
|
1720
1774
|
{currentFields.includes("relationModelModuleName") && (
|
|
1721
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1775
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1722
1776
|
<label
|
|
1723
1777
|
htmlFor="relationModelModuleName"
|
|
1724
1778
|
className="form-field-label"
|
|
@@ -1780,7 +1834,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1780
1834
|
{currentFields.includes(
|
|
1781
1835
|
"relationModelSingularName"
|
|
1782
1836
|
) && (
|
|
1783
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1837
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1784
1838
|
<label
|
|
1785
1839
|
htmlFor="relationModelSingularName"
|
|
1786
1840
|
className="form-field-label"
|
|
@@ -1826,8 +1880,41 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1826
1880
|
</div>
|
|
1827
1881
|
)}
|
|
1828
1882
|
|
|
1883
|
+
{isUserKeyFields && (
|
|
1884
|
+
<div className="field col-6 flex-flex-column gap-2">
|
|
1885
|
+
<label
|
|
1886
|
+
htmlFor="userKey"
|
|
1887
|
+
className="form-field-label"
|
|
1888
|
+
>
|
|
1889
|
+
Set User Key
|
|
1890
|
+
</label>
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
<SingleSelectAutoCompleteField
|
|
1894
|
+
key="userKey"
|
|
1895
|
+
formik={formik}
|
|
1896
|
+
isFormFieldValid={isFormFieldValid}
|
|
1897
|
+
fieldName="userKey"
|
|
1898
|
+
fieldNameId="userKey"
|
|
1899
|
+
labelKey="displayName"
|
|
1900
|
+
valueKey="name"
|
|
1901
|
+
searchData={searchUserKeyField}
|
|
1902
|
+
existingData={formik.values.userKey}
|
|
1903
|
+
/>
|
|
1904
|
+
{isFormFieldValid(
|
|
1905
|
+
formik,
|
|
1906
|
+
"userKey"
|
|
1907
|
+
) && (
|
|
1908
|
+
<Message
|
|
1909
|
+
severity="error"
|
|
1910
|
+
text={formik?.errors?.userKey?.toString()}
|
|
1911
|
+
/>
|
|
1912
|
+
)}
|
|
1913
|
+
</div>
|
|
1914
|
+
)}
|
|
1915
|
+
|
|
1829
1916
|
{currentFields.includes("relationCreateInverse") && formik.values.relationType === "many-to-many" && (
|
|
1830
|
-
<div className="field col-6 flex flex-column gap-2">
|
|
1917
|
+
<div className="field col-6 flex flex-column gap-2 mt-3">
|
|
1831
1918
|
<label htmlFor="relationCreateInverse" className="form-field-label">
|
|
1832
1919
|
Relation Create Inverse
|
|
1833
1920
|
</label>
|
|
@@ -1838,7 +1925,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1838
1925
|
checked={Boolean(formik.values.relationCreateInverse)}
|
|
1839
1926
|
onChange={(e) => formik.setFieldValue("relationCreateInverse", e.checked)}
|
|
1840
1927
|
/>
|
|
1841
|
-
<label htmlFor="relationCreateInverse" className="ml-2">
|
|
1928
|
+
<label htmlFor="relationCreateInverse" className="ml-2">Create Inverse</label>
|
|
1842
1929
|
</div>
|
|
1843
1930
|
{isFormFieldValid(formik, "relationCreateInverse") && (
|
|
1844
1931
|
<Message severity="error" text={formik?.errors?.relationCreateInverse?.toString()} />
|
|
@@ -1847,7 +1934,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1847
1934
|
)}
|
|
1848
1935
|
|
|
1849
1936
|
{currentFields.includes("relationModelFieldName") && formik.values.relationCreateInverse && formik.values.relationType === "many-to-many" && (
|
|
1850
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1937
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1851
1938
|
<label
|
|
1852
1939
|
htmlFor="relationModelFieldName"
|
|
1853
1940
|
className="form-field-label"
|
|
@@ -1878,7 +1965,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1878
1965
|
)}
|
|
1879
1966
|
|
|
1880
1967
|
{currentFields.includes("relationJoinTableName") && formik.values.relationType === "many-to-many" && (
|
|
1881
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1968
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1882
1969
|
<label
|
|
1883
1970
|
htmlFor="relationJoinTableName"
|
|
1884
1971
|
className="form-field-label"
|
|
@@ -1909,7 +1996,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1909
1996
|
)}
|
|
1910
1997
|
|
|
1911
1998
|
{currentFields.includes("joinColumnName") && formik.values.relationType === "many-to-many" && (
|
|
1912
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
1999
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1913
2000
|
<label
|
|
1914
2001
|
htmlFor="joinColumnName"
|
|
1915
2002
|
className="form-field-label"
|
|
@@ -1940,7 +2027,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1940
2027
|
)}
|
|
1941
2028
|
|
|
1942
2029
|
{currentFields.includes("relationJoinColumnName") && formik.values.relationType === "many-to-many" && (
|
|
1943
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2030
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1944
2031
|
<label
|
|
1945
2032
|
htmlFor="relationJoinColumnName"
|
|
1946
2033
|
className="form-field-label"
|
|
@@ -1971,7 +2058,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
1971
2058
|
)}
|
|
1972
2059
|
|
|
1973
2060
|
{currentFields.includes("selectionDynamicProvider") && (
|
|
1974
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2061
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
1975
2062
|
<label
|
|
1976
2063
|
htmlFor="selectionDynamicProvider"
|
|
1977
2064
|
className="form-field-label"
|
|
@@ -2027,7 +2114,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2027
2114
|
</div>
|
|
2028
2115
|
)}
|
|
2029
2116
|
{currentFields.includes("selectionValueType") && (
|
|
2030
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2117
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2031
2118
|
<label
|
|
2032
2119
|
htmlFor="selectionValueType"
|
|
2033
2120
|
className="form-field-label"
|
|
@@ -2045,7 +2132,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2045
2132
|
e.value
|
|
2046
2133
|
)
|
|
2047
2134
|
}
|
|
2048
|
-
placeholder="Select
|
|
2135
|
+
placeholder="Select Value Type"
|
|
2049
2136
|
className={classNames("", {
|
|
2050
2137
|
"p-invalid": isFormFieldValid(
|
|
2051
2138
|
formik,
|
|
@@ -2066,7 +2153,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2066
2153
|
)}
|
|
2067
2154
|
|
|
2068
2155
|
{currentFields.includes("selectionStaticValues") && (
|
|
2069
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2156
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2070
2157
|
<label
|
|
2071
2158
|
htmlFor="selectionStaticValues"
|
|
2072
2159
|
className="form-field-label"
|
|
@@ -2112,7 +2199,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2112
2199
|
</div>
|
|
2113
2200
|
)}
|
|
2114
2201
|
{currentFields.includes("computedFieldValueType") && (
|
|
2115
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2202
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2116
2203
|
<label
|
|
2117
2204
|
htmlFor="computedFieldValueType"
|
|
2118
2205
|
className="form-field-label"
|
|
@@ -2163,7 +2250,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2163
2250
|
{currentFields.includes(
|
|
2164
2251
|
"computedFieldValueProvider"
|
|
2165
2252
|
) && (
|
|
2166
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2253
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2167
2254
|
<label
|
|
2168
2255
|
htmlFor="computedFieldValueProvider"
|
|
2169
2256
|
className="form-field-label"
|
|
@@ -2346,13 +2433,13 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2346
2433
|
|
|
2347
2434
|
</div>
|
|
2348
2435
|
)}
|
|
2349
|
-
{(currentFields.includes("regexPattern") || currentFields.includes("min") || currentFields.includes("max") || currentFields.includes("ormType")) && ormTypeOptions &&
|
|
2436
|
+
{(currentFields.includes("regexPattern") || currentFields.includes("min") || currentFields.includes("max") || currentFields.includes("ormType")) && ormTypeOptions && selectedType.value !== 'relation' &&
|
|
2350
2437
|
<>
|
|
2351
2438
|
<p className="form-wrapper-heading text-base">Validations</p>
|
|
2352
2439
|
<div className="formgrid grid">
|
|
2353
2440
|
{(currentFields.includes("regexPattern") && selectedType.value === "password") &&
|
|
2354
2441
|
<>
|
|
2355
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2442
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2356
2443
|
<label
|
|
2357
2444
|
htmlFor="regexPattern"
|
|
2358
2445
|
className="form-field-label"
|
|
@@ -2375,7 +2462,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2375
2462
|
}
|
|
2376
2463
|
{currentFields.includes("regexPattern") && (
|
|
2377
2464
|
<>
|
|
2378
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2465
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2379
2466
|
<label
|
|
2380
2467
|
htmlFor="regexPattern"
|
|
2381
2468
|
className="form-field-label"
|
|
@@ -2437,9 +2524,9 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2437
2524
|
{(currentFields.includes("min") || currentFields.includes("max")) &&
|
|
2438
2525
|
<>
|
|
2439
2526
|
{currentFields.includes("min") && (
|
|
2440
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2527
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2441
2528
|
<label htmlFor="min" className="form-field-label">
|
|
2442
|
-
Min (Characters Allowed)
|
|
2529
|
+
Min {(selectedType.value !== "int" && selectedType.value !== "decimal") && `(Characters Allowed)`}
|
|
2443
2530
|
|
|
2444
2531
|
</label>
|
|
2445
2532
|
{/* <InputText
|
|
@@ -2472,6 +2559,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2472
2559
|
"min"
|
|
2473
2560
|
),
|
|
2474
2561
|
})}
|
|
2562
|
+
disabled={fieldMetaData?.id}
|
|
2475
2563
|
/>
|
|
2476
2564
|
}
|
|
2477
2565
|
|
|
@@ -2484,9 +2572,10 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2484
2572
|
</div>
|
|
2485
2573
|
)}
|
|
2486
2574
|
{currentFields.includes("max") && (
|
|
2487
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2575
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2488
2576
|
<label htmlFor="max" className="form-field-label">
|
|
2489
|
-
Max (
|
|
2577
|
+
Max {(selectedType.value !== "int" &&
|
|
2578
|
+
selectedType.value !== "decimal") && `(Characters allowed)`}
|
|
2490
2579
|
</label>
|
|
2491
2580
|
{/* <InputText
|
|
2492
2581
|
type="text"
|
|
@@ -2517,6 +2606,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2517
2606
|
"max"
|
|
2518
2607
|
),
|
|
2519
2608
|
})}
|
|
2609
|
+
disabled={fieldMetaData?.id}
|
|
2520
2610
|
/>
|
|
2521
2611
|
}
|
|
2522
2612
|
|
|
@@ -2533,7 +2623,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2533
2623
|
{currentFields.includes("ormType") && (
|
|
2534
2624
|
<div className="md:col-12 sm:col-12">
|
|
2535
2625
|
{ormTypeOptions && ormTypeOptions.length > 1 &&
|
|
2536
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2626
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2537
2627
|
<label htmlFor="ormType" className="form-field-label">
|
|
2538
2628
|
Type
|
|
2539
2629
|
</label>
|
|
@@ -2586,8 +2676,8 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2586
2676
|
|
|
2587
2677
|
<p className="form-wrapper-heading text-base">Settings</p>
|
|
2588
2678
|
<div className="formgrid grid">
|
|
2589
|
-
{currentFields.includes("required") && (
|
|
2590
|
-
<div className="field col-6 flex-flex-column gap-2">
|
|
2679
|
+
{currentFields.includes("required") && selectedType.value !== 'relation' && (
|
|
2680
|
+
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2591
2681
|
<div className="flex align-items-center">
|
|
2592
2682
|
<Checkbox
|
|
2593
2683
|
name="required"
|
|
@@ -2610,7 +2700,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2610
2700
|
)}
|
|
2611
2701
|
</div>
|
|
2612
2702
|
)}
|
|
2613
|
-
{currentFields.includes("unique") && (
|
|
2703
|
+
{currentFields.includes("unique") && selectedType.value !== 'relation' && (
|
|
2614
2704
|
<div className="field col-6 flex-flex-column gap-2">
|
|
2615
2705
|
<div className="flex align-items-center">
|
|
2616
2706
|
<Checkbox
|
|
@@ -2634,7 +2724,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2634
2724
|
)}
|
|
2635
2725
|
</div>
|
|
2636
2726
|
)}
|
|
2637
|
-
{currentFields.includes("index") && (
|
|
2727
|
+
{currentFields.includes("index") && selectedType.value !== 'relation' && (
|
|
2638
2728
|
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2639
2729
|
<div className="flex align-items-center">
|
|
2640
2730
|
<Checkbox
|
|
@@ -2656,7 +2746,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2656
2746
|
)}
|
|
2657
2747
|
</div>
|
|
2658
2748
|
)}
|
|
2659
|
-
{currentFields.includes("private") && (
|
|
2749
|
+
{currentFields.includes("private") && selectedType.value !== 'relation' && (
|
|
2660
2750
|
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2661
2751
|
<div className="flex align-items-center">
|
|
2662
2752
|
<Checkbox
|
|
@@ -2681,7 +2771,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2681
2771
|
)}
|
|
2682
2772
|
</div>
|
|
2683
2773
|
)}
|
|
2684
|
-
{currentFields.includes("encrypt") && (
|
|
2774
|
+
{currentFields.includes("encrypt") && selectedType.value !== 'relation' && (
|
|
2685
2775
|
<div className="field col-6 flex-flex-column gap-2 mt-3">
|
|
2686
2776
|
<div className="flex align-items-center gap-2">
|
|
2687
2777
|
<Checkbox
|
|
@@ -2742,7 +2832,7 @@ const FieldMetaDataForm = ({ modelMetaData, fieldMetaData, setFieldMetaData, all
|
|
|
2742
2832
|
Is Userkey
|
|
2743
2833
|
</label>
|
|
2744
2834
|
</div>
|
|
2745
|
-
<p className="fieldSubTitle">
|
|
2835
|
+
<p className="fieldSubTitle">By selecting this option, you are setting this field as the model's user key. Any existing user key configuration will be overwritten</p>
|
|
2746
2836
|
|
|
2747
2837
|
{isFormFieldValid(formik, "isUserKey") && (
|
|
2748
2838
|
<Message
|
|
@@ -290,7 +290,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
290
290
|
)}
|
|
291
291
|
</div>
|
|
292
292
|
|
|
293
|
-
<div className="field col-12 flex flex-column gap-
|
|
293
|
+
<div className="field col-12 flex flex-column gap-1 mt-4">
|
|
294
294
|
<label htmlFor="dataSource" className="form-field-label">
|
|
295
295
|
Data Source
|
|
296
296
|
</label>
|
|
@@ -542,7 +542,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
542
542
|
/>
|
|
543
543
|
)}
|
|
544
544
|
</div>
|
|
545
|
-
<div className="field col-12 flex flex-column gap-
|
|
545
|
+
<div className="field col-12 flex flex-column gap-1 mt-4">
|
|
546
546
|
<label htmlFor="singularName" className="form-field-label">
|
|
547
547
|
Singular Name
|
|
548
548
|
</label>
|
|
@@ -564,7 +564,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
564
564
|
/>
|
|
565
565
|
)}
|
|
566
566
|
</div>
|
|
567
|
-
<div className="field col-12 flex flex-column gap-
|
|
567
|
+
<div className="field col-12 flex flex-column gap-1 mt-4">
|
|
568
568
|
<label htmlFor="pluralName" className="form-field-label">
|
|
569
569
|
Plural Name
|
|
570
570
|
</label>
|
|
@@ -602,7 +602,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
602
602
|
</div>
|
|
603
603
|
</div>
|
|
604
604
|
{showTableName &&
|
|
605
|
-
<div className="field col-12 flex flex-column gap-
|
|
605
|
+
<div className="field col-12 flex flex-column gap-1 mt-4">
|
|
606
606
|
<label htmlFor="tableName" className="form-field-label">
|
|
607
607
|
Table Name
|
|
608
608
|
</label>
|
|
@@ -625,7 +625,7 @@ const ModelMetaData = React.forwardRef(({ modelMetaData, setModelMetaData, allMo
|
|
|
625
625
|
)}
|
|
626
626
|
</div>
|
|
627
627
|
}
|
|
628
|
-
<div className="field col-12 flex flex-column gap-
|
|
628
|
+
<div className="field col-12 flex flex-column gap-1 mt-4">
|
|
629
629
|
<label htmlFor="description" className="form-field-label">
|
|
630
630
|
Description
|
|
631
631
|
</label>
|
|
@@ -208,7 +208,7 @@ const CreateModule = ({ data }: any) => {
|
|
|
208
208
|
if (data) {
|
|
209
209
|
setmenuIconPreview(`${process.env.API_URL}/${data.menuIconUrl}`);
|
|
210
210
|
|
|
211
|
-
const fileName = data
|
|
211
|
+
const fileName = data?.menuIconUrl?.split("/").pop(); // Extract filename from URL
|
|
212
212
|
setFileDetails({ name: fileName || "Unknown File", type: "Uploaded File" });
|
|
213
213
|
|
|
214
214
|
// Set the upload progress to 100% since the file is already uploaded
|
|
@@ -332,15 +332,23 @@ const CreateModule = ({ data }: any) => {
|
|
|
332
332
|
outlined
|
|
333
333
|
severity="secondary"
|
|
334
334
|
type="button"
|
|
335
|
-
icon=
|
|
335
|
+
icon={
|
|
336
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
337
|
+
<path d="M6 14C5.45 14 4.97917 13.8042 4.5875 13.4125C4.19583 13.0208 4 12.55 4 12C4 11.45 4.19583 10.9792 4.5875 10.5875C4.97917 10.1958 5.45 10 6 10C6.55 10 7.02083 10.1958 7.4125 10.5875C7.80417 10.9792 8 11.45 8 12C8 12.55 7.80417 13.0208 7.4125 13.4125C7.02083 13.8042 6.55 14 6 14ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM18 14C17.45 14 16.9792 13.8042 16.5875 13.4125C16.1958 13.0208 16 12.55 16 12C16 11.45 16.1958 10.9792 16.5875 10.5875C16.9792 10.1958 17.45 10 18 10C18.55 10 19.0208 10.1958 19.4125 10.5875C19.8042 10.9792 20 11.45 20 12C20 12.55 19.8042 13.0208 19.4125 13.4125C19.0208 13.8042 18.55 14 18 14Z" fill="#4B4D52" />
|
|
338
|
+
</svg>
|
|
339
|
+
}
|
|
336
340
|
size="small"
|
|
337
|
-
className="
|
|
341
|
+
className="bg-primary-reverse p-0"
|
|
342
|
+
style={{
|
|
343
|
+
height: 32,
|
|
344
|
+
width: 32
|
|
345
|
+
}}
|
|
338
346
|
onClick={(e) =>
|
|
339
347
|
// @ts-ignore
|
|
340
348
|
op.current.toggle(e)
|
|
341
349
|
}
|
|
342
350
|
/>
|
|
343
|
-
<OverlayPanel ref={op} className="solid-custom-overlay"
|
|
351
|
+
<OverlayPanel ref={op} className="solid-custom-overlay">
|
|
344
352
|
<div className="flex flex-column gap-1 p-1">
|
|
345
353
|
<Button
|
|
346
354
|
text
|
|
@@ -317,7 +317,7 @@ const CreateUser = ({ data, params }: any) => {
|
|
|
317
317
|
/>
|
|
318
318
|
)}
|
|
319
319
|
</div>
|
|
320
|
-
<div className="field col-6 flex flex-column gap-
|
|
320
|
+
<div className="field col-6 flex flex-column gap-1 mt-4">
|
|
321
321
|
<label htmlFor="email" className="form-field-label">
|
|
322
322
|
Email
|
|
323
323
|
</label>
|
|
@@ -340,7 +340,7 @@ const CreateUser = ({ data, params }: any) => {
|
|
|
340
340
|
/>
|
|
341
341
|
)}
|
|
342
342
|
</div>
|
|
343
|
-
<div className="field col-6 flex flex-column gap-
|
|
343
|
+
<div className="field col-6 flex flex-column gap-1 mt-4">
|
|
344
344
|
<label htmlFor="mobile" className="form-field-label">
|
|
345
345
|
Mobile
|
|
346
346
|
</label>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { handleError } from "@/helpers/ToastContainer";
|
|
4
|
+
import { getSession, signOut, useSession } from "next-auth/react";
|
|
5
|
+
import { usePathname, useRouter } from "next/navigation";
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
|
+
import { Layout } from "./Layout";
|
|
8
|
+
import { Dialog } from "primereact/dialog";
|
|
9
|
+
import { Divider } from "primereact/divider";
|
|
10
|
+
import SolidChangeForcePassword from "../auth/SolidChangeForcePassword";
|
|
11
|
+
|
|
12
|
+
export const AdminLayout = ({ children }: { children: React.ReactNode }) => {
|
|
13
|
+
// const theme = useSelector((state: any) => state.theme.mode);
|
|
14
|
+
const { data: session, status } = useSession();
|
|
15
|
+
const [isForcePasswordChange, setIsForcePasswordChange] = useState(false)
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// @ts-expect-error: Handling potential case where 'data?.user?.user' might be undefined or null
|
|
18
|
+
if (session?.user?.user?.forcePasswordChange === true) {
|
|
19
|
+
setIsForcePasswordChange(true)
|
|
20
|
+
} else {
|
|
21
|
+
setIsForcePasswordChange(false)
|
|
22
|
+
}
|
|
23
|
+
}, [session])
|
|
24
|
+
const pathname = usePathname();
|
|
25
|
+
const router = useRouter();
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const handleRouteChange = async () => {
|
|
28
|
+
const session = await getSession(); // Force refetch session on navigation
|
|
29
|
+
if (session?.error === "RefreshAccessTokenError") {
|
|
30
|
+
handleError(["Session Expired. Please Login Again."])
|
|
31
|
+
signOut({ callbackUrl: "/auth/login" });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
};
|
|
36
|
+
// Listen to routeChangeComplete event
|
|
37
|
+
handleRouteChange()
|
|
38
|
+
|
|
39
|
+
}, [pathname])
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Layout>
|
|
43
|
+
{/* <div className={`${process.env.NEXT_PUBLIC_ENABLE_CUSTOM_HEADER_FOOTER == "true" && 'header-margin-top'}`} style={{ minHeight: `${process.env.NEXT_PUBLIC_ENABLE_CUSTOM_HEADER_FOOTER == "true" ? 'calc(100vh - 70px)' : 'calc(100vh)'}` }}> */}
|
|
44
|
+
|
|
45
|
+
{/* <div className="min-h-full max-h-full flex flex-column relative flex-auto overflow-x-auto"> */}
|
|
46
|
+
{/* <DashboardHeader /> */}
|
|
47
|
+
{/* <SolidListingHeader></SolidListingHeader> */}
|
|
48
|
+
{/* {pathname.includes('all') && <ListingHeader />} */}
|
|
49
|
+
{/* <div className="flex flex-column flex-auto" style={{ backgroundColor: '#f6f6f9', padding: '1.5rem 1.5rem 1.5rem', }}> */}
|
|
50
|
+
{children}
|
|
51
|
+
{/* </div> */}
|
|
52
|
+
{/* </div> */}
|
|
53
|
+
{/* </div> */}
|
|
54
|
+
{isForcePasswordChange &&
|
|
55
|
+
<Dialog header="Change Default Password" visible={isForcePasswordChange} closable={false} draggable={false} style={{ width: '25vw' }} onHide={() => setIsForcePasswordChange(false)}>
|
|
56
|
+
<Divider className="mt-0" />
|
|
57
|
+
<SolidChangeForcePassword />
|
|
58
|
+
</Dialog>
|
|
59
|
+
}
|
|
60
|
+
</Layout>
|
|
61
|
+
)
|
|
62
|
+
}
|