@schemavaults/auth-ui 0.12.18 → 0.12.20
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.
|
@@ -20,6 +20,13 @@ export interface AccountDetailsCardProps {
|
|
|
20
20
|
* fetch of `/api/me/organizations`.
|
|
21
21
|
*/
|
|
22
22
|
preloaded_memberships?: readonly OrganizationMembershipRoleDetails[];
|
|
23
|
+
/**
|
|
24
|
+
* Whether the current user is permitted to create new organizations.
|
|
25
|
+
* When false, the "Create Organization" button is hidden (e.g. the
|
|
26
|
+
* `admin_only_organization_creation` server setting is enabled and the
|
|
27
|
+
* user is not an admin). Defaults to true.
|
|
28
|
+
*/
|
|
29
|
+
canCreateOrganization?: boolean;
|
|
23
30
|
}
|
|
24
31
|
export declare function AccountDetailsCard(props: AccountDetailsCardProps): ReactElement;
|
|
25
32
|
export default AccountDetailsCard;
|
|
@@ -29,8 +29,9 @@ export function AccountDetailsCard(props) {
|
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
return (_jsxs(Card, { className: cardClassName, children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Account Details" }), _jsxs(CardDescription, { children: ["View and manage your ", friendlyName, " account."] })] }), _jsx(CardContent, { children: _jsxs("div", { className: "flex flex-col items-start justify-start gap-2", children: [_jsx(KeyValueWithSkeleton, { label: "User ID", value: currentUser?.uid }), _jsxs("div", { className: "flex w-full flex-row flex-wrap items-center justify-start gap-2", children: [_jsx(KeyValueWithSkeleton, { label: "Email", value: currentUser?.email, className: "w-auto grow-0" }), currentUser && (_jsx(EmailVerificationStatus, { email: currentUser.email, verified: currentUser.email_verified === true, isAuthServerAccountPage: props.isAuthServerAccountPage, auth_server_url: props.auth_server_url, redirect: props.redirect }))] }), props.isAuthServerAccountPage && (_jsxs("div", { className: "flex flex-row items-center justify-start gap-2 flex-wrap", children: [_jsx("h3", { className: "text-lg font-bold", children: "Organizations:" }), memberships && memberships.length > 0 ? (_jsx(_Fragment, { children: memberships.map((membership) => (_jsx(Link, { href: `/org/${membership.organization_id}`, children: _jsxs(Button, { variant: "outline", size: "sm", className: "flex flex-row flex-nowrap gap-2", children: [_jsx(Building2, { className: "h-4 w-4" }), membership.organization_name, membership.role && (_jsxs("span", { className: "text-xs text-muted-foreground", children: ["(", membership.role, ")"] }))] }) }, membership.organization_id))) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "No organizations" })), (
|
|
33
|
-
memberships
|
|
32
|
+
return (_jsxs(Card, { className: cardClassName, children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Account Details" }), _jsxs(CardDescription, { children: ["View and manage your ", friendlyName, " account."] })] }), _jsx(CardContent, { children: _jsxs("div", { className: "flex flex-col items-start justify-start gap-2", children: [_jsx(KeyValueWithSkeleton, { label: "User ID", value: currentUser?.uid }), _jsxs("div", { className: "flex w-full flex-row flex-wrap items-center justify-start gap-2", children: [_jsx(KeyValueWithSkeleton, { label: "Email", value: currentUser?.email, className: "w-auto grow-0" }), currentUser && (_jsx(EmailVerificationStatus, { email: currentUser.email, verified: currentUser.email_verified === true, isAuthServerAccountPage: props.isAuthServerAccountPage, auth_server_url: props.auth_server_url, redirect: props.redirect }))] }), props.isAuthServerAccountPage && (_jsxs("div", { className: "flex flex-row items-center justify-start gap-2 flex-wrap", children: [_jsx("h3", { className: "text-lg font-bold", children: "Organizations:" }), memberships && memberships.length > 0 ? (_jsx(_Fragment, { children: memberships.map((membership) => (_jsx(Link, { href: `/org/${membership.organization_id}`, children: _jsxs(Button, { variant: "outline", size: "sm", className: "flex flex-row flex-nowrap gap-2", children: [_jsx(Building2, { className: "h-4 w-4" }), membership.organization_name, membership.role && (_jsxs("span", { className: "text-xs text-muted-foreground", children: ["(", membership.role, ")"] }))] }) }, membership.organization_id))) })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "No organizations" })), (props.canCreateOrganization ?? true) &&
|
|
33
|
+
(!memberships ||
|
|
34
|
+
memberships.length < MAXIMUM_USER_ORGANIZATIONS) && (_jsx(Link, { href: "/org/new", children: _jsxs(Button, { variant: "outline", size: "sm", className: "flex flex-row flex-nowrap gap-2", children: [_jsx(Plus, { className: "h-4 w-4" }), "Create Organization"] }) }))] }))] }) }), _jsx(CardFooter, { children: _jsxs("div", { className: "flex flex-row items-start justify-start flex-wrap gap-2", children: [_jsx(SignOutButton, { Link: props.Link }), showLinkToAuthServerAccountPage && (_jsx(ViewFullUserProfileButton, { navigate: async () => {
|
|
34
35
|
const accountUrl = new URL("/account", props.auth_server_url).toString();
|
|
35
36
|
await props.redirect(accountUrl);
|
|
36
37
|
} })), _jsx(ViewAdminDashboardButton, { navigate: async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_card.js","sourceRoot":"","sources":["../../../src/components/AccountCard/account_card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,EAAE,EACF,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,GAEnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,0BAA0B,GAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,yBAAyB,MAAM,0BAA0B,CAAC;AACjE,OAAO,wBAAwB,MAAM,wBAAwB,CAAC;AAC9D,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"account_card.js","sourceRoot":"","sources":["../../../src/components/AccountCard/account_card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EACL,MAAM,EACN,IA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ACD,KAAK,EAAE,KAAK,CAAC,OAAO,GACpB,IACE,GACK,IACR,CACR,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schemavaults/auth-ui",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "React.js UI components for authentication/authorization shared between different SchemaVaults apps",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"react-dom": "^19.2.8",
|
|
18
18
|
"next": "^16.2.11",
|
|
19
19
|
"@schemavaults/ui": "^0.87.1",
|
|
20
|
-
"@schemavaults/auth-react-provider": "0.16.
|
|
20
|
+
"@schemavaults/auth-react-provider": "0.16.9",
|
|
21
21
|
"@schemavaults/app-definitions": "0.11.4",
|
|
22
22
|
"@schemavaults/auth-common": "0.22.4",
|
|
23
23
|
"lucide-react": "0.575.0",
|