@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
|
@@ -51,7 +51,8 @@ export class SolidTimeField implements ISolidField {
|
|
|
51
51
|
const calendarRef = useRef<any>(null); // Reference for the Calendar component
|
|
52
52
|
const fieldDescription = fieldLayoutInfo.attrs.description ?? fieldMetadata.description;
|
|
53
53
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
54
|
-
|
|
54
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
55
|
+
|
|
55
56
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
56
57
|
|
|
57
58
|
const fieldDisabled = fieldLayoutInfo.attrs?.disabled;
|
|
@@ -60,10 +61,12 @@ export class SolidTimeField implements ISolidField {
|
|
|
60
61
|
return (
|
|
61
62
|
<div className={className}>
|
|
62
63
|
<div className="flex flex-column gap-2 mt-4">
|
|
63
|
-
|
|
64
|
+
{showFieldLabel != false &&
|
|
65
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel}
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
{fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}
|
|
68
|
+
</label>
|
|
69
|
+
}
|
|
67
70
|
<Calendar
|
|
68
71
|
disabled={formDisabled || fieldDisabled}
|
|
69
72
|
ref={calendarRef} // Attach ref to Calendar
|
|
@@ -136,6 +136,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
136
136
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
137
137
|
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
138
138
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
139
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
139
140
|
|
|
140
141
|
// auto complete specific code.
|
|
141
142
|
const entityApi = createSolidEntityApi(fieldMetadata.relationModelSingularName);
|
|
@@ -235,9 +236,11 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
235
236
|
return (
|
|
236
237
|
<div className={className}>
|
|
237
238
|
<div className="flex align-items-center gap-3">
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
{showFieldLabel != false &&
|
|
240
|
+
<label className="form-field-label">
|
|
241
|
+
{capitalize(fieldLayoutInfo.attrs.name)}
|
|
242
|
+
</label>
|
|
243
|
+
}
|
|
241
244
|
{fieldLayoutInfo.attrs.inlineCreate === "true" &&
|
|
242
245
|
this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
|
|
243
246
|
}
|
|
@@ -289,8 +292,9 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
289
292
|
renderAutoCompleteMode(formik: FormikObject, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
|
|
290
293
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
291
294
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
292
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
295
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
293
296
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
297
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
294
298
|
|
|
295
299
|
// auto complete specific code.
|
|
296
300
|
const entityApi = createSolidEntityApi(fieldMetadata.relationModelSingularName);
|
|
@@ -358,9 +362,11 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
358
362
|
|
|
359
363
|
return (
|
|
360
364
|
<div className={className}>
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
365
|
+
{showFieldLabel != false &&
|
|
366
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
|
|
367
|
+
{fieldLabel}
|
|
368
|
+
</label>
|
|
369
|
+
}
|
|
364
370
|
<div className="flex align-items-center gap-3">
|
|
365
371
|
<AutoComplete
|
|
366
372
|
readOnly={readOnly}
|
|
@@ -388,7 +394,7 @@ export class SolidRelationManyToManyField implements ISolidField {
|
|
|
388
394
|
|
|
389
395
|
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
390
396
|
const fieldLayoutInfo = this.fieldContext.field;
|
|
391
|
-
const className = fieldLayoutInfo.attrs?.className || 'field col-
|
|
397
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
392
398
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
393
399
|
|
|
394
400
|
const params = {
|
|
@@ -7,6 +7,12 @@ import { useState } from "react";
|
|
|
7
7
|
import * as Yup from 'yup';
|
|
8
8
|
import { Schema } from "yup";
|
|
9
9
|
import { FormikObject, ISolidField, SolidFieldProps } from "../ISolidField";
|
|
10
|
+
import { camelCase, capitalize } from "lodash";
|
|
11
|
+
import { Button } from "primereact/button";
|
|
12
|
+
import { Checkbox } from "primereact/checkbox";
|
|
13
|
+
import { Dialog } from "primereact/dialog";
|
|
14
|
+
import { Panel } from "primereact/panel";
|
|
15
|
+
import SolidFormView from "../../SolidFormView";
|
|
10
16
|
|
|
11
17
|
|
|
12
18
|
export class SolidRelationManyToOneField implements ISolidField {
|
|
@@ -57,6 +63,8 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
57
63
|
const className = fieldLayoutInfo.attrs?.className || 'field col-12';
|
|
58
64
|
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
59
65
|
const solidFormViewMetaData = this.fieldContext.solidFormViewMetaData;
|
|
66
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
67
|
+
const [visibleCreateRelationEntity, setvisibleCreateRelationEntity] = useState(false);
|
|
60
68
|
|
|
61
69
|
// auto complete specific code.
|
|
62
70
|
const entityApi = createSolidEntityApi(fieldMetadata.relationModelSingularName);
|
|
@@ -106,11 +114,36 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
106
114
|
|
|
107
115
|
const isFormFieldValid = (formik: any, fieldName: string) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
108
116
|
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
const disabled = fieldLayoutInfo.attrs?.disabled;
|
|
121
|
+
const readOnly = fieldLayoutInfo.attrs?.readOnly;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
const customCreateHandler = (values: any) => {
|
|
125
|
+
const currentRelationData = formik.values[fieldLayoutInfo.attrs.name] || [];
|
|
126
|
+
const jsonValues = Object.fromEntries(values.entries());
|
|
127
|
+
const updatedRelationData = [
|
|
128
|
+
...currentRelationData,
|
|
129
|
+
{
|
|
130
|
+
label: jsonValues[fieldMetadata?.relationModel?.userKeyField?.name],
|
|
131
|
+
value: "new",
|
|
132
|
+
original: jsonValues,
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
formik.setFieldValue(fieldLayoutInfo.attrs.name, updatedRelationData);
|
|
137
|
+
|
|
138
|
+
}
|
|
109
139
|
return (
|
|
110
140
|
<div className={className}>
|
|
111
141
|
<div className="flex flex-column gap-2 mt-4">
|
|
112
|
-
|
|
113
|
-
|
|
142
|
+
{showFieldLabel != false &&
|
|
143
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">
|
|
144
|
+
{fieldLabel}
|
|
145
|
+
</label>
|
|
146
|
+
}
|
|
114
147
|
<AutoComplete
|
|
115
148
|
readOnly={formReadonly || fieldReadonly}
|
|
116
149
|
disabled={formDisabled || fieldDisabled}
|
|
@@ -122,8 +155,11 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
122
155
|
suggestions={autoCompleteItems}
|
|
123
156
|
completeMethod={autoCompleteSearch}
|
|
124
157
|
onChange={formik.handleChange}
|
|
125
|
-
className="solid-standard-autocomplete"
|
|
158
|
+
className="w-full solid-standard-autocomplete"
|
|
126
159
|
/>
|
|
160
|
+
{fieldLayoutInfo.attrs.inlineCreate === "true" &&
|
|
161
|
+
this.renderSolidFormEmbededView(formik, customCreateHandler, visibleCreateRelationEntity, setvisibleCreateRelationEntity)
|
|
162
|
+
}
|
|
127
163
|
</div>
|
|
128
164
|
{isFormFieldValid(formik, fieldLayoutInfo.attrs.name) && (
|
|
129
165
|
<Message severity="error" text={formik?.errors[fieldLayoutInfo.attrs.name]?.toString()} />
|
|
@@ -131,4 +167,58 @@ export class SolidRelationManyToOneField implements ISolidField {
|
|
|
131
167
|
</div>
|
|
132
168
|
);
|
|
133
169
|
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
renderSolidFormEmbededView(formik: FormikObject, customCreateHandler: any, visibleCreateRelationEntity: any, setvisibleCreateRelationEntity: any) {
|
|
173
|
+
|
|
174
|
+
const fieldMetadata = this.fieldContext.fieldMetadata;
|
|
175
|
+
const fieldLayoutInfo = this.fieldContext.field;
|
|
176
|
+
const className = fieldLayoutInfo.attrs?.className || 'field col-6 flex flex-column gap-2 mt-4';
|
|
177
|
+
const fieldLabel = fieldLayoutInfo.attrs.label ?? fieldMetadata.displayName;
|
|
178
|
+
|
|
179
|
+
const params = {
|
|
180
|
+
moduleName: this.fieldContext.fieldMetadata.relationModelModuleName,
|
|
181
|
+
id: "new",
|
|
182
|
+
embeded: true,
|
|
183
|
+
layout: fieldLayoutInfo?.attrs?.inlineCreateLayout,
|
|
184
|
+
customCreateHandler: ((values: any) => {
|
|
185
|
+
setvisibleCreateRelationEntity(false);
|
|
186
|
+
customCreateHandler(values)
|
|
187
|
+
}),
|
|
188
|
+
inlineCreateAutoSave: fieldLayoutInfo?.attrs?.inlineCreateAutoSave,
|
|
189
|
+
handlePopupClose: (() => {
|
|
190
|
+
setvisibleCreateRelationEntity(false);
|
|
191
|
+
}),
|
|
192
|
+
modelName: camelCase(this.fieldContext.fieldMetadata.relationModelSingularName)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<div >
|
|
197
|
+
<Button
|
|
198
|
+
icon="pi pi-plus"
|
|
199
|
+
rounded
|
|
200
|
+
outlined
|
|
201
|
+
aria-label="Filter"
|
|
202
|
+
type="button"
|
|
203
|
+
size="small"
|
|
204
|
+
onClick={() => setvisibleCreateRelationEntity(true)}
|
|
205
|
+
className="custom-add-button"
|
|
206
|
+
/>
|
|
207
|
+
<Dialog
|
|
208
|
+
header=""
|
|
209
|
+
showHeader={false}
|
|
210
|
+
visible={visibleCreateRelationEntity}
|
|
211
|
+
style={{ width: fieldLayoutInfo?.attrs?.inlineCreateLayout?.attrs?.width ?? "60vw" }}
|
|
212
|
+
onHide={() => {
|
|
213
|
+
if (!visibleCreateRelationEntity) return;
|
|
214
|
+
setvisibleCreateRelationEntity(false);
|
|
215
|
+
}}
|
|
216
|
+
className="solid-dialog"
|
|
217
|
+
>
|
|
218
|
+
<SolidFormView {...params} />
|
|
219
|
+
|
|
220
|
+
</Dialog>
|
|
221
|
+
</div>
|
|
222
|
+
)
|
|
223
|
+
}
|
|
134
224
|
}
|
|
@@ -62,6 +62,7 @@ export class SolidRelationOneToManyField implements ISolidField {
|
|
|
62
62
|
const [listViewParams, setListViewParams] = useState<any>()
|
|
63
63
|
const [formViewParams, setformViewParams] = useState<any>()
|
|
64
64
|
const [refreshList, setRefreshList] = useState(false); // Added state for rerender
|
|
65
|
+
const showFieldLabel = fieldLayoutInfo?.attrs?.showLabel;
|
|
65
66
|
|
|
66
67
|
|
|
67
68
|
const handlePopupOpen = (id: any) => {
|
|
@@ -133,7 +134,10 @@ export class SolidRelationOneToManyField implements ISolidField {
|
|
|
133
134
|
return (
|
|
134
135
|
<div className={className}>
|
|
135
136
|
{/* <div className="justify-content-center align-items-center"> */}
|
|
136
|
-
|
|
137
|
+
{showFieldLabel != false &&
|
|
138
|
+
<label htmlFor={fieldLayoutInfo.attrs.name} className="form-field-label">{fieldLabel} {fieldDescription && <span className="form_field_help">({fieldDescription}) </span>}</label>
|
|
139
|
+
}
|
|
140
|
+
|
|
137
141
|
{/* </div>
|
|
138
142
|
<br></br> */}
|
|
139
143
|
{listViewParams &&
|
|
@@ -237,7 +237,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
237
237
|
groupFilter: {
|
|
238
238
|
limit: kanbanViewMetaData?.data?.solidView?.layout?.attrs?.recordsCount,
|
|
239
239
|
offset: 0,
|
|
240
|
-
filters:filters
|
|
240
|
+
filters: filters
|
|
241
241
|
}
|
|
242
242
|
// sort: [`id:desc`],
|
|
243
243
|
};
|
|
@@ -258,7 +258,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
258
258
|
|
|
259
259
|
// clear Filter
|
|
260
260
|
|
|
261
|
-
const clearFilter = async() => {
|
|
261
|
+
const clearFilter = async () => {
|
|
262
262
|
if (solidKanbanViewMetaData) {
|
|
263
263
|
// initialFilterMethod()
|
|
264
264
|
}
|
|
@@ -553,7 +553,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
553
553
|
|
|
554
554
|
|
|
555
555
|
return (
|
|
556
|
-
|
|
556
|
+
<div className="page-parent-wrapper">
|
|
557
557
|
<div className="flex gap-3 mb-4 align-items-center justify-content-between kanban-view">
|
|
558
558
|
<div className="flex gap-3 mb-4 align-items-center" >
|
|
559
559
|
|
|
@@ -610,7 +610,7 @@ export const SolidKanbanView = (params: SolidKanbanViewParams) => {
|
|
|
610
610
|
>
|
|
611
611
|
<p>Are you sure you want to delete the selected records?</p>
|
|
612
612
|
</Dialog>
|
|
613
|
-
|
|
613
|
+
</div>
|
|
614
614
|
);
|
|
615
615
|
};
|
|
616
616
|
|
|
@@ -59,6 +59,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
59
59
|
// const [showGlobalSearchElement, setShowGlobalSearchElement] = useState<boolean>(false);
|
|
60
60
|
|
|
61
61
|
const [toPopulate, setToPopulate] = useState<string[]>([]);
|
|
62
|
+
const [toPopulateMedia, setToPopulateMedia] = useState<string[]>([]);
|
|
62
63
|
const [actionsAllowed, setActionsAllowed] = useState<string[]>([]);
|
|
63
64
|
|
|
64
65
|
const [triggerCheckIfPermissionExists] = useLazyCheckIfPermissionExistsQuery();
|
|
@@ -123,6 +124,8 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
123
124
|
|
|
124
125
|
const initialFilters: any = {};
|
|
125
126
|
const toPopulate: string[] = [];
|
|
127
|
+
const toPopulateMedia: string[] = [];
|
|
128
|
+
|
|
126
129
|
for (let i = 0; i < solidView.layout.children?.length; i++) {
|
|
127
130
|
const column = solidView.layout.children[i];
|
|
128
131
|
const fieldMetadata = solidFieldsMetadata[column.attrs.name];
|
|
@@ -155,10 +158,14 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
155
158
|
if (fieldMetadata.type === 'relation' && fieldMetadata.relationType === 'many-to-one') {
|
|
156
159
|
toPopulate.push(fieldMetadata.name);
|
|
157
160
|
}
|
|
161
|
+
if (fieldMetadata.type === 'mediaSingle' || fieldMetadata.relationType === 'mediaMultiple') {
|
|
162
|
+
toPopulateMedia.push(fieldMetadata.name);
|
|
163
|
+
}
|
|
158
164
|
}
|
|
159
165
|
// setFilters(initialFilters);
|
|
160
166
|
setRows(solidListViewMetaData?.data?.solidView?.layout?.attrs?.defaultPageSize ? solidListViewMetaData?.data?.solidView?.layout?.attrs.defaultPageSize : 25)
|
|
161
167
|
setToPopulate(toPopulate);
|
|
168
|
+
setToPopulateMedia(toPopulateMedia);
|
|
162
169
|
}
|
|
163
170
|
|
|
164
171
|
useEffect(() => {
|
|
@@ -268,11 +275,12 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
268
275
|
|
|
269
276
|
// Fetch data after toPopulate has been populated...
|
|
270
277
|
useEffect(() => {
|
|
271
|
-
if (toPopulate) {
|
|
278
|
+
if (toPopulate || toPopulateMedia) {
|
|
272
279
|
const queryData = {
|
|
273
280
|
offset: 0,
|
|
274
281
|
limit: 25,
|
|
275
282
|
populate: toPopulate,
|
|
283
|
+
populateMedia: toPopulateMedia,
|
|
276
284
|
sort: [`id:desc`],
|
|
277
285
|
filters: { ...params.customFilter }
|
|
278
286
|
};
|
|
@@ -288,7 +296,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
288
296
|
setSelectedRecoverRecords([]);
|
|
289
297
|
setShowArchived(false);
|
|
290
298
|
}
|
|
291
|
-
}, [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, toPopulate]);
|
|
299
|
+
}, [isDeleteSolidEntitiesSucess, isDeleteSolidSingleEntitySuccess, toPopulate, toPopulateMedia]);
|
|
292
300
|
|
|
293
301
|
// Handle pagination event.
|
|
294
302
|
const onPageChange = (event: any) => {
|
|
@@ -402,6 +410,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
402
410
|
limit: limit ?? rows,
|
|
403
411
|
filters: filters ?? filters,
|
|
404
412
|
populate: toPopulate,
|
|
413
|
+
populateMedia: toPopulateMedia
|
|
405
414
|
};
|
|
406
415
|
|
|
407
416
|
if (sortField) {
|
|
@@ -450,7 +459,6 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
450
459
|
const op = useRef(null)
|
|
451
460
|
const [deleteEntity, setDeleteEntity] = useState(false);
|
|
452
461
|
|
|
453
|
-
|
|
454
462
|
// clickable link allowing one to open the detail / form view.
|
|
455
463
|
const detailsBodyTemplate = (solidViewData: any) => {
|
|
456
464
|
return (
|
|
@@ -472,62 +480,6 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
472
480
|
<path d="M4 14C4 14.55 3.80417 15.0208 3.4125 15.4125C3.02083 15.8042 2.55 16 2 16C1.45 16 0.979167 15.8042 0.5875 15.4125C0.195833 15.0208 0 14.55 0 14C0 13.45 0.195833 12.9792 0.5875 12.5875C0.979167 12.1958 1.45 12 2 12C2.55 12 3.02083 12.1958 3.4125 12.5875C3.80417 12.9792 4 13.45 4 14ZM4 8C4 8.55 3.80417 9.02083 3.4125 9.4125C3.02083 9.80417 2.55 10 2 10C1.45 10 0.979167 9.80417 0.5875 9.4125C0.195833 9.02083 0 8.55 0 8C0 7.45 0.195833 6.97917 0.5875 6.5875C0.979167 6.19583 1.45 6 2 6C2.55 6 3.02083 6.19583 3.4125 6.5875C3.80417 6.97917 4 7.45 4 8ZM4 2C4 2.55 3.80417 3.02083 3.4125 3.4125C3.02083 3.80417 2.55 4 2 4C1.45 4 0.979167 3.80417 0.5875 3.4125C0.195833 3.02083 0 2.55 0 2C0 1.45 0.195833 0.979166 0.5875 0.5875C0.979167 0.195833 1.45 0 2 0C2.55 0 3.02083 0.195833 3.4125 0.5875C3.80417 0.979166 4 1.45 4 2Z" fill="#666666" />
|
|
473
481
|
</svg>
|
|
474
482
|
</Button>
|
|
475
|
-
<OverlayPanel ref={op} className="solid-custom-overlay" style={{ top: 10 }}>
|
|
476
|
-
<div className="flex flex-column gap-1 p-1">
|
|
477
|
-
<Button
|
|
478
|
-
className="w-8rem text-left gap-2"
|
|
479
|
-
label="Edit"
|
|
480
|
-
size="small"
|
|
481
|
-
iconPos="left"
|
|
482
|
-
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
483
|
-
<path d="M3.33333 12.6667H4.28333L10.8 6.15L9.85 5.2L3.33333 11.7167V12.6667ZM2 14V11.1667L10.8 2.38333C10.9333 2.26111 11.0806 2.16667 11.2417 2.1C11.4028 2.03333 11.5722 2 11.75 2C11.9278 2 12.1 2.03333 12.2667 2.1C12.4333 2.16667 12.5778 2.26667 12.7 2.4L13.6167 3.33333C13.75 3.45556 13.8472 3.6 13.9083 3.76667C13.9694 3.93333 14 4.1 14 4.26667C14 4.44444 13.9694 4.61389 13.9083 4.775C13.8472 4.93611 13.75 5.08333 13.6167 5.21667L4.83333 14H2ZM10.3167 5.68333L9.85 5.2L10.8 6.15L10.3167 5.68333Z" fill="#F9F0FF" />
|
|
484
|
-
</svg>}
|
|
485
|
-
onClick={() => {
|
|
486
|
-
console.log("solidViewData.id", solidViewData.id);
|
|
487
|
-
|
|
488
|
-
if (params.embeded == true) {
|
|
489
|
-
params.handlePopUpOpen(solidsolidViewDataId);
|
|
490
|
-
} else {
|
|
491
|
-
router.push(`${editButtonUrl}/${solidsolidViewDataId}`)
|
|
492
|
-
}
|
|
493
|
-
}}
|
|
494
|
-
/>
|
|
495
|
-
<Button
|
|
496
|
-
text
|
|
497
|
-
className="w-8rem text-left gap-2"
|
|
498
|
-
label="Delete"
|
|
499
|
-
size="small"
|
|
500
|
-
iconPos="left"
|
|
501
|
-
severity="secondary"
|
|
502
|
-
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
503
|
-
<path d="M4.66666 14C4.29999 14 3.9861 13.8694 3.72499 13.6083C3.46388 13.3472 3.33332 13.0333 3.33332 12.6667V4H2.66666V2.66667H5.99999V2H9.99999V2.66667H13.3333V4H12.6667V12.6667C12.6667 13.0333 12.5361 13.3472 12.275 13.6083C12.0139 13.8694 11.7 14 11.3333 14H4.66666ZM11.3333 4H4.66666V12.6667H11.3333V4ZM5.99999 11.3333H7.33332V5.33333H5.99999V11.3333ZM8.66666 11.3333H9.99999V5.33333H8.66666V11.3333Z" fill="#4B4D52" />
|
|
504
|
-
</svg>}
|
|
505
|
-
onClick={() => setDeleteEntity(true)}
|
|
506
|
-
/>
|
|
507
|
-
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons &&
|
|
508
|
-
solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons.map((rowAction: any) => {
|
|
509
|
-
return (
|
|
510
|
-
<Button
|
|
511
|
-
text
|
|
512
|
-
size="small"
|
|
513
|
-
icon={rowAction?.attrs?.className ? rowAction?.attrs?.className : "pi pi-pencil"}
|
|
514
|
-
onClick={() => {
|
|
515
|
-
setListRowActionData({
|
|
516
|
-
modelName: params.modelName,
|
|
517
|
-
moduleName: params.moduleName,
|
|
518
|
-
rowAction: rowAction,
|
|
519
|
-
rowData: solidViewData,
|
|
520
|
-
closeListViewRowActionPopup: closeListViewRowActionPopup
|
|
521
|
-
|
|
522
|
-
});
|
|
523
|
-
setListViewRowActionPopupState(true)
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
/>
|
|
527
|
-
);
|
|
528
|
-
})}
|
|
529
|
-
</div>
|
|
530
|
-
</OverlayPanel>
|
|
531
483
|
</div>
|
|
532
484
|
// <a onClick={() => {
|
|
533
485
|
// if (params.embeded == true) {
|
|
@@ -673,7 +625,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
673
625
|
const [view, setView] = useState<string | any>(viewModes[0].value);
|
|
674
626
|
|
|
675
627
|
return (
|
|
676
|
-
|
|
628
|
+
<div className="page-parent-wrapper">
|
|
677
629
|
<div className="page-header">
|
|
678
630
|
<Toast ref={toast} />
|
|
679
631
|
<div className="flex gap-3 align-items-center">
|
|
@@ -759,7 +711,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
759
711
|
rows={rows}
|
|
760
712
|
rowsPerPageOptions={solidListViewMetaData?.data?.solidView?.layout?.attrs?.pageSizeOptions}
|
|
761
713
|
dataKey="id"
|
|
762
|
-
emptyMessage=
|
|
714
|
+
emptyMessage={solidListViewMetaData?.data?.solidView?.model?.description || 'No Entities found.'}
|
|
763
715
|
filterDisplay="menu"
|
|
764
716
|
totalRecords={totalRecords}
|
|
765
717
|
first={first}
|
|
@@ -898,12 +850,12 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
898
850
|
</p>
|
|
899
851
|
<p className="" style={{ color: 'var{--solid-grey-500}' }}>{selectedSolidViewData?.singularName}</p>
|
|
900
852
|
<div className="flex align-items-center gap-2 mt-3">
|
|
901
|
-
<Button label="Delete" size="small" onClick={() => { deleteSolidSingleEntiry(
|
|
902
|
-
<Button label="Cancel" size="small" onClick={() => setDeleteEntity(false)} outlined />
|
|
853
|
+
<Button label="Delete" size="small" onClick={() => { deleteSolidSingleEntiry(selectedSolidViewData?.id); setDeleteEntity(false); }} />
|
|
854
|
+
<Button label="Cancel" size="small" onClick={() => setDeleteEntity(false)} outlined className='bg-primary-reverse' />
|
|
903
855
|
</div>
|
|
904
856
|
</div>
|
|
905
857
|
</Dialog>
|
|
906
|
-
|
|
858
|
+
</div>
|
|
907
859
|
);
|
|
908
860
|
};
|
|
909
861
|
|
|
@@ -9,11 +9,29 @@ const SolidMediaMultipleColumn = ({ solidListViewMetaData, fieldMetadata, column
|
|
|
9
9
|
const showFilterOperator = false;
|
|
10
10
|
const columnDataType = undefined;
|
|
11
11
|
const header = column.attrs.label ?? fieldMetadata.displayName;
|
|
12
|
+
const imageBodyTemplate = (product: any) => {
|
|
13
|
+
if (!product?._media?.[fieldMetadata.name]) return null;
|
|
12
14
|
|
|
15
|
+
const imageUrls = product._media[fieldMetadata.name].map((i: any) => i._full_url);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
{imageUrls.map((url: string, index: number) => (
|
|
20
|
+
<img
|
|
21
|
+
key={index}
|
|
22
|
+
src={url}
|
|
23
|
+
alt={`product-image-${index}`}
|
|
24
|
+
className="w-6rem shadow-2 border-round"
|
|
25
|
+
/>
|
|
26
|
+
))}
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
13
30
|
return (
|
|
14
31
|
<Column
|
|
15
32
|
key={fieldMetadata.name}
|
|
16
33
|
field={fieldMetadata.name}
|
|
34
|
+
body={imageBodyTemplate}
|
|
17
35
|
header={header}
|
|
18
36
|
// className="text-sm"
|
|
19
37
|
sortable={column.attrs.sortable}
|
|
@@ -8,16 +8,37 @@ import { FilterMatchMode } from 'primereact/api';
|
|
|
8
8
|
|
|
9
9
|
const SolidMediaSingleColumn = ({ solidListViewMetaData, fieldMetadata, column }: SolidListViewColumnParams) => {
|
|
10
10
|
// const filterable = column.attrs.filterable;
|
|
11
|
+
|
|
11
12
|
const filterable = false;
|
|
12
13
|
const showFilterOperator = false;
|
|
13
14
|
const columnDataType = undefined;
|
|
14
15
|
const header = column.attrs.label ?? fieldMetadata.displayName;
|
|
15
16
|
|
|
17
|
+
const imageBodyTemplate = (product: any) => {
|
|
18
|
+
if (!product?._media?.[fieldMetadata.name]) return null;
|
|
19
|
+
|
|
20
|
+
const imageUrls = product._media[fieldMetadata.name].map((i: any) => i._full_url);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{imageUrls.map((url: string, index: number) => (
|
|
25
|
+
<img
|
|
26
|
+
key={index}
|
|
27
|
+
src={url}
|
|
28
|
+
alt={`product-image-${index}`}
|
|
29
|
+
className="w-6rem shadow-2 border-round"
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
16
36
|
return (
|
|
17
37
|
<Column
|
|
18
38
|
key={fieldMetadata.name}
|
|
19
39
|
field={fieldMetadata.name}
|
|
20
40
|
header={header}
|
|
41
|
+
body={imageBodyTemplate}
|
|
21
42
|
// className="text-sm"
|
|
22
43
|
sortable={column.attrs.sortable}
|
|
23
44
|
// filter={filterable}
|
|
@@ -17,6 +17,7 @@ import { BackButton } from "@/components/common/BackButton";
|
|
|
17
17
|
import { SolidFormStepper } from "@/components/common/SolidFormStepper";
|
|
18
18
|
import { Dialog } from "primereact/dialog";
|
|
19
19
|
import { Divider } from "primereact/divider";
|
|
20
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
20
21
|
|
|
21
22
|
interface ErrorResponseData {
|
|
22
23
|
message: string;
|
|
@@ -303,6 +304,62 @@ const CreateModel = ({ data, params }: any) => {
|
|
|
303
304
|
}
|
|
304
305
|
|
|
305
306
|
}, [isCreateModelError, isDeleteModelError, isUpdateModelError])
|
|
307
|
+
const op = useRef(null);
|
|
308
|
+
|
|
309
|
+
const formActionDropdown = () => {
|
|
310
|
+
return (
|
|
311
|
+
<div>
|
|
312
|
+
<Button
|
|
313
|
+
outlined
|
|
314
|
+
severity="secondary"
|
|
315
|
+
type="button"
|
|
316
|
+
icon={
|
|
317
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
318
|
+
<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" />
|
|
319
|
+
</svg>
|
|
320
|
+
}
|
|
321
|
+
size="small"
|
|
322
|
+
className="bg-primary-reverse p-0"
|
|
323
|
+
style={{
|
|
324
|
+
height: 32,
|
|
325
|
+
width: 32
|
|
326
|
+
}}
|
|
327
|
+
onClick={(e) =>
|
|
328
|
+
// @ts-ignore
|
|
329
|
+
op.current.toggle(e)
|
|
330
|
+
}
|
|
331
|
+
/>
|
|
332
|
+
<OverlayPanel ref={op} className="solid-custom-overlay">
|
|
333
|
+
<div className="flex flex-column gap-1 p-1">
|
|
334
|
+
<Button
|
|
335
|
+
text
|
|
336
|
+
type="button"
|
|
337
|
+
className="w-8rem text-left gap-2 text-color"
|
|
338
|
+
label="Duplicate"
|
|
339
|
+
size="small"
|
|
340
|
+
iconPos="left"
|
|
341
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
342
|
+
<path d="M6 11.9997C5.63333 11.9997 5.31944 11.8691 5.05833 11.608C4.79722 11.3469 4.66667 11.033 4.66667 10.6663V2.66634C4.66667 2.29967 4.79722 1.98579 5.05833 1.72467C5.31944 1.46356 5.63333 1.33301 6 1.33301H12C12.3667 1.33301 12.6806 1.46356 12.9417 1.72467C13.2028 1.98579 13.3333 2.29967 13.3333 2.66634V10.6663C13.3333 11.033 13.2028 11.3469 12.9417 11.608C12.6806 11.8691 12.3667 11.9997 12 11.9997H6ZM6 10.6663H12V2.66634H6V10.6663ZM3.33333 14.6663C2.96667 14.6663 2.65278 14.5358 2.39167 14.2747C2.13056 14.0136 2 13.6997 2 13.333V3.99967H3.33333V13.333H10.6667V14.6663H3.33333Z" fill="black" fill-opacity="0.88" />
|
|
343
|
+
</svg>}
|
|
344
|
+
/>
|
|
345
|
+
<Button
|
|
346
|
+
text
|
|
347
|
+
type="button"
|
|
348
|
+
className="w-8rem text-left gap-2 text-color"
|
|
349
|
+
label="Delete"
|
|
350
|
+
size="small"
|
|
351
|
+
iconPos="left"
|
|
352
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
353
|
+
<path d="M4.66666 14C4.29999 14 3.9861 13.8694 3.72499 13.6083C3.46388 13.3472 3.33332 13.0333 3.33332 12.6667V4H2.66666V2.66667H5.99999V2H9.99999V2.66667H13.3333V4H12.6667V12.6667C12.6667 13.0333 12.5361 13.3472 12.275 13.6083C12.0139 13.8694 11.7 14 11.3333 14H4.66666ZM11.3333 4H4.66666V12.6667H11.3333V4ZM5.99999 11.3333H7.33332V5.33333H5.99999V11.3333ZM8.66666 11.3333H9.99999V5.33333H8.66666V11.3333Z" fill="#4B4D52" />
|
|
354
|
+
</svg>
|
|
355
|
+
}
|
|
356
|
+
onClick={() => setDeleteEntity(true)}
|
|
357
|
+
/>
|
|
358
|
+
</div>
|
|
359
|
+
</OverlayPanel>
|
|
360
|
+
</div>
|
|
361
|
+
)
|
|
362
|
+
}
|
|
306
363
|
|
|
307
364
|
return (
|
|
308
365
|
<div className="solid-form-wrapper">
|
|
@@ -338,6 +395,7 @@ const CreateModel = ({ data, params }: any) => {
|
|
|
338
395
|
</>
|
|
339
396
|
}
|
|
340
397
|
<CancelButton />
|
|
398
|
+
{formActionDropdown()}
|
|
341
399
|
</div>
|
|
342
400
|
</>
|
|
343
401
|
}
|
|
@@ -74,6 +74,30 @@ const FieldMetaData = ({ modelMetaData, fieldMetaData, setFieldMetaData, deleteM
|
|
|
74
74
|
)
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
const showToaster = async (message: any, severity: any) => {
|
|
78
|
+
const errorMessages = Object.values(message);
|
|
79
|
+
if (errorMessages.length > 0) {
|
|
80
|
+
toast?.current?.show({
|
|
81
|
+
severity: severity,
|
|
82
|
+
summary: "Can you send me the report?",
|
|
83
|
+
life: 3000,
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
content: (props) => (
|
|
86
|
+
<div
|
|
87
|
+
className="flex flex-column align-items-left"
|
|
88
|
+
style={{ flex: "1" }}
|
|
89
|
+
>
|
|
90
|
+
{errorMessages.map((m, index) => (
|
|
91
|
+
<div className="flex align-items-center gap-2" key={index}>
|
|
92
|
+
<span className="font-bold text-900">{String(m)}</span>
|
|
93
|
+
</div>
|
|
94
|
+
))}
|
|
95
|
+
</div>
|
|
96
|
+
),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
77
101
|
|
|
78
102
|
|
|
79
103
|
return (
|
|
@@ -124,6 +148,7 @@ const FieldMetaData = ({ modelMetaData, fieldMetaData, setFieldMetaData, deleteM
|
|
|
124
148
|
header=""
|
|
125
149
|
visible={visiblePopup}
|
|
126
150
|
style={{ width: "40vw" }}
|
|
151
|
+
className="solid-dialog"
|
|
127
152
|
onHide={() => {
|
|
128
153
|
if (!visiblePopup) return;
|
|
129
154
|
|
|
@@ -131,7 +156,7 @@ const FieldMetaData = ({ modelMetaData, fieldMetaData, setFieldMetaData, deleteM
|
|
|
131
156
|
}}
|
|
132
157
|
showHeader={false}
|
|
133
158
|
>
|
|
134
|
-
<FieldMetaDataForm modelMetaData={modelMetaData} fieldMetaData={selectedFieldMetaData} allFields={fieldMetaData} setFieldMetaData={setFieldMetaData} deleteModelFunction={deleteModelFunction} setVisiblePopup={setVisiblePopup} formikFieldsMetadataRef={formikFieldsMetadataRef} params={params} setIsRequiredPopUp={setIsRequiredPopUp}></FieldMetaDataForm>
|
|
159
|
+
<FieldMetaDataForm modelMetaData={modelMetaData} fieldMetaData={selectedFieldMetaData} allFields={fieldMetaData} setFieldMetaData={setFieldMetaData} deleteModelFunction={deleteModelFunction} setVisiblePopup={setVisiblePopup} formikFieldsMetadataRef={formikFieldsMetadataRef} params={params} setIsRequiredPopUp={setIsRequiredPopUp} showToaster={showToaster}></FieldMetaDataForm>
|
|
135
160
|
</Dialog>
|
|
136
161
|
<Dialog
|
|
137
162
|
visible={isRequiredPopUp}
|
|
@@ -149,6 +174,7 @@ const FieldMetaData = ({ modelMetaData, fieldMetaData, setFieldMetaData, deleteM
|
|
|
149
174
|
</div>
|
|
150
175
|
)}
|
|
151
176
|
onHide={() => setIsRequiredPopUp(false)}
|
|
177
|
+
className="solid-dialog"
|
|
152
178
|
>
|
|
153
179
|
<p>If there is data against this model this operation might not work and manual intervention will be required</p>
|
|
154
180
|
</Dialog>
|