@solidxai/core-ui 0.1.12-beta.0 → 0.1.12-beta.1
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/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +6 -3
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +16 -2
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +7 -4
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +16 -2
- package/dist/components/common/SolidLoadingState.d.ts +10 -0
- package/dist/components/common/SolidLoadingState.d.ts.map +1 -0
- package/dist/components/common/SolidLoadingState.js +8 -0
- package/dist/components/common/SolidLoadingState.js.map +1 -0
- package/dist/components/common/SolidLoadingState.module.css +56 -0
- package/dist/components/common/SolidLoadingState.tsx +28 -0
- package/dist/components/core/json/SolidJsonEditor.css +195 -0
- package/dist/components/core/json/SolidJsonEditor.d.ts +19 -0
- package/dist/components/core/json/SolidJsonEditor.d.ts.map +1 -0
- package/dist/components/core/json/SolidJsonEditor.js +109 -0
- package/dist/components/core/json/SolidJsonEditor.js.map +1 -0
- package/dist/components/core/json/SolidJsonEditor.tsx +150 -0
- package/dist/components/core/module/CreateModule.css +70 -2
- package/dist/components/core/module/CreateModule.d.ts.map +1 -1
- package/dist/components/core/module/CreateModule.js +2 -2
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +13 -1
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.ts +14 -0
- package/dist/redux/api/datasourceIntrospectionApi.d.ts +203 -0
- package/dist/redux/api/datasourceIntrospectionApi.d.ts.map +1 -0
- package/dist/redux/api/datasourceIntrospectionApi.js +71 -0
- package/dist/redux/api/datasourceIntrospectionApi.js.map +1 -0
- package/dist/redux/api/datasourceIntrospectionApi.ts +261 -0
- package/dist/redux/api/datasourceManagementApi.d.ts +46 -0
- package/dist/redux/api/datasourceManagementApi.d.ts.map +1 -0
- package/dist/redux/api/datasourceManagementApi.js +35 -0
- package/dist/redux/api/datasourceManagementApi.js.map +1 -0
- package/dist/redux/api/datasourceManagementApi.ts +86 -0
- package/dist/redux/store/StoreProvider.d.ts.map +1 -1
- package/dist/redux/store/StoreProvider.js +4 -2
- package/dist/redux/store/StoreProvider.js.map +1 -1
- package/dist/redux/store/StoreProvider.tsx +9 -1
- package/dist/redux/store/defaultStoreConfig.d.ts +23 -0
- package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
- package/dist/redux/store/defaultStoreConfig.js +4 -0
- package/dist/redux/store/defaultStoreConfig.js.map +1 -1
- package/dist/redux/store/defaultStoreConfig.ts +4 -0
- package/dist/resources/solid-custom.css +70 -16
- package/dist/routes/guards/AdminGuard.d.ts.map +1 -1
- package/dist/routes/guards/AdminGuard.js +2 -1
- package/dist/routes/guards/AdminGuard.js.map +1 -1
- package/dist/routes/guards/AdminGuard.tsx +7 -1
- package/dist/routes/guards/AuthGuard.d.ts.map +1 -1
- package/dist/routes/guards/AuthGuard.js +2 -1
- package/dist/routes/guards/AuthGuard.js.map +1 -1
- package/dist/routes/guards/AuthGuard.tsx +8 -2
- package/dist/routes/guards/GuestGuard.d.ts.map +1 -1
- package/dist/routes/guards/GuestGuard.js +2 -1
- package/dist/routes/guards/GuestGuard.js.map +1 -1
- package/dist/routes/guards/GuestGuard.tsx +8 -2
- package/dist/routes/pages/admin/core/DashboardPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.js +7 -5
- package/dist/routes/pages/admin/core/DashboardPage.js.map +1 -1
- package/dist/routes/pages/admin/core/DashboardPage.module.css +18 -0
- package/dist/routes/pages/admin/core/DashboardPage.tsx +50 -32
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +828 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +947 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -0
- package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +1719 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.css +337 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.d.ts +3 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.d.ts.map +1 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.js +221 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.js.map +1 -0
- package/dist/routes/pages/admin/core/DatasourcesPage.tsx +540 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +5 -1
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +4 -0
- package/package.json +1 -1
|
@@ -2471,10 +2471,11 @@ body {
|
|
|
2471
2471
|
min-width: 0 !important;
|
|
2472
2472
|
width: min(100%, 388px) !important;
|
|
2473
2473
|
max-width: 388px !important;
|
|
2474
|
-
padding:
|
|
2475
|
-
border-radius:
|
|
2474
|
+
padding: 24px !important;
|
|
2475
|
+
border-radius: 16px !important;
|
|
2476
2476
|
backdrop-filter: none !important;
|
|
2477
|
-
box-shadow:
|
|
2477
|
+
box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08) !important;
|
|
2478
|
+
font-family: var(--font-family, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
|
|
2478
2479
|
}
|
|
2479
2480
|
|
|
2480
2481
|
.solid-auth-theme-wrapper.left .auth-container,
|
|
@@ -2504,22 +2505,35 @@ body {
|
|
|
2504
2505
|
|
|
2505
2506
|
.solid-auth-theme-wrapper .solid-auth-title {
|
|
2506
2507
|
margin-top: 0 !important;
|
|
2507
|
-
font-size:
|
|
2508
|
-
|
|
2509
|
-
|
|
2508
|
+
font-size: clamp(1.45rem, 1.2rem + 0.7vw, 1.75rem) !important;
|
|
2509
|
+
font-weight: 650 !important;
|
|
2510
|
+
line-height: 1.08 !important;
|
|
2511
|
+
letter-spacing: -0.03em !important;
|
|
2510
2512
|
}
|
|
2511
2513
|
|
|
2512
2514
|
.solid-auth-theme-wrapper .solid-auth-helper {
|
|
2513
|
-
margin-top: 0.
|
|
2514
|
-
margin-bottom:
|
|
2515
|
-
font-size:
|
|
2516
|
-
line-height: 1.
|
|
2515
|
+
margin-top: 0.65rem !important;
|
|
2516
|
+
margin-bottom: 1rem !important;
|
|
2517
|
+
font-size: 0.92rem !important;
|
|
2518
|
+
line-height: 1.55 !important;
|
|
2519
|
+
letter-spacing: -0.01em !important;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
.solid-auth-theme-wrapper .solid-auth-input-label {
|
|
2523
|
+
font-size: 0.84rem !important;
|
|
2524
|
+
font-weight: 600 !important;
|
|
2525
|
+
letter-spacing: -0.01em !important;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
.solid-auth-theme-wrapper .solid-auth-inline-link {
|
|
2529
|
+
font-size: 0.84rem !important;
|
|
2530
|
+
font-weight: 500 !important;
|
|
2517
2531
|
}
|
|
2518
2532
|
|
|
2519
2533
|
.solid-auth-theme-wrapper .auth-container .solid-input {
|
|
2520
|
-
height:
|
|
2521
|
-
border-radius:
|
|
2522
|
-
padding: 0
|
|
2534
|
+
height: 42px !important;
|
|
2535
|
+
border-radius: 10px !important;
|
|
2536
|
+
padding: 0 12px !important;
|
|
2523
2537
|
border: 1px solid #2f2f37 !important;
|
|
2524
2538
|
border-color: #2f2f37 !important;
|
|
2525
2539
|
border-top-color: #2f2f37 !important;
|
|
@@ -2586,9 +2600,17 @@ body {
|
|
|
2586
2600
|
.solid-auth-theme-wrapper .auth-submit-button.solid-btn,
|
|
2587
2601
|
.solid-auth-theme-wrapper .auth-back-button.solid-btn,
|
|
2588
2602
|
.solid-auth-theme-wrapper .solid-auth-social-btn.solid-btn {
|
|
2589
|
-
min-height:
|
|
2590
|
-
height:
|
|
2591
|
-
border-radius:
|
|
2603
|
+
min-height: 42px !important;
|
|
2604
|
+
height: 42px !important;
|
|
2605
|
+
border-radius: 10px !important;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
.solid-auth-theme-wrapper .auth-submit-button.solid-btn .solid-btn-label,
|
|
2609
|
+
.solid-auth-theme-wrapper .auth-back-button.solid-btn .solid-btn-label,
|
|
2610
|
+
.solid-auth-theme-wrapper .solid-auth-social-btn.solid-btn .solid-btn-label {
|
|
2611
|
+
font-size: 0.92rem !important;
|
|
2612
|
+
font-weight: 600 !important;
|
|
2613
|
+
letter-spacing: -0.01em !important;
|
|
2592
2614
|
}
|
|
2593
2615
|
|
|
2594
2616
|
.solid-auth-theme-wrapper .auth-container .solid-message {
|
|
@@ -2621,6 +2643,38 @@ body {
|
|
|
2621
2643
|
color: #ef4444 !important;
|
|
2622
2644
|
}
|
|
2623
2645
|
|
|
2646
|
+
.solid-auth-theme-wrapper .solid-auth-empty-state {
|
|
2647
|
+
margin-top: 1rem;
|
|
2648
|
+
border: 1px solid var(--solid-border-default) !important;
|
|
2649
|
+
border-radius: 14px;
|
|
2650
|
+
background: color-mix(in srgb, var(--solid-surface-input) 55%, transparent);
|
|
2651
|
+
padding: 14px 15px;
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
.solid-auth-theme-wrapper .solid-auth-empty-state.is-loading {
|
|
2655
|
+
background: color-mix(in srgb, var(--solid-surface-input) 42%, transparent);
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
.solid-auth-theme-wrapper .solid-auth-empty-title,
|
|
2659
|
+
.solid-auth-theme-wrapper .solid-auth-empty-copy {
|
|
2660
|
+
margin: 0;
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
.solid-auth-theme-wrapper .solid-auth-empty-title {
|
|
2664
|
+
color: var(--solid-text-primary) !important;
|
|
2665
|
+
font-size: 0.95rem !important;
|
|
2666
|
+
font-weight: 600 !important;
|
|
2667
|
+
line-height: 1.4 !important;
|
|
2668
|
+
letter-spacing: -0.01em !important;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
.solid-auth-theme-wrapper .solid-auth-empty-copy {
|
|
2672
|
+
margin-top: 0.35rem;
|
|
2673
|
+
color: var(--solid-text-secondary) !important;
|
|
2674
|
+
font-size: 0.84rem !important;
|
|
2675
|
+
line-height: 1.55 !important;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2624
2678
|
/* Side auth layout shell (left/right) */
|
|
2625
2679
|
.solid-auth-theme-wrapper.left,
|
|
2626
2680
|
.solid-auth-theme-wrapper.right {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/AdminGuard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/AdminGuard.tsx"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,4CAiBzB"}
|
|
@@ -2,11 +2,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Navigate, Outlet } from "react-router-dom";
|
|
3
3
|
import { useSession } from "../../hooks/useSession";
|
|
4
4
|
import { hasAnyRole } from "../../helpers/rolesHelper";
|
|
5
|
+
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
5
6
|
export function AdminGuard() {
|
|
6
7
|
var _a;
|
|
7
8
|
var _b = useSession(), session = _b.data, status = _b.status;
|
|
8
9
|
if (status === "loading") {
|
|
9
|
-
return _jsx(
|
|
10
|
+
return (_jsx(SolidLoadingState, { title: "Checking access", description: "We are verifying your session and access permissions." }));
|
|
10
11
|
}
|
|
11
12
|
if (!hasAnyRole((_a = session === null || session === void 0 ? void 0 : session.user) === null || _a === void 0 ? void 0 : _a.roles, ["Admin"])) {
|
|
12
13
|
return _jsx(Navigate, { to: "/not-found", replace: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/AdminGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"AdminGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/AdminGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,UAAU,UAAU;;IAClB,IAAA,KAA4B,UAAU,EAAE,EAAhC,OAAO,UAAA,EAAE,MAAM,YAAiB,CAAC;IAE/C,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,CACL,KAAC,iBAAiB,IAChB,KAAK,EAAC,iBAAiB,EACvB,WAAW,EAAC,uDAAuD,GACnE,CACH,CAAC;KACH;IAED,IAAI,CAAC,UAAU,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE;QAChD,OAAO,KAAC,QAAQ,IAAC,EAAE,EAAC,YAAY,EAAC,OAAO,SAAG,CAAC;KAC7C;IAED,OAAO,KAAC,MAAM,KAAG,CAAC;AACpB,CAAC","sourcesContent":["import { Navigate, Outlet } from \"react-router-dom\";\nimport { useSession } from \"../../hooks/useSession\";\nimport { hasAnyRole } from \"../../helpers/rolesHelper\";\nimport { SolidLoadingState } from \"../../components/common/SolidLoadingState\";\n\nexport function AdminGuard() {\n const { data: session, status } = useSession();\n\n if (status === \"loading\") {\n return (\n <SolidLoadingState\n title=\"Checking access\"\n description=\"We are verifying your session and access permissions.\"\n />\n );\n }\n\n if (!hasAnyRole(session?.user?.roles, [\"Admin\"])) {\n return <Navigate to=\"/not-found\" replace />;\n }\n\n return <Outlet />;\n}\n"]}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Navigate, Outlet } from "react-router-dom";
|
|
2
2
|
import { useSession } from "../../hooks/useSession";
|
|
3
3
|
import { hasAnyRole } from "../../helpers/rolesHelper";
|
|
4
|
+
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
4
5
|
|
|
5
6
|
export function AdminGuard() {
|
|
6
7
|
const { data: session, status } = useSession();
|
|
7
8
|
|
|
8
9
|
if (status === "loading") {
|
|
9
|
-
return
|
|
10
|
+
return (
|
|
11
|
+
<SolidLoadingState
|
|
12
|
+
title="Checking access"
|
|
13
|
+
description="We are verifying your session and access permissions."
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
if (!hasAnyRole(session?.user?.roles, ["Admin"])) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":"AAIA,KAAK,cAAc,GAAG;IACpB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,EAAE,cAAc,2CA2C1D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Navigate, Outlet, useLocation } from "react-router-dom";
|
|
3
3
|
import { useSession } from "../../hooks/useSession";
|
|
4
|
+
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
4
5
|
export function AuthGuard(_a) {
|
|
5
6
|
var getLoginRoute = _a.getLoginRoute;
|
|
6
7
|
var location = useLocation();
|
|
@@ -19,7 +20,7 @@ export function AuthGuard(_a) {
|
|
|
19
20
|
};
|
|
20
21
|
var resolveLoginRoute = getLoginRoute || defaultGetLoginRoute;
|
|
21
22
|
if (status === "loading") {
|
|
22
|
-
return _jsx(
|
|
23
|
+
return (_jsx(SolidLoadingState, { title: "Checking your session", description: "We are confirming your sign-in status before opening this page." }));
|
|
23
24
|
}
|
|
24
25
|
if (status === "unauthenticated") {
|
|
25
26
|
return (_jsx(Navigate, { to: resolveLoginRoute(location.pathname), state: { from: location }, replace: true }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAM9E,MAAM,UAAU,SAAS,CAAC,EAAiC;QAA/B,aAAa,mBAAA;IACvC,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IACvB,IAAA,MAAM,GAAK,UAAU,EAAE,OAAjB,CAAkB;IAEhC,IAAM,oBAAoB,GAAG,UAAC,QAAgB;QAC5C,IAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,aAAa,CAAC;QAEhD,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEzB,8CAA8C;QAC9C,IAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAEvC,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAO,aAAa,CAAC;SACtB;QAED,OAAO,WAAI,IAAI,gBAAa,CAAC;IAC/B,CAAC,CAAC;IAEF,IAAM,iBAAiB,GAAG,aAAa,IAAI,oBAAoB,CAAC;IAEhE,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,CACL,KAAC,iBAAiB,IAChB,KAAK,EAAC,uBAAuB,EAC7B,WAAW,EAAC,iEAAiE,GAC7E,CACH,CAAC;KACH;IAED,IAAI,MAAM,KAAK,iBAAiB,EAAE;QAChC,OAAO,CACL,KAAC,QAAQ,IACP,EAAE,EAAE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACxC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EACzB,OAAO,SACP,CACH,CAAC;KACH;IAED,OAAO,KAAC,MAAM,KAAG,CAAC;AACpB,CAAC","sourcesContent":["import { Navigate, Outlet, useLocation } from \"react-router-dom\";\nimport { useSession } from \"../../hooks/useSession\";\nimport { SolidLoadingState } from \"../../components/common/SolidLoadingState\";\n\ntype AuthGuardProps = {\n getLoginRoute?: (pathname: string) => string;\n};\n\nexport function AuthGuard({ getLoginRoute }: AuthGuardProps) {\n const location = useLocation();\n const { status } = useSession();\n\n const defaultGetLoginRoute = (pathname: string) => {\n const segments = pathname.split(\"/\").filter(Boolean);\n\n if (segments.length === 0) return \"/auth/login\";\n\n const base = segments[0];\n\n // routes that should NOT be treated as tenant\n const systemRoutes = [\"admin\", \"auth\"];\n\n if (systemRoutes.includes(base)) {\n return \"/auth/login\";\n }\n\n return `/${base}/auth/login`;\n };\n\n const resolveLoginRoute = getLoginRoute || defaultGetLoginRoute;\n\n if (status === \"loading\") {\n return (\n <SolidLoadingState\n title=\"Checking your session\"\n description=\"We are confirming your sign-in status before opening this page.\"\n />\n );\n }\n\n if (status === \"unauthenticated\") {\n return (\n <Navigate\n to={resolveLoginRoute(location.pathname)}\n state={{ from: location }}\n replace\n />\n );\n }\n\n return <Outlet />;\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Navigate, Outlet, useLocation } from "react-router-dom";
|
|
2
2
|
import { useSession } from "../../hooks/useSession";
|
|
3
|
+
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
3
4
|
|
|
4
5
|
type AuthGuardProps = {
|
|
5
6
|
getLoginRoute?: (pathname: string) => string;
|
|
@@ -29,7 +30,12 @@ export function AuthGuard({ getLoginRoute }: AuthGuardProps) {
|
|
|
29
30
|
const resolveLoginRoute = getLoginRoute || defaultGetLoginRoute;
|
|
30
31
|
|
|
31
32
|
if (status === "loading") {
|
|
32
|
-
return
|
|
33
|
+
return (
|
|
34
|
+
<SolidLoadingState
|
|
35
|
+
title="Checking your session"
|
|
36
|
+
description="We are confirming your sign-in status before opening this page."
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
if (status === "unauthenticated") {
|
|
@@ -43,4 +49,4 @@ export function AuthGuard({ getLoginRoute }: AuthGuardProps) {
|
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
return <Outlet />;
|
|
46
|
-
}
|
|
52
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuestGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/GuestGuard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GuestGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/GuestGuard.tsx"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,4CAoBzB"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { Outlet, useNavigate } from "react-router-dom";
|
|
4
4
|
import { useSession } from "../../hooks/useSession";
|
|
5
|
+
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
5
6
|
export function GuestGuard() {
|
|
6
7
|
var status = useSession().status;
|
|
7
8
|
var navigate = useNavigate();
|
|
@@ -11,7 +12,7 @@ export function GuestGuard() {
|
|
|
11
12
|
}
|
|
12
13
|
}, [status, navigate]);
|
|
13
14
|
if (status === "loading" || status === "authenticated") {
|
|
14
|
-
return _jsx(
|
|
15
|
+
return (_jsx(SolidLoadingState, { title: "Loading", description: "Please wait while we route you to the right place." }));
|
|
15
16
|
}
|
|
16
17
|
return _jsx(Outlet, {});
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuestGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/GuestGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"GuestGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/GuestGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,UAAU,UAAU;IAChB,IAAA,MAAM,GAAK,UAAU,EAAE,OAAjB,CAAkB;IAChC,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,CAAC;QACR,IAAI,MAAM,KAAK,eAAe,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YACvE,QAAQ,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SACvC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvB,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,eAAe,EAAE;QACtD,OAAO,CACL,KAAC,iBAAiB,IAChB,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,oDAAoD,GAChE,CACH,CAAC;KACH;IAED,OAAO,KAAC,MAAM,KAAG,CAAC;AACpB,CAAC","sourcesContent":["import { useEffect } from \"react\";\nimport { Outlet, useNavigate } from \"react-router-dom\";\nimport { useSession } from \"../../hooks/useSession\";\nimport { SolidLoadingState } from \"../../components/common/SolidLoadingState\";\n\nexport function GuestGuard() {\n const { status } = useSession();\n const navigate = useNavigate();\n\n useEffect(() => {\n if (status === \"authenticated\" && location.pathname.startsWith(\"/auth\")) {\n navigate(\"/admin\", { replace: true });\n }\n }, [status, navigate]);\n\n if (status === \"loading\" || status === \"authenticated\") {\n return (\n <SolidLoadingState\n title=\"Loading\"\n description=\"Please wait while we route you to the right place.\"\n />\n );\n }\n\n return <Outlet />;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { Outlet, useNavigate } from "react-router-dom";
|
|
3
3
|
import { useSession } from "../../hooks/useSession";
|
|
4
|
+
import { SolidLoadingState } from "../../components/common/SolidLoadingState";
|
|
4
5
|
|
|
5
6
|
export function GuestGuard() {
|
|
6
7
|
const { status } = useSession();
|
|
@@ -13,8 +14,13 @@ export function GuestGuard() {
|
|
|
13
14
|
}, [status, navigate]);
|
|
14
15
|
|
|
15
16
|
if (status === "loading" || status === "authenticated") {
|
|
16
|
-
return
|
|
17
|
+
return (
|
|
18
|
+
<SolidLoadingState
|
|
19
|
+
title="Loading"
|
|
20
|
+
description="Please wait while we route you to the right place."
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
return <Outlet />;
|
|
20
|
-
}
|
|
26
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/DashboardPage.tsx"],"names":[],"mappings":"AAIA,OAAO,kCAAkC,CAAC;AAqa1C,wBAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"DashboardPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/DashboardPage.tsx"],"names":[],"mappings":"AAIA,OAAO,kCAAkC,CAAC;AAqa1C,wBAAgB,aAAa,4CAgnB5B"}
|
|
@@ -399,7 +399,7 @@ export function DashboardPage() {
|
|
|
399
399
|
var gridInstanceRef = useRef(null);
|
|
400
400
|
var _f = useGetDashboardDefinitionQuery({ moduleName: moduleName, dashboardName: dashboardName }, { skip: !moduleName || !dashboardName }), definition = _f.data, definitionLoading = _f.isLoading;
|
|
401
401
|
var layoutData = useGetDashboardLayoutQuery({ moduleName: moduleName, dashboardName: dashboardName }, { skip: !moduleName || !dashboardName }).data;
|
|
402
|
-
var _g = useGetDashboardDataMutation(), getDashboardData = _g[0], _h = _g[1], dashboardData = _h.data, dataLoading = _h.isLoading, dataError = _h.error;
|
|
402
|
+
var _g = useGetDashboardDataMutation(), getDashboardData = _g[0], _h = _g[1], dashboardData = _h.data, dataLoading = _h.isLoading, dataUninitialized = _h.isUninitialized, dataError = _h.error;
|
|
403
403
|
var _j = useSaveDashboardLayoutMutation(), saveDashboardLayout = _j[0], saveLayoutLoading = _j[1].isLoading;
|
|
404
404
|
var getVariableOptions = useLazyGetDashboardVariableOptionsQuery()[0];
|
|
405
405
|
var _k = useState({}), appliedVariableValues = _k[0], setAppliedVariableValues = _k[1];
|
|
@@ -507,6 +507,8 @@ export function DashboardPage() {
|
|
|
507
507
|
});
|
|
508
508
|
return map;
|
|
509
509
|
}, [definitionWidgets]);
|
|
510
|
+
var hasDashboardPayload = dashboardData !== undefined;
|
|
511
|
+
var showDashboardLoadingState = !dataError && (dataLoading || dataUninitialized || !hasDashboardPayload);
|
|
510
512
|
var widgetDataMap = useMemo(function () {
|
|
511
513
|
var map = new Map();
|
|
512
514
|
var rows = Array.isArray(dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.widgets) ? dashboardData.widgets : [];
|
|
@@ -580,7 +582,7 @@ export function DashboardPage() {
|
|
|
580
582
|
}, 0);
|
|
581
583
|
}, [appliedVariableValues, defaultFilterValues, variables]);
|
|
582
584
|
useEffect(function () {
|
|
583
|
-
if (!gridRef.current || orderedWidgets.length === 0)
|
|
585
|
+
if (showDashboardLoadingState || !gridRef.current || orderedWidgets.length === 0)
|
|
584
586
|
return;
|
|
585
587
|
if (gridInstanceRef.current) {
|
|
586
588
|
gridInstanceRef.current.destroy(false);
|
|
@@ -631,7 +633,7 @@ export function DashboardPage() {
|
|
|
631
633
|
if (gridInstanceRef.current === instance)
|
|
632
634
|
gridInstanceRef.current = null;
|
|
633
635
|
};
|
|
634
|
-
}, [activeGridColumns, baseLayoutItems, isCompactLayout, orderedWidgets, renderedLayoutItems]);
|
|
636
|
+
}, [activeGridColumns, baseLayoutItems, isCompactLayout, orderedWidgets, renderedLayoutItems, showDashboardLoadingState]);
|
|
635
637
|
var handleDraftVariableChange = function (variableName, value) {
|
|
636
638
|
setFilterDraftValues(function (prev) {
|
|
637
639
|
var _a;
|
|
@@ -854,12 +856,12 @@ export function DashboardPage() {
|
|
|
854
856
|
if (definitionLoading) {
|
|
855
857
|
return (_jsx("div", { className: styles.page, children: _jsx(SolidSpinner, {}) }));
|
|
856
858
|
}
|
|
857
|
-
return (_jsxs("div", { className: styles.page, children: [_jsxs("div", { className: styles.header, children: [_jsxs("div", { className: styles.titleBlock, children: [_jsx("h1", { className: styles.title, children: getDashboardTitle(definition, dashboardName) }), _jsx("p", { className: styles.subtitle, children: (_e = definition === null || definition === void 0 ? void 0 : definition.description) !== null && _e !== void 0 ? _e : "".concat(moduleName, " / ").concat(dashboardName) })] }), _jsxs("div", { className: styles.headerActions, children: [_jsxs("div", { className: styles.filterButtonWrap, children: [_jsx(SolidButton, { className: styles.iconButton, leftIcon: _jsx(Filter, { size: 16 }), onClick: function () { return setIsFilterDialogOpen(true); }, tooltip: "Filters", "aria-label": "Filters" }), appliedFilterCount > 0 ? _jsx("span", { className: styles.filterCountBadge, children: appliedFilterCount }) : null] }), _jsx(SolidButton, { className: styles.iconButton, leftIcon: _jsx(RefreshCw, { size: 16 }), onClick: function () { return void handleRefresh(); }, disabled: dataLoading, tooltip: "Refresh", "aria-label": "Refresh" }), _jsx(SolidButton, { className: styles.iconButton, leftIcon: _jsx(Save, { size: 16 }), onClick: function () { return void handleSaveLayout(); }, disabled: saveLayoutLoading || isCompactLayout, tooltip: "Save Layout", "aria-label": "Save Layout" })] })] }), _jsxs(SolidDialog, { open: isFilterDialogOpen, onOpenChange: setIsFilterDialogOpen, header: "Dashboard Filters", contentClassName: styles.filterDialogContent, children: [_jsx(SolidDialogBody, { children: _jsx("div", { className: styles.filterModalColumn, children: variables.map(renderVariable) }) }), _jsxs(SolidDialogFooter, { className: styles.filterModalActions, children: [_jsx(SolidButton, { variant: "outline", onClick: function () { return void handleClearFilters(); }, children: "Clear" }), _jsx(SolidButton, { onClick: function () { return void handleApplyFilters(); }, children: "Apply" })] })] }), dataError ? _jsx("p", { className: styles.error, children: "Failed to load dashboard data." }) : null, _jsx("div", { ref: gridRef, className: "grid-stack ".concat(styles.gridStack, " ").concat(isCompactLayout ? styles.gridStackCompact : ""), children: orderedWidgets.map(function (widget) {
|
|
859
|
+
return (_jsxs("div", { className: styles.page, children: [_jsxs("div", { className: styles.header, children: [_jsxs("div", { className: styles.titleBlock, children: [_jsx("h1", { className: styles.title, children: getDashboardTitle(definition, dashboardName) }), _jsx("p", { className: styles.subtitle, children: (_e = definition === null || definition === void 0 ? void 0 : definition.description) !== null && _e !== void 0 ? _e : "".concat(moduleName, " / ").concat(dashboardName) })] }), _jsxs("div", { className: styles.headerActions, children: [_jsxs("div", { className: styles.filterButtonWrap, children: [_jsx(SolidButton, { className: styles.iconButton, leftIcon: _jsx(Filter, { size: 16 }), onClick: function () { return setIsFilterDialogOpen(true); }, tooltip: "Filters", "aria-label": "Filters" }), appliedFilterCount > 0 ? _jsx("span", { className: styles.filterCountBadge, children: appliedFilterCount }) : null] }), _jsx(SolidButton, { className: styles.iconButton, leftIcon: _jsx(RefreshCw, { size: 16 }), onClick: function () { return void handleRefresh(); }, disabled: dataLoading, tooltip: "Refresh", "aria-label": "Refresh" }), _jsx(SolidButton, { className: styles.iconButton, leftIcon: _jsx(Save, { size: 16 }), onClick: function () { return void handleSaveLayout(); }, disabled: saveLayoutLoading || isCompactLayout, tooltip: "Save Layout", "aria-label": "Save Layout" })] })] }), _jsxs(SolidDialog, { open: isFilterDialogOpen, onOpenChange: setIsFilterDialogOpen, header: "Dashboard Filters", contentClassName: styles.filterDialogContent, children: [_jsx(SolidDialogBody, { children: _jsx("div", { className: styles.filterModalColumn, children: variables.map(renderVariable) }) }), _jsxs(SolidDialogFooter, { className: styles.filterModalActions, children: [_jsx(SolidButton, { variant: "outline", onClick: function () { return void handleClearFilters(); }, children: "Clear" }), _jsx(SolidButton, { onClick: function () { return void handleApplyFilters(); }, children: "Apply" })] })] }), dataError ? _jsx("p", { className: styles.error, children: "Failed to load dashboard data." }) : null, showDashboardLoadingState ? (_jsxs("div", { className: styles.dashboardLoadingState, children: [_jsx(SolidSpinner, { size: 30, label: "Loading records" }), _jsx("p", { className: styles.dashboardLoadingCopy, children: "Please wait while dashboard data is loading..." })] })) : (_jsx("div", { ref: gridRef, className: "grid-stack ".concat(styles.gridStack, " ").concat(isCompactLayout ? styles.gridStackCompact : ""), children: orderedWidgets.map(function (widget) {
|
|
858
860
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
859
861
|
var widgetName = (_a = widget === null || widget === void 0 ? void 0 : widget.id) !== null && _a !== void 0 ? _a : widget === null || widget === void 0 ? void 0 : widget.name;
|
|
860
862
|
var runtime = widgetDataMap.get(widgetName);
|
|
861
863
|
var slot = (_b = renderedWidgetLayoutMap.get(widgetName)) !== null && _b !== void 0 ? _b : widgetLayoutMap.get(widgetName);
|
|
862
864
|
return (_jsx("div", { className: "grid-stack-item", "gs-id": widgetName, "gs-x": (_c = slot === null || slot === void 0 ? void 0 : slot.x) !== null && _c !== void 0 ? _c : 0, "gs-y": (_d = slot === null || slot === void 0 ? void 0 : slot.y) !== null && _d !== void 0 ? _d : 0, "gs-w": (_e = slot === null || slot === void 0 ? void 0 : slot.w) !== null && _e !== void 0 ? _e : 4, "gs-h": (_f = slot === null || slot === void 0 ? void 0 : slot.h) !== null && _f !== void 0 ? _f : 3, "gs-min-w": (_g = slot === null || slot === void 0 ? void 0 : slot.minW) !== null && _g !== void 0 ? _g : 2, "gs-min-h": (_h = slot === null || slot === void 0 ? void 0 : slot.minH) !== null && _h !== void 0 ? _h : 2, children: _jsxs("div", { className: "grid-stack-item-content ".concat(styles.widgetCard), children: [_jsx("h3", { className: styles.widgetTitle, children: getWidgetTitle(widget, widgetName) }), _jsx("div", { className: styles.widgetBody, children: runtime ? renderWidgetBody(widget, runtime) : _jsx("p", { className: styles.muted, children: "No data" }) })] }) }, widgetName));
|
|
863
|
-
}) })] }));
|
|
865
|
+
}) }))] }));
|
|
864
866
|
}
|
|
865
867
|
//# sourceMappingURL=DashboardPage.js.map
|