@schemavaults/auth-ui 0.13.9 → 0.14.3
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/ApiServersCard/api_servers_card.d.ts +15 -0
- package/dist/components/ApiServersCard/api_servers_card.js +33 -3
- package/dist/components/ApiServersCard/api_servers_card.js.map +1 -1
- package/dist/components/ApiServersTable/ApiServerRowActions.js +20 -6
- package/dist/components/ApiServersTable/ApiServerRowActions.js.map +1 -1
- package/dist/components/ApiServersTable/ApiServersTable.d.ts +12 -1
- package/dist/components/ApiServersTable/ApiServersTable.js +14 -15
- package/dist/components/ApiServersTable/ApiServersTable.js.map +1 -1
- package/dist/components/ApiServersTable/ApiServersTableConfigContext.d.ts +6 -0
- package/dist/components/ApiServersTable/ApiServersTableConfigContext.js +1 -0
- package/dist/components/ApiServersTable/ApiServersTableConfigContext.js.map +1 -1
- package/dist/components/ApiServersTable/columns.js +3 -1
- package/dist/components/ApiServersTable/columns.js.map +1 -1
- package/dist/components/ApiServersTable/useApiServersList.d.ts +6 -0
- package/dist/components/ApiServersTable/useApiServersList.js +1 -0
- package/dist/components/ApiServersTable/useApiServersList.js.map +1 -1
- package/dist/components/AppsCard/apps_card.d.ts +15 -0
- package/dist/components/AppsCard/apps_card.js +36 -5
- package/dist/components/AppsCard/apps_card.js.map +1 -1
- package/dist/components/AppsTable/AppsTable.d.ts +12 -1
- package/dist/components/AppsTable/AppsTable.js +14 -8
- package/dist/components/AppsTable/AppsTable.js.map +1 -1
- package/dist/components/AppsTable/columns.d.ts +1 -1
- package/dist/components/AppsTable/columns.js +5 -3
- package/dist/components/AppsTable/columns.js.map +1 -1
- package/dist/components/AppsTable/frontend_app_actions.d.ts +2 -1
- package/dist/components/AppsTable/frontend_app_actions.js +19 -3
- package/dist/components/AppsTable/frontend_app_actions.js.map +1 -1
- package/dist/components/CreateApiServerDialog/CreateApiServerDialog.d.ts +7 -2
- package/dist/components/CreateApiServerDialog/CreateApiServerDialog.js +2 -4
- package/dist/components/CreateApiServerDialog/CreateApiServerDialog.js.map +1 -1
- package/dist/components/CreateApiServerDialog/CreateApiServerForm.d.ts +7 -3
- package/dist/components/CreateApiServerDialog/CreateApiServerForm.js +8 -4
- package/dist/components/CreateApiServerDialog/CreateApiServerForm.js.map +1 -1
- package/dist/components/CreateAppDialog/CreateAppDialog.d.ts +7 -2
- package/dist/components/CreateAppDialog/CreateAppDialog.js +2 -4
- package/dist/components/CreateAppDialog/CreateAppDialog.js.map +1 -1
- package/dist/components/CreateAppDialog/CreateAppForm.d.ts +7 -3
- package/dist/components/CreateAppDialog/CreateAppForm.js +8 -11
- package/dist/components/CreateAppDialog/CreateAppForm.js.map +1 -1
- package/dist/components/CreateAppDialog/requested-ownership-fields.d.ts +9 -0
- package/dist/components/CreateAppDialog/requested-ownership-fields.js +26 -0
- package/dist/components/CreateAppDialog/requested-ownership-fields.js.map +1 -0
- package/dist/components/OwnerTypeFilter/OwnerTypeFilter.d.ts +45 -0
- package/dist/components/OwnerTypeFilter/OwnerTypeFilter.js +76 -0
- package/dist/components/OwnerTypeFilter/OwnerTypeFilter.js.map +1 -0
- package/dist/components/OwnerTypeFilter/index.d.ts +2 -0
- package/dist/components/OwnerTypeFilter/index.js +2 -0
- package/dist/components/OwnerTypeFilter/index.js.map +1 -0
- package/dist/components/ResourceOwnerLabel/ResourceOwnerLabel.d.ts +20 -0
- package/dist/components/ResourceOwnerLabel/ResourceOwnerLabel.js +52 -0
- package/dist/components/ResourceOwnerLabel/ResourceOwnerLabel.js.map +1 -0
- package/dist/components/ResourceOwnerLabel/index.d.ts +4 -0
- package/dist/components/ResourceOwnerLabel/index.js +3 -0
- package/dist/components/ResourceOwnerLabel/index.js.map +1 -0
- package/dist/components/ResourceOwnerLabel/useCanManageListedResource.d.ts +32 -0
- package/dist/components/ResourceOwnerLabel/useCanManageListedResource.js +44 -0
- package/dist/components/ResourceOwnerLabel/useCanManageListedResource.js.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColumnDef } from "@schemavaults/ui";
|
|
2
2
|
import type { ListAppsQueryType, SchemaVaultsApp } from "@schemavaults/app-definitions";
|
|
3
3
|
import type { PreloadedAppsTableDataWithDomainRefs } from "./preloaded_apps_table_data";
|
|
4
|
-
export declare function getAppsTableColumns(queryType: ListAppsQueryType, preloaded?: PreloadedAppsTableDataWithDomainRefs, isOrgOwner?: boolean): ColumnDef<SchemaVaultsApp>[];
|
|
4
|
+
export declare function getAppsTableColumns(queryType: ListAppsQueryType, preloaded?: PreloadedAppsTableDataWithDomainRefs, isOrgOwner?: boolean, managedOrganizationIds?: readonly string[]): ColumnDef<SchemaVaultsApp>[];
|
|
@@ -5,7 +5,8 @@ import Link from "next/link";
|
|
|
5
5
|
import { FrontendApplicationActions } from "./frontend_app_actions";
|
|
6
6
|
import AppDomainsList from "./AppDomainsList";
|
|
7
7
|
import { AppWindowMac, Globe } from "lucide-react";
|
|
8
|
-
|
|
8
|
+
import { ResourceOwnerLabel } from "../ResourceOwnerLabel";
|
|
9
|
+
export function getAppsTableColumns(queryType, preloaded, isOrgOwner, managedOrganizationIds) {
|
|
9
10
|
const columns = [
|
|
10
11
|
{
|
|
11
12
|
id: "select",
|
|
@@ -41,7 +42,8 @@ export function getAppsTableColumns(queryType, preloaded, isOrgOwner) {
|
|
|
41
42
|
{
|
|
42
43
|
id: "owner_organization_id",
|
|
43
44
|
accessorKey: "owner_organization_id",
|
|
44
|
-
header: "Owner
|
|
45
|
+
header: "Owner",
|
|
46
|
+
cell: ({ row }) => (_jsx(ResourceOwnerLabel, { resource: row.original })),
|
|
45
47
|
},
|
|
46
48
|
{
|
|
47
49
|
id: "web",
|
|
@@ -82,7 +84,7 @@ export function getAppsTableColumns(queryType, preloaded, isOrgOwner) {
|
|
|
82
84
|
id: "actions",
|
|
83
85
|
cell: ({ row }) => {
|
|
84
86
|
const app = row.original;
|
|
85
|
-
return _jsx(FrontendApplicationActions, { app: app, queryType: queryType, isOrgOwner: isOrgOwner });
|
|
87
|
+
return (_jsx(FrontendApplicationActions, { app: app, queryType: queryType, isOrgOwner: isOrgOwner, managedOrganizationIds: managedOrganizationIds }));
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../../src/components/AppsTable/columns.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAK7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../../src/components/AppsTable/columns.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAK7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,UAAU,mBAAmB,CACjC,SAA4B,EAC5B,SAAgD,EAChD,UAAoB,EACpB,sBAA0C;IAE1C,MAAM,OAAO,GAAiC;QAC5C;YACE,EAAE,EAAE,QAAQ;YACZ,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACrB,KAAC,QAAQ,IACP,OAAO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EACzD,CAAC,CACF,CAAC;oBACF,MAAM,GAAG,SAAS,CAAC;gBACrB,CAAC;gBAED,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;oBAC/B,OAAO,CACL,YAAG,SAAS,EAAC,kBAAkB,6CAAiC,CACjE,CAAC;gBACJ,CAAC;gBAED,OAAO,CACL,KAAC,cAAc,IACb,MAAM,EAAE,MAAM,EACd,iBAAiB,EACf,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS;wBAC1C,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;wBAC3B,CAAC,CAAC,SAAS,GAEf,CACH,CAAC;YACJ,CAAC;YACD,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,IAAI;SACnB;QACD;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,EAAgB,EAAE;gBAC9B,MAAM,GAAG,GAAoB,GAAG,CAAC,QAAQ,CAAC;gBAE1C,OAAO,CACL,KAAC,0BAA0B,IACzB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,sBAAsB,GAC9C,CACH,CAAC;YACJ,CAAC;SACF;KACF,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -4,6 +4,7 @@ interface FrontendApplicationActionsProps {
|
|
|
4
4
|
app: SchemaVaultsApp;
|
|
5
5
|
queryType: ListAppsQueryType;
|
|
6
6
|
isOrgOwner?: boolean;
|
|
7
|
+
managedOrganizationIds?: readonly string[];
|
|
7
8
|
}
|
|
8
|
-
export declare function FrontendApplicationActions({ app, queryType, isOrgOwner, }: FrontendApplicationActionsProps): ReactElement;
|
|
9
|
+
export declare function FrontendApplicationActions({ app, queryType, isOrgOwner, managedOrganizationIds, }: FrontendApplicationActionsProps): ReactElement;
|
|
9
10
|
export {};
|
|
@@ -12,10 +12,11 @@ import { useAppDomains } from "./useAppDomains";
|
|
|
12
12
|
import { launchWebApp } from "./launchWebApp";
|
|
13
13
|
import { CreateAppDomainDialogOpenDispatchContext } from "../CreateAppDomainDialog";
|
|
14
14
|
import { DeleteAppDialog } from "../DeleteAppDialog";
|
|
15
|
+
import { useCanManageListedResource } from "../ResourceOwnerLabel/useCanManageListedResource";
|
|
15
16
|
const dropdownMenuActionsClassName = "hover:cursor-pointer flex flex-row gap-2 items-center justify-start pointer-events-auto";
|
|
16
17
|
class CantCopyWithinInsecureContextError extends Error {
|
|
17
18
|
}
|
|
18
|
-
export function FrontendApplicationActions({ app, queryType, isOrgOwner, }) {
|
|
19
|
+
export function FrontendApplicationActions({ app, queryType, isOrgOwner, managedOrganizationIds, }) {
|
|
19
20
|
const app_id = app.app_id;
|
|
20
21
|
const { toast } = useToast();
|
|
21
22
|
const [authorizingApp, startAuthorizingApp] = useTransition();
|
|
@@ -61,8 +62,23 @@ export function FrontendApplicationActions({ app, queryType, isOrgOwner, }) {
|
|
|
61
62
|
appDomains.data.length === 0 ||
|
|
62
63
|
launchableAppDomains.length === 0;
|
|
63
64
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
// Whether the viewer may manage this particular app: global admins, an
|
|
66
|
+
// organization owner/admin on an org page, the owning user of a
|
|
67
|
+
// user-owned app, or (on the "accessible" list) an owner/admin of the
|
|
68
|
+
// owning organization. The server enforces every action regardless.
|
|
69
|
+
const canManageApp = useCanManageListedResource({
|
|
70
|
+
resource: app,
|
|
71
|
+
queryType,
|
|
72
|
+
isOrgOwner,
|
|
73
|
+
managedOrganizationIds,
|
|
74
|
+
});
|
|
75
|
+
const isDeleteAppDisabled = app.hardcoded || !canManageApp;
|
|
76
|
+
const showAddAppDomain = !app.hardcoded &&
|
|
77
|
+
canManageApp &&
|
|
78
|
+
(queryType === "all" ||
|
|
79
|
+
queryType === "org" ||
|
|
80
|
+
queryType === "owned" ||
|
|
81
|
+
queryType === "accessible");
|
|
66
82
|
const showConnectApi = admin && queryType === "all";
|
|
67
83
|
return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "h-8 w-8 p-0", "data-testid": "app-actions-button", children: [_jsx("span", { className: "sr-only", children: "Open menu" }), _jsx(MoreHorizontal, { className: "h-4 w-4" })] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuLabel, { children: "Actions" }), _jsx(DropdownMenuItem, { className: cn(dropdownMenuActionsClassName), asChild: true, children: _jsxs(Link, { href: `/apps/${app.app_id}`, children: [_jsx(Eye, { className: "h-4 w-4" }), " View app details"] }) }), !launchAppDisabled && (_jsxs(DropdownMenuItem, { className: cn(dropdownMenuActionsClassName), onClick: launchAppDisabled
|
|
68
84
|
? undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend_app_actions.js","sourceRoot":"","sources":["../../../src/components/AppsTable/frontend_app_actions.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAQb,OAAO,EAEL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,UAAU,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,GAAG,EACH,cAAc,EACd,UAAU,EACV,OAAO,EACP,KAAK,GACN,MAAM,cAAc,CAAC;AACtB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,OAAO,GACR,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wCAAwC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"frontend_app_actions.js","sourceRoot":"","sources":["../../../src/components/AppsTable/frontend_app_actions.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAQb,OAAO,EAEL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,UAAU,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,GAAG,EACH,cAAc,EACd,UAAU,EACV,OAAO,EACP,KAAK,GACN,MAAM,cAAc,CAAC;AACtB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,OAAO,GACR,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wCAAwC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4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SAAS,EAAC,SAAS,GAAG,oBACd,CACpB,EAEA,gBAAgB,IAAI,CACnB,MAAC,gBAAgB,IACf,SAAS,EAAE,EAAE,CAAC,4BAA4B,CAAC,EAC3C,OAAO,EAAE,GAAS,EAAE;oCAClB,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oCACnC,OAAO;gCACT,CAAC,aAED,KAAC,SAAS,IAAC,SAAS,EAAC,SAAS,GAAG,mBAChB,CACpB,EAEA,CAAC,mBAAmB,IAAI,CACvB,8BACE,KAAC,qBAAqB,KAAG,EACzB,MAAC,gBAAgB,IACf,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,EAC/D,OAAO,EAAE,GAAS,EAAE;4CAClB,mBAAmB,CAAC,IAAI,CAAC,CAAC;wCAC5B,CAAC,EACD,QAAQ,EAAE,mBAAmB,aAE7B,KAAC,KAAK,IAAC,SAAS,EAAC,SAAS,GAAG,mBACZ,IAClB,CACJ,IACmB,IACT,EACd,CAAC,mBAAmB,IAAI,CACvB,KAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,GAAG,CAAC,QAAQ,EACtB,IAAI,EAAE,gBAAgB,EACtB,YAAY,EAAE,mBAAmB,GACjC,CACH,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { useSWRConfig } from "swr";
|
|
3
|
+
import type { RequestedResourceOwnership } from "@schemavaults/app-definitions";
|
|
3
4
|
interface CreateApiServerDialogProps {
|
|
4
5
|
clearApiServersCache: (mutate: ReturnType<typeof useSWRConfig>["mutate"]) => void;
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Who the new API server will belong to: the platform (admins only), an
|
|
8
|
+
* organization the user administers, or the user's own account.
|
|
9
|
+
*/
|
|
10
|
+
ownership: RequestedResourceOwnership;
|
|
6
11
|
open: boolean;
|
|
7
12
|
onOpenChange: (val: boolean) => void;
|
|
8
13
|
uuid: () => string;
|
|
9
14
|
}
|
|
10
|
-
export declare function CreateApiServerDialog({ clearApiServersCache,
|
|
15
|
+
export declare function CreateApiServerDialog({ clearApiServersCache, ownership, open, onOpenChange, uuid, }: CreateApiServerDialogProps): ReactElement;
|
|
11
16
|
interface CreateApiServerDialogTriggerProps {
|
|
12
17
|
onOpenChange: (val: boolean) => void;
|
|
13
18
|
}
|
|
@@ -4,10 +4,8 @@ import { Button } from "@schemavaults/ui";
|
|
|
4
4
|
import { Dialog, DialogContent } from "@schemavaults/ui";
|
|
5
5
|
import { Server } from "lucide-react";
|
|
6
6
|
import CreateApiServerForm from "./CreateApiServerForm";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const ownerOrganizationId = useAuthUiOwnerOrganizationId();
|
|
10
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { id: "create-api-server-dialog-content", className: "sm:max-w-[425px] max-h-[90vh] overflow-y-auto", children: _jsx(CreateApiServerForm, { clearApiServersCache: clearApiServersCache, owner_organization_id: owner_organization_id ? owner_organization_id : ownerOrganizationId, onSuccess: () => onOpenChange(false), uuid: uuid }) }) }));
|
|
7
|
+
export function CreateApiServerDialog({ clearApiServersCache, ownership, open, onOpenChange, uuid, }) {
|
|
8
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { id: "create-api-server-dialog-content", className: "sm:max-w-[425px] max-h-[90vh] overflow-y-auto", children: _jsx(CreateApiServerForm, { clearApiServersCache: clearApiServersCache, ownership: ownership, onSuccess: () => onOpenChange(false), uuid: uuid }) }) }));
|
|
11
9
|
}
|
|
12
10
|
export function CreateApiServerDialogTrigger({ onOpenChange, }) {
|
|
13
11
|
return (_jsxs(Button, { id: "open-create-api-server-dialog-button", onClick: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApiServerDialog.js","sourceRoot":"","sources":["../../../src/components/CreateApiServerDialog/CreateApiServerDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateApiServerDialog.js","sourceRoot":"","sources":["../../../src/components/CreateApiServerDialog/CreateApiServerDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAiBxD,MAAM,UAAU,qBAAqB,CAAC,EACpC,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,IAAI,GACuB;IAC3B,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,YAC5C,KAAC,aAAa,IACZ,EAAE,EAAC,kCAAkC,EACrC,SAAS,EAAC,+CAA+C,YAEzD,KAAC,mBAAmB,IAClB,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EACpC,IAAI,EAAE,IAAI,GACV,GACY,GACT,CACV,CAAC;AACJ,CAAC;AAKD,MAAM,UAAU,4BAA4B,CAAC,EAC3C,YAAY,GACsB;IAClC,OAAO,CACL,MAAC,MAAM,IACL,EAAE,EAAC,sCAAsC,EACzC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,aAED,KAAC,MAAM,IAAC,SAAS,EAAC,cAAc,GAAG,mBAC5B,CACV,CAAC;AACJ,CAAC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { useSWRConfig } from "swr";
|
|
3
|
-
import type
|
|
3
|
+
import { type RequestedResourceOwnership } from "@schemavaults/app-definitions";
|
|
4
4
|
interface CreateApiServerFormProps {
|
|
5
5
|
clearApiServersCache: (mutate: ReturnType<typeof useSWRConfig>["mutate"]) => void;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Who the new API server will belong to: the platform (admins only), an
|
|
8
|
+
* organization the user administers, or the user's own account.
|
|
9
|
+
*/
|
|
10
|
+
ownership: RequestedResourceOwnership;
|
|
7
11
|
uuid: () => string;
|
|
8
12
|
onSuccess: () => void;
|
|
9
13
|
}
|
|
10
|
-
export declare function CreateApiServerForm({ clearApiServersCache,
|
|
14
|
+
export declare function CreateApiServerForm({ clearApiServersCache, ownership, uuid, onSuccess, }: CreateApiServerFormProps): ReactElement;
|
|
11
15
|
export default CreateApiServerForm;
|
|
@@ -9,9 +9,11 @@ import { schemaVaultsApiServerDefinitionSchema, } from "@schemavaults/app-defini
|
|
|
9
9
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
10
10
|
import { Server } from "lucide-react";
|
|
11
11
|
import { useAuthUiFriendlyName } from "../FriendlyNameProvider";
|
|
12
|
-
|
|
12
|
+
import { requestedOwnershipToDefinitionFields } from "../CreateAppDialog/requested-ownership-fields";
|
|
13
|
+
export function CreateApiServerForm({ clearApiServersCache, ownership, uuid, onSuccess, }) {
|
|
13
14
|
const { toast } = useToast();
|
|
14
15
|
const friendlyName = useAuthUiFriendlyName();
|
|
16
|
+
const ownershipFields = useMemo(() => requestedOwnershipToDefinitionFields(ownership), [ownership]);
|
|
15
17
|
const defaultValues = useMemo(() => {
|
|
16
18
|
return {
|
|
17
19
|
api_server_name: "",
|
|
@@ -20,9 +22,9 @@ export function CreateApiServerForm({ clearApiServersCache, owner_organization_i
|
|
|
20
22
|
public: false,
|
|
21
23
|
created_at: Date.now(),
|
|
22
24
|
hardcoded: false,
|
|
23
|
-
|
|
25
|
+
...ownershipFields,
|
|
24
26
|
};
|
|
25
|
-
}, [
|
|
27
|
+
}, [ownershipFields, uuid]);
|
|
26
28
|
const form = useForm({
|
|
27
29
|
resolver: zodResolver(schemaVaultsApiServerDefinitionSchema),
|
|
28
30
|
defaultValues,
|
|
@@ -45,7 +47,9 @@ export function CreateApiServerForm({ clearApiServersCache, owner_organization_i
|
|
|
45
47
|
}
|
|
46
48
|
await authClient.createApiServer({
|
|
47
49
|
...values,
|
|
48
|
-
|
|
50
|
+
// The owner is fixed by the card this form was opened from, never
|
|
51
|
+
// by form input.
|
|
52
|
+
...ownershipFields,
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
55
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApiServerForm.js","sourceRoot":"","sources":["../../../src/components/CreateApiServerDialog/CreateApiServerForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAqB,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"CreateApiServerForm.js","sourceRoot":"","sources":["../../../src/components/CreateApiServerDialog/CreateApiServerForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAqB,MAAM,OAAO,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAGL,qCAAqC,GAEtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAe/G,MAAM,UAAU,mBAAmB,CAAC,EAClC,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,SAAS,GACgB;IACzB,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,YAAY,GAAW,qBAAqB,EAAE,CAAC;IACrD,MAAM,eAAe,GAAG,OAAO,CAC7B,GAAG,EAAE,CAAC,oCAAoC,CAAC,SAAS,CAAC,EACrD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,MAAM,aAAa,GACjB,OAAO,CAAC,GAAG,EAAE;QACX,OAAO;YACL,eAAe,EAAE,EAAE;YACnB,aAAa,EAAE,IAAI,E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AC/C,EACd,KAAC,eAAe,oNAKE,EAClB,KAAC,WAAW,KAAG,IACN,CACZ,GACD,EACF,KAAC,SAAS,IACR,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAC,wBAAwB,EAC7B,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACrB,MAAC,QAAQ,eACP,KAAC,SAAS,8BAAwB,EAClC,KAAC,WAAW,cACV,KAAC,QAAQ,IACP,WAAW,EAAC,8DAA8D,KACtE,KAAK,GACT,GACU,EACd,KAAC,eAAe,sDAEE,EAClB,KAAC,WAAW,KAAG,IACN,CACZ,GACD,EACF,KAAC,SAAS,IACR,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACrB,MAAC,QAAQ,IAAC,SAAS,EAAC,4CAA4C,aAC9D,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,wBAAoB,EACjD,KAAC,WAAW,cACV,KAAC,QAAQ,IACP,OAAO,EAAE,KAAK,CAAC,KAAK,EACpB,eAAe,EAAE,KAAK,CAAC,QAAQ,GAC/B,GACU,EACd,KAAC,eAAe,IAAC,SAAS,EAAC,QAAQ,gJAGjB,EAClB,KAAC,WAAW,KAAG,IACN,CACZ,GACD,EACF,KAAC,YAAY,cACX,MAAC,MAAM,IAAC,EAAE,EAAC,sCAAsC,EAAC,IAAI,EAAC,QAAQ,aAC7D,KAAC,MAAM,IAAC,SAAS,EAAC,cAAc,GAAG,iCAE5B,GACI,IACV,GACF,CACR,CAAC;AACJ,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { useSWRConfig } from "swr";
|
|
3
|
+
import type { RequestedResourceOwnership } from "@schemavaults/app-definitions";
|
|
3
4
|
interface CreateFrontendAppDialogProps {
|
|
4
5
|
clearFrontendAppsCache: (mutate: ReturnType<typeof useSWRConfig>["mutate"]) => void;
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Who the new app will belong to: the platform (admins only), an
|
|
8
|
+
* organization the user administers, or the user's own account.
|
|
9
|
+
*/
|
|
10
|
+
ownership: RequestedResourceOwnership;
|
|
6
11
|
open: boolean;
|
|
7
12
|
onOpenChange: (val: boolean) => void;
|
|
8
13
|
uuid: () => string;
|
|
9
14
|
}
|
|
10
|
-
export declare function CreateAppDialog({ clearFrontendAppsCache,
|
|
15
|
+
export declare function CreateAppDialog({ clearFrontendAppsCache, ownership, ...props }: CreateFrontendAppDialogProps): ReactElement;
|
|
11
16
|
export declare function CreateAppDialogTrigger(): ReactElement;
|
|
12
17
|
export default CreateAppDialog;
|
|
@@ -3,13 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Button } from "@schemavaults/ui";
|
|
4
4
|
import { useContext } from "react";
|
|
5
5
|
import { Dialog, DialogContent } from "@schemavaults/ui";
|
|
6
|
-
import { useAuthUiOwnerOrganizationId } from "../OwnerOrganizationProvider";
|
|
7
6
|
import { AppWindow } from "lucide-react";
|
|
8
7
|
import CreateAppForm from "./CreateAppForm";
|
|
9
8
|
import CreateAppDialogOpenDispatchContext from "./CreateAppDialogOpenDispatchContext";
|
|
10
|
-
export function CreateAppDialog({ clearFrontendAppsCache,
|
|
11
|
-
|
|
12
|
-
return (_jsx(Dialog, { open: props.open, onOpenChange: props.onOpenChange, children: _jsx(DialogContent, { id: "create-app-dialog-content", className: "sm:max-w-[425px] max-h-[90vh] overflow-y-auto", children: _jsx(CreateAppForm, { owner_organization_id: owner_organization_id ?? ownerOrganizationId, clearFrontendAppsCache: clearFrontendAppsCache, onSuccess: () => props.onOpenChange(false), uuid: props.uuid }) }) }));
|
|
9
|
+
export function CreateAppDialog({ clearFrontendAppsCache, ownership, ...props }) {
|
|
10
|
+
return (_jsx(Dialog, { open: props.open, onOpenChange: props.onOpenChange, children: _jsx(DialogContent, { id: "create-app-dialog-content", className: "sm:max-w-[425px] max-h-[90vh] overflow-y-auto", children: _jsx(CreateAppForm, { ownership: ownership, clearFrontendAppsCache: clearFrontendAppsCache, onSuccess: () => props.onOpenChange(false), uuid: props.uuid }) }) }));
|
|
13
11
|
}
|
|
14
12
|
export function CreateAppDialogTrigger() {
|
|
15
13
|
const onOpenChange = useContext(CreateAppDialogOpenDispatchContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAppDialog.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/CreateAppDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CreateAppDialog.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/CreateAppDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AAgBtF,MAAM,UAAU,eAAe,CAAC,EAC9B,sBAAsB,EACtB,SAAS,EACT,GAAG,KAAK,EACqB;IAC7B,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,YACxD,KAAC,aAAa,IACZ,EAAE,EAAC,2BAA2B,EAC9B,SAAS,EAAC,+CAA+C,YAEzD,KAAC,aAAa,IACZ,SAAS,EAAE,SAAS,EACpB,sBAAsB,EAAE,sBAAsB,EAC9C,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAC1C,IAAI,EAAE,KAAK,CAAC,IAAI,GAChB,GACY,GACT,CACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,YAAY,GAA4B,UAAU,CACtD,kCAAkC,CACnC,CAAC;IAEF,OAAO,CACL,MAAC,MAAM,IACL,EAAE,EAAC,+BAA+B,EAClC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,YAAY,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,aAED,KAAC,SAAS,IAAC,SAAS,EAAC,cAAc,GAAG,mBAC/B,CACV,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { useSWRConfig } from "swr";
|
|
3
|
-
import { type
|
|
3
|
+
import { type RequestedResourceOwnership } from "@schemavaults/app-definitions";
|
|
4
4
|
export interface CreateAppFormProps {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Who the new app will belong to: the platform (admins only), an
|
|
7
|
+
* organization the user administers, or the user's own account.
|
|
8
|
+
*/
|
|
9
|
+
ownership: RequestedResourceOwnership;
|
|
6
10
|
clearFrontendAppsCache: (mutate: ReturnType<typeof useSWRConfig>["mutate"]) => void;
|
|
7
11
|
onSuccess: () => void;
|
|
8
12
|
uuid: () => string;
|
|
9
13
|
}
|
|
10
|
-
export default function CreateAppForm({
|
|
14
|
+
export default function CreateAppForm({ ownership, clearFrontendAppsCache, onSuccess, uuid, }: CreateAppFormProps): ReactElement;
|
|
@@ -9,10 +9,10 @@ import { schemaVaultsAppDefinitionSchema, } from "@schemavaults/app-definitions"
|
|
|
9
9
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
10
10
|
import { AppWindow } from "lucide-react";
|
|
11
11
|
import { useAuthUiFriendlyName } from "../FriendlyNameProvider";
|
|
12
|
-
import {
|
|
13
|
-
export default function CreateAppForm({
|
|
12
|
+
import { requestedOwnershipToDefinitionFields } from "../CreateAppDialog/requested-ownership-fields";
|
|
13
|
+
export default function CreateAppForm({ ownership, clearFrontendAppsCache, onSuccess, uuid, }) {
|
|
14
14
|
const friendlyName = useAuthUiFriendlyName();
|
|
15
|
-
const
|
|
15
|
+
const ownershipFields = useMemo(() => requestedOwnershipToDefinitionFields(ownership), [ownership]);
|
|
16
16
|
const defaultValues = useMemo(() => {
|
|
17
17
|
return {
|
|
18
18
|
app_name: "",
|
|
@@ -22,9 +22,9 @@ export default function CreateAppForm({ owner_organization_id, clearFrontendApps
|
|
|
22
22
|
web: true,
|
|
23
23
|
created_at: Date.now(),
|
|
24
24
|
hardcoded: false,
|
|
25
|
-
|
|
25
|
+
...ownershipFields,
|
|
26
26
|
};
|
|
27
|
-
}, [
|
|
27
|
+
}, [ownershipFields, uuid]);
|
|
28
28
|
const form = useForm({
|
|
29
29
|
resolver: zodResolver(schemaVaultsAppDefinitionSchema),
|
|
30
30
|
defaultValues,
|
|
@@ -46,13 +46,10 @@ export default function CreateAppForm({ owner_organization_id, clearFrontendApps
|
|
|
46
46
|
const authClient = auth.ready ? auth.client.current : undefined;
|
|
47
47
|
const createAppRequestBody = {
|
|
48
48
|
...values,
|
|
49
|
+
// The owner is fixed by the card this form was opened from, never
|
|
50
|
+
// by form input.
|
|
51
|
+
...ownershipFields,
|
|
49
52
|
};
|
|
50
|
-
if (typeof owner_organization_id === "string") {
|
|
51
|
-
createAppRequestBody["owner_organization_id"] = owner_organization_id;
|
|
52
|
-
}
|
|
53
|
-
else if (!owner_organization_id && authClient?.currentUser?.admin) {
|
|
54
|
-
createAppRequestBody["owner_organization_id"] = ownerOrganizationId;
|
|
55
|
-
}
|
|
56
53
|
// if we're creating it from this form then it must be non-hardcoded/dynamic...
|
|
57
54
|
createAppRequestBody["hardcoded"] = false;
|
|
58
55
|
createAppRequestBody["created_at"] = Date.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAppForm.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/CreateAppForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAqB,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateAppForm.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/CreateAppForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,eAAe,EACf,SAAS,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAqB,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,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,UAAU,EACpB,MAAM,EAAE,KAAK,CAAC,MAAM,GACpB,GACU,EACd,KAAC,eAAe,IAAC,SAAS,EAAC,QAAQ,mHAGjB,EAClB,KAAC,WAAW,KAAG,IACN,CACZ,GACD,EACF,KAAC,SAAS,IACR,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAC,KAAK,EACV,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACrB,MAAC,QAAQ,IAAC,SAAS,EAAC,4CAA4C,aAC9D,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,iCAA6B,EAC1D,KAAC,WAAW,cACV,KAAC,QAAQ,IACP,OAAO,EAAE,KAAK,CAAC,KAAK,EACpB,eAAe,EAAE,KAAK,CAAC,QAAQ,EAC/B,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,KAAK,CAAC,MAAM,GACpB,GACU,EACd,KAAC,eAAe,IAAC,SAAS,EAAC,QAAQ,wJAIjB,EAClB,KAAC,WAAW,KAAG,IACN,CACZ,GACD,EACF,KAAC,YAAY,cACX,MAAC,MAAM,IACL,EAAE,EAAC,+BAA+B,EAClC,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,UAAU,aAEpB,KAAC,SAAS,IAAC,SAAS,EAAC,cAAc,GAAG,iCAE/B,GACI,IACV,GACF,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RequestedResourceOwnership, ResourceOwnershipFields } from "@schemavaults/app-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* @description Maps the ownership a create form was opened with onto the
|
|
4
|
+
* ownership fields of a creation request body (`POST /api/apps`,
|
|
5
|
+
* `POST /api/apis`). The server re-validates that the caller may create
|
|
6
|
+
* resources for that owner; see `resolveRequestedOwnershipForCreation`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function requestedOwnershipToDefinitionFields(ownership: RequestedResourceOwnership): Required<Pick<ResourceOwnershipFields, "owner_type" | "owner_organization_id" | "owner_uid">>;
|
|
9
|
+
export default requestedOwnershipToDefinitionFields;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Maps the ownership a create form was opened with onto the
|
|
3
|
+
* ownership fields of a creation request body (`POST /api/apps`,
|
|
4
|
+
* `POST /api/apis`). The server re-validates that the caller may create
|
|
5
|
+
* resources for that owner; see `resolveRequestedOwnershipForCreation`.
|
|
6
|
+
*/
|
|
7
|
+
export function requestedOwnershipToDefinitionFields(ownership) {
|
|
8
|
+
switch (ownership.owner_type) {
|
|
9
|
+
case "platform":
|
|
10
|
+
return { owner_type: "platform", owner_organization_id: null, owner_uid: null };
|
|
11
|
+
case "organization":
|
|
12
|
+
return {
|
|
13
|
+
owner_type: "organization",
|
|
14
|
+
owner_organization_id: ownership.owner_organization_id,
|
|
15
|
+
owner_uid: null,
|
|
16
|
+
};
|
|
17
|
+
case "user":
|
|
18
|
+
return {
|
|
19
|
+
owner_type: "user",
|
|
20
|
+
owner_organization_id: null,
|
|
21
|
+
owner_uid: ownership.owner_uid,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export default requestedOwnershipToDefinitionFields;
|
|
26
|
+
//# sourceMappingURL=requested-ownership-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requested-ownership-fields.js","sourceRoot":"","sources":["../../../src/components/CreateAppDialog/requested-ownership-fields.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,SAAqC;IAErC,QAAQ,SAAS,CAAC,UAAU,EAAE,CAAC;QAC7B,KAAK,UAAU;YACb,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAClF,KAAK,cAAc;YACjB,OAAO;gBACL,UAAU,EAAE,cAAc;gBAC1B,qBAAqB,EAAE,SAAS,CAAC,qBAAqB;gBACtD,SAAS,EAAE,IAAI;aAChB,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,UAAU,EAAE,MAAM;gBAClB,qBAAqB,EAAE,IAAI;gBAC3B,SAAS,EAAE,SAAS,CAAC,SAAS;aAC/B,CAAC;IACN,CAAC;AACH,CAAC;AAED,eAAe,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import type { ResourceOwnerType, ResourceOwnershipFields } from "@schemavaults/app-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* "all" shows every listed resource; any other value keeps only resources
|
|
5
|
+
* whose resolved `owner_type` matches.
|
|
6
|
+
*/
|
|
7
|
+
export type OwnerTypeFilterValue = "all" | ResourceOwnerType;
|
|
8
|
+
export declare const OWNER_TYPE_FILTER_VALUES: readonly ["all", "user", "organization", "platform"];
|
|
9
|
+
export declare function isOwnerTypeFilterValue(value: unknown): value is OwnerTypeFilterValue;
|
|
10
|
+
/**
|
|
11
|
+
* @description Applies an owner-type filter to a list of app/API server
|
|
12
|
+
* definitions. Definitions whose ownership cannot be resolved are kept
|
|
13
|
+
* under "all" and dropped under a specific filter.
|
|
14
|
+
*/
|
|
15
|
+
export declare function filterByOwnerType<T extends ResourceOwnershipFields>(resources: readonly T[], filter: OwnerTypeFilterValue, platform_owner_organization_id: string): readonly T[];
|
|
16
|
+
/**
|
|
17
|
+
* @description Applies {@link filterByOwnerType} with the platform owner
|
|
18
|
+
* organization id from context.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useOwnerTypeFilteredResources<T extends ResourceOwnershipFields>(resources: readonly T[] | undefined, filter: OwnerTypeFilterValue | undefined): readonly T[] | undefined;
|
|
21
|
+
export interface OwnerTypeFilterProps {
|
|
22
|
+
value: OwnerTypeFilterValue;
|
|
23
|
+
onValueChange: (value: OwnerTypeFilterValue) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to offer the "Personal" option (default true). Pages hide it
|
|
26
|
+
* when the viewer owns no personal resources and the server does not let
|
|
27
|
+
* them create any, so the filter never offers an always-empty view.
|
|
28
|
+
*/
|
|
29
|
+
showPersonal?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to offer the "Platform" option. Only global admins can see
|
|
32
|
+
* platform-owned resources, so pages hide it for everyone else.
|
|
33
|
+
*/
|
|
34
|
+
showPlatform?: boolean;
|
|
35
|
+
className?: string;
|
|
36
|
+
/** Test/automation hook; defaults to "owner-type-filter". */
|
|
37
|
+
id?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @description A single-select toggle group for filtering listed apps / API
|
|
41
|
+
* servers by who owns them: all, the current user's own account, one of
|
|
42
|
+
* their organizations, or the platform.
|
|
43
|
+
*/
|
|
44
|
+
export declare function OwnerTypeFilter({ value, onValueChange, showPersonal, showPlatform, className, id, }: OwnerTypeFilterProps): ReactElement;
|
|
45
|
+
export default OwnerTypeFilter;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { ToggleGroup, ToggleGroupItem, cn } from "@schemavaults/ui";
|
|
5
|
+
import { resolveResourceOwnership } from "@schemavaults/app-definitions";
|
|
6
|
+
import { Building2, Layers, Server, User as UserIcon } from "lucide-react";
|
|
7
|
+
import { useAuthUiFriendlyName } from "../FriendlyNameProvider";
|
|
8
|
+
import { useAuthUiOwnerOrganizationId } from "../OwnerOrganizationProvider";
|
|
9
|
+
export const OWNER_TYPE_FILTER_VALUES = [
|
|
10
|
+
"all",
|
|
11
|
+
"user",
|
|
12
|
+
"organization",
|
|
13
|
+
"platform",
|
|
14
|
+
];
|
|
15
|
+
export function isOwnerTypeFilterValue(value) {
|
|
16
|
+
return (typeof value === "string" &&
|
|
17
|
+
OWNER_TYPE_FILTER_VALUES.includes(value));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @description Applies an owner-type filter to a list of app/API server
|
|
21
|
+
* definitions. Definitions whose ownership cannot be resolved are kept
|
|
22
|
+
* under "all" and dropped under a specific filter.
|
|
23
|
+
*/
|
|
24
|
+
export function filterByOwnerType(resources, filter, platform_owner_organization_id) {
|
|
25
|
+
if (filter === "all") {
|
|
26
|
+
return resources;
|
|
27
|
+
}
|
|
28
|
+
return resources.filter((resource) => {
|
|
29
|
+
try {
|
|
30
|
+
return (resolveResourceOwnership(resource, { platform_owner_organization_id })
|
|
31
|
+
.owner_type === filter);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @description Applies {@link filterByOwnerType} with the platform owner
|
|
40
|
+
* organization id from context.
|
|
41
|
+
*/
|
|
42
|
+
export function useOwnerTypeFilteredResources(resources, filter) {
|
|
43
|
+
const platformOrganizationId = useAuthUiOwnerOrganizationId();
|
|
44
|
+
if (!resources || !filter || filter === "all") {
|
|
45
|
+
return resources;
|
|
46
|
+
}
|
|
47
|
+
return filterByOwnerType(resources, filter, platformOrganizationId);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @description A single-select toggle group for filtering listed apps / API
|
|
51
|
+
* servers by who owns them: all, the current user's own account, one of
|
|
52
|
+
* their organizations, or the platform.
|
|
53
|
+
*/
|
|
54
|
+
export function OwnerTypeFilter({ value, onValueChange, showPersonal = true, showPlatform = false, className, id = "owner-type-filter", }) {
|
|
55
|
+
const friendlyName = useAuthUiFriendlyName();
|
|
56
|
+
const itemClassName = "flex flex-row flex-nowrap items-center gap-2";
|
|
57
|
+
// A selection whose option is no longer offered (e.g. the last personal
|
|
58
|
+
// app was deleted and the user cannot create another) falls back to "all"
|
|
59
|
+
// so the list never stays filtered by a hidden option.
|
|
60
|
+
const isValueHidden = (value === "user" && !showPersonal) ||
|
|
61
|
+
(value === "platform" && !showPlatform);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (isValueHidden) {
|
|
64
|
+
onValueChange("all");
|
|
65
|
+
}
|
|
66
|
+
}, [isValueHidden, onValueChange]);
|
|
67
|
+
return (_jsxs(ToggleGroup, { id: id, type: "single", value: value, onValueChange: (next) => {
|
|
68
|
+
// Radix-style toggle groups emit "" when the active item is
|
|
69
|
+
// clicked again; keep the current selection in that case.
|
|
70
|
+
if (isOwnerTypeFilterValue(next)) {
|
|
71
|
+
onValueChange(next);
|
|
72
|
+
}
|
|
73
|
+
}, variant: "outline", size: "sm", className: cn("flex flex-row flex-wrap gap-1", className), "aria-label": "Filter by owner", children: [_jsxs(ToggleGroupItem, { value: "all", className: itemClassName, "data-testid": `${id}-all`, children: [_jsx(Layers, { className: "h-4 w-4" }), " All"] }), showPersonal && (_jsxs(ToggleGroupItem, { value: "user", className: itemClassName, "data-testid": `${id}-user`, title: "Owned by your account", children: [_jsx(UserIcon, { className: "h-4 w-4" }), " Personal"] })), _jsxs(ToggleGroupItem, { value: "organization", className: itemClassName, "data-testid": `${id}-organization`, title: "Owned by one of your organizations", children: [_jsx(Building2, { className: "h-4 w-4" }), " Organization"] }), showPlatform && (_jsxs(ToggleGroupItem, { value: "platform", className: itemClassName, "data-testid": `${id}-platform`, title: `Owned by the ${friendlyName} platform`, children: [_jsx(Server, { className: "h-4 w-4" }), " Platform"] }))] }));
|
|
74
|
+
}
|
|
75
|
+
export default OwnerTypeFilter;
|
|
76
|
+
//# sourceMappingURL=OwnerTypeFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnerTypeFilter.js","sourceRoot":"","sources":["../../../src/components/OwnerTypeFilter/OwnerTypeFilter.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAKpE,OAAO,EA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X,GAAG,EAAE,OAAO,EACzB,KAAK,EAAC,uBAAuB,aAE7B,KAAC,QAAQ,IAAC,SAAS,EAAC,SAAS,GAAG,iBAChB,CACnB,EACD,MAAC,eAAe,IACd,KAAK,EAAC,cAAc,EACpB,SAAS,EAAE,aAAa,iBACX,GAAG,EAAE,eAAe,EACjC,KAAK,EAAC,oCAAoC,aAE1C,KAAC,SAAS,IAAC,SAAS,EAAC,SAAS,GAAG,qBACjB,EACjB,YAAY,IAAI,CACf,MAAC,eAAe,IACd,KAAK,EAAC,UAAU,EAChB,SAAS,EAAE,aAAa,iBACX,GAAG,EAAE,WAAW,EAC7B,KAAK,EAAE,gBAAgB,YAAY,WAAW,aAE9C,KAAC,MAAM,IAAC,SAAS,EAAC,SAAS,GAAG,iBACd,CACnB,IACW,CACf,CAAC;AACJ,CAAC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/OwnerTypeFilter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC"}
|