@solidxai/core-ui 0.1.8-beta.7 → 0.1.8-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/AuthLayout.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +16 -32
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +4 -20
- package/dist/components/auth/AuthTabs.d.ts.map +1 -1
- package/dist/components/auth/AuthTabs.js +9 -9
- package/dist/components/auth/AuthTabs.js.map +1 -1
- package/dist/components/auth/AuthTabs.tsx +14 -15
- package/dist/components/auth/SolidOTPVerify.d.ts +3 -0
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -0
- package/dist/components/auth/SolidOTPVerify.js +67 -0
- package/dist/components/auth/SolidOTPVerify.js.map +1 -0
- package/dist/components/auth/SolidOTPVerify.tsx +133 -0
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +1 -1
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +12 -5
- package/dist/components/common/AuthBanner.js.map +1 -1
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +41 -46
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +0 -19
- package/dist/components/common/SolidThemeProvider.d.ts.map +1 -1
- package/dist/components/common/SolidThemeProvider.js +5 -21
- package/dist/components/common/SolidThemeProvider.js.map +1 -1
- package/dist/components/common/SolidThemeProvider.tsx +6 -24
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts +2 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.d.ts.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js +50 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.js.map +1 -0
- package/dist/components/core/common/LoadDynamicJsxComponent.tsx +70 -0
- package/dist/components/core/form/SolidFormView.js +42 -41
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +16 -16
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +1 -1
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +41 -44
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +16 -25
- 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 +2 -1
- 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 +10 -21
- 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 +10 -18
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.d.ts.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js +6 -3
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.js.map +1 -1
- package/dist/components/core/kanban/kanban-fields/SolidShortTextKanbanField.tsx +24 -30
- 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/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +3 -11
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +27 -48
- 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 +7 -6
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowButtonContextMenu.tsx +10 -9
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.css +283 -9
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.js +35 -28
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.tsx +64 -62
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.d.ts +2 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.js +4 -4
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.tsx +17 -10
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.js +2 -19
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.tsx +24 -43
- package/dist/components/core/users/CreateUser.css +114 -0
- package/dist/components/core/users/CreateUser.d.ts +1 -0
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +4 -3
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +32 -26
- package/dist/components/layout/context/layoutcontext.js +2 -2
- package/dist/components/layout/context/layoutcontext.js.map +1 -1
- package/dist/components/layout/context/layoutcontext.tsx +2 -2
- package/dist/components/shad-cn-ui/SolidConfirmDialog.d.ts +6 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.js +3 -3
- package/dist/components/shad-cn-ui/SolidConfirmDialog.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.tsx +15 -3
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +2 -2
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +0 -2
- package/dist/nextAuth/authProviders.d.ts +4 -0
- package/dist/nextAuth/authProviders.d.ts.map +1 -0
- package/dist/nextAuth/authProviders.js +198 -0
- package/dist/nextAuth/authProviders.js.map +1 -0
- package/dist/nextAuth/authProviders.tsx +232 -0
- package/dist/nextAuth/handleLogout.d.ts +2 -0
- package/dist/nextAuth/handleLogout.d.ts.map +1 -0
- package/dist/nextAuth/handleLogout.js +36 -0
- package/dist/nextAuth/handleLogout.js.map +1 -0
- package/dist/nextAuth/handleLogout.tsx +39 -0
- package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
- package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
- package/dist/nextAuth/refreshAccessToken.js +24 -0
- package/dist/nextAuth/refreshAccessToken.js.map +1 -0
- package/dist/nextAuth/refreshAccessToken.tsx +28 -0
- package/dist/redux/features/settingsSlice.d.ts +20 -0
- package/dist/redux/features/settingsSlice.d.ts.map +1 -0
- package/dist/redux/features/settingsSlice.js +39 -0
- package/dist/redux/features/settingsSlice.js.map +1 -0
- package/dist/redux/features/settingsSlice.ts +60 -0
- package/dist/resources/globals.css +97 -77
- package/dist/resources/shadcn-base.css +62 -304
- package/package.json +1 -1
- package/dist/components/core/list/SolidDataTablePagination.d.ts +0 -15
- package/dist/components/core/list/SolidDataTablePagination.d.ts.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.js +0 -22
- package/dist/components/core/list/SolidDataTablePagination.js.map +0 -1
- package/dist/components/core/list/SolidDataTablePagination.tsx +0 -71
- package/dist/components/solid-ui/SolidButton.d.ts +0 -14
- package/dist/components/solid-ui/SolidButton.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidButton.js +0 -36
- package/dist/components/solid-ui/SolidButton.js.map +0 -1
- package/dist/components/solid-ui/SolidButton.tsx +0 -54
- package/dist/components/solid-ui/SolidTabs.d.ts +0 -18
- package/dist/components/solid-ui/SolidTabs.d.ts.map +0 -1
- package/dist/components/solid-ui/SolidTabs.js +0 -22
- package/dist/components/solid-ui/SolidTabs.js.map +0 -1
- package/dist/components/solid-ui/SolidTabs.tsx +0 -73
- package/dist/components/solid-ui/index.d.ts +0 -3
- package/dist/components/solid-ui/index.d.ts.map +0 -1
- package/dist/components/solid-ui/index.js +0 -3
- package/dist/components/solid-ui/index.js.map +0 -1
- package/dist/components/solid-ui/index.ts +0 -2
|
@@ -37,6 +37,7 @@ import { SolidListViewRowActionsMenu } from "./SolidListViewRowActionsMenu";
|
|
|
37
37
|
import { SolidHeaderRequestStatus } from "../../common/SolidHeaderRequestStatus";
|
|
38
38
|
import {
|
|
39
39
|
SolidButton,
|
|
40
|
+
SolidConfirmDialog,
|
|
40
41
|
SolidDialog,
|
|
41
42
|
SolidDialogBody,
|
|
42
43
|
SolidDialogClose,
|
|
@@ -1714,32 +1715,21 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1714
1715
|
)}
|
|
1715
1716
|
</div>
|
|
1716
1717
|
</div>
|
|
1717
|
-
<
|
|
1718
|
+
<SolidConfirmDialog
|
|
1718
1719
|
open={isDialogVisible}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
onDeleteClose();
|
|
1722
|
-
}
|
|
1723
|
-
}}
|
|
1720
|
+
onCancel={onDeleteClose}
|
|
1721
|
+
onConfirm={deleteBulk}
|
|
1724
1722
|
className="solid-shadcn-confirm-dialog solid-delete-confirm-dialog"
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
<
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
<SolidButton variant="destructive" size="sm" autoFocus onClick={deleteBulk}>
|
|
1736
|
-
Delete
|
|
1737
|
-
</SolidButton>
|
|
1738
|
-
<SolidButton variant="outline" size="sm" onClick={onDeleteClose}>
|
|
1739
|
-
Cancel
|
|
1740
|
-
</SolidButton>
|
|
1741
|
-
</SolidDialogFooter>
|
|
1742
|
-
</SolidDialog>
|
|
1723
|
+
headerClassName="solid-shadcn-dialog-head"
|
|
1724
|
+
bodyClassName="solid-shadcn-dialog-body"
|
|
1725
|
+
footerClassName="solid-shadcn-dialog-actions"
|
|
1726
|
+
separatorClassName="solid-shadcn-dialog-sep"
|
|
1727
|
+
showSeparator
|
|
1728
|
+
title="Delete Records"
|
|
1729
|
+
message={<p className="solid-shadcn-dialog-text">Are you sure you want to delete the selected records?</p>}
|
|
1730
|
+
confirmLabel="Delete"
|
|
1731
|
+
cancelLabel="Cancel"
|
|
1732
|
+
/>
|
|
1743
1733
|
<SolidDialog
|
|
1744
1734
|
open={isRecoverDialogVisible}
|
|
1745
1735
|
onOpenChange={(open) => {
|
|
@@ -1790,32 +1780,21 @@ export const SolidListView = forwardRef<SolidListViewHandle, SolidListViewParams
|
|
|
1790
1780
|
</SolidDialog>
|
|
1791
1781
|
)
|
|
1792
1782
|
}
|
|
1793
|
-
<
|
|
1783
|
+
<SolidConfirmDialog
|
|
1794
1784
|
open={deleteEntity}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
setDeleteEntity(false);
|
|
1798
|
-
}
|
|
1799
|
-
}}
|
|
1785
|
+
onCancel={() => setDeleteEntity(false)}
|
|
1786
|
+
onConfirm={handleDeleteEntity}
|
|
1800
1787
|
className="solid-shadcn-confirm-dialog solid-delete-confirm-dialog"
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
<
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
<SolidButton variant="destructive" size="sm" onClick={handleDeleteEntity}>
|
|
1812
|
-
Delete
|
|
1813
|
-
</SolidButton>
|
|
1814
|
-
<SolidButton variant="outline" size="sm" onClick={() => setDeleteEntity(false)}>
|
|
1815
|
-
Cancel
|
|
1816
|
-
</SolidButton>
|
|
1817
|
-
</SolidDialogFooter>
|
|
1818
|
-
</SolidDialog>
|
|
1788
|
+
headerClassName="solid-shadcn-dialog-head"
|
|
1789
|
+
bodyClassName="solid-shadcn-dialog-body"
|
|
1790
|
+
footerClassName="solid-shadcn-dialog-actions"
|
|
1791
|
+
separatorClassName="solid-shadcn-dialog-sep"
|
|
1792
|
+
showSeparator
|
|
1793
|
+
title={`Delete ${entityDisplayName}`}
|
|
1794
|
+
message={<p className="solid-shadcn-dialog-text">{`Are you sure you want to delete this ${entityDisplayName}?`}</p>}
|
|
1795
|
+
confirmLabel="Delete"
|
|
1796
|
+
cancelLabel="Cancel"
|
|
1797
|
+
/>
|
|
1819
1798
|
{openLightbox && (
|
|
1820
1799
|
<SolidLightbox
|
|
1821
1800
|
open={openLightbox}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SolidListViewRowButtonContextMenu: ({ button, params,
|
|
1
|
+
export declare const SolidListViewRowButtonContextMenu: ({ button, params, getSelectedSolidViewData, solidListViewMetaData, handleCustomButtonClick }: any) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
//# sourceMappingURL=SolidListViewRowButtonContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewRowButtonContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolidListViewRowButtonContextMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,iCAAiC,iGAAkG,GAAG,mDAmClJ,CAAC"}
|
|
@@ -9,21 +9,23 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useSession } from "../../../hooks/useSession";
|
|
14
14
|
import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
15
|
+
import { Button } from "primereact/button";
|
|
15
16
|
export var SolidListViewRowButtonContextMenu = function (_a) {
|
|
16
17
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
17
|
-
var button = _a.button, params = _a.params,
|
|
18
|
+
var button = _a.button, params = _a.params, getSelectedSolidViewData = _a.getSelectedSolidViewData, solidListViewMetaData = _a.solidListViewMetaData, handleCustomButtonClick = _a.handleCustomButtonClick;
|
|
19
|
+
var selectedSolidViewData = getSelectedSolidViewData === null || getSelectedSolidViewData === void 0 ? void 0 : getSelectedSolidViewData();
|
|
18
20
|
var _j = useSession(), session = _j.data, status = _j.status;
|
|
19
21
|
var user = session === null || session === void 0 ? void 0 : session.user;
|
|
20
22
|
var hasRole = !((_b = button === null || button === void 0 ? void 0 : button.attrs) === null || _b === void 0 ? void 0 : _b.roles) || ((_c = button === null || button === void 0 ? void 0 : button.attrs) === null || _c === void 0 ? void 0 : _c.roles.length) === 0 ? true : hasAnyRole(user === null || user === void 0 ? void 0 : user.roles, (_d = button === null || button === void 0 ? void 0 : button.attrs) === null || _d === void 0 ? void 0 : _d.roles);
|
|
21
23
|
if (!hasRole)
|
|
22
24
|
return null;
|
|
23
|
-
return (
|
|
25
|
+
return (_jsx(Button, { type: "button", icon: ((_e = button === null || button === void 0 ? void 0 : button.attrs) === null || _e === void 0 ? void 0 : _e.icon) ? (_f = button === null || button === void 0 ? void 0 : button.attrs) === null || _f === void 0 ? void 0 : _f.icon : "pi pi-pencil", className: "w-full text-left gap-2 ".concat(((_g = button === null || button === void 0 ? void 0 : button.attrs) === null || _g === void 0 ? void 0 : _g.className) ? (_h = button === null || button === void 0 ? void 0 : button.attrs) === null || _h === void 0 ? void 0 : _h.className : ''), label: button.attrs.label, size: "small", onClick: function () {
|
|
24
26
|
var event = {
|
|
25
27
|
params: params,
|
|
26
|
-
rowData:
|
|
28
|
+
rowData: selectedSolidViewData,
|
|
27
29
|
solidListViewMetaData: solidListViewMetaData.data,
|
|
28
30
|
};
|
|
29
31
|
var modifiedButtonAttrs = __assign({}, button.attrs); // Create a copy
|
|
@@ -32,7 +34,6 @@ export var SolidListViewRowButtonContextMenu = function (_a) {
|
|
|
32
34
|
modifiedButtonAttrs.popupWidth = '30vw';
|
|
33
35
|
}
|
|
34
36
|
handleCustomButtonClick(modifiedButtonAttrs, event);
|
|
35
|
-
|
|
36
|
-
}, children: [_jsx("i", { className: "".concat(((_g = button === null || button === void 0 ? void 0 : button.attrs) === null || _g === void 0 ? void 0 : _g.icon) ? (_h = button === null || button === void 0 ? void 0 : button.attrs) === null || _h === void 0 ? void 0 : _h.icon : "pi pi-pencil", " solid-row-action-button-icon") }), _jsx("span", { className: "solid-row-action-button-label", children: button.attrs.label })] }));
|
|
37
|
+
} }));
|
|
37
38
|
};
|
|
38
39
|
//# sourceMappingURL=SolidListViewRowButtonContextMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidListViewRowButtonContextMenu.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidListViewRowButtonContextMenu.js","sourceRoot":"","sources":["../../../../src/components/core/list/SolidListViewRowButtonContextMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,CAAC,IAAM,iCAAiC,GAAG,UAAC,EAAiG;;QAA/F,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,wBAAwB,8BAAA,EAAE,qBAAqB,2BAAA,EAAE,uBAAuB,6BAAA;IACxI,IAAM,qBAAqB,GAAG,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,EAAI,CAAC;IAErD,IAAA,KAA4B,UAAU,EAAE,EAAhC,OAAO,UAAA,EAAE,MAAM,YAAiB,CAAC;IAC/C,IAAM,IAAI,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC;IAE3B,IAAM,OAAO,GAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,KAAK,CAAA,IAAI,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,KAAK,CAAC,MAAM,MAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,KAAK,CAAC,CAAC;IAElI,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,OAAO,CACH,KAAC,MAAM,IACH,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,IAAI,EAAC,CAAC,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,IAAI,CAAC,CAAC,CAAC,cAAc,EAChE,SAAS,EAAE,iCAA0B,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,SAAS,EAAC,CAAC,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAE,EAC/F,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EACzB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE;YACL,IAAM,KAAK,GAAG;gBACV,MAAM,QAAA;gBACN,OAAO,EAAE,qBAAqB;gBAC9B,qBAAqB,EAAE,qBAAqB,CAAC,IAAI;aACpD,CAAC;YAEF,IAAM,mBAAmB,gBAAQ,MAAM,CAAC,KAAK,CAAE,CAAC,CAAC,gBAAgB;YAEjE,oDAAoD;YACpD,IAAI,mBAAmB,CAAC,MAAM,KAAK,4BAA4B,IAAI,mBAAmB,CAAC,MAAM,KAAK,6BAA6B,EAAE;gBAC7H,mBAAmB,CAAC,UAAU,GAAG,MAAM,CAAC;aAC3C;YAED,uBAAuB,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,GACH,CACL,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useSession } from \"../../../hooks/useSession\";\nimport { hasAnyRole } from \"../../../helpers/rolesHelper\";\nimport { Button } from \"primereact/button\";\n\nexport const SolidListViewRowButtonContextMenu = ({ button, params, getSelectedSolidViewData, solidListViewMetaData, handleCustomButtonClick }: any) => {\n const selectedSolidViewData = getSelectedSolidViewData?.();\n\n const { data: session, status } = useSession();\n const user = session?.user;\n\n const hasRole = !button?.attrs?.roles || button?.attrs?.roles.length === 0 ? true : hasAnyRole(user?.roles, button?.attrs?.roles);\n\n if (!hasRole) return null;\n\n return (\n <Button\n type=\"button\"\n icon={button?.attrs?.icon ? button?.attrs?.icon : \"pi pi-pencil\"}\n className={`w-full text-left gap-2 ${button?.attrs?.className ? button?.attrs?.className : ''}`}\n label={button.attrs.label}\n size=\"small\"\n onClick={() => {\n const event = {\n params,\n rowData: selectedSolidViewData,\n solidListViewMetaData: solidListViewMetaData.data,\n };\n\n const modifiedButtonAttrs = { ...button.attrs }; // Create a copy\n\n // Conditionally add popupWidth for specific actions\n if (modifiedButtonAttrs.action === 'GenerateModelCodeRowAction' || modifiedButtonAttrs.action === 'GenerateModuleCodeRowAction') {\n modifiedButtonAttrs.popupWidth = '30vw';\n }\n\n handleCustomButtonClick(modifiedButtonAttrs, event);\n }}\n />\n );\n};\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useSession } from "../../../hooks/useSession";
|
|
2
2
|
import { hasAnyRole } from "../../../helpers/rolesHelper";
|
|
3
|
+
import { Button } from "primereact/button";
|
|
3
4
|
|
|
4
|
-
export const SolidListViewRowButtonContextMenu = ({ button, params,
|
|
5
|
+
export const SolidListViewRowButtonContextMenu = ({ button, params, getSelectedSolidViewData, solidListViewMetaData, handleCustomButtonClick }: any) => {
|
|
6
|
+
const selectedSolidViewData = getSelectedSolidViewData?.();
|
|
5
7
|
|
|
6
8
|
const { data: session, status } = useSession();
|
|
7
9
|
const user = session?.user;
|
|
@@ -11,13 +13,16 @@ export const SolidListViewRowButtonContextMenu = ({ button, params, rowData, sol
|
|
|
11
13
|
if (!hasRole) return null;
|
|
12
14
|
|
|
13
15
|
return (
|
|
14
|
-
<
|
|
16
|
+
<Button
|
|
15
17
|
type="button"
|
|
16
|
-
|
|
18
|
+
icon={button?.attrs?.icon ? button?.attrs?.icon : "pi pi-pencil"}
|
|
19
|
+
className={`w-full text-left gap-2 ${button?.attrs?.className ? button?.attrs?.className : ''}`}
|
|
20
|
+
label={button.attrs.label}
|
|
21
|
+
size="small"
|
|
17
22
|
onClick={() => {
|
|
18
23
|
const event = {
|
|
19
24
|
params,
|
|
20
|
-
rowData:
|
|
25
|
+
rowData: selectedSolidViewData,
|
|
21
26
|
solidListViewMetaData: solidListViewMetaData.data,
|
|
22
27
|
};
|
|
23
28
|
|
|
@@ -29,11 +34,7 @@ export const SolidListViewRowButtonContextMenu = ({ button, params, rowData, sol
|
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
handleCustomButtonClick(modifiedButtonAttrs, event);
|
|
32
|
-
onActionComplete?.();
|
|
33
37
|
}}
|
|
34
|
-
|
|
35
|
-
<i className={`${button?.attrs?.icon ? button?.attrs?.icon : "pi pi-pencil"} solid-row-action-button-icon`} />
|
|
36
|
-
<span className="solid-row-action-button-label">{button.attrs.label}</span>
|
|
37
|
-
</button>
|
|
38
|
+
/>
|
|
38
39
|
);
|
|
39
40
|
};
|
|
@@ -1,38 +1,312 @@
|
|
|
1
1
|
.solid-api-keys-tab {
|
|
2
|
-
padding:
|
|
2
|
+
padding: 0;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.solid-api-keys-hero {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
gap: 16px;
|
|
11
|
+
margin-bottom: 18px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.solid-api-keys-copy {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 4px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.solid-api-keys-title {
|
|
21
|
+
font-size: 18px;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
color: var(--foreground);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.solid-api-keys-subtitle {
|
|
27
|
+
max-width: 700px;
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
line-height: 1.5;
|
|
30
|
+
color: var(--muted-foreground);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.solid-api-keys-actions {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 10px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.solid-api-keys-count {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
min-height: 32px;
|
|
43
|
+
padding: 0 10px;
|
|
44
|
+
border-radius: 999px;
|
|
45
|
+
border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
|
|
46
|
+
background: color-mix(in srgb, var(--accent) 30%, transparent);
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
color: var(--muted-foreground);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.solid-api-keys-state {
|
|
53
|
+
min-height: 220px;
|
|
54
|
+
display: grid;
|
|
55
|
+
place-items: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.solid-api-keys-error {
|
|
59
|
+
min-height: 220px;
|
|
60
|
+
display: grid;
|
|
61
|
+
place-items: center;
|
|
62
|
+
text-align: center;
|
|
63
|
+
gap: 6px;
|
|
64
|
+
color: var(--muted-foreground);
|
|
65
|
+
font-size: 13px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.solid-api-keys-empty {
|
|
69
|
+
width: 100%;
|
|
70
|
+
min-height: 320px;
|
|
71
|
+
border: 1px dashed color-mix(in srgb, var(--border) 86%, transparent);
|
|
72
|
+
border-radius: 16px;
|
|
73
|
+
background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 32%, transparent), transparent);
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
gap: 14px;
|
|
79
|
+
padding: 28px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.solid-api-keys-empty-icon {
|
|
83
|
+
width: 56px;
|
|
84
|
+
height: 56px;
|
|
85
|
+
border-radius: 999px;
|
|
86
|
+
display: grid;
|
|
87
|
+
place-items: center;
|
|
88
|
+
background: color-mix(in srgb, var(--primary) 10%, var(--card));
|
|
89
|
+
color: color-mix(in srgb, var(--foreground) 72%, transparent);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.solid-api-keys-empty-title {
|
|
93
|
+
font-size: 16px;
|
|
94
|
+
font-weight: 700;
|
|
95
|
+
color: var(--foreground);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.solid-api-keys-empty-copy {
|
|
99
|
+
max-width: 360px;
|
|
100
|
+
margin-top: 6px;
|
|
101
|
+
font-size: 13px;
|
|
102
|
+
line-height: 1.5;
|
|
103
|
+
color: var(--muted-foreground);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.solid-api-keys-table-shell {
|
|
107
|
+
width: 100%;
|
|
108
|
+
border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
|
|
109
|
+
border-radius: 16px;
|
|
110
|
+
background: color-mix(in srgb, var(--card) 98%, white 2%);
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.solid-api-keys-table-wrap {
|
|
115
|
+
overflow-x: auto;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.solid-api-keys-table {
|
|
119
|
+
width: 100%;
|
|
120
|
+
border-collapse: collapse;
|
|
121
|
+
table-layout: fixed;
|
|
3
122
|
}
|
|
4
123
|
|
|
5
124
|
.solid-api-keys-th {
|
|
6
|
-
padding:
|
|
125
|
+
padding: 13px 16px;
|
|
7
126
|
text-align: left;
|
|
8
127
|
font-size: 12px;
|
|
9
128
|
font-weight: 600;
|
|
10
|
-
color: var(--
|
|
129
|
+
color: var(--muted-foreground);
|
|
11
130
|
letter-spacing: 0.02em;
|
|
12
|
-
border-bottom: 1px solid var(--
|
|
131
|
+
border-bottom: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
|
|
132
|
+
background: color-mix(in srgb, var(--accent) 32%, transparent);
|
|
13
133
|
white-space: nowrap;
|
|
14
134
|
}
|
|
15
135
|
|
|
136
|
+
.solid-api-keys-th--right {
|
|
137
|
+
text-align: right;
|
|
138
|
+
}
|
|
139
|
+
|
|
16
140
|
.solid-api-keys-td {
|
|
17
|
-
padding:
|
|
141
|
+
padding: 16px;
|
|
18
142
|
font-size: 13px;
|
|
19
|
-
color: var(--
|
|
20
|
-
border-bottom: 1px solid var(--
|
|
143
|
+
color: var(--foreground);
|
|
144
|
+
border-bottom: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
|
|
21
145
|
vertical-align: middle;
|
|
22
146
|
}
|
|
23
147
|
|
|
148
|
+
.solid-api-keys-td--right {
|
|
149
|
+
text-align: right;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.solid-api-keys-name {
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
color: var(--foreground);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.solid-api-keys-code {
|
|
158
|
+
display: inline-flex;
|
|
159
|
+
max-width: 100%;
|
|
160
|
+
font-family: monospace;
|
|
161
|
+
font-size: 12.5px;
|
|
162
|
+
background: color-mix(in srgb, var(--accent) 34%, transparent);
|
|
163
|
+
padding: 4px 8px;
|
|
164
|
+
border-radius: 999px;
|
|
165
|
+
color: color-mix(in srgb, var(--foreground) 90%, transparent);
|
|
166
|
+
overflow-wrap: anywhere;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.solid-api-keys-muted {
|
|
170
|
+
color: var(--muted-foreground);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.solid-api-keys-date--expired {
|
|
174
|
+
color: var(--destructive);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.solid-api-keys-date--warning {
|
|
178
|
+
color: #b7791f;
|
|
179
|
+
}
|
|
180
|
+
|
|
24
181
|
.solid-api-keys-row--expired td {
|
|
25
182
|
opacity: 0.6;
|
|
26
183
|
}
|
|
27
184
|
|
|
28
185
|
.solid-api-keys-row--expired:hover td {
|
|
29
|
-
background: var(--
|
|
186
|
+
background: color-mix(in srgb, var(--accent) 42%, transparent);
|
|
30
187
|
}
|
|
31
188
|
|
|
32
189
|
tbody tr:hover .solid-api-keys-td {
|
|
33
|
-
background: var(--
|
|
190
|
+
background: color-mix(in srgb, var(--accent) 42%, transparent);
|
|
34
191
|
}
|
|
35
192
|
|
|
36
193
|
tbody tr:last-child .solid-api-keys-td {
|
|
37
194
|
border-bottom: none;
|
|
38
195
|
}
|
|
196
|
+
|
|
197
|
+
.solid-api-key-dialog-header {
|
|
198
|
+
padding-bottom: 14px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.solid-api-key-dialog-body {
|
|
202
|
+
padding-top: 18px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.solid-api-key-dialog-fields {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: column;
|
|
208
|
+
gap: 16px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.solid-api-key-dialog-field {
|
|
212
|
+
display: flex;
|
|
213
|
+
flex-direction: column;
|
|
214
|
+
gap: 8px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.solid-api-key-dialog-hint {
|
|
218
|
+
font-size: 12px;
|
|
219
|
+
line-height: 1.45;
|
|
220
|
+
color: var(--muted-foreground);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.solid-api-key-dialog-footer {
|
|
224
|
+
padding-top: 14px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.solid-api-key-reveal-warning {
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: flex-start;
|
|
230
|
+
gap: 10px;
|
|
231
|
+
padding: 12px 14px;
|
|
232
|
+
margin-bottom: 18px;
|
|
233
|
+
border-radius: 12px;
|
|
234
|
+
border: 1px solid color-mix(in srgb, #f59e0b 28%, var(--border));
|
|
235
|
+
background: color-mix(in srgb, #f59e0b 10%, transparent);
|
|
236
|
+
font-size: 13px;
|
|
237
|
+
line-height: 1.5;
|
|
238
|
+
color: var(--foreground);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.solid-api-key-reveal-warning-icon {
|
|
242
|
+
flex: 0 0 auto;
|
|
243
|
+
margin-top: 1px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.solid-api-key-reveal-box {
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
gap: 10px;
|
|
250
|
+
padding: 14px;
|
|
251
|
+
border-radius: 12px;
|
|
252
|
+
border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
|
|
253
|
+
background: color-mix(in srgb, var(--accent) 28%, transparent);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.solid-api-key-reveal-code {
|
|
257
|
+
flex: 1 1 auto;
|
|
258
|
+
margin: 0;
|
|
259
|
+
font-family: monospace;
|
|
260
|
+
font-size: 13px;
|
|
261
|
+
line-height: 1.45;
|
|
262
|
+
color: var(--foreground);
|
|
263
|
+
word-break: break-all;
|
|
264
|
+
user-select: all;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.solid-api-key-reveal-copy {
|
|
268
|
+
width: 34px;
|
|
269
|
+
height: 34px;
|
|
270
|
+
border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
|
|
271
|
+
border-radius: 10px;
|
|
272
|
+
background: var(--card);
|
|
273
|
+
color: var(--muted-foreground);
|
|
274
|
+
display: inline-flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
justify-content: center;
|
|
277
|
+
cursor: pointer;
|
|
278
|
+
flex-shrink: 0;
|
|
279
|
+
transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.solid-api-key-reveal-copy:hover {
|
|
283
|
+
background: var(--accent);
|
|
284
|
+
color: var(--foreground);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.solid-api-key-reveal-copy-success,
|
|
288
|
+
.solid-api-key-reveal-copied {
|
|
289
|
+
color: #16a34a;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.solid-api-key-reveal-copied {
|
|
293
|
+
font-size: 12px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@media (max-width: 900px) {
|
|
297
|
+
.solid-api-keys-hero {
|
|
298
|
+
flex-direction: column;
|
|
299
|
+
align-items: stretch;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.solid-api-keys-actions {
|
|
303
|
+
justify-content: space-between;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
@media (max-width: 640px) {
|
|
308
|
+
.solid-api-keys-actions {
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
align-items: stretch;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKeysTab.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/users/ApiKeysTab/ApiKeysTab.tsx"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ApiKeysTab.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/users/ApiKeysTab/ApiKeysTab.tsx"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAmJ1B,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAiB,EAAE,EAAE,eAAe,2CAsGxE"}
|
|
@@ -34,8 +34,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
37
46
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
38
|
-
import { useState } from "react";
|
|
47
|
+
import { useMemo, useState } from "react";
|
|
39
48
|
import { useDispatch } from "react-redux";
|
|
40
49
|
import { KeyRound, Plus } from "lucide-react";
|
|
41
50
|
import "./ApiKeysTab.css";
|
|
@@ -64,39 +73,35 @@ function getExpiryStatus(expiresAt) {
|
|
|
64
73
|
return "ok";
|
|
65
74
|
}
|
|
66
75
|
function ApiKeysTable(_a) {
|
|
67
|
-
var keys = _a.keys, onToggleActive = _a.onToggleActive, isTogglingId = _a.isTogglingId;
|
|
76
|
+
var keys = _a.keys, onToggleActive = _a.onToggleActive, isTogglingId = _a.isTogglingId, onGenerateFirstKey = _a.onGenerateFirstKey, canCreate = _a.canCreate;
|
|
68
77
|
if (keys.length === 0) {
|
|
69
|
-
return (_jsxs("div", { className: "
|
|
78
|
+
return (_jsxs("div", { className: "solid-api-keys-empty", children: [_jsx("div", { className: "solid-api-keys-empty-icon", children: _jsx(KeyRound, { size: 30, strokeWidth: 1.6 }) }), _jsxs("div", { className: "text-center", children: [_jsx("p", { className: "solid-api-keys-empty-title m-0", children: "No API keys yet" }), _jsx("p", { className: "solid-api-keys-empty-copy m-0", children: canCreate
|
|
79
|
+
? "Generate a key to enable secure programmatic access for this user."
|
|
80
|
+
: "API key generation is disabled for this user account." })] }), canCreate ? (_jsxs(SolidButton, { type: "button", onClick: onGenerateFirstKey, children: [_jsx(Plus, { size: 14 }), "Generate First Key"] })) : null] }));
|
|
70
81
|
}
|
|
71
|
-
return (_jsx("div", {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
fontSize: 13,
|
|
77
|
-
background: "var(--solid-surface-secondary, #f5f5f5)",
|
|
78
|
-
padding: "2px 6px",
|
|
79
|
-
borderRadius: 4,
|
|
80
|
-
}, children: key.maskedKey }) }), _jsx("td", { className: "solid-api-keys-td", children: isExpired ? (_jsx(SolidTag, { tone: "danger", children: "Expired" })) : !key.isActive ? (_jsx(SolidTag, { tone: "warn", children: "Inactive" })) : expiryStatus === "expiring-soon" ? (_jsx(SolidTag, { tone: "warn", children: "Expiring soon" })) : (_jsx(SolidTag, { tone: "success", children: "Active" })) }), _jsx("td", { className: "solid-api-keys-td", style: {
|
|
81
|
-
color: expiryStatus === "expired"
|
|
82
|
-
? "var(--solid-danger-color, #ef4444)"
|
|
83
|
-
: expiryStatus === "expiring-soon"
|
|
84
|
-
? "var(--solid-warn-color, #f59e0b)"
|
|
85
|
-
: undefined,
|
|
86
|
-
}, children: expiryStatus === "never" ? (_jsx("span", { style: { color: "var(--solid-text-secondary, #888)" }, children: "Never" })) : (formatDate(key.expiresAt)) }), _jsx("td", { className: "solid-api-keys-td", style: { color: "var(--solid-text-secondary, #888)" }, children: formatDate(key.lastUsedAt) }), _jsx("td", { className: "solid-api-keys-td", style: { textAlign: "right" }, children: isTogglingId === key.id ? (_jsx(SolidSpinner, {})) : (_jsx(SolidSwitch, { checked: key.isActive, disabled: isExpired, onChange: function () { return onToggleActive(key); } })) })] }, key.id));
|
|
87
|
-
}) })] }) }));
|
|
82
|
+
return (_jsx("div", { className: "solid-api-keys-table-shell", children: _jsx("div", { className: "solid-api-keys-table-wrap", children: _jsxs("table", { className: "solid-api-keys-table", children: [_jsxs("colgroup", { children: [_jsx("col", { style: { width: "18%" } }), _jsx("col", { style: { width: "22%" } }), _jsx("col", { style: { width: "14%" } }), _jsx("col", { style: { width: "16%" } }), _jsx("col", { style: { width: "18%" } }), _jsx("col", { style: { width: "12%" } })] }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "solid-api-keys-th", children: "Name" }), _jsx("th", { className: "solid-api-keys-th", children: "Key" }), _jsx("th", { className: "solid-api-keys-th", children: "Status" }), _jsx("th", { className: "solid-api-keys-th", children: "Expires" }), _jsx("th", { className: "solid-api-keys-th", children: "Last Used" }), _jsx("th", { className: "solid-api-keys-th solid-api-keys-th--right", children: "Active" })] }) }), _jsx("tbody", { children: keys.map(function (key) {
|
|
83
|
+
var expiryStatus = getExpiryStatus(key.expiresAt);
|
|
84
|
+
var isExpired = expiryStatus === "expired";
|
|
85
|
+
return (_jsxs("tr", { className: isExpired ? "solid-api-keys-row--expired" : undefined, children: [_jsx("td", { className: "solid-api-keys-td", children: _jsx("span", { className: "solid-api-keys-name", children: key.name }) }), _jsx("td", { className: "solid-api-keys-td", children: _jsx("code", { className: "solid-api-keys-code", children: key.maskedKey }) }), _jsx("td", { className: "solid-api-keys-td", children: isExpired ? (_jsx(SolidTag, { tone: "danger", children: "Expired" })) : !key.isActive ? (_jsx(SolidTag, { tone: "warn", children: "Inactive" })) : expiryStatus === "expiring-soon" ? (_jsx(SolidTag, { tone: "warn", children: "Expiring soon" })) : (_jsx(SolidTag, { tone: "success", children: "Active" })) }), _jsx("td", { className: "solid-api-keys-td ".concat(expiryStatus === "expired" ? "solid-api-keys-date--expired" : "", " ").concat(expiryStatus === "expiring-soon" ? "solid-api-keys-date--warning" : ""), children: expiryStatus === "never" ? (_jsx("span", { className: "solid-api-keys-muted", children: "Never" })) : (formatDate(key.expiresAt)) }), _jsx("td", { className: "solid-api-keys-td solid-api-keys-muted", children: formatDate(key.lastUsedAt) }), _jsx("td", { className: "solid-api-keys-td solid-api-keys-td--right", children: isTogglingId === key.id ? (_jsx(SolidSpinner, {})) : (_jsx(SolidSwitch, { checked: key.isActive, disabled: isExpired, onChange: function () { return onToggleActive(key); } })) })] }, key.id));
|
|
86
|
+
}) })] }) }) }));
|
|
88
87
|
}
|
|
89
88
|
export function ApiKeysTab(_a) {
|
|
90
89
|
var _this = this;
|
|
91
|
-
var _b
|
|
92
|
-
var userId = _a.userId,
|
|
90
|
+
var _b;
|
|
91
|
+
var userId = _a.userId, _c = _a.canCreate, canCreate = _c === void 0 ? false : _c;
|
|
93
92
|
var dispatch = useDispatch();
|
|
94
|
-
var
|
|
93
|
+
var _d = useGetUserApiKeysQuery(userId), data = _d.data, isLoading = _d.isLoading, isError = _d.isError, refetch = _d.refetch;
|
|
95
94
|
var updateApiKey = useUpdateApiKeyMutation()[0];
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
95
|
+
var _e = useState(null), togglingId = _e[0], setTogglingId = _e[1];
|
|
96
|
+
var _f = useState(false), showGenerate = _f[0], setShowGenerate = _f[1];
|
|
97
|
+
var _g = useState(null), revealKey = _g[0], setRevealKey = _g[1];
|
|
98
|
+
var _h = useState([]), optimisticKeys = _h[0], setOptimisticKeys = _h[1];
|
|
99
|
+
var keys = useMemo(function () {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
var serverKeys = (_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.apiKeys) !== null && _b !== void 0 ? _b : [];
|
|
102
|
+
var merged = __spreadArray(__spreadArray([], optimisticKeys.filter(function (key) { return !serverKeys.some(function (serverKey) { return serverKey.id === key.id; }); }), true), serverKeys, true);
|
|
103
|
+
return merged.sort(function (a, b) { return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(); });
|
|
104
|
+
}, [(_b = data === null || data === void 0 ? void 0 : data.data) === null || _b === void 0 ? void 0 : _b.apiKeys, optimisticKeys]);
|
|
100
105
|
var handleToggle = function (key) { return __awaiter(_this, void 0, void 0, function () {
|
|
101
106
|
var err_1;
|
|
102
107
|
var _a;
|
|
@@ -131,8 +136,10 @@ export function ApiKeysTab(_a) {
|
|
|
131
136
|
}
|
|
132
137
|
});
|
|
133
138
|
}); };
|
|
134
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "solid-api-keys-tab", children: [_jsxs("div", { className: "
|
|
139
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "solid-api-keys-tab", children: [_jsxs("div", { className: "solid-api-keys-hero", children: [_jsxs("div", { className: "solid-api-keys-copy", children: [_jsx("p", { className: "solid-api-keys-title m-0", children: "API Keys" }), _jsx("p", { className: "solid-api-keys-subtitle m-0", children: "Keys grant programmatic access. Store them securely \u2014 they are shown only once." })] }), _jsxs("div", { className: "solid-api-keys-actions", children: [_jsxs("span", { className: "solid-api-keys-count", children: [keys.length, " key", keys.length === 1 ? "" : "s"] }), canCreate ? (_jsxs(SolidButton, { size: "small", type: "button", onClick: function () { return setShowGenerate(true); }, children: [_jsx(Plus, { size: 14 }), "Generate Key"] })) : null] })] }), isLoading ? (_jsx("div", { className: "solid-api-keys-state", children: _jsx(SolidSpinner, {}) })) : isError && keys.length === 0 ? (_jsxs("div", { className: "solid-api-keys-error", children: [_jsx("p", { className: "m-0", children: "Something went wrong while loading API keys." }), _jsx("p", { className: "m-0", children: "Please refresh the page and try again." })] })) : (_jsx(ApiKeysTable, { keys: keys, onToggleActive: handleToggle, isTogglingId: togglingId, onGenerateFirstKey: function () { return setShowGenerate(true); }, canCreate: canCreate }))] }), _jsx(GenerateApiKeyModal, { open: showGenerate, userId: Number(userId), onClose: function () { return setShowGenerate(false); }, onCreated: function (apiKey, keyName, record) {
|
|
135
140
|
setShowGenerate(false);
|
|
141
|
+
setOptimisticKeys(function (previous) { return __spreadArray([record], previous.filter(function (existing) { return existing.id !== record.id; }), true); });
|
|
142
|
+
void refetch();
|
|
136
143
|
setRevealKey({ apiKey: apiKey, keyName: keyName });
|
|
137
144
|
} }), revealKey && (_jsx(RevealApiKeyModal, { open: true, apiKey: revealKey.apiKey, keyName: revealKey.keyName, onClose: function () { return setRevealKey(null); } }))] }));
|
|
138
145
|
}
|