@solidstarters/solid-core-ui 1.1.6 → 1.1.8
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/SolidChangeForcePassword.d.ts.map +1 -1
- package/dist/components/auth/SolidChangeForcePassword.js +7 -7
- 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 +9 -4
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +13 -6
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/common/BackButton.d.ts +2 -0
- package/dist/components/common/BackButton.d.ts.map +1 -0
- package/dist/components/common/BackButton.js +17 -0
- package/dist/components/common/BackButton.js.map +1 -0
- package/dist/components/common/CancelButton.js +2 -2
- package/dist/components/common/CancelButton.js.map +1 -1
- package/dist/components/common/DropzonePlaceholder.d.ts.map +1 -1
- package/dist/components/common/DropzonePlaceholder.js +2 -1
- package/dist/components/common/DropzonePlaceholder.js.map +1 -1
- package/dist/components/common/FileReaderExt.d.ts +4 -0
- package/dist/components/common/FileReaderExt.d.ts.map +1 -0
- package/dist/components/common/FileReaderExt.js +15 -0
- package/dist/components/common/FileReaderExt.js.map +1 -0
- package/dist/components/common/GeneralSettings.d.ts +4 -0
- package/dist/components/common/GeneralSettings.d.ts.map +1 -0
- package/dist/components/common/GeneralSettings.js +139 -0
- package/dist/components/common/GeneralSettings.js.map +1 -0
- package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +1 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js +1 -1
- package/dist/components/common/SingleSelectAutoCompleteField.js.map +1 -1
- package/dist/components/common/SolidFormStepper.d.ts +2 -0
- package/dist/components/common/SolidFormStepper.d.ts.map +1 -0
- package/dist/components/common/SolidFormStepper.js +6 -0
- package/dist/components/common/SolidFormStepper.js.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +1 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.js +2 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.js +6 -5
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.d.ts +2 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.d.ts.map +1 -1
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js +4 -3
- package/dist/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.js.map +1 -1
- package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormView.js +83 -54
- 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 +4 -4
- 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 -7
- 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 -7
- 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 +4 -4
- 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 +4 -4
- 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 +2 -2
- 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 +2 -2
- 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 +11 -11
- 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 +13 -13
- 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 +2 -2
- 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 +4 -4
- 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 +4 -4
- 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 +2 -2
- 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 -7
- 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 +15 -14
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +99 -21
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/model/CreateModel.d.ts.map +1 -1
- package/dist/components/core/model/CreateModel.js +15 -11
- 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 +6 -6
- package/dist/components/core/model/FieldMetaData.js.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
- package/dist/components/core/model/FieldMetaDataForm.js +189 -176
- package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
- package/dist/components/core/model/FieldSelector.d.ts.map +1 -1
- package/dist/components/core/model/FieldSelector.js +1 -1
- package/dist/components/core/model/FieldSelector.js.map +1 -1
- package/dist/components/core/model/ModelMetaData.d.ts.map +1 -1
- package/dist/components/core/model/ModelMetaData.js +55 -44
- package/dist/components/core/model/ModelMetaData.js.map +1 -1
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +98 -60
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +18 -15
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
- package/dist/components/layout/user-profile-menu.js +3 -1
- package/dist/components/layout/user-profile-menu.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/redux/api/solidEntityApi.d.ts +2 -0
- package/dist/redux/api/solidEntityApi.d.ts.map +1 -1
- package/dist/redux/api/solidEntityApi.js +10 -0
- package/dist/redux/api/solidEntityApi.js.map +1 -1
- package/dist/redux/api/solidSettingsApi.d.ts +9 -0
- package/dist/redux/api/solidSettingsApi.d.ts.map +1 -0
- package/dist/redux/api/solidSettingsApi.js +40 -0
- package/dist/redux/api/solidSettingsApi.js.map +1 -0
- package/package.json +1 -1
- package/src/components/auth/SolidChangeForcePassword.tsx +2 -3
- package/src/components/auth/SolidForgotPassword.tsx +9 -4
- package/src/components/auth/SolidLogin.tsx +21 -12
- package/src/components/common/BackButton.tsx +27 -0
- package/src/components/common/CancelButton.tsx +2 -2
- package/src/components/common/DropzonePlaceholder.tsx +11 -3
- package/src/components/common/FileReaderExt.tsx +18 -0
- package/src/components/common/GeneralSettings.tsx +286 -0
- package/src/components/common/SingleSelectAutoCompleteField.tsx +0 -1
- package/src/components/common/SolidFormStepper.tsx +12 -0
- package/src/components/core/common/LoadDynamicJsxComponent.tsx +2 -1
- package/src/components/core/common/SolidGlobalSearchElement.tsx +6 -2
- package/src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx +4 -4
- package/src/components/core/form/SolidFormView.tsx +201 -186
- package/src/components/core/form/fields/SolidBooleanField.tsx +3 -7
- package/src/components/core/form/fields/SolidDateField.tsx +2 -8
- package/src/components/core/form/fields/SolidDateTimeField.tsx +19 -24
- package/src/components/core/form/fields/SolidDecimalField.tsx +2 -7
- package/src/components/core/form/fields/SolidIntegerField.tsx +17 -22
- package/src/components/core/form/fields/SolidJsonField.tsx +15 -19
- package/src/components/core/form/fields/SolidLongTextField.tsx +19 -24
- package/src/components/core/form/fields/SolidMediaMultipleField.tsx +47 -51
- package/src/components/core/form/fields/SolidMediaSingleField.tsx +47 -51
- package/src/components/core/form/fields/SolidRichTextField.tsx +3 -7
- package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +2 -7
- package/src/components/core/form/fields/SolidSelectionStaticField.tsx +20 -25
- package/src/components/core/form/fields/SolidShortTextField.tsx +18 -23
- package/src/components/core/form/fields/SolidTimeField.tsx +19 -24
- package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +51 -52
- package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +20 -25
- package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +6 -5
- package/src/components/core/list/SolidListView.tsx +118 -8
- package/src/components/core/model/CreateModel.tsx +68 -53
- package/src/components/core/model/FieldMetaData.tsx +16 -21
- package/src/components/core/model/FieldMetaDataForm.tsx +803 -895
- package/src/components/core/model/FieldSelector.tsx +10 -15
- package/src/components/core/model/ModelMetaData.tsx +373 -358
- package/src/components/core/module/CreateModule.tsx +327 -295
- package/src/components/core/users/CreateUser.tsx +175 -167
- package/src/components/layout/user-profile-menu.tsx +6 -1
- package/src/index.ts +6 -2
- package/src/redux/api/solidEntityApi.tsx +11 -0
- package/src/redux/api/solidSettingsApi.tsx +47 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import { useCreateSolidSettingsMutation, useUpdateSolidSettingsMutation } from '@/redux/api/solidSettingsApi';
|
|
3
|
+
import { useFormik } from 'formik';
|
|
4
|
+
import { Button } from 'primereact/button';
|
|
5
|
+
import { InputText } from 'primereact/inputtext';
|
|
6
|
+
import { SelectButton } from 'primereact/selectbutton';
|
|
7
|
+
import { Toast } from 'primereact/toast';
|
|
8
|
+
import { useRef } from 'react'
|
|
9
|
+
|
|
10
|
+
export const GeneralSettings = ({ solidSettingsData }: { solidSettingsData: any }) => {
|
|
11
|
+
console.log("solidSettingsData", solidSettingsData);
|
|
12
|
+
|
|
13
|
+
const [updateSolidSettings] = useUpdateSolidSettingsMutation();
|
|
14
|
+
const [
|
|
15
|
+
createSolidSettings,
|
|
16
|
+
] = useCreateSolidSettingsMutation();
|
|
17
|
+
const toast = useRef<Toast>(null);
|
|
18
|
+
|
|
19
|
+
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
20
|
+
toast.current?.show({
|
|
21
|
+
severity,
|
|
22
|
+
summary,
|
|
23
|
+
detail,
|
|
24
|
+
life: 3000,
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const initialValues = {
|
|
28
|
+
iamAllowPublicRegistration: solidSettingsData?.data?.records?.[0]?.iamAllowPublicRegistration || false,
|
|
29
|
+
iamPasswordRegistrationEnabled: solidSettingsData?.data?.records?.[0]?.iamPasswordRegistrationEnabled || false,
|
|
30
|
+
iamPasswordLessRegistrationEnabled: solidSettingsData?.data?.records?.[0]?.iamPasswordLessRegistrationEnabled || false,
|
|
31
|
+
iamGoogleOAuthEnabled: solidSettingsData?.data?.records?.[0]?.iamGoogleOAuthEnabled || false,
|
|
32
|
+
shouldQueueEmails: solidSettingsData?.data?.records?.[0]?.shouldQueueEmails || false,
|
|
33
|
+
shouldQueueSms: solidSettingsData?.data?.records?.[0]?.shouldQueueSms || false,
|
|
34
|
+
authPagesTheme: solidSettingsData?.data?.records?.[0]?.authPagesTheme || "light",
|
|
35
|
+
authPagesLayout: solidSettingsData?.data?.records?.[0]?.authPagesLayout || "center",
|
|
36
|
+
appTnc: solidSettingsData?.data?.records?.[0]?.appTnc || "",
|
|
37
|
+
appPrivacyPolicy: solidSettingsData?.data?.records?.[0]?.appPrivacyPolicy || "",
|
|
38
|
+
iamDefaultRole: solidSettingsData?.data?.records?.[0]?.iamDefaultRole || "Admin",
|
|
39
|
+
appTitle: solidSettingsData?.data?.records?.[0]?.appTitle || "SolidX",
|
|
40
|
+
appDescription: solidSettingsData?.data?.records?.[0]?.appDescription || "appDescription",
|
|
41
|
+
};
|
|
42
|
+
const formik = useFormik({
|
|
43
|
+
initialValues: initialValues,
|
|
44
|
+
enableReinitialize: true,
|
|
45
|
+
onSubmit: async (values) => {
|
|
46
|
+
console.log("Formik Values:", formik.values);
|
|
47
|
+
try {
|
|
48
|
+
const formData = new FormData()
|
|
49
|
+
Object.entries(values).forEach(([key, value]) => {
|
|
50
|
+
if (typeof value === "boolean") {
|
|
51
|
+
formData.append(key, value ? "true" : "");
|
|
52
|
+
} else {
|
|
53
|
+
formData.append(key, value.toString().toLowerCase());
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (solidSettingsData?.data?.records?.length > 0) {
|
|
57
|
+
await updateSolidSettings({
|
|
58
|
+
id: solidSettingsData?.data?.records?.[0]?.id,
|
|
59
|
+
data: formData,
|
|
60
|
+
}).unwrap()
|
|
61
|
+
showToast("success", "Success", "General Settings Updated");
|
|
62
|
+
} else {
|
|
63
|
+
createSolidSettings(formData)
|
|
64
|
+
showToast("success", "Success", "General Settings Created");
|
|
65
|
+
}
|
|
66
|
+
} catch (error) {
|
|
67
|
+
showToast("error", "Failed", "Something went wrong");
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const booleanOptions = [
|
|
73
|
+
{ label: "True", value: true },
|
|
74
|
+
{ label: "False", value: false },
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
const justifyOptions = [
|
|
78
|
+
{ icon: 'pi pi-align-left', value: 'left' },
|
|
79
|
+
{ icon: 'pi pi-align-center', value: 'Center' },
|
|
80
|
+
{ icon: 'pi pi-align-right', value: 'Right' },
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const justifyTemplate = (option: any) => {
|
|
84
|
+
return <i className={option.icon}></i>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="page-parent-wrapper p-4">
|
|
89
|
+
<Toast ref={toast} />
|
|
90
|
+
<h3>General Settings</h3>
|
|
91
|
+
<div className="formgrid grid">
|
|
92
|
+
<div className="col-7">
|
|
93
|
+
<form onSubmit={formik.handleSubmit}>
|
|
94
|
+
<div className="formgrid grid">
|
|
95
|
+
<div className="col-6 mt-3">
|
|
96
|
+
<div className="formgrid grid align-items-center">
|
|
97
|
+
<div className="col-5">
|
|
98
|
+
<label className="form-field-label">Allow Public Registration</label>
|
|
99
|
+
</div>
|
|
100
|
+
<div className="col-7">
|
|
101
|
+
<SelectButton
|
|
102
|
+
name="iamAllowPublicRegistration"
|
|
103
|
+
value={formik.values.iamAllowPublicRegistration}
|
|
104
|
+
onChange={(e) => formik.setFieldValue("iamAllowPublicRegistration", e.value)}
|
|
105
|
+
options={booleanOptions}
|
|
106
|
+
optionLabel="label"
|
|
107
|
+
optionValue="value"
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<div className="col-6 mt-3">
|
|
114
|
+
<div className="formgrid grid align-items-center">
|
|
115
|
+
<div className="col-5">
|
|
116
|
+
<label className="form-field-label">Password Registration Enabled</label>
|
|
117
|
+
</div>
|
|
118
|
+
<div className="col-7">
|
|
119
|
+
<SelectButton
|
|
120
|
+
name="iamPasswordRegistrationEnabled"
|
|
121
|
+
value={formik.values.iamPasswordRegistrationEnabled}
|
|
122
|
+
onChange={(e) => formik.setFieldValue("iamPasswordRegistrationEnabled", e.value)}
|
|
123
|
+
options={booleanOptions}
|
|
124
|
+
optionLabel="label"
|
|
125
|
+
optionValue="value"
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div className="col-6 mt-3">
|
|
132
|
+
<div className="formgrid grid align-items-center">
|
|
133
|
+
<div className="col-5">
|
|
134
|
+
<label className="form-field-label">Passwordless Registration Enabled</label>
|
|
135
|
+
</div>
|
|
136
|
+
<div className="col-7">
|
|
137
|
+
<SelectButton
|
|
138
|
+
name="iamPasswordLessRegistrationEnabled"
|
|
139
|
+
value={formik.values.iamPasswordLessRegistrationEnabled}
|
|
140
|
+
onChange={(e) => formik.setFieldValue("iamPasswordLessRegistrationEnabled", e.value)}
|
|
141
|
+
options={booleanOptions}
|
|
142
|
+
optionLabel="label"
|
|
143
|
+
optionValue="value"
|
|
144
|
+
/>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<div className="col-6 mt-3">
|
|
150
|
+
<div className="formgrid grid align-items-center">
|
|
151
|
+
<div className="col-5">
|
|
152
|
+
<label className="form-field-label">Google OAuth Enabled</label>
|
|
153
|
+
</div>
|
|
154
|
+
<div className="col-7">
|
|
155
|
+
<SelectButton
|
|
156
|
+
name="iamGoogleOAuthEnabled"
|
|
157
|
+
value={formik.values.iamGoogleOAuthEnabled}
|
|
158
|
+
onChange={(e) => formik.setFieldValue("iamGoogleOAuthEnabled", e.value)}
|
|
159
|
+
options={booleanOptions}
|
|
160
|
+
optionLabel="label"
|
|
161
|
+
optionValue="value"
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div className="col-6 mt-3">
|
|
168
|
+
<div className="formgrid grid align-items-center">
|
|
169
|
+
<div className="col-5">
|
|
170
|
+
<label className="form-field-label">Use queue for sending emails</label>
|
|
171
|
+
</div>
|
|
172
|
+
<div className="col-7">
|
|
173
|
+
<SelectButton
|
|
174
|
+
name="shouldQueueEmails"
|
|
175
|
+
value={formik.values.shouldQueueEmails}
|
|
176
|
+
onChange={(e) => formik.setFieldValue("shouldQueueEmails", e.value)}
|
|
177
|
+
options={booleanOptions}
|
|
178
|
+
optionLabel="label"
|
|
179
|
+
optionValue="value"
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div className="col-6 mt-3">
|
|
186
|
+
<div className="formgrid grid align-items-center">
|
|
187
|
+
<div className="col-5">
|
|
188
|
+
<label className="form-field-label">Use queue for sending SMS</label>
|
|
189
|
+
</div>
|
|
190
|
+
<div className="col-7">
|
|
191
|
+
<SelectButton
|
|
192
|
+
name="shouldQueueSms"
|
|
193
|
+
onChange={(e) => formik.setFieldValue("shouldQueueSms", e.value)}
|
|
194
|
+
value={formik.values.shouldQueueSms}
|
|
195
|
+
options={booleanOptions}
|
|
196
|
+
optionLabel="label"
|
|
197
|
+
optionValue="value"
|
|
198
|
+
/>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div className="col-6 mt-3">
|
|
204
|
+
<div className="formgrid grid align-items-center">
|
|
205
|
+
<div className="col-5">
|
|
206
|
+
<label className="form-field-label">Authentication Pages Theme</label>
|
|
207
|
+
</div>
|
|
208
|
+
<div className="col-7">
|
|
209
|
+
<div className="theme-buttons mt-2">
|
|
210
|
+
<Button
|
|
211
|
+
type="button"
|
|
212
|
+
label="Solid Light"
|
|
213
|
+
outlined={formik.values.authPagesTheme !== "light"}
|
|
214
|
+
onClick={() => formik.setFieldValue("authPagesTheme", "light")}
|
|
215
|
+
/>
|
|
216
|
+
<Button
|
|
217
|
+
type="button"
|
|
218
|
+
label="Solid Dark"
|
|
219
|
+
outlined={formik.values.authPagesTheme !== "dark"}
|
|
220
|
+
onClick={() => formik.setFieldValue("authPagesTheme", "dark")}
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<div className="col-6 mt-3">
|
|
227
|
+
<div className="formgrid grid align-items-center">
|
|
228
|
+
<div className="col-5">
|
|
229
|
+
<label className="form-field-label">Authentication Pages Theme</label>
|
|
230
|
+
</div>
|
|
231
|
+
<div className="col-7">
|
|
232
|
+
<SelectButton
|
|
233
|
+
name="authPagesLayout"
|
|
234
|
+
value={
|
|
235
|
+
formik.values.authPagesLayout === "left"
|
|
236
|
+
? "left"
|
|
237
|
+
: formik.values.authPagesLayout.charAt(0).toUpperCase() + formik.values.authPagesLayout.slice(1)
|
|
238
|
+
}
|
|
239
|
+
onChange={(e) => formik.setFieldValue("authPagesLayout", e.value)}
|
|
240
|
+
itemTemplate={justifyTemplate}
|
|
241
|
+
optionLabel="value"
|
|
242
|
+
options={justifyOptions}
|
|
243
|
+
/>
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
<div className="col-6 mt-3">
|
|
248
|
+
<div className="formgrid grid align-items-center">
|
|
249
|
+
<div className="col-5">
|
|
250
|
+
<label className="form-field-label">Terms and Conditions Link</label>
|
|
251
|
+
</div>
|
|
252
|
+
<div className="col-7">
|
|
253
|
+
<InputText
|
|
254
|
+
type="text"
|
|
255
|
+
id="appTnc"
|
|
256
|
+
name="appTnc"
|
|
257
|
+
onChange={formik.handleChange}
|
|
258
|
+
value={formik.values.appTnc}
|
|
259
|
+
/>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
<div className="col-6 mt-3">
|
|
264
|
+
<div className="formgrid grid align-items-center">
|
|
265
|
+
<div className="col-5">
|
|
266
|
+
<label className="form-field-label">Privacy Policy Link</label>
|
|
267
|
+
</div>
|
|
268
|
+
<div className="col-7">
|
|
269
|
+
<InputText
|
|
270
|
+
type="text"
|
|
271
|
+
id="appPrivacyPolicy"
|
|
272
|
+
name="appPrivacyPolicy"
|
|
273
|
+
onChange={formik.handleChange}
|
|
274
|
+
value={formik.values.appPrivacyPolicy}
|
|
275
|
+
/>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
<Button type="submit" label="Save" className="mt-3" />
|
|
281
|
+
</form>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
)
|
|
286
|
+
}
|
|
@@ -35,7 +35,6 @@ export const SingleSelectAutoCompleteField = ({ disabled, formik, isFormFieldVal
|
|
|
35
35
|
invalid={isFormFieldValid(formik, fieldName)}
|
|
36
36
|
completeMethod={searchItems}
|
|
37
37
|
virtualScrollerOptions={{ itemSize: 38 }}
|
|
38
|
-
className="w-full small-input"
|
|
39
38
|
// style={{
|
|
40
39
|
// maxHeight: 39.67
|
|
41
40
|
// }}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Button } from 'primereact/button'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
export const SolidFormStepper = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className='flex justify-content-end'>
|
|
7
|
+
<Button type='button' severity='secondary' className='solid-step-button btn-step-first'>Step 1</Button>
|
|
8
|
+
<Button type='button' className='solid-step-button btn-step'>Step 2</Button>
|
|
9
|
+
<Button type='button' className='solid-step-button btn-step-last'>Step 3</Button>
|
|
10
|
+
</div>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import dynamic from "next/dynamic";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import GenerateModelCodeRowAction from "../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction";
|
|
4
5
|
|
|
5
6
|
// Fallback component for missing components
|
|
6
7
|
const FallbackComponent = ({ componentName }: any) => (
|
|
@@ -31,7 +32,7 @@ export const LoadDynamicJsxComponent = ({ context }: any) => {
|
|
|
31
32
|
} catch (error) {
|
|
32
33
|
console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
33
34
|
// Return a fallback component if the import fails
|
|
34
|
-
return () => <
|
|
35
|
+
return () => <GenerateModelCodeRowAction context={context} />;
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
{ ssr: false } // Disable server-side rendering
|
|
@@ -101,7 +101,7 @@ const transformRulesToFilters = (input: any) => {
|
|
|
101
101
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCustomFilter }: any, ref) => {
|
|
104
|
+
export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCustomFilter, setShowArchived, showArchived }: any, ref) => {
|
|
105
105
|
|
|
106
106
|
const initialState: FilterRule[] = [
|
|
107
107
|
{
|
|
@@ -160,7 +160,7 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
160
160
|
}
|
|
161
161
|
}, [])
|
|
162
162
|
|
|
163
|
-
const op = useRef(null);
|
|
163
|
+
const op = useRef<OverlayPanel>(null);
|
|
164
164
|
|
|
165
165
|
return (
|
|
166
166
|
<div className="flex justify-content-center solid-custom-filter-wrapper">
|
|
@@ -184,6 +184,10 @@ export const SolidGlobalSearchElement = forwardRef(({ viewData, handleApplyCusto
|
|
|
184
184
|
<div className="px-2 py-1">
|
|
185
185
|
<Button text size="small" label="Custom Filter" iconPos="left" icon='pi pi-plus' onClick={() => setShowGlobalSearchElement(true)} />
|
|
186
186
|
</div>
|
|
187
|
+
<Divider className="m-0" />
|
|
188
|
+
{viewData?.data?.solidView?.model?.enableSoftDelete && <div className="px-2 py-1">
|
|
189
|
+
<Button text size="small" label={showArchived ? "Hide Archived Records" : "Show Archived Records"} iconPos="left" onClick={() => {setShowArchived(!showArchived); op.current?.hide()}} />
|
|
190
|
+
</div>}
|
|
187
191
|
</OverlayPanel>
|
|
188
192
|
<Dialog header={false} className="search-filter-popup" showHeader={false} visible={showGlobalSearchElement} style={{ width: '50vw' }} onHide={() => { if (!showGlobalSearchElement) return; setShowGlobalSearchElement(false); }}>
|
|
189
193
|
<div className="flex field-popup-navigation gap-3 justify-content-between ">
|
package/src/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { useGenerateCodeForModelMutation } from "@/redux/api/modelApi";
|
|
|
3
3
|
import { Button } from "primereact/button";
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const GenerateModelCodeRowAction = ({ context }: any) => {
|
|
7
7
|
|
|
8
8
|
const [
|
|
9
9
|
generateCode,
|
|
@@ -13,7 +13,7 @@ export const GenerateModelCodeRowAction = ({ context }: any) => {
|
|
|
13
13
|
|
|
14
14
|
const generateCodeHandler = async () => {
|
|
15
15
|
const response = await generateCode({ id: context.rowData.id })
|
|
16
|
-
context.
|
|
16
|
+
context.closeListViewRowActionPopup();
|
|
17
17
|
console.log("response", response);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -29,10 +29,10 @@ export const GenerateModelCodeRowAction = ({ context }: any) => {
|
|
|
29
29
|
</ul>
|
|
30
30
|
<div className="flex gap-5 justify-content-center">
|
|
31
31
|
<Button label="Ok" icon="pi pi-check" className='small-button' severity="danger" autoFocus onClick={generateCodeHandler} />
|
|
32
|
-
<Button label="Cancel" icon="pi pi-times" className='small-button' onClick={() => context.
|
|
32
|
+
<Button label="Cancel" icon="pi pi-times" className='small-button' onClick={() => context.closeListViewRowActionPopup()} />
|
|
33
33
|
</div>
|
|
34
34
|
</div >
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
export default GenerateModelCodeRowAction;
|