@solidxai/core-ui 0.1.8-beta.6 → 0.1.8-beta.7
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/common/AuthBanner.js.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.js.map +1 -1
- package/dist/components/core/kanban/SolidManyToOneFilterElement.tsx +1 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaMultipleKanbanField.tsx +21 -10
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js +2 -2
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidMediaSingleKanbanField.tsx +18 -10
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +3 -6
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +30 -24
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/relations/SolidRelationManyToOneKanbanField.tsx +2 -2
- package/dist/components/core/list/SolidDataTablePagination.d.ts +15 -0
- package/dist/components/core/list/SolidDataTablePagination.d.ts.map +1 -0
- package/dist/components/core/list/SolidDataTablePagination.js +22 -0
- package/dist/components/core/list/SolidDataTablePagination.js.map +1 -0
- package/dist/components/core/list/SolidDataTablePagination.tsx +71 -0
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +0 -4
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.d.ts.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js +6 -7
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +9 -10
- package/dist/components/solid-ui/SolidButton.d.ts +14 -0
- package/dist/components/solid-ui/SolidButton.d.ts.map +1 -0
- package/dist/components/solid-ui/SolidButton.js +36 -0
- package/dist/components/solid-ui/SolidButton.js.map +1 -0
- package/dist/components/solid-ui/SolidButton.tsx +54 -0
- package/dist/components/solid-ui/SolidTabs.d.ts +18 -0
- package/dist/components/solid-ui/SolidTabs.d.ts.map +1 -0
- package/dist/components/solid-ui/SolidTabs.js +22 -0
- package/dist/components/solid-ui/SolidTabs.js.map +1 -0
- package/dist/components/solid-ui/SolidTabs.tsx +73 -0
- package/dist/components/solid-ui/index.d.ts +3 -0
- package/dist/components/solid-ui/index.d.ts.map +1 -0
- package/dist/components/solid-ui/index.js +3 -0
- package/dist/components/solid-ui/index.js.map +1 -0
- package/dist/components/solid-ui/index.ts +2 -0
- package/package.json +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts +0 -3
- package/dist/components/auth/SolidOTPVerify.d.ts.map +0 -1
- package/dist/components/auth/SolidOTPVerify.js +0 -67
- package/dist/components/auth/SolidOTPVerify.js.map +0 -1
- package/dist/components/auth/SolidOTPVerify.tsx +0 -133
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +0 -2
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +0 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.js +0 -50
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +0 -1
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +0 -70
- package/dist/nextAuth/authProviders.d.ts +0 -4
- package/dist/nextAuth/authProviders.d.ts.map +0 -1
- package/dist/nextAuth/authProviders.js +0 -198
- package/dist/nextAuth/authProviders.js.map +0 -1
- package/dist/nextAuth/authProviders.tsx +0 -232
- package/dist/nextAuth/handleLogout.d.ts +0 -2
- package/dist/nextAuth/handleLogout.d.ts.map +0 -1
- package/dist/nextAuth/handleLogout.js +0 -36
- package/dist/nextAuth/handleLogout.js.map +0 -1
- package/dist/nextAuth/handleLogout.tsx +0 -39
- package/dist/nextAuth/refreshAccessToken.d.ts +0 -2
- package/dist/nextAuth/refreshAccessToken.d.ts.map +0 -1
- package/dist/nextAuth/refreshAccessToken.js +0 -24
- package/dist/nextAuth/refreshAccessToken.js.map +0 -1
- package/dist/nextAuth/refreshAccessToken.tsx +0 -28
- package/dist/redux/features/settingsSlice.d.ts +0 -20
- package/dist/redux/features/settingsSlice.d.ts.map +0 -1
- package/dist/redux/features/settingsSlice.js +0 -39
- package/dist/redux/features/settingsSlice.js.map +0 -1
- package/dist/redux/features/settingsSlice.ts +0 -60
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
function cx() {
|
|
3
|
+
var parts = [];
|
|
4
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5
|
+
parts[_i] = arguments[_i];
|
|
6
|
+
}
|
|
7
|
+
return parts.filter(Boolean).join(" ");
|
|
8
|
+
}
|
|
9
|
+
export function SolidTab(_props) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
export function SolidTabGroup(_a) {
|
|
13
|
+
var tabs = _a.tabs, value = _a.value, onValueChange = _a.onValueChange, className = _a.className, listClassName = _a.listClassName, panelClassName = _a.panelClassName;
|
|
14
|
+
return (_jsxs("div", { className: cx("solid-tabs", className), children: [_jsx("div", { className: cx("solid-tabs-list", listClassName), role: "tablist", children: tabs.map(function (tab) {
|
|
15
|
+
var isActive = tab.value === value;
|
|
16
|
+
return (_jsx("button", { type: "button", role: "tab", "aria-selected": isActive, "aria-controls": "solid-tab-panel-".concat(tab.value), id: "solid-tab-".concat(tab.value), className: cx("solid-tabs-trigger", isActive && "is-active"), onClick: function () { return onValueChange(tab.value); }, children: tab.label }, tab.value));
|
|
17
|
+
}) }), tabs.map(function (tab) {
|
|
18
|
+
var isActive = tab.value === value;
|
|
19
|
+
return (_jsx("div", { role: "tabpanel", id: "solid-tab-panel-".concat(tab.value), "aria-labelledby": "solid-tab-".concat(tab.value), hidden: !isActive, className: cx("solid-tabs-panel", panelClassName), children: isActive ? tab.content : null }, tab.value));
|
|
20
|
+
})] }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=SolidTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidTabs.js","sourceRoot":"","sources":["../../../src/components/solid-ui/SolidTabs.tsx"],"names":[],"mappings":";AAiBA,SAAS,EAAE;IAAC,eAA2C;SAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;QAA3C,0BAA2C;;IACrD,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,MAAqB;IAC5C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAOT;QANnB,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,aAAa,mBAAA,EACb,cAAc,oBAAA;IAEd,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,aACzC,cAAK,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,aAAa,CAAC,EAAE,IAAI,EAAC,SAAS,YACjE,IAAI,CAAC,GAAG,CAAC,UAAC,GAAG;oBACZ,IAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC;oBACrC,OAAO,CACL,iBAEE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,KAAK,mBACK,QAAQ,mBACR,0BAAmB,GAAG,CAAC,KAAK,CAAE,EAC7C,EAAE,EAAE,oBAAa,GAAG,CAAC,KAAK,CAAE,EAC5B,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,QAAQ,IAAI,WAAW,CAAC,EAC5D,OAAO,EAAE,cAAM,OAAA,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAxB,CAAwB,YAEtC,GAAG,CAAC,KAAK,IATL,GAAG,CAAC,KAAK,CAUP,CACV,CAAC;gBACJ,CAAC,CAAC,GACE,EAEL,IAAI,CAAC,GAAG,CAAC,UAAC,GAAG;gBACZ,IAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC;gBACrC,OAAO,CACL,cAEE,IAAI,EAAC,UAAU,EACf,EAAE,EAAE,0BAAmB,GAAG,CAAC,KAAK,CAAE,qBACjB,oBAAa,GAAG,CAAC,KAAK,CAAE,EACzC,MAAM,EAAE,CAAC,QAAQ,EACjB,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,cAAc,CAAC,YAEhD,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAPzB,GAAG,CAAC,KAAK,CAQV,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from \"react\";\n\ntype SolidTabProps = {\n value: string;\n label: React.ReactNode;\n content: React.ReactNode;\n};\n\ntype SolidTabGroupProps = {\n tabs: SolidTabProps[];\n value: string;\n onValueChange: (value: string) => void;\n className?: string;\n listClassName?: string;\n panelClassName?: string;\n};\n\nfunction cx(...parts: Array<string | false | undefined>) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport function SolidTab(_props: SolidTabProps) {\n return null;\n}\n\nexport function SolidTabGroup({\n tabs,\n value,\n onValueChange,\n className,\n listClassName,\n panelClassName,\n}: SolidTabGroupProps) {\n return (\n <div className={cx(\"solid-tabs\", className)}>\n <div className={cx(\"solid-tabs-list\", listClassName)} role=\"tablist\">\n {tabs.map((tab) => {\n const isActive = tab.value === value;\n return (\n <button\n key={tab.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`solid-tab-panel-${tab.value}`}\n id={`solid-tab-${tab.value}`}\n className={cx(\"solid-tabs-trigger\", isActive && \"is-active\")}\n onClick={() => onValueChange(tab.value)}\n >\n {tab.label}\n </button>\n );\n })}\n </div>\n\n {tabs.map((tab) => {\n const isActive = tab.value === value;\n return (\n <div\n key={tab.value}\n role=\"tabpanel\"\n id={`solid-tab-panel-${tab.value}`}\n aria-labelledby={`solid-tab-${tab.value}`}\n hidden={!isActive}\n className={cx(\"solid-tabs-panel\", panelClassName)}\n >\n {isActive ? tab.content : null}\n </div>\n );\n })}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type SolidTabProps = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type SolidTabGroupProps = {
|
|
10
|
+
tabs: SolidTabProps[];
|
|
11
|
+
value: string;
|
|
12
|
+
onValueChange: (value: string) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
listClassName?: string;
|
|
15
|
+
panelClassName?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function cx(...parts: Array<string | false | undefined>) {
|
|
19
|
+
return parts.filter(Boolean).join(" ");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function SolidTab(_props: SolidTabProps) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SolidTabGroup({
|
|
27
|
+
tabs,
|
|
28
|
+
value,
|
|
29
|
+
onValueChange,
|
|
30
|
+
className,
|
|
31
|
+
listClassName,
|
|
32
|
+
panelClassName,
|
|
33
|
+
}: SolidTabGroupProps) {
|
|
34
|
+
return (
|
|
35
|
+
<div className={cx("solid-tabs", className)}>
|
|
36
|
+
<div className={cx("solid-tabs-list", listClassName)} role="tablist">
|
|
37
|
+
{tabs.map((tab) => {
|
|
38
|
+
const isActive = tab.value === value;
|
|
39
|
+
return (
|
|
40
|
+
<button
|
|
41
|
+
key={tab.value}
|
|
42
|
+
type="button"
|
|
43
|
+
role="tab"
|
|
44
|
+
aria-selected={isActive}
|
|
45
|
+
aria-controls={`solid-tab-panel-${tab.value}`}
|
|
46
|
+
id={`solid-tab-${tab.value}`}
|
|
47
|
+
className={cx("solid-tabs-trigger", isActive && "is-active")}
|
|
48
|
+
onClick={() => onValueChange(tab.value)}
|
|
49
|
+
>
|
|
50
|
+
{tab.label}
|
|
51
|
+
</button>
|
|
52
|
+
);
|
|
53
|
+
})}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
{tabs.map((tab) => {
|
|
57
|
+
const isActive = tab.value === value;
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
key={tab.value}
|
|
61
|
+
role="tabpanel"
|
|
62
|
+
id={`solid-tab-panel-${tab.value}`}
|
|
63
|
+
aria-labelledby={`solid-tab-${tab.value}`}
|
|
64
|
+
hidden={!isActive}
|
|
65
|
+
className={cx("solid-tabs-panel", panelClassName)}
|
|
66
|
+
>
|
|
67
|
+
{isActive ? tab.content : null}
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
})}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/solid-ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/solid-ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { SolidButton } from \"./SolidButton\";\nexport { SolidTab, SolidTabGroup } from \"./SolidTabs\";\n"]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SolidOTPVerify.d.ts","sourceRoot":"./","sources":["components/auth/SolidOTPVerify.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,cAAc,+CAmHnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Form, Formik } from "formik";
|
|
4
|
-
import { signIn } from "next-auth/react";
|
|
5
|
-
import Link from "next/link";
|
|
6
|
-
import { useRouter } from "next/navigation";
|
|
7
|
-
import { Button } from "primereact/button";
|
|
8
|
-
import { InputOtp } from "primereact/inputotp";
|
|
9
|
-
import { Message } from "primereact/message";
|
|
10
|
-
import { Toast } from "primereact/toast";
|
|
11
|
-
import { useRef, useState } from "react";
|
|
12
|
-
import * as Yup from "yup";
|
|
13
|
-
import { useSelector } from "react-redux";
|
|
14
|
-
import Image from "next/image";
|
|
15
|
-
import SolidLogo from '../../resources/images/SolidXLogo.svg';
|
|
16
|
-
import { ERROR_MESSAGES } from "../../constants/error-messages";
|
|
17
|
-
const SolidOTPVerify = () => {
|
|
18
|
-
// const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
|
|
19
|
-
// useEffect(() => {
|
|
20
|
-
// trigger("") // Fetch settings on mount
|
|
21
|
-
// }, [trigger])
|
|
22
|
-
const solidSettingsData = useSelector((state) => state.settingsState?.solidSettings);
|
|
23
|
-
const [otp, setOTP] = useState();
|
|
24
|
-
const toast = useRef(null);
|
|
25
|
-
const router = useRouter();
|
|
26
|
-
const [password, setPassword] = useState('');
|
|
27
|
-
const [checked, setChecked] = useState(false);
|
|
28
|
-
const validationSchema = Yup.object({
|
|
29
|
-
email: Yup.string()
|
|
30
|
-
.email(ERROR_MESSAGES.FIELD_INVALID(' email address'))
|
|
31
|
-
.required(ERROR_MESSAGES.FIELD_REUQIRED('Email')),
|
|
32
|
-
});
|
|
33
|
-
const showToast = (severity, summary, detail) => {
|
|
34
|
-
toast.current?.show({
|
|
35
|
-
severity,
|
|
36
|
-
summary,
|
|
37
|
-
detail,
|
|
38
|
-
...(severity === "error"
|
|
39
|
-
? { sticky: true } // stays until user closes
|
|
40
|
-
: { life: 3000 }),
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const isFormFieldValid = (formik, fieldName) => formik.touched[fieldName] && formik.errors[fieldName];
|
|
44
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toast, { ref: toast }), _jsxs("div", { className: `auth-container ${solidSettingsData?.authPagesLayout === 'center' ? 'center' : 'side'}`, style: { minWidth: 480 }, children: [solidSettingsData?.authPagesLayout === 'center' &&
|
|
45
|
-
_jsx("div", { className: "flex justify-content-center", children: _jsx("div", { className: `solid-logo flex align-items-center ${solidSettingsData?.appLogoPosition}`, children: _jsx(Image, { alt: "solid logo", src: solidSettingsData?.appLogo || SolidLogo, className: "relative", fill: true }) }) }), _jsx("h2", { className: `solid-auth-title ${solidSettingsData?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`, children: "OTP Verification" }), _jsx("p", { className: "solid-auth-subtitle text-sm", children: "Please enter the OTP sent to your email to complete verification" }), _jsx(_Fragment, { children: _jsx(Formik, { initialValues: {
|
|
46
|
-
email: "",
|
|
47
|
-
password: "",
|
|
48
|
-
}, validationSchema: validationSchema, onSubmit: async (values) => {
|
|
49
|
-
// Handle form submission
|
|
50
|
-
const email = values.email;
|
|
51
|
-
const password = values.password;
|
|
52
|
-
const response = await signIn("credentials", {
|
|
53
|
-
redirect: false,
|
|
54
|
-
email,
|
|
55
|
-
password,
|
|
56
|
-
});
|
|
57
|
-
if (response?.error) {
|
|
58
|
-
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, response.error);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
showToast("success", ERROR_MESSAGES.LOGIN_SUCCESS, ERROR_MESSAGES.DASHBOARD_REDIRECTING);
|
|
62
|
-
router.push(`${process.env.NEXT_PUBLIC_LOGIN_REDIRECT_URL}`);
|
|
63
|
-
}
|
|
64
|
-
}, children: (formik) => (_jsxs(Form, { children: [_jsxs("div", { className: "flex flex-column gap-2 px-3", children: [_jsx("label", { htmlFor: "email", className: "solid-auth-input-label", children: "Enter OTP" }), _jsx(InputOtp, { value: otp, onChange: (e) => setOTP(e.value), length: 6, style: { width: '100%' } }), isFormFieldValid(formik, "email") && _jsx(Message, { className: "text-red-500 text-sm", severity: "error", text: formik?.errors?.email?.toString() }), _jsxs("div", { className: "flex align-items-center justify-content-between", children: [_jsx(Button, { type: "button", icon: 'pi pi-refresh', iconPos: "left", link: true, label: "Resend Code", className: "px-0 text-sm font-normal" }), _jsx("p", { className: "m-0 text-sm text-color", children: "Time left: 00:28" })] })] }), _jsx("div", { className: "mt-4", children: _jsx(Button, { type: "submit", className: "w-full font-light auth-submit-button", label: "Verify", disabled: formik.isSubmitting, loading: formik.isSubmitting }) })] })) }) })] }), _jsx("div", { className: "text-center mt-5", children: _jsxs("div", { className: "text-sm text-400 secondary-dark-color", children: ['<', " Back to ", _jsx(Link, { className: "font-bold", href: "/auth/login", children: "Sign In" })] }) })] }));
|
|
65
|
-
};
|
|
66
|
-
export default SolidOTPVerify;
|
|
67
|
-
//# sourceMappingURL=SolidOTPVerify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SolidOTPVerify.js","sourceRoot":"./","sources":["components/auth/SolidOTPVerify.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,SAAS,MAAM,uCAAuC,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,MAAM,cAAc,GAAG,GAAG,EAAE;IAExB,gFAAgF;IAChF,oBAAoB;IACpB,6CAA6C;IAC7C,gBAAgB;IAEhB,MAAM,iBAAiB,GAAG,WAAW,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAE1F,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,EAAgB,CAAC;IAE/C,MAAM,KAAK,GAAG,MAAM,CAAQ,IAAI,C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\nimport Link from \"next/link\";\nimport { useRouter } from \"next/navigation\";\nimport { Button } from \"primereact/button\";\nimport { InputOtp } from \"primereact/inputotp\";\nimport { Message } from \"primereact/message\";\nimport { Toast } from \"primereact/toast\";\nimport { useRef, useState } from \"react\";\nimport * as Yup from \"yup\";\nimport { useSelector } from \"react-redux\";\nimport Image from \"next/image\";\nimport SolidLogo from '../../resources/images/SolidXLogo.svg'\nimport { ERROR_MESSAGES } from \"../../constants/error-messages\";\n\nconst SolidOTPVerify = () => {\n\n // const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();\n // useEffect(() => {\n // trigger(\"\") // Fetch settings on mount\n // }, [trigger])\n\n const solidSettingsData = useSelector((state: any) => state.settingsState?.solidSettings);\n\n const [otp, setOTP] = useState<number | any>();\n\n const toast = useRef<Toast>(null);\n const router = useRouter();\n\n const [password, setPassword] = useState('');\n const [checked, setChecked] = useState<boolean>(false);\n\n const validationSchema = Yup.object({\n email: Yup.string()\n .email(ERROR_MESSAGES.FIELD_INVALID(' email address'))\n .required(ERROR_MESSAGES.FIELD_REUQIRED('Email')),\n });\n\n const showToast = (severity: \"success\" | \"error\", summary: string, detail: string) => {\n toast.current?.show({\n severity,\n summary,\n detail,\n ...(severity === \"error\"\n ? { sticky: true } // stays until user closes\n : { life: 3000 }),\n });\n };\n\n const isFormFieldValid = (formik: any, fieldName: string) =>\n formik.touched[fieldName] && formik.errors[fieldName];\n\n return (\n <>\n <Toast ref={toast} />\n <div className={`auth-container ${solidSettingsData?.authPagesLayout === 'center' ? 'center' : 'side'}`} style={{ minWidth: 480 }}>\n {solidSettingsData?.authPagesLayout === 'center' &&\n <div className=\"flex justify-content-center\">\n <div className={`solid-logo flex align-items-center ${solidSettingsData?.appLogoPosition}`}>\n <Image\n alt=\"solid logo\"\n src={solidSettingsData?.appLogo || SolidLogo}\n className=\"relative\"\n fill\n />\n </div>\n </div>\n }\n <h2 className={`solid-auth-title ${solidSettingsData?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>OTP Verification</h2>\n <p className=\"solid-auth-subtitle text-sm\">\n Please enter the OTP sent to your email to complete verification\n </p>\n <>\n <Formik\n initialValues={{\n email: \"\",\n password: \"\",\n }}\n validationSchema={validationSchema}\n onSubmit={async (values) => {\n // Handle form submission\n const email = values.email;\n const password = values.password;\n\n const response = await signIn(\"credentials\", {\n redirect: false,\n email,\n password,\n });\n if (response?.error) {\n showToast(\"error\", ERROR_MESSAGES.LOGIN_ERROR, response.error);\n } else {\n showToast(\"success\", ERROR_MESSAGES.LOGIN_SUCCESS, ERROR_MESSAGES.DASHBOARD_REDIRECTING);\n router.push(`${process.env.NEXT_PUBLIC_LOGIN_REDIRECT_URL}`);\n }\n\n }}\n >\n {(formik) => (\n <Form>\n <div className=\"flex flex-column gap-2 px-3\">\n <label htmlFor=\"email\" className=\"solid-auth-input-label\">Enter OTP</label>\n <InputOtp value={otp} onChange={(e) => setOTP(e.value)} length={6} style={{ width: '100%' }} />\n {isFormFieldValid(formik, \"email\") && <Message\n className=\"text-red-500 text-sm\"\n severity=\"error\"\n text={formik?.errors?.email?.toString()}\n />}\n <div className=\"flex align-items-center justify-content-between\">\n <Button type=\"button\" icon='pi pi-refresh' iconPos=\"left\" link label=\"Resend Code\" className=\"px-0 text-sm font-normal\" />\n <p className=\"m-0 text-sm text-color\">\n Time left: 00:28\n </p>\n </div>\n </div>\n <div className=\"mt-4\">\n <Button type=\"submit\" className=\"w-full font-light auth-submit-button\" label=\"Verify\" disabled={formik.isSubmitting} loading={formik.isSubmitting} />\n </div>\n </Form>\n )}\n </Formik>\n </>\n </div>\n <div className=\"text-center mt-5\">\n <div className=\"text-sm text-400 secondary-dark-color\">\n {'<'} Back to <Link className=\"font-bold\" href=\"/auth/login\">Sign In</Link>\n </div>\n </div>\n </>\n );\n};\n\nexport default SolidOTPVerify;"]}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Form, Formik } from "formik";
|
|
4
|
-
import { signIn } from "next-auth/react";
|
|
5
|
-
import Link from "next/link";
|
|
6
|
-
import { useRouter } from "next/navigation";
|
|
7
|
-
import { Button } from "primereact/button";
|
|
8
|
-
import { InputOtp } from "primereact/inputotp";
|
|
9
|
-
import { Message } from "primereact/message";
|
|
10
|
-
import { Toast } from "primereact/toast";
|
|
11
|
-
import { useEffect, useRef, useState } from "react";
|
|
12
|
-
import * as Yup from "yup";
|
|
13
|
-
import Image from "next/image";
|
|
14
|
-
import SolidLogo from '../../resources/images/SolidXLogo.svg'
|
|
15
|
-
import { ERROR_MESSAGES } from "../../constants/error-messages";
|
|
16
|
-
import { useLazyGetAuthSettingsQuery } from "../../redux/api/solidSettingsApi";
|
|
17
|
-
|
|
18
|
-
const SolidOTPVerify = () => {
|
|
19
|
-
|
|
20
|
-
const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
trigger("") // Fetch settings on mount
|
|
23
|
-
}, [trigger])
|
|
24
|
-
|
|
25
|
-
const [otp, setOTP] = useState<number | any>();
|
|
26
|
-
|
|
27
|
-
const toast = useRef<Toast>(null);
|
|
28
|
-
const router = useRouter();
|
|
29
|
-
|
|
30
|
-
const [password, setPassword] = useState('');
|
|
31
|
-
const [checked, setChecked] = useState<boolean>(false);
|
|
32
|
-
|
|
33
|
-
const validationSchema = Yup.object({
|
|
34
|
-
email: Yup.string()
|
|
35
|
-
.email(ERROR_MESSAGES.FIELD_INVALID(' email address'))
|
|
36
|
-
.required(ERROR_MESSAGES.FIELD_REUQIRED('Email')),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
40
|
-
toast.current?.show({
|
|
41
|
-
severity,
|
|
42
|
-
summary,
|
|
43
|
-
detail,
|
|
44
|
-
...(severity === "error"
|
|
45
|
-
? { sticky: true } // stays until user closes
|
|
46
|
-
: { life: 3000 }),
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const isFormFieldValid = (formik: any, fieldName: string) =>
|
|
51
|
-
formik.touched[fieldName] && formik.errors[fieldName];
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
<Toast ref={toast} />
|
|
56
|
-
<div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`} style={{ minWidth: 480 }}>
|
|
57
|
-
{solidSettingsData?.data?.authPagesLayout === 'center' &&
|
|
58
|
-
<div className="flex justify-content-center">
|
|
59
|
-
<div className={`solid-logo flex align-items-center ${solidSettingsData?.data?.appLogoPosition}`}>
|
|
60
|
-
<Image
|
|
61
|
-
alt="solid logo"
|
|
62
|
-
src={solidSettingsData?.data?.appLogo || SolidLogo}
|
|
63
|
-
className="relative"
|
|
64
|
-
fill
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
}
|
|
69
|
-
<h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>OTP Verification</h2>
|
|
70
|
-
<p className="solid-auth-subtitle text-sm">
|
|
71
|
-
Please enter the OTP sent to your email to complete verification
|
|
72
|
-
</p>
|
|
73
|
-
<>
|
|
74
|
-
<Formik
|
|
75
|
-
initialValues={{
|
|
76
|
-
email: "",
|
|
77
|
-
password: "",
|
|
78
|
-
}}
|
|
79
|
-
validationSchema={validationSchema}
|
|
80
|
-
onSubmit={async (values) => {
|
|
81
|
-
// Handle form submission
|
|
82
|
-
const email = values.email;
|
|
83
|
-
const password = values.password;
|
|
84
|
-
|
|
85
|
-
const response = await signIn("credentials", {
|
|
86
|
-
redirect: false,
|
|
87
|
-
email,
|
|
88
|
-
password,
|
|
89
|
-
});
|
|
90
|
-
if (response?.error) {
|
|
91
|
-
showToast("error", ERROR_MESSAGES.LOGIN_ERROR, response.error);
|
|
92
|
-
} else {
|
|
93
|
-
showToast("success", ERROR_MESSAGES.LOGIN_SUCCESS, ERROR_MESSAGES.DASHBOARD_REDIRECTING);
|
|
94
|
-
router.push(`${process.env.NEXT_PUBLIC_LOGIN_REDIRECT_URL}`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
{(formik) => (
|
|
100
|
-
<Form>
|
|
101
|
-
<div className="flex flex-column gap-2 px-3">
|
|
102
|
-
<label htmlFor="email" className="solid-auth-input-label">Enter OTP</label>
|
|
103
|
-
<InputOtp value={otp} onChange={(e) => setOTP(e.value)} length={6} style={{ width: '100%' }} />
|
|
104
|
-
{isFormFieldValid(formik, "email") && <Message
|
|
105
|
-
className="text-red-500 text-sm"
|
|
106
|
-
severity="error"
|
|
107
|
-
text={formik?.errors?.email?.toString()}
|
|
108
|
-
/>}
|
|
109
|
-
<div className="flex align-items-center justify-content-between">
|
|
110
|
-
<Button type="button" icon='pi pi-refresh' iconPos="left" link label="Resend Code" className="px-0 text-sm font-normal" />
|
|
111
|
-
<p className="m-0 text-sm text-color">
|
|
112
|
-
Time left: 00:28
|
|
113
|
-
</p>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
<div className="mt-4">
|
|
117
|
-
<Button type="submit" className="w-full font-light auth-submit-button" label="Verify" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
118
|
-
</div>
|
|
119
|
-
</Form>
|
|
120
|
-
)}
|
|
121
|
-
</Formik>
|
|
122
|
-
</>
|
|
123
|
-
</div>
|
|
124
|
-
<div className="text-center mt-5">
|
|
125
|
-
<div className="text-sm text-400 secondary-dark-color">
|
|
126
|
-
{'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
</>
|
|
130
|
-
);
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export default SolidOTPVerify;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadDynamicJsxComponent.d.ts","sourceRoot":"./","sources":["components/core/common/LoadDynamicJsxComponent.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,uBAAuB,gBAAiB,GAAG,4CAoDvD,CAAA"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
4
|
-
import dynamic from "next/dynamic";
|
|
5
|
-
import { useState, useEffect } from "react";
|
|
6
|
-
// Fallback component for missing components
|
|
7
|
-
const FallbackComponent = ({ componentName }) => (_jsxs("div", { style: { color: "red" }, children: ["Could not load ", _jsx("strong", { children: componentName })] }));
|
|
8
|
-
export const LoadDynamicJsxComponent = ({ context }) => {
|
|
9
|
-
// const Component = dynamic<Props>(
|
|
10
|
-
// async () => {
|
|
11
|
-
// try {
|
|
12
|
-
// const componentName = context?.rowAction?.action?.customComponent.split('/').pop();
|
|
13
|
-
// const mod = await import();
|
|
14
|
-
// // Return the default export or a named export matching the componentName
|
|
15
|
-
// return mod.default || mod[componentName];
|
|
16
|
-
// } catch (error) {
|
|
17
|
-
// console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
18
|
-
// // Return a fallback component if the import fails
|
|
19
|
-
// return () => <GenerateModelCodeRowAction context={context} />;
|
|
20
|
-
// }
|
|
21
|
-
// },
|
|
22
|
-
// { ssr: false } // Disable server-side rendering
|
|
23
|
-
// );
|
|
24
|
-
const [Component, setComponent] = useState(null);
|
|
25
|
-
const componentPath = context?.rowAction?.action?.customComponent;
|
|
26
|
-
const componentKey = componentPath?.split("/")?.pop();
|
|
27
|
-
const componentMap = {
|
|
28
|
-
"GenerateModelCodeRowAction": dynamic(() => import("../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction"), { ssr: false }),
|
|
29
|
-
"GenerateModuleCodeRowAction": dynamic(() => import("../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction"), { ssr: false }),
|
|
30
|
-
};
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (!componentKey)
|
|
33
|
-
return;
|
|
34
|
-
if (componentMap[componentKey]) {
|
|
35
|
-
setComponent(() => () => setComponent(() => componentMap[componentKey]));
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
import(componentPath)
|
|
39
|
-
.then((mod) => setComponent(() => mod.default || mod))
|
|
40
|
-
.catch((err) => {
|
|
41
|
-
console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);
|
|
42
|
-
setComponent(() => () => _jsx(FallbackComponent, { componentName: componentKey }));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}, [componentKey]);
|
|
46
|
-
if (!Component)
|
|
47
|
-
return _jsx("p", { children: "Loading..." });
|
|
48
|
-
return _jsx(Component, { context: context });
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=LoadDynamicJsxComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadDynamicJsxComponent.js","sourceRoot":"./","sources":["components/core/common/LoadDynamicJsxComponent.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,CAAC,EAAE,aAAa,EAAO,EAAE,EAAE,CAAC,CAClD,eAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gCACT,2BAAS,aAAa,GAAU,IAC7C,CACT,CAAC;AAMF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAE,OAAO,EAAO,EAAE,EAAE;IAGxD,oCAAoC;IACpC,oBAAoB;IACpB,gBAAgB;IAEhB,kGAAkG;IAClG,0CAA0C;IAC1C,wFAAwF;I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AC,iBAAiB,IAAC,aAAa,EAAE,YAAY,GAAI,CAAC,CAAC;YAC7E,CAAC,CAAC,CAAC;SACN;IACL,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,IAAI,CAAC,SAAS;QAAE,OAAO,qCAAiB,CAAC;IAEzC,OAAO,KAAC,SAAS,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC;AAC3C,CAAC,CAAA","sourcesContent":["'use client';\nimport { ERROR_MESSAGES } from \"../../../constants/error-messages\";\nimport dynamic from \"next/dynamic\";\nimport { useState, useEffect } from \"react\";\n// Fallback component for missing components\nconst FallbackComponent = ({ componentName }: any) => (\n <div style={{ color: \"red\" }}>\n Could not load <strong>{componentName}</strong>\n </div>\n);\n\ntype Props = {\n context: any;\n};\n\nexport const LoadDynamicJsxComponent = ({ context }: any) => {\n\n \n // const Component = dynamic<Props>(\n // async () => {\n // try {\n \n // const componentName = context?.rowAction?.action?.customComponent.split('/').pop();\n // const mod = await import();\n // // Return the default export or a named export matching the componentName\n // return mod.default || mod[componentName];\n // } catch (error) {\n // console.error(`Failed to load component \"${context?.rowAction?.action?.customComponent}\":`, error);\n // // Return a fallback component if the import fails\n // return () => <GenerateModelCodeRowAction context={context} />;\n // }\n // },\n // { ssr: false } // Disable server-side rendering\n // );\n const [Component, setComponent] = useState<any>(null);\n const componentPath = context?.rowAction?.action?.customComponent;\n const componentKey = componentPath?.split(\"/\")?.pop();\n\n const componentMap: Record<string, any> = {\n \"GenerateModelCodeRowAction\": dynamic(\n () => import(\"../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction\"),\n { ssr: false }\n ),\n \"GenerateModuleCodeRowAction\": dynamic(\n () => import(\"../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction\"),\n { ssr: false }\n ),\n };\n\n useEffect(() => {\n if (!componentKey) return;\n\n if (componentMap[componentKey]) {\n setComponent(() => () => setComponent(() => componentMap[componentKey]));\n } else {\n import(componentPath)\n .then((mod) => setComponent(() => mod.default || mod))\n .catch((err) => {\n console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);\n setComponent(() => () => <FallbackComponent componentName={componentKey} />);\n });\n }\n }, [componentKey]);\n\n if (!Component) return <p>Loading...</p>;\n\n return <Component context={context} />;\n}\n\n\n"]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { ERROR_MESSAGES } from "../../../constants/error-messages";
|
|
3
|
-
import dynamic from "next/dynamic";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
// Fallback component for missing components
|
|
6
|
-
const FallbackComponent = ({ componentName }: any) => (
|
|
7
|
-
<div style={{ color: "red" }}>
|
|
8
|
-
Could not load <strong>{componentName}</strong>
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
type Props = {
|
|
13
|
-
context: any;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const LoadDynamicJsxComponent = ({ context }: any) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// const Component = dynamic<Props>(
|
|
20
|
-
// async () => {
|
|
21
|
-
// try {
|
|
22
|
-
|
|
23
|
-
// const componentName = context?.rowAction?.action?.customComponent.split('/').pop();
|
|
24
|
-
// const mod = await import();
|
|
25
|
-
// // Return the default export or a named export matching the componentName
|
|
26
|
-
// return mod.default || mod[componentName];
|
|
27
|
-
// } catch (error) {
|
|
28
|
-
// console.error(`Failed to load component "${context?.rowAction?.action?.customComponent}":`, error);
|
|
29
|
-
// // Return a fallback component if the import fails
|
|
30
|
-
// return () => <GenerateModelCodeRowAction context={context} />;
|
|
31
|
-
// }
|
|
32
|
-
// },
|
|
33
|
-
// { ssr: false } // Disable server-side rendering
|
|
34
|
-
// );
|
|
35
|
-
const [Component, setComponent] = useState<any>(null);
|
|
36
|
-
const componentPath = context?.rowAction?.action?.customComponent;
|
|
37
|
-
const componentKey = componentPath?.split("/")?.pop();
|
|
38
|
-
|
|
39
|
-
const componentMap: Record<string, any> = {
|
|
40
|
-
"GenerateModelCodeRowAction": dynamic(
|
|
41
|
-
() => import("../extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction"),
|
|
42
|
-
{ ssr: false }
|
|
43
|
-
),
|
|
44
|
-
"GenerateModuleCodeRowAction": dynamic(
|
|
45
|
-
() => import("../extension/solid-core/moduleMetadata/list/GenerateModuleCodeRowAction"),
|
|
46
|
-
{ ssr: false }
|
|
47
|
-
),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (!componentKey) return;
|
|
52
|
-
|
|
53
|
-
if (componentMap[componentKey]) {
|
|
54
|
-
setComponent(() => () => setComponent(() => componentMap[componentKey]));
|
|
55
|
-
} else {
|
|
56
|
-
import(componentPath)
|
|
57
|
-
.then((mod) => setComponent(() => mod.default || mod))
|
|
58
|
-
.catch((err) => {
|
|
59
|
-
console.error(` ${ERROR_MESSAGES.LOADING_COMPONENT} ${componentPath}:`, err);
|
|
60
|
-
setComponent(() => () => <FallbackComponent componentName={componentKey} />);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}, [componentKey]);
|
|
64
|
-
|
|
65
|
-
if (!Component) return <p>Loading...</p>;
|
|
66
|
-
|
|
67
|
-
return <Component context={context} />;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authProviders.d.ts","sourceRoot":"./","sources":["nextAuth/authProviders.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAW5C,QAAA,MAAM,aAAa,EAAE,eAqNpB,CAAA;AAED,eAAe,aAAa,CAAA"}
|