@solidstarters/solid-core-ui 1.1.3 → 1.1.4
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 +3 -0
- package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -0
- package/dist/components/auth/SolidChangeForcePassword.js +125 -0
- package/dist/components/auth/SolidChangeForcePassword.js.map +1 -0
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +54 -42
- 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 +51 -38
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -1
- package/dist/components/auth/SolidOTPVerify.js +3 -2
- package/dist/components/auth/SolidOTPVerify.js.map +1 -1
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +12 -9
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.d.ts +4 -1
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +58 -53
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/common/FilterComponent.d.ts +3 -0
- package/dist/components/common/FilterComponent.d.ts.map +1 -0
- package/dist/components/common/FilterComponent.js +214 -0
- package/dist/components/common/FilterComponent.js.map +1 -0
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +2 -2
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +39 -6
- package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
- package/dist/components/core/filter/columns/SolidBigintField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBigintField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBigintField.js +8 -0
- package/dist/components/core/filter/columns/SolidBigintField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js +27 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.js +22 -0
- package/dist/components/core/filter/columns/SolidComputedField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts +9 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.js +35 -0
- package/dist/components/core/filter/columns/SolidDateField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js +8 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.js +8 -0
- package/dist/components/core/filter/columns/SolidFloatField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.js +34 -0
- package/dist/components/core/filter/columns/SolidIntField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.js +12 -0
- package/dist/components/core/filter/columns/SolidRelationField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js +25 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js +26 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js +33 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidTimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.js +25 -0
- package/dist/components/core/filter/columns/SolidUuidField.js.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts +4 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js +54 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js.map +1 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +31 -58
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +5 -1
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +5 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.js +5 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIdColumn.js +5 -1
- package/dist/components/core/list/columns/SolidIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.js +5 -1
- package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +5 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +5 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js +5 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +3 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +3 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js +3 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +5 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +6 -7
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/redux/api/authApi.d.ts +4 -1
- package/dist/redux/api/authApi.d.ts.map +1 -1
- package/dist/redux/api/authApi.js +28 -1
- package/dist/redux/api/authApi.js.map +1 -1
- package/package.json +1 -1
- package/solidstarters-solid-core-ui-1.1.2.tgz +0 -0
- package/src/components/auth/SolidChangeForcePassword.tsx +159 -0
- package/src/components/auth/SolidForgotPassword.tsx +77 -78
- package/src/components/auth/SolidLogin.tsx +110 -93
- package/src/components/auth/SolidOTPVerify.tsx +16 -14
- package/src/components/auth/SolidRegister.tsx +41 -16
- package/src/components/auth/SolidResetPassword.tsx +106 -110
- package/src/components/common/SocialMediaLogin.tsx +7 -3
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +86 -15
- package/src/components/core/list/SolidListView.tsx +71 -59
- package/src/components/core/list/columns/SolidBooleanColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidDateColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidDatetimeColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidExternalIdColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidIdColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidIntColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidSelectionDynamicColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidShortTextColumn.tsx +3 -5
- package/src/components/core/list/columns/SolidTimeColumn.tsx +1 -1
- package/src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -2
- package/src/components/layout/AppSidebar.tsx +10 -14
- package/src/index.ts +1 -0
- package/src/redux/api/authApi.ts +30 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useConfirmForgotPasswordMutation } from "@/redux/api/authApi";
|
|
4
|
+
import { useFormik } from "formik";
|
|
5
5
|
import Link from "next/link";
|
|
6
6
|
import { useRouter } from "next/navigation";
|
|
7
7
|
import { Button } from "primereact/button";
|
|
@@ -9,27 +9,18 @@ import { Message } from "primereact/message";
|
|
|
9
9
|
import { Password } from "primereact/password";
|
|
10
10
|
import { Toast } from "primereact/toast";
|
|
11
11
|
import { classNames } from "primereact/utils";
|
|
12
|
-
import { useContext, useRef
|
|
12
|
+
import { useContext, useRef } from "react";
|
|
13
13
|
import * as Yup from "yup";
|
|
14
14
|
import { LayoutContext } from "../layout/context/layoutcontext";
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
const SolidResetPassword = () => {
|
|
17
|
+
const SolidResetPassword = ({ verificationToken, username }: { verificationToken?: any, username?: any }) => {
|
|
18
18
|
const { layoutConfig } = useContext(LayoutContext);
|
|
19
19
|
const { authLayout } = layoutConfig;
|
|
20
20
|
const toast = useRef<Toast>(null);
|
|
21
21
|
const router = useRouter();
|
|
22
22
|
|
|
23
|
-
const [
|
|
24
|
-
const [checked, setChecked] = useState<boolean>(false);
|
|
25
|
-
|
|
26
|
-
const validationSchema = Yup.object({
|
|
27
|
-
email: Yup.string()
|
|
28
|
-
.email("Invalid email address")
|
|
29
|
-
.required("Email is required"),
|
|
30
|
-
password: Yup.string().required("Password is required"),
|
|
31
|
-
});
|
|
32
|
-
|
|
23
|
+
const [confirmForgotPassword] = useConfirmForgotPasswordMutation();
|
|
33
24
|
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
34
25
|
toast.current?.show({
|
|
35
26
|
severity,
|
|
@@ -39,6 +30,41 @@ const SolidResetPassword = () => {
|
|
|
39
30
|
});
|
|
40
31
|
};
|
|
41
32
|
|
|
33
|
+
const validationSchema = Yup.object({
|
|
34
|
+
password: Yup.string().min(6, 'Password must be at least 6 characters').required('Password is required'),
|
|
35
|
+
confirmPassword: Yup.string().oneOf([Yup.ref('password')], 'Passwords must match').required('Confirm password is required'),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const formik = useFormik({
|
|
39
|
+
initialValues: {
|
|
40
|
+
username: username,
|
|
41
|
+
password: "",
|
|
42
|
+
confirmPassword: "",
|
|
43
|
+
verificationToken: verificationToken,
|
|
44
|
+
},
|
|
45
|
+
validationSchema,
|
|
46
|
+
onSubmit: async (values) => {
|
|
47
|
+
try {
|
|
48
|
+
const payload = {
|
|
49
|
+
username: values.username,
|
|
50
|
+
password: values.password,
|
|
51
|
+
verificationToken: values.verificationToken,
|
|
52
|
+
};
|
|
53
|
+
console.log("Paylod", payload);
|
|
54
|
+
const response = await confirmForgotPassword(payload).unwrap();
|
|
55
|
+
if (response?.statusCode === 200) {
|
|
56
|
+
showToast("success", "Login Successfull", "Password Updated Successfully")
|
|
57
|
+
router.push('/auth/login');
|
|
58
|
+
} else (
|
|
59
|
+
showToast("error", "Login Error", response.error)
|
|
60
|
+
)
|
|
61
|
+
} catch (err: any) {
|
|
62
|
+
console.log("Error", err);
|
|
63
|
+
showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
42
68
|
const isFormFieldValid = (formik: any, fieldName: string) =>
|
|
43
69
|
formik.touched[fieldName] && formik.errors[fieldName];
|
|
44
70
|
|
|
@@ -46,107 +72,77 @@ const SolidResetPassword = () => {
|
|
|
46
72
|
<>
|
|
47
73
|
<Toast ref={toast} />
|
|
48
74
|
<div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`}>
|
|
49
|
-
|
|
50
|
-
<div className="
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
{authLayout === 'Center' &&
|
|
76
|
+
<div className="flex justify-content-center">
|
|
77
|
+
<div className="solid-logo flex align-items-center gap-3">
|
|
78
|
+
<img
|
|
79
|
+
alt="solid logo"
|
|
80
|
+
src={'/images/SS-Logo-1 1.png'}
|
|
81
|
+
className="position-relative img-fluid"
|
|
82
|
+
/>
|
|
83
|
+
<div>
|
|
84
|
+
<p className="solid-logo-title">
|
|
85
|
+
Solid<br />Starters
|
|
86
|
+
</p>
|
|
87
|
+
</div>
|
|
60
88
|
</div>
|
|
61
89
|
</div>
|
|
62
|
-
|
|
63
|
-
<h2 className=
|
|
64
|
-
<p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p>
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
password
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
className="text-red-500 text-sm"
|
|
112
|
-
severity="error"
|
|
113
|
-
text={formik?.errors?.password?.toString()}
|
|
114
|
-
/>}
|
|
115
|
-
</div>
|
|
116
|
-
<div className="flex flex-column gap-2 mt-4" style={{}}>
|
|
117
|
-
<label htmlFor="password" className="solid-auth-input-label">Confirm Password</label>
|
|
118
|
-
<Password
|
|
119
|
-
id="password"
|
|
120
|
-
placeholder="***************"
|
|
121
|
-
value={password}
|
|
122
|
-
onChange={(e) => {
|
|
123
|
-
setPassword(e.target.value);
|
|
124
|
-
formik.setFieldValue("password", e.target.value);
|
|
125
|
-
}}
|
|
126
|
-
toggleMask
|
|
127
|
-
className={classNames("", {
|
|
128
|
-
"p-invalid": isFormFieldValid(formik, "password"),
|
|
129
|
-
})}
|
|
130
|
-
inputClassName="w-full"
|
|
131
|
-
feedback={false}
|
|
132
|
-
/>
|
|
133
|
-
{isFormFieldValid(formik, "password") && <Message
|
|
134
|
-
className="text-red-500 text-sm"
|
|
135
|
-
severity="error"
|
|
136
|
-
text={formik?.errors?.password?.toString()}
|
|
137
|
-
/>}
|
|
138
|
-
</div>
|
|
139
|
-
{/* <div className="flex align-items-center mt-4">
|
|
90
|
+
}
|
|
91
|
+
<h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>Create New Password</h2>
|
|
92
|
+
{/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
|
|
93
|
+
<form onSubmit={formik.handleSubmit}>
|
|
94
|
+
<div className="flex flex-column gap-2">
|
|
95
|
+
<label htmlFor="password" className="solid-auth-input-label">New Password</label>
|
|
96
|
+
<Password
|
|
97
|
+
id="password"
|
|
98
|
+
name="password"
|
|
99
|
+
placeholder="***************"
|
|
100
|
+
value={formik.values.password}
|
|
101
|
+
onChange={formik.handleChange}
|
|
102
|
+
onBlur={formik.handleBlur}
|
|
103
|
+
toggleMask
|
|
104
|
+
className={classNames("", {
|
|
105
|
+
"p-invalid": isFormFieldValid(formik, "password"),
|
|
106
|
+
})}
|
|
107
|
+
inputClassName="w-full"
|
|
108
|
+
feedback={false}
|
|
109
|
+
/>
|
|
110
|
+
{isFormFieldValid(formik, "password") && <Message
|
|
111
|
+
className="text-red-500 text-sm"
|
|
112
|
+
severity="error"
|
|
113
|
+
text={formik?.errors?.password?.toString()}
|
|
114
|
+
/>}
|
|
115
|
+
</div>
|
|
116
|
+
<div className="flex flex-column gap-2 mt-4" style={{}}>
|
|
117
|
+
<label htmlFor="password" className="solid-auth-input-label">Confirm Password</label>
|
|
118
|
+
<Password
|
|
119
|
+
id="confirmPassword"
|
|
120
|
+
name="confirmPassword"
|
|
121
|
+
placeholder="***************"
|
|
122
|
+
value={formik.values.confirmPassword}
|
|
123
|
+
onChange={formik.handleChange}
|
|
124
|
+
onBlur={formik.handleBlur}
|
|
125
|
+
toggleMask
|
|
126
|
+
className={classNames("", {
|
|
127
|
+
"p-invalid": isFormFieldValid(formik, "confirmPassword"),
|
|
128
|
+
})}
|
|
129
|
+
inputClassName="w-full"
|
|
130
|
+
feedback={false}
|
|
131
|
+
/>
|
|
132
|
+
{isFormFieldValid(formik, "confirmPassword") && <Message
|
|
133
|
+
className="text-red-500 text-sm"
|
|
134
|
+
severity="error"
|
|
135
|
+
text={formik?.errors?.confirmPassword?.toString()}
|
|
136
|
+
/>}
|
|
137
|
+
</div>
|
|
138
|
+
{/* <div className="flex align-items-center mt-4">
|
|
140
139
|
<Checkbox inputId="remember" onChange={(e: any) => setChecked(e.checked)} checked={checked} />
|
|
141
140
|
<label htmlFor="remember" className="ml-2">Remember me</label>
|
|
142
141
|
</div> */}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
)}
|
|
148
|
-
</Formik>
|
|
149
|
-
</>
|
|
142
|
+
<div className="mt-4">
|
|
143
|
+
<Button className="w-full font-light auth-submit-button" label="Reset Password" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
144
|
+
</div>
|
|
145
|
+
</form>
|
|
150
146
|
</div>
|
|
151
147
|
<div className="text-center mt-5">
|
|
152
148
|
<div className="text-sm text-400 secondary-dark-color">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { signIn } from 'next-auth/react'
|
|
2
2
|
import { Button } from 'primereact/button'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
|
|
4
5
|
export const SocialMediaLogin = () => {
|
|
5
6
|
return (
|
|
@@ -21,11 +22,14 @@ export const SocialMediaLogin = () => {
|
|
|
21
22
|
</defs>
|
|
22
23
|
</svg>
|
|
23
24
|
)}
|
|
25
|
+
className='flex gap-3'
|
|
24
26
|
outlined
|
|
25
27
|
severity="secondary"
|
|
28
|
+
label='Sign In with Google'
|
|
29
|
+
onClick={()=>signIn('google', {callbackUrl :'http://localhost:3001/admin/core/solid-core/user/list'})}
|
|
26
30
|
>
|
|
27
31
|
</Button>
|
|
28
|
-
<Button icon={() => (
|
|
32
|
+
{/* <Button icon={() => (
|
|
29
33
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" xlinkHref="http://www.w3.org/1999/xlink">
|
|
30
34
|
<rect width="24" height="24" fill="url(#pattern0_3520_3835)" />
|
|
31
35
|
<defs>
|
|
@@ -39,7 +43,7 @@ export const SocialMediaLogin = () => {
|
|
|
39
43
|
outlined
|
|
40
44
|
severity="secondary"
|
|
41
45
|
>
|
|
42
|
-
</Button>
|
|
46
|
+
</Button> */}
|
|
43
47
|
</div>
|
|
44
48
|
)
|
|
45
49
|
}
|
|
@@ -1,31 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
2
|
import { Button } from "primereact/button";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { Checkbox, CheckboxChangeEvent } from "primereact/checkbox";
|
|
4
|
+
import { Divider } from "primereact/divider";
|
|
5
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
6
|
+
import { useRef, useState } from "react";
|
|
6
7
|
|
|
8
|
+
interface FilterColumns {
|
|
9
|
+
name: string;
|
|
10
|
+
key: string;
|
|
11
|
+
}
|
|
7
12
|
export const SolidConfigureLayoutElement = ({ }: any) => {
|
|
8
13
|
|
|
9
|
-
const [visible, setVisible] = useState<boolean>(false);
|
|
14
|
+
// const [visible, setVisible] = useState<boolean>(false);
|
|
15
|
+
const op = useRef(null);
|
|
16
|
+
const customizeLayout = useRef(null);
|
|
17
|
+
|
|
18
|
+
const categories: FilterColumns[] = [
|
|
19
|
+
{ name: 'ID', key: 'A' },
|
|
20
|
+
{ name: 'Tracker Date', key: 'M' },
|
|
21
|
+
{ name: 'Production', key: 'P' },
|
|
22
|
+
{ name: 'Research', key: 'R' }
|
|
23
|
+
];
|
|
24
|
+
const [selectedCategories, setSelectedCategories] = useState<FilterColumns[]>([categories[1]]);
|
|
25
|
+
|
|
26
|
+
const onCategoryChange = (e: CheckboxChangeEvent) => {
|
|
27
|
+
let _selectedCategories = [...selectedCategories];
|
|
28
|
+
|
|
29
|
+
if (e.checked)
|
|
30
|
+
_selectedCategories.push(e.value);
|
|
31
|
+
else
|
|
32
|
+
_selectedCategories = _selectedCategories.filter(category => category.key !== e.value.key);
|
|
33
|
+
|
|
34
|
+
setSelectedCategories(_selectedCategories);
|
|
35
|
+
};
|
|
10
36
|
|
|
11
37
|
return (
|
|
12
|
-
<div className="
|
|
38
|
+
<div className="position-relative">
|
|
13
39
|
<Button
|
|
14
40
|
type="button"
|
|
15
41
|
size="small"
|
|
16
42
|
icon="pi pi-cog"
|
|
17
|
-
onClick={() => setVisible(true)}
|
|
18
43
|
severity="secondary"
|
|
19
44
|
outlined
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
onClick={(e) => op.current.toggle(e)}
|
|
20
47
|
/>
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
<OverlayPanel ref={op}>
|
|
49
|
+
<div className="p-2">
|
|
50
|
+
<div className="flex flex-column">
|
|
51
|
+
<Button text icon='pi pi-download' label="Import" size="small" severity="secondary" className="text-left gap-2" />
|
|
52
|
+
<Button text icon='pi pi-upload' label="Export" size="small" severity="secondary" className="text-left gap-2" />
|
|
53
|
+
<Button text icon='pi pi-share-alt' label="Share" size="small" severity="secondary" className="text-left gap-2" />
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<Divider className="m-0" />
|
|
57
|
+
<div className="p-2 position-relative">
|
|
58
|
+
<Button
|
|
59
|
+
icon='pi pi-sliders-h'
|
|
60
|
+
label="Customize Layout"
|
|
61
|
+
size="small"
|
|
62
|
+
className="text-left gap-2 w-13rem"
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
onClick={(e) => customizeLayout.current.toggle(e)}
|
|
65
|
+
// onMouseEnter={(e) => customizeLayout.current.show(e)}
|
|
66
|
+
/>
|
|
67
|
+
<p className="mt-3 mb-1 font-medium" style={{ color: 'var(--gray-400)' }}>Saved Layouts</p>
|
|
68
|
+
<Button text severity="secondary" label="Diet Tracking" icon="pi pi-plus" size="small"/>
|
|
69
|
+
<OverlayPanel ref={customizeLayout} className="customize-layout-panel" style={{ minWidth: 250 }}>
|
|
70
|
+
<div className="pl-3 pt-2 flex align-items-center justify-content-between">
|
|
71
|
+
<p className="m-0 font-bold">Columns</p>
|
|
72
|
+
<Button text label="Save Layout" icon="pi pi-plus" />
|
|
73
|
+
</div>
|
|
74
|
+
<div className="flex flex-column gap-3 p-3">
|
|
75
|
+
{categories.map((category) => {
|
|
76
|
+
return (
|
|
77
|
+
<div key={category.key} className="flex align-items-center gap-1">
|
|
78
|
+
<Checkbox
|
|
79
|
+
inputId={category.key}
|
|
80
|
+
name="category"
|
|
81
|
+
value={category}
|
|
82
|
+
onChange={onCategoryChange}
|
|
83
|
+
checked={selectedCategories.some((item) => item.key === category.key)}
|
|
84
|
+
/>
|
|
85
|
+
<label htmlFor={category.key} className="ml-2">
|
|
86
|
+
{category.name}
|
|
87
|
+
</label>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
})}
|
|
91
|
+
</div>
|
|
92
|
+
<Divider className="m-0" />
|
|
93
|
+
<div className="p-3 flex gap-2">
|
|
94
|
+
<Button label="Apply" size="small" />
|
|
95
|
+
<Button outlined label="Cancel" size="small" />
|
|
96
|
+
</div>
|
|
97
|
+
</OverlayPanel>
|
|
98
|
+
</div>
|
|
99
|
+
</OverlayPanel>
|
|
29
100
|
</div>
|
|
30
101
|
)
|
|
31
102
|
|
|
@@ -27,6 +27,7 @@ import { useRouter } from "next/navigation";
|
|
|
27
27
|
import { ListViewRowActionPopup } from "./ListViewRowActionPopup";
|
|
28
28
|
import FilterComponent, { FilterOperator, FilterRule, FilterRuleType } from "@/components/core/common/FilterComponent";
|
|
29
29
|
import { SolidLayoutViews } from '../common/SolidLayoutViews'
|
|
30
|
+
import { SolidConfigureLayoutElement } from '../common/SolidConfigureLayoutElement'
|
|
30
31
|
import { FilterIcon } from '../../modelsComponents/filterIcon';
|
|
31
32
|
import { OverlayPanel } from "primereact/overlaypanel";
|
|
32
33
|
const getRandomInt = (min: number, max: number) => {
|
|
@@ -403,67 +404,74 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
403
404
|
solidGlobalSearchElementRef.current.clearFilter()
|
|
404
405
|
};
|
|
405
406
|
|
|
407
|
+
const [solidsolidViewDataId, setSolidViewDataId] = useState<number | null>()
|
|
406
408
|
const op = useRef(null)
|
|
407
409
|
|
|
408
410
|
// clickable link allowing one to open the detail / form view.
|
|
409
411
|
const detailsBodyTemplate = (solidViewData: any) => {
|
|
410
412
|
return (
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
413
|
+
<div>
|
|
414
|
+
<Button
|
|
415
|
+
text
|
|
416
|
+
size="small"
|
|
417
|
+
className=""
|
|
418
|
+
onClick={(e) =>
|
|
419
|
+
// @ts-ignore
|
|
420
|
+
{
|
|
421
|
+
op.current.toggle(e);
|
|
422
|
+
setSolidViewDataId(solidViewData.id)
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
>
|
|
427
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="3" height="10" viewBox="0 0 4 16" fill="none">
|
|
428
|
+
<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" />
|
|
429
|
+
</svg>
|
|
430
|
+
</Button>
|
|
431
|
+
<OverlayPanel ref={op} className="solid-custom-overlay" style={{ top: 10 }}>
|
|
432
|
+
<div className="flex flex-column gap-1 p-1">
|
|
433
|
+
<Button
|
|
434
|
+
className="w-8rem text-left gap-2"
|
|
435
|
+
label="Edit"
|
|
436
|
+
size="small"
|
|
437
|
+
iconPos="left"
|
|
438
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
439
|
+
<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" />
|
|
440
|
+
</svg>}
|
|
441
|
+
onClick={() => {
|
|
442
|
+
console.log("solidViewData.id", solidViewData.id);
|
|
443
|
+
|
|
444
|
+
if (params.embeded == true) {
|
|
445
|
+
params.handlePopUpOpen(solidsolidViewDataId);
|
|
446
|
+
} else {
|
|
447
|
+
router.push(`${editButtonUrl}/${solidsolidViewDataId}`)
|
|
448
|
+
}
|
|
449
|
+
}}
|
|
450
|
+
/>
|
|
451
|
+
<Button
|
|
452
|
+
text
|
|
453
|
+
className="w-8rem text-left gap-2"
|
|
454
|
+
label="Delete"
|
|
455
|
+
size="small"
|
|
456
|
+
iconPos="left"
|
|
457
|
+
severity="secondary"
|
|
458
|
+
icon={<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
459
|
+
<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" />
|
|
460
|
+
</svg>}
|
|
461
|
+
onClick={() => deleteSolidSingleEntiry(solidViewData.id)}
|
|
462
|
+
/>
|
|
463
|
+
</div>
|
|
464
|
+
</OverlayPanel>
|
|
465
|
+
</div>
|
|
466
|
+
// <a onClick={() => {
|
|
467
|
+
// if (params.embeded == true) {
|
|
468
|
+
// params.handlePopUpOpen(solidViewData.id);
|
|
469
|
+
// } else {
|
|
470
|
+
// router.push(`${editButtonUrl}/${solidViewData.id}`)
|
|
471
|
+
// }
|
|
472
|
+
// }} rel="noopener noreferrer" className="text-sm font-bold p-0" style={{ color: "#12415D" }}>
|
|
473
|
+
// <i className="pi pi-pencil" style={{ fontSize: "1rem" }}></i>
|
|
474
|
+
// </a>
|
|
467
475
|
);
|
|
468
476
|
};
|
|
469
477
|
|
|
@@ -580,7 +588,9 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
580
588
|
setView={setView}
|
|
581
589
|
view={view}
|
|
582
590
|
/>
|
|
583
|
-
|
|
591
|
+
{params.embeded === false &&
|
|
592
|
+
<SolidConfigureLayoutElement></SolidConfigureLayoutElement>
|
|
593
|
+
}
|
|
584
594
|
{/* {params.embeded === false &&
|
|
585
595
|
<SolidListViewOptions></SolidListViewOptions>
|
|
586
596
|
} */}
|
|
@@ -593,7 +603,7 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
593
603
|
showGridlines={false}
|
|
594
604
|
lazy
|
|
595
605
|
scrollable
|
|
596
|
-
scrollHeight="90vh"
|
|
606
|
+
// scrollHeight="90vh"
|
|
597
607
|
size={size}
|
|
598
608
|
resizableColumns
|
|
599
609
|
paginator={true}
|
|
@@ -617,13 +627,15 @@ export const SolidListView = (params: SolidListViewParams) => {
|
|
|
617
627
|
filterIcon={<FilterIcon />}
|
|
618
628
|
tableClassName="solid-data-table"
|
|
619
629
|
paginatorClassName="solid-paginator"
|
|
630
|
+
paginatorTemplate="RowsPerPageDropdown CurrentPageReport PrevPageLink NextPageLink"
|
|
631
|
+
currentPageReportTemplate="{first} - {last} of {totalRecords}"
|
|
620
632
|
>
|
|
621
633
|
|
|
622
634
|
<Column selectionMode="multiple" headerStyle={{ width: "3em" }} />
|
|
623
635
|
|
|
624
636
|
{renderColumnsDynamically(listViewMetaData)}
|
|
625
637
|
{actionsAllowed.includes(`${updatePermission(params.modelName)}`) && solidListViewMetaData?.data?.solidView?.layout?.attrs?.edit !== false &&
|
|
626
|
-
<Column body={detailsBodyTemplate}></Column>
|
|
638
|
+
<Column body={detailsBodyTemplate} ></Column>
|
|
627
639
|
}
|
|
628
640
|
{solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons &&
|
|
629
641
|
solidListViewMetaData?.data?.solidView?.layout?.attrs?.rowButtons.map((rowAction: any) => {
|
|
@@ -43,7 +43,7 @@ const SolidBooleanColumn = ({ solidListViewMetaData, fieldMetadata, column }: So
|
|
|
43
43
|
key={fieldMetadata.name}
|
|
44
44
|
field={fieldMetadata.name}
|
|
45
45
|
header={header}
|
|
46
|
-
className="text-sm"
|
|
46
|
+
// className="text-sm"
|
|
47
47
|
sortable={column.attrs.sortable}
|
|
48
48
|
// filter={filterable}
|
|
49
49
|
dataType={columnDataType}
|
|
@@ -46,9 +46,9 @@ const SolidDateColumn = ({ solidListViewMetaData, fieldMetadata, column }: Solid
|
|
|
46
46
|
key={fieldMetadata.name}
|
|
47
47
|
field={fieldMetadata.name}
|
|
48
48
|
header={header}
|
|
49
|
-
className="text-sm"
|
|
49
|
+
// className="text-sm"
|
|
50
50
|
sortable={column.attrs.sortable}
|
|
51
|
-
filter={filterable}
|
|
51
|
+
// filter={filterable}
|
|
52
52
|
dataType={columnDataType}
|
|
53
53
|
showFilterOperator={showFilterOperator}
|
|
54
54
|
filterMatchModeOptions={dateFilterMatchModeOptions}
|
|
@@ -34,9 +34,9 @@ const SolidDatetimeColumn = ({ solidListViewMetaData, fieldMetadata, column }: S
|
|
|
34
34
|
key={fieldMetadata.name}
|
|
35
35
|
field={fieldMetadata.name}
|
|
36
36
|
header={header}
|
|
37
|
-
className="text-sm"
|
|
37
|
+
// className="text-sm"
|
|
38
38
|
sortable={column.attrs.sortable}
|
|
39
|
-
filter={filterable}
|
|
39
|
+
// filter={filterable}
|
|
40
40
|
dataType={columnDataType}
|
|
41
41
|
showFilterOperator={showFilterOperator}
|
|
42
42
|
filterMatchModeOptions={dateFilterMatchModeOptions}
|