@protobase/ui 0.25.1 → 0.25.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/account/account-pages.js +3 -2
- package/dist/account/account-security-page.js +9 -4
- package/dist/account/backup-codes.js +7 -6
- package/dist/account/messages.js +214 -0
- package/dist/account/passkeys-section.js +23 -22
- package/dist/account/password-dialog.js +3 -2
- package/dist/account/sign-in-policy-form.js +11 -10
- package/dist/account/sign-in-policy-labels.js +30 -29
- package/dist/account/sign-in-policy-page.js +11 -6
- package/dist/account/sign-in-providers-section.js +6 -5
- package/dist/account/staff-sign-in-log.js +11 -10
- package/dist/account/totp-qr.js +2 -1
- package/dist/account/two-factor-section.js +24 -23
- package/dist/account/two-factor-setup.js +18 -17
- package/dist/action-card/action-card.js +2 -1
- package/dist/action-card/messages.js +8 -0
- package/dist/activity-chart/activity-chart.js +3 -2
- package/dist/activity-chart/messages.js +14 -0
- package/dist/app/app.d.ts +1 -1
- package/dist/app/app.js +20 -21
- package/dist/app/assistant-shell.js +2 -1
- package/dist/app/batch-failure.js +2 -1
- package/dist/app/breadcrumb-for.js +4 -3
- package/dist/app/charts/chart-groups.js +3 -2
- package/dist/app/charts/chart-view.js +3 -2
- package/dist/app/charts/group-bars.js +2 -1
- package/dist/app/charts/messages.js +26 -0
- package/dist/app/charts/period-chart.js +3 -2
- package/dist/app/charts/split-points.js +2 -1
- package/dist/app/comments/comment-composer.js +19 -18
- package/dist/app/comments/comments-section.js +4 -3
- package/dist/app/comments/messages.js +26 -0
- package/dist/app/create/create-page.js +11 -18
- package/dist/app/custom-section.js +4 -6
- package/dist/app/displays/board-column.js +6 -5
- package/dist/app/displays/board-columns.js +3 -2
- package/dist/app/displays/board-display.js +13 -15
- package/dist/app/displays/calendar-controls.js +3 -2
- package/dist/app/displays/calendar-display.js +12 -17
- package/dist/app/displays/card-carousel.js +4 -3
- package/dist/app/displays/cards-display.js +2 -1
- package/dist/app/displays/custom-display.js +4 -6
- package/dist/app/displays/display-frame.js +3 -2
- package/dist/app/displays/list-cards.js +5 -8
- package/dist/app/displays/list-displays.js +3 -3
- package/dist/app/displays/map-display.js +15 -14
- package/dist/app/displays/messages.js +128 -2
- package/dist/app/displays/period-controls.js +4 -3
- package/dist/app/displays/record-card.js +7 -6
- package/dist/app/displays/timeline-display.js +17 -26
- package/dist/app/displays/timeline-range.js +2 -1
- package/dist/app/displays/use-board-move.js +2 -2
- package/dist/app/displays/use-calendar-move.js +2 -1
- package/dist/app/document-title.js +2 -1
- package/dist/app/export/builder-port.js +2 -1
- package/dist/app/export/export-dialog.js +36 -40
- package/dist/app/export/export-worker.js +2 -0
- package/dist/app/export/messages.js +78 -0
- package/dist/app/export/run-export.js +5 -2
- package/dist/app/export/sink.js +4 -3
- package/dist/app/export/use-export-flow.js +4 -3
- package/dist/app/field-editor.js +4 -3
- package/dist/app/field-types/messages.js +8 -0
- package/dist/app/field-types/widget-part.js +2 -1
- package/dist/app/file-field.js +11 -14
- package/dist/app/gallery/gallery-section.js +4 -3
- package/dist/app/gallery/lightbox.js +5 -4
- package/dist/app/gallery/messages.js +30 -0
- package/dist/app/gallery/photo-details.js +3 -2
- package/dist/app/hand-order/hand-sorted-list.js +3 -6
- package/dist/app/hand-order/messages.js +4 -2
- package/dist/app/history/describe-change.js +3 -8
- package/dist/app/history/messages.js +32 -0
- package/dist/app/import/convert.js +20 -19
- package/dist/app/import/failed-rows.js +3 -2
- package/dist/app/import/import-button.js +2 -1
- package/dist/app/import/import-check-step.js +19 -35
- package/dist/app/import/import-dialog.js +13 -17
- package/dist/app/import/import-file-step.js +5 -9
- package/dist/app/import/import-mapping-step.js +32 -35
- package/dist/app/import/import-result-step.js +13 -12
- package/dist/app/import/messages.js +200 -0
- package/dist/app/import/parse-worker.js +2 -0
- package/dist/app/import/prepare-rows.js +5 -4
- package/dist/app/import/sheet-cell.js +2 -1
- package/dist/app/import/sheet-file.js +3 -2
- package/dist/app/import/sheet-source.js +7 -3
- package/dist/app/import/xlsx-reader.js +4 -3
- package/dist/app/import/xlsx-xml.js +2 -1
- package/dist/app/import/zip-reader.js +4 -3
- package/dist/app/list-edit/use-list-edits.js +1 -1
- package/dist/app/list-group-chart.js +2 -1
- package/dist/app/list-page.js +1 -1
- package/dist/app/map/map-layer-switch.js +3 -2
- package/dist/app/map/messages.js +14 -0
- package/dist/app/messages.js +116 -2
- package/dist/app/meta-gate.js +1 -1
- package/dist/app/nav-from-meta.js +11 -10
- package/dist/app/pages/action-inputs/action-inputs-dialog.js +3 -2
- package/dist/app/pages/action-inputs/input-answers.js +6 -5
- package/dist/app/pages/blocks/card-row.js +3 -2
- package/dist/app/pages/blocks/modal-form.js +5 -4
- package/dist/app/pages/blocks/record-card.js +3 -2
- package/dist/app/pages/blocks/stat.js +2 -1
- package/dist/app/pages/composed-page.js +6 -8
- package/dist/app/pages/confirm-action.js +2 -1
- package/dist/app/pages/custom-boundary.js +4 -2
- package/dist/app/pages/messages.js +64 -0
- package/dist/app/pages/render-node.js +5 -7
- package/dist/app/pages/use-run-action.js +11 -10
- package/dist/app/record-page.js +1 -1
- package/dist/app/record-row/messages.js +26 -0
- package/dist/app/record-row/record-row-body.js +12 -7
- package/dist/app/record-row/record-row.js +4 -3
- package/dist/app/record-row/saved-record-row.js +3 -2
- package/dist/app/related-dots/dots-summary.js +2 -1
- package/dist/app/related-dots/messages.js +8 -0
- package/dist/app/relation-picker.js +9 -8
- package/dist/app/router.js +5 -4
- package/dist/app/runtime/messages.js +58 -0
- package/dist/app/runtime/runtime-status.js +10 -23
- package/dist/app/runtime/runtime-update-dialog.js +7 -6
- package/dist/app/runtime/runtime-update.js +4 -3
- package/dist/app/saved/favorite-button.js +2 -1
- package/dist/app/saved/messages.js +22 -0
- package/dist/app/saved/saved-list.js +4 -7
- package/dist/app/saved/use-favorite.js +3 -2
- package/dist/app/search/messages.js +6 -2
- package/dist/app/search/navigation-hits.js +9 -7
- package/dist/app/searches/filter-chip-list.js +2 -1
- package/dist/app/searches/messages.js +96 -0
- package/dist/app/searches/save-search-button.js +5 -4
- package/dist/app/searches/saved-search-rows.js +3 -2
- package/dist/app/searches/saved-search-section.js +6 -5
- package/dist/app/searches/saved-search.js +4 -3
- package/dist/app/searches/saved-searches.js +15 -25
- package/dist/app/searches/search-controls.js +5 -4
- package/dist/app/searches/search-diff.js +4 -2
- package/dist/app/searches/search-name-dialog.js +4 -3
- package/dist/app/searches/update-search-dialog.js +15 -30
- package/dist/app/searches/use-save-search.js +8 -7
- package/dist/app/searches/use-search-row.js +4 -3
- package/dist/app/sensitive-field.js +5 -4
- package/dist/app/source-notice.js +13 -8
- package/dist/app/staff-banner.js +12 -19
- package/dist/app-shell/global-search.js +2 -2
- package/dist/app-shell/messages.js +4 -2
- package/dist/assistant-dock/assistant-dock.js +5 -5
- package/dist/assistant-dock/messages.js +26 -0
- package/dist/assistant-dock/use-assistant.js +2 -1
- package/dist/assistant-dock/use-backend-data.js +2 -1
- package/dist/assistant-dock/widget-view.js +3 -2
- package/dist/auth/auth-gate.js +10 -5
- package/dist/auth/auth-locale.js +14 -0
- package/dist/auth/auth-messages.js +122 -43
- package/dist/auth/auth-provider.js +6 -1
- package/dist/auth/code-form.js +2 -1
- package/dist/auth/email-code-form.js +11 -13
- package/dist/auth/email-code-page.js +2 -1
- package/dist/auth/first-run-page.js +6 -5
- package/dist/auth/forgot-password-form.js +14 -16
- package/dist/auth/forgot-password-page.js +2 -1
- package/dist/auth/messages.js +200 -0
- package/dist/auth/provider-sign-in-page.js +5 -5
- package/dist/auth/resend-code-button.js +2 -1
- package/dist/auth/reset-password-form.js +11 -10
- package/dist/auth/reset-password-page.js +4 -3
- package/dist/auth/setup-required-form.js +7 -9
- package/dist/auth/setup-required-page.js +7 -2
- package/dist/auth/sign-in-form.js +15 -18
- package/dist/auth/sign-in-prompt.js +4 -3
- package/dist/auth/sign-up-code-form.js +11 -13
- package/dist/auth/sign-up-details-form.js +14 -21
- package/dist/auth/sign-up-email-form.js +8 -7
- package/dist/auth/sign-up-page.js +2 -1
- package/dist/auth/staff-sign-in-form.js +14 -17
- package/dist/auth/two-factor-form.js +17 -16
- package/dist/auth/user-to-shell.js +2 -1
- package/dist/chat/composer.js +8 -7
- package/dist/chat/messages.js +14 -0
- package/dist/compact-table/compact-table.js +4 -8
- package/dist/compact-table/messages.js +18 -0
- package/dist/data/meta-data.d.ts +1 -1
- package/dist/data/use-update-record.js +1 -1
- package/dist/inline-child-table/inline-child-table.js +12 -12
- package/dist/inline-child-table/line-row.js +10 -9
- package/dist/inline-child-table/messages.js +52 -0
- package/dist/inline-child-table/totals-footer.js +5 -8
- package/dist/invitations/invite-form.js +3 -2
- package/dist/invitations/link-notice.js +6 -4
- package/dist/invitations/messages.js +24 -0
- package/dist/invitations/pending-invitation-row.js +4 -3
- package/dist/lists/messages.js +8 -0
- package/dist/lists/paged-search-list.js +2 -1
- package/dist/locale/slotted.js +14 -0
- package/dist/markdown/markdown-editor.js +6 -5
- package/dist/markdown/messages.js +16 -0
- package/dist/organizations/all-organizations.js +6 -5
- package/dist/organizations/app-roles-picker.js +2 -1
- package/dist/organizations/invitation-page.js +39 -49
- package/dist/organizations/invitations-page.js +11 -10
- package/dist/organizations/members-page.js +15 -10
- package/dist/organizations/messages.js +180 -0
- package/dist/organizations/organization-page.js +27 -26
- package/dist/organizations/organization-paths.js +16 -13
- package/dist/organizations/organization-row.js +3 -2
- package/dist/organizations/organizations-page.js +17 -16
- package/dist/organizations/use-organizations.js +2 -1
- package/dist/package.js +1 -1
- package/dist/plugins/before-sign-in.js +6 -1
- package/dist/plugins/load-plugin.d.ts +1 -1
- package/dist/plugins/load-plugin.js +3 -2
- package/dist/plugins/messages.js +36 -0
- package/dist/plugins/plugin-gate.js +6 -1
- package/dist/plugins/plugin-manifest.js +8 -7
- package/dist/plugins/plugin-notice.js +8 -12
- package/dist/primitives/messages.js +16 -0
- package/dist/primitives/sheet.js +2 -1
- package/dist/primitives/spinner.js +2 -1
- package/dist/primitives/token.js +2 -1
- package/dist/record-view/messages.js +4 -2
- package/dist/record-view/record-tabs.js +2 -1
- package/dist/roles/messages.js +14 -0
- package/dist/roles/use-active-role.js +3 -2
- package/dist/shell/assets/app-CW3U56yM.js +69 -0
- package/dist/shell/assets/cn-Bi0ZEjD9.js +1 -0
- package/dist/shell/assets/export-worker-ClACk00b.js +2 -0
- package/dist/shell/assets/{index-BuKnJ48y.js → index-B7cIjCuz.js} +2 -2
- package/dist/shell/assets/maplibre-CVG5L9FD.js +814 -0
- package/dist/shell/assets/{markdown-content-CvNiaqsy.js → markdown-content-CtGUP4W6.js} +1 -1
- package/dist/shell/assets/parse-worker-UhbwEjS0.js +5 -0
- package/dist/shell/assets/preload-helper-BX9CcZkY.js +1 -0
- package/dist/shell/assets/{record-map-BmPHHEMK.js → record-map-Cw3_NcUl.js} +1 -1
- package/dist/shell/assets/records-map-D4f3ZeDL.js +1 -0
- package/dist/shell/assets/shared-protobase-ui-CB_i50NP.js +1 -0
- package/dist/shell/index.html +5 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/side-panel/messages.js +8 -0
- package/dist/side-panel/side-panel.js +2 -1
- package/dist/toasts/messages.js +8 -0
- package/dist/toasts/toast.js +2 -1
- package/dist/users/app-invitations.js +5 -4
- package/dist/users/create-user-form.js +9 -8
- package/dist/users/messages.js +52 -0
- package/dist/users/use-user-roles.js +2 -1
- package/dist/users/user-list.js +6 -5
- package/dist/users/user-row.js +5 -4
- package/package.json +4 -4
- package/dist/shell/assets/app-BPHSSo4E.js +0 -69
- package/dist/shell/assets/export-worker-Bz57Pf5g.js +0 -2
- package/dist/shell/assets/maplibre-C2VkKdp3.js +0 -814
- package/dist/shell/assets/parse-worker-BtcY0dQw.js +0 -5
- package/dist/shell/assets/records-map-BvUD1Fqc.js +0 -1
- package/dist/shell/assets/shared-protobase-ui-B-pEBDQf.js +0 -1
|
@@ -6,7 +6,8 @@ import { authMessage } from "../auth/auth-messages.js";
|
|
|
6
6
|
import { useAuth } from "../auth/auth-provider.js";
|
|
7
7
|
import { Button, buttonClass } from "../primitives/button.js";
|
|
8
8
|
import { AuthLayout } from "../auth/auth-layout.js";
|
|
9
|
-
import {
|
|
9
|
+
import { text } from "./messages.js";
|
|
10
|
+
import { organizationRoleLabel, roleLabel } from "./organization-paths.js";
|
|
10
11
|
import { useAction } from "./use-action.js";
|
|
11
12
|
import { useEffect, useState } from "react";
|
|
12
13
|
import { AuthError } from "@protobase/client";
|
|
@@ -36,7 +37,7 @@ const SignUp = ({ token, preview, joins, onDone }) => {
|
|
|
36
37
|
children: [
|
|
37
38
|
/* @__PURE__ */ jsx("p", {
|
|
38
39
|
className: "text-muted-foreground",
|
|
39
|
-
children: joins ?
|
|
40
|
+
children: joins ? text("makeAccountToJoin", preview.email) : text("makeAccount", preview.email)
|
|
40
41
|
}),
|
|
41
42
|
error && /* @__PURE__ */ jsx("p", {
|
|
42
43
|
role: "alert",
|
|
@@ -44,17 +45,17 @@ const SignUp = ({ token, preview, joins, onDone }) => {
|
|
|
44
45
|
children: error
|
|
45
46
|
}),
|
|
46
47
|
/* @__PURE__ */ jsx(Input, {
|
|
47
|
-
"aria-label": "
|
|
48
|
-
placeholder: "
|
|
48
|
+
"aria-label": text("yourName"),
|
|
49
|
+
placeholder: text("yourName"),
|
|
49
50
|
autoComplete: "name",
|
|
50
51
|
value: name,
|
|
51
52
|
onChange: (event) => setName(event.target.value)
|
|
52
53
|
}),
|
|
53
54
|
withPassword && /* @__PURE__ */ jsx(Input, {
|
|
54
|
-
"aria-label": "
|
|
55
|
+
"aria-label": text("password"),
|
|
55
56
|
type: "password",
|
|
56
57
|
autoComplete: "new-password",
|
|
57
|
-
placeholder: passwordOptional ?
|
|
58
|
+
placeholder: passwordOptional ? text("passwordOptional", 12) : text("passwordRequired", 12),
|
|
58
59
|
value: password,
|
|
59
60
|
onChange: (event) => setPassword(event.target.value)
|
|
60
61
|
}),
|
|
@@ -63,7 +64,7 @@ const SignUp = ({ token, preview, joins, onDone }) => {
|
|
|
63
64
|
variant: "primary",
|
|
64
65
|
loading: busy,
|
|
65
66
|
disabled: !name.trim() || withPassword && !passwordOptional && password.length < 12,
|
|
66
|
-
children: joins ? "
|
|
67
|
+
children: joins ? text("createAndJoin") : text("createYourAccount")
|
|
67
68
|
})
|
|
68
69
|
]
|
|
69
70
|
});
|
|
@@ -79,61 +80,59 @@ const InvitationPage = ({ token, onDone, signIn }) => {
|
|
|
79
80
|
const [invalid, setInvalid] = useState();
|
|
80
81
|
const { busy, error, run } = useAction();
|
|
81
82
|
useEffect(() => {
|
|
82
|
-
session.organizations.invitation(token).then(setPreview, (failure) => setInvalid(failure instanceof AuthError ? authMessage(failure) : "
|
|
83
|
+
session.organizations.invitation(token).then(setPreview, (failure) => setInvalid(failure instanceof AuthError ? authMessage(failure) : text("invalidLink")));
|
|
83
84
|
}, [session, token]);
|
|
84
85
|
if (invalid) return /* @__PURE__ */ jsx(AuthLayout, {
|
|
85
|
-
title: "
|
|
86
|
+
title: text("invitation"),
|
|
86
87
|
description: invalid,
|
|
87
88
|
children: /* @__PURE__ */ jsx(Button, {
|
|
88
89
|
className: "w-full",
|
|
89
90
|
onClick: onDone,
|
|
90
|
-
children: "
|
|
91
|
+
children: text("goToApp")
|
|
91
92
|
})
|
|
92
93
|
});
|
|
93
94
|
if (!preview) return /* @__PURE__ */ jsx(AuthLayout, {
|
|
94
|
-
title: "
|
|
95
|
+
title: text("invitation"),
|
|
95
96
|
children: /* @__PURE__ */ jsxs("div", {
|
|
96
97
|
className: "flex items-center justify-center gap-2 text-muted-foreground",
|
|
97
|
-
children: [
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ jsx(Spinner, {}),
|
|
100
|
+
" ",
|
|
101
|
+
text("loading")
|
|
102
|
+
]
|
|
98
103
|
})
|
|
99
104
|
});
|
|
100
105
|
const user = state.kind === "signed-in" ? state.user : void 0;
|
|
101
106
|
const sameAddress = user?.email.toLowerCase() === preview.email.toLowerCase();
|
|
102
107
|
if (!preview.organization) {
|
|
103
108
|
const app = preview.app?.name ?? "";
|
|
104
|
-
const description =
|
|
109
|
+
const description = text("invitesToApp", preview.inviter.name, app);
|
|
105
110
|
return /* @__PURE__ */ jsx(AuthLayout, {
|
|
106
|
-
title:
|
|
111
|
+
title: text("join", app),
|
|
107
112
|
description,
|
|
108
113
|
children: preview.hasAccount ? user && sameAddress ? /* @__PURE__ */ jsx(Button, {
|
|
109
114
|
variant: "primary",
|
|
110
115
|
className: "w-full",
|
|
111
116
|
onClick: onDone,
|
|
112
|
-
children: "
|
|
113
|
-
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */
|
|
117
|
+
children: text("goToApp")
|
|
118
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
114
119
|
className: "mb-3 text-muted-foreground",
|
|
115
|
-
children:
|
|
120
|
+
children: text("hasAccount", preview.email)
|
|
116
121
|
}), user ? /* @__PURE__ */ jsx(Button, {
|
|
117
122
|
className: "w-full",
|
|
118
123
|
onClick: () => void signOut(),
|
|
119
|
-
children: "
|
|
120
|
-
}) : /* @__PURE__ */
|
|
124
|
+
children: text("signOut")
|
|
125
|
+
}) : /* @__PURE__ */ jsx(RouteLink, {
|
|
121
126
|
to: signIn,
|
|
122
127
|
className: cn(buttonClass({ variant: "primary" }), "w-full"),
|
|
123
|
-
children:
|
|
124
|
-
})] }) : user ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */
|
|
128
|
+
children: text("signInAs", preview.email)
|
|
129
|
+
})] }) : user ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("p", {
|
|
125
130
|
className: "mb-3 text-muted-foreground",
|
|
126
|
-
children:
|
|
127
|
-
"This invitation is for ",
|
|
128
|
-
preview.email,
|
|
129
|
-
", and you are signed in as ",
|
|
130
|
-
user.email,
|
|
131
|
-
"."
|
|
132
|
-
]
|
|
131
|
+
children: text("otherAddress", preview.email, user.email)
|
|
133
132
|
}), /* @__PURE__ */ jsx(Button, {
|
|
134
133
|
className: "w-full",
|
|
135
134
|
onClick: () => void signOut(),
|
|
136
|
-
children: "
|
|
135
|
+
children: text("signOutToAccept")
|
|
137
136
|
})] }) : /* @__PURE__ */ jsx(SignUp, {
|
|
138
137
|
token,
|
|
139
138
|
preview,
|
|
@@ -144,27 +143,22 @@ const InvitationPage = ({ token, onDone, signIn }) => {
|
|
|
144
143
|
}
|
|
145
144
|
const organization = preview.organization;
|
|
146
145
|
const roles = preview.appRoles.map((name) => roleLabel(organizations?.roles ?? [], name));
|
|
147
|
-
const
|
|
146
|
+
const role = organizationRoleLabel(preview.role).toLowerCase();
|
|
147
|
+
const description = roles.length > 0 ? text("invitesToWith", preview.inviter.name, organization.name, role, roles.join(", ")) : text("invitesTo", preview.inviter.name, organization.name, role);
|
|
148
148
|
if (user && !sameAddress) return /* @__PURE__ */ jsxs(AuthLayout, {
|
|
149
|
-
title:
|
|
149
|
+
title: text("join", organization.name),
|
|
150
150
|
description,
|
|
151
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
152
152
|
className: "mb-3 text-muted-foreground",
|
|
153
|
-
children:
|
|
154
|
-
"This invitation is for ",
|
|
155
|
-
preview.email,
|
|
156
|
-
", and you are signed in as ",
|
|
157
|
-
user.email,
|
|
158
|
-
"."
|
|
159
|
-
]
|
|
153
|
+
children: text("otherAddress", preview.email, user.email)
|
|
160
154
|
}), /* @__PURE__ */ jsx(Button, {
|
|
161
155
|
className: "w-full",
|
|
162
156
|
onClick: () => void signOut(),
|
|
163
|
-
children: "
|
|
157
|
+
children: text("signOutToAccept")
|
|
164
158
|
})]
|
|
165
159
|
});
|
|
166
160
|
return /* @__PURE__ */ jsx(AuthLayout, {
|
|
167
|
-
title:
|
|
161
|
+
title: text("join", organization.name),
|
|
168
162
|
description,
|
|
169
163
|
children: user ? /* @__PURE__ */ jsxs("div", {
|
|
170
164
|
className: "flex flex-col gap-3",
|
|
@@ -172,7 +166,7 @@ const InvitationPage = ({ token, onDone, signIn }) => {
|
|
|
172
166
|
role: "alert",
|
|
173
167
|
className: "text-xs font-medium text-danger-text",
|
|
174
168
|
children: error
|
|
175
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
176
170
|
variant: "primary",
|
|
177
171
|
className: "w-full",
|
|
178
172
|
loading: busy,
|
|
@@ -180,16 +174,12 @@ const InvitationPage = ({ token, onDone, signIn }) => {
|
|
|
180
174
|
await session.organizations.accept(token);
|
|
181
175
|
onDone();
|
|
182
176
|
}),
|
|
183
|
-
children:
|
|
177
|
+
children: text("join", organization.name)
|
|
184
178
|
})]
|
|
185
|
-
}) : preview.hasAccount ? /* @__PURE__ */
|
|
179
|
+
}) : preview.hasAccount ? /* @__PURE__ */ jsx(RouteLink, {
|
|
186
180
|
to: signIn,
|
|
187
181
|
className: cn(buttonClass({ variant: "primary" }), "w-full"),
|
|
188
|
-
children:
|
|
189
|
-
"Sign in as ",
|
|
190
|
-
preview.email,
|
|
191
|
-
" to join"
|
|
192
|
-
]
|
|
182
|
+
children: text("signInAsToJoin", preview.email)
|
|
193
183
|
}) : /* @__PURE__ */ jsx(SignUp, {
|
|
194
184
|
token,
|
|
195
185
|
preview,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PageHeader } from "../app-shell/page-header.js";
|
|
2
2
|
import { useAuth } from "../auth/auth-provider.js";
|
|
3
3
|
import { AccountSection } from "../account/account-section.js";
|
|
4
|
-
import {
|
|
4
|
+
import { text } from "./messages.js";
|
|
5
|
+
import { grantableRoles, organizationRoleLabel, roleLabel } from "./organization-paths.js";
|
|
5
6
|
import { InviteForm } from "../invitations/invite-form.js";
|
|
6
7
|
import { PendingInvitationRow } from "../invitations/pending-invitation-row.js";
|
|
7
8
|
import { AppRolesPicker } from "./app-roles-picker.js";
|
|
@@ -25,17 +26,17 @@ const InviteToOrganization = ({ current, onSent }) => {
|
|
|
25
26
|
return sent;
|
|
26
27
|
};
|
|
27
28
|
return /* @__PURE__ */ jsx(InviteForm, {
|
|
28
|
-
title: "
|
|
29
|
-
description: "
|
|
29
|
+
title: text("inviteSomeone"),
|
|
30
|
+
description: text("inviteDescription"),
|
|
30
31
|
onInvite: invite,
|
|
31
32
|
beside: /* @__PURE__ */ jsx("select", {
|
|
32
|
-
"aria-label": "
|
|
33
|
+
"aria-label": text("organizationRole"),
|
|
33
34
|
value: role,
|
|
34
35
|
onChange: (event) => setRole(event.target.value),
|
|
35
36
|
className: "h-8 rounded-md border border-border-strong bg-background px-2",
|
|
36
37
|
children: assignableOrganizationRoles(current).map((option) => /* @__PURE__ */ jsx("option", {
|
|
37
38
|
value: option,
|
|
38
|
-
children:
|
|
39
|
+
children: organizationRoleLabel(option)
|
|
39
40
|
}, option))
|
|
40
41
|
}),
|
|
41
42
|
children: /* @__PURE__ */ jsx(AppRolesPicker, {
|
|
@@ -51,7 +52,7 @@ const PendingRow = ({ invitation, organizationId, onChanged }) => {
|
|
|
51
52
|
const appRoles = invitation.appRoles.map((name) => roleLabel(organizations?.roles ?? [], name));
|
|
52
53
|
return /* @__PURE__ */ jsx(PendingInvitationRow, {
|
|
53
54
|
email: invitation.email,
|
|
54
|
-
gives: `${
|
|
55
|
+
gives: `${organizationRoleLabel(invitation.role)}${appRoles.length > 0 ? ` · ${appRoles.join(", ")}` : ""}`,
|
|
55
56
|
expiresAt: invitation.expiresAt,
|
|
56
57
|
onResend: async () => {
|
|
57
58
|
const sent = await session.organizations.resend(organizationId, invitation);
|
|
@@ -78,16 +79,16 @@ const InvitationsPage = ({ current }) => {
|
|
|
78
79
|
className: "mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6",
|
|
79
80
|
children: [
|
|
80
81
|
/* @__PURE__ */ jsx(PageHeader, {
|
|
81
|
-
title: "
|
|
82
|
-
subtitle:
|
|
82
|
+
title: text("invitations"),
|
|
83
|
+
subtitle: text("peopleInvited", current.organization.name)
|
|
83
84
|
}),
|
|
84
85
|
/* @__PURE__ */ jsx(InviteToOrganization, {
|
|
85
86
|
current,
|
|
86
87
|
onSent: load
|
|
87
88
|
}),
|
|
88
89
|
/* @__PURE__ */ jsx(AccountSection, {
|
|
89
|
-
title: "
|
|
90
|
-
description: invitations.length > 0 ? "
|
|
90
|
+
title: text("notAcceptedYet"),
|
|
91
|
+
description: invitations.length > 0 ? text("sendingAgain") : text("nobodyWaiting"),
|
|
91
92
|
children: invitations.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
92
93
|
className: "divide-y rounded-md border",
|
|
93
94
|
children: invitations.map((invitation) => /* @__PURE__ */ jsx(PendingRow, {
|
|
@@ -4,7 +4,8 @@ import { authMessage } from "../auth/auth-messages.js";
|
|
|
4
4
|
import { useAuth } from "../auth/auth-provider.js";
|
|
5
5
|
import { Button } from "../primitives/button.js";
|
|
6
6
|
import { AccountSection, SectionError } from "../account/account-section.js";
|
|
7
|
-
import {
|
|
7
|
+
import { text } from "./messages.js";
|
|
8
|
+
import { grantableRoles, organizationRoleLabel } from "./organization-paths.js";
|
|
8
9
|
import { useAction } from "./use-action.js";
|
|
9
10
|
import { AppRolesPicker } from "./app-roles-picker.js";
|
|
10
11
|
import { PersonRow } from "../people/person-row.js";
|
|
@@ -33,7 +34,7 @@ const MemberRow = ({ member, current, onChanged }) => {
|
|
|
33
34
|
self,
|
|
34
35
|
error,
|
|
35
36
|
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("select", {
|
|
36
|
-
"aria-label":
|
|
37
|
+
"aria-label": text("roleOf", member.name),
|
|
37
38
|
value: member.role,
|
|
38
39
|
disabled: busy || roleLocked,
|
|
39
40
|
onChange: (event) => void run(async () => {
|
|
@@ -43,7 +44,7 @@ const MemberRow = ({ member, current, onChanged }) => {
|
|
|
43
44
|
className: "h-7 rounded-md border border-border-strong bg-background px-2 text-xs",
|
|
44
45
|
children: (roleLocked ? [member.role] : organizationRoles).map((role) => /* @__PURE__ */ jsx("option", {
|
|
45
46
|
value: role,
|
|
46
|
-
children:
|
|
47
|
+
children: organizationRoleLabel(role)
|
|
47
48
|
}, role))
|
|
48
49
|
}), !self && /* @__PURE__ */ jsx(Button, {
|
|
49
50
|
size: "sm",
|
|
@@ -54,7 +55,7 @@ const MemberRow = ({ member, current, onChanged }) => {
|
|
|
54
55
|
await session.organizations.removeMember(organizationId, member.id);
|
|
55
56
|
onChanged();
|
|
56
57
|
}),
|
|
57
|
-
children: "
|
|
58
|
+
children: text("remove")
|
|
58
59
|
})] }),
|
|
59
60
|
children: /* @__PURE__ */ jsx(AppRolesPicker, {
|
|
60
61
|
roles: membershipRoles,
|
|
@@ -78,18 +79,18 @@ const MembersPage = ({ current }) => {
|
|
|
78
79
|
const [error, setError] = useState();
|
|
79
80
|
const organizationId = current?.organization?.id;
|
|
80
81
|
const load = useCallback(() => {
|
|
81
|
-
if (organizationId) session.organizations.members(organizationId).then(setMembers, (failure) => setError(failure instanceof AuthError ? authMessage(failure) : "
|
|
82
|
+
if (organizationId) session.organizations.members(organizationId).then(setMembers, (failure) => setError(failure instanceof AuthError ? authMessage(failure) : text("couldNotReadMembers")));
|
|
82
83
|
}, [session, organizationId]);
|
|
83
84
|
useEffect(load, [load]);
|
|
84
85
|
if (!current?.organization) return null;
|
|
85
86
|
return /* @__PURE__ */ jsxs("div", {
|
|
86
87
|
className: "mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6",
|
|
87
88
|
children: [/* @__PURE__ */ jsx(PageHeader, {
|
|
88
|
-
title: "
|
|
89
|
-
subtitle:
|
|
89
|
+
title: text("members"),
|
|
90
|
+
subtitle: text("whoWorks", current.organization.name)
|
|
90
91
|
}), /* @__PURE__ */ jsxs(AccountSection, {
|
|
91
|
-
title: "
|
|
92
|
-
description: "
|
|
92
|
+
title: text("members"),
|
|
93
|
+
description: text("membersDescription"),
|
|
93
94
|
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), members ? /* @__PURE__ */ jsx("ul", {
|
|
94
95
|
className: "divide-y rounded-md border",
|
|
95
96
|
children: members.map((member) => /* @__PURE__ */ jsx(MemberRow, {
|
|
@@ -99,7 +100,11 @@ const MembersPage = ({ current }) => {
|
|
|
99
100
|
}, `${member.id}/${member.role}/${member.appRoles.join()}`))
|
|
100
101
|
}) : !error && /* @__PURE__ */ jsxs("div", {
|
|
101
102
|
className: "flex items-center gap-2 text-muted-foreground",
|
|
102
|
-
children: [
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx(Spinner, {}),
|
|
105
|
+
" ",
|
|
106
|
+
text("loading")
|
|
107
|
+
]
|
|
103
108
|
})]
|
|
104
109
|
})]
|
|
105
110
|
});
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { defineMessages } from "../locale/messages.js";
|
|
2
|
+
//#region src/organizations/messages.ts
|
|
3
|
+
const text = defineMessages({
|
|
4
|
+
en: {
|
|
5
|
+
organizations: "Organizations",
|
|
6
|
+
organization: "Organization",
|
|
7
|
+
members: "Members",
|
|
8
|
+
invitations: "Invitations",
|
|
9
|
+
owner: "Owner",
|
|
10
|
+
admin: "Admin",
|
|
11
|
+
member: "Member",
|
|
12
|
+
loading: "Loading",
|
|
13
|
+
name: "Name",
|
|
14
|
+
slug: "Slug",
|
|
15
|
+
save: "Save",
|
|
16
|
+
cancel: "Cancel",
|
|
17
|
+
delete: "Delete",
|
|
18
|
+
remove: "Remove",
|
|
19
|
+
create: "Create",
|
|
20
|
+
current: "Current",
|
|
21
|
+
open: "Open",
|
|
22
|
+
allOrganizations: "All organizations",
|
|
23
|
+
allOrganizationsDescription: "Every organization in the app. Your global roles let you work in any of them, with what those roles allow there. Opening one you are not a member of is written to the audit log.",
|
|
24
|
+
findOrganization: "Find an organization",
|
|
25
|
+
nameOrSlug: "Name or slug",
|
|
26
|
+
cannotChangeRole: "You cannot give or take away this role",
|
|
27
|
+
makeAccountToJoin: (email) => `Make your account for ${email} to join.`,
|
|
28
|
+
makeAccount: (email) => `Make your account for ${email}.`,
|
|
29
|
+
yourName: "Your name",
|
|
30
|
+
password: "Password",
|
|
31
|
+
passwordOptional: (length) => `Password (optional, ${length}+ characters)`,
|
|
32
|
+
passwordRequired: (length) => `Password (${length}+ characters)`,
|
|
33
|
+
createAndJoin: "Create account and join",
|
|
34
|
+
createYourAccount: "Create your account",
|
|
35
|
+
invalidLink: "This invitation link is not valid",
|
|
36
|
+
invitation: "Invitation",
|
|
37
|
+
goToApp: "Go to the app",
|
|
38
|
+
invitesToApp: (inviter, app) => `${inviter} invites you to join ${app}.`,
|
|
39
|
+
invitesTo: (inviter, organization, role) => `${inviter} invites you to ${organization} as ${role}.`,
|
|
40
|
+
invitesToWith: (inviter, organization, role, roles) => `${inviter} invites you to ${organization} as ${role}, with ${roles}.`,
|
|
41
|
+
join: (name) => `Join ${name}`,
|
|
42
|
+
hasAccount: (email) => `${email} has an account already: sign in with it.`,
|
|
43
|
+
signOut: "Sign out",
|
|
44
|
+
signInAs: (email) => `Sign in as ${email}`,
|
|
45
|
+
signInAsToJoin: (email) => `Sign in as ${email} to join`,
|
|
46
|
+
otherAddress: (invited, signedIn) => `This invitation is for ${invited}, and you are signed in as ${signedIn}.`,
|
|
47
|
+
signOutToAccept: "Sign out to accept it",
|
|
48
|
+
inviteSomeone: "Invite someone",
|
|
49
|
+
inviteDescription: "They get an email with a link to join, or to make an account first. You can give the app roles you hold, and those your roles grant.",
|
|
50
|
+
organizationRole: "Organization role",
|
|
51
|
+
peopleInvited: (organization) => `People invited to ${organization}.`,
|
|
52
|
+
notAcceptedYet: "Not accepted yet",
|
|
53
|
+
sendingAgain: "Sending again gives a new link, which replaces the earlier one.",
|
|
54
|
+
nobodyWaiting: "Nobody is waiting.",
|
|
55
|
+
roleOf: (name) => `Organization role of ${name}`,
|
|
56
|
+
couldNotReadMembers: "Could not read the members",
|
|
57
|
+
whoWorks: (organization) => `Who works in ${organization}, and with which roles.`,
|
|
58
|
+
membersDescription: "Owners and admins manage the organization; app roles decide what each member sees and does in the app.",
|
|
59
|
+
details: "Details",
|
|
60
|
+
detailsEditable: "The name people see, and the slug that names it in links.",
|
|
61
|
+
detailsReadOnly: "Owners and admins can change these.",
|
|
62
|
+
handOver: "Hand over",
|
|
63
|
+
handOverDescription: "Make another member the owner. You stay as an admin.",
|
|
64
|
+
newOwner: "New owner",
|
|
65
|
+
chooseMember: "Choose a member",
|
|
66
|
+
deleteOrganization: "Delete organization",
|
|
67
|
+
deleteDescription: "Takes the organization and its members and invitations away. Its records must be deleted first.",
|
|
68
|
+
deleteTitle: (name) => `Delete ${name}?`,
|
|
69
|
+
deleteConfirm: "Type its name to confirm. This cannot be undone.",
|
|
70
|
+
organizationName: "Organization name",
|
|
71
|
+
leave: "Leave",
|
|
72
|
+
leaveOwner: "An organization keeps an owner: hand it over before you leave, unless it has another owner.",
|
|
73
|
+
leaveMember: "You stop being a member, and lose your roles here.",
|
|
74
|
+
leaveName: (name) => `Leave ${name}`,
|
|
75
|
+
noOrganization: "You do not work in an organization now. Choose one under Organizations.",
|
|
76
|
+
youAre: (role) => `You are ${role} here.`,
|
|
77
|
+
throughGlobalRoles: "You work here through your global roles, without being a member.",
|
|
78
|
+
newOrganization: "New organization",
|
|
79
|
+
newOrganizationDescription: "You become its owner, with every role, and work in it once it is made.",
|
|
80
|
+
invitationsForYou: "Invitations for you",
|
|
81
|
+
invitationsForYouDescription: "Open the link in the invitation email to accept one.",
|
|
82
|
+
anOrganization: "An organization",
|
|
83
|
+
noAppRoles: "no app roles",
|
|
84
|
+
until: (date) => `Until ${date}`,
|
|
85
|
+
organizationsSubtitle: "You work in one organization at a time; what you see follows from your roles there.",
|
|
86
|
+
yourOrganizations: "Your organizations",
|
|
87
|
+
memberOf: "The organizations you are a member of.",
|
|
88
|
+
notMember: "You are not a member of an organization yet.",
|
|
89
|
+
couldNotReadOrganizations: "Could not read your organizations"
|
|
90
|
+
},
|
|
91
|
+
nl: {
|
|
92
|
+
organizations: "Organisaties",
|
|
93
|
+
organization: "Organisatie",
|
|
94
|
+
members: "Leden",
|
|
95
|
+
invitations: "Uitnodigingen",
|
|
96
|
+
owner: "Eigenaar",
|
|
97
|
+
admin: "Beheerder",
|
|
98
|
+
member: "Lid",
|
|
99
|
+
loading: "Laden",
|
|
100
|
+
name: "Naam",
|
|
101
|
+
slug: "Slug",
|
|
102
|
+
save: "Bewaren",
|
|
103
|
+
cancel: "Annuleren",
|
|
104
|
+
delete: "Verwijderen",
|
|
105
|
+
remove: "Verwijderen",
|
|
106
|
+
create: "Maken",
|
|
107
|
+
current: "Huidige",
|
|
108
|
+
open: "Openen",
|
|
109
|
+
allOrganizations: "Alle organisaties",
|
|
110
|
+
allOrganizationsDescription: "Elke organisatie in de app. Met je globale rollen kun je in elk ervan werken, met wat die rollen daar toestaan. Wie er een opent waar die geen lid van is, komt in het auditlogboek.",
|
|
111
|
+
findOrganization: "Een organisatie zoeken",
|
|
112
|
+
nameOrSlug: "Naam of slug",
|
|
113
|
+
cannotChangeRole: "Je kunt deze rol niet geven of afnemen",
|
|
114
|
+
makeAccountToJoin: (email) => `Maak je account voor ${email} om lid te worden.`,
|
|
115
|
+
makeAccount: (email) => `Maak je account voor ${email}.`,
|
|
116
|
+
yourName: "Je naam",
|
|
117
|
+
password: "Wachtwoord",
|
|
118
|
+
passwordOptional: (length) => `Wachtwoord (optioneel, ${length}+ tekens)`,
|
|
119
|
+
passwordRequired: (length) => `Wachtwoord (${length}+ tekens)`,
|
|
120
|
+
createAndJoin: "Account maken en lid worden",
|
|
121
|
+
createYourAccount: "Je account maken",
|
|
122
|
+
invalidLink: "Deze uitnodigingslink is niet geldig",
|
|
123
|
+
invitation: "Uitnodiging",
|
|
124
|
+
goToApp: "Naar de app",
|
|
125
|
+
invitesToApp: (inviter, app) => `${inviter} nodigt je uit voor ${app}.`,
|
|
126
|
+
invitesTo: (inviter, organization, role) => `${inviter} nodigt je uit voor ${organization} als ${role}.`,
|
|
127
|
+
invitesToWith: (inviter, organization, role, roles) => `${inviter} nodigt je uit voor ${organization} als ${role}, met ${roles}.`,
|
|
128
|
+
join: (name) => `Lid worden van ${name}`,
|
|
129
|
+
hasAccount: (email) => `${email} heeft al een account: log daarmee in.`,
|
|
130
|
+
signOut: "Uitloggen",
|
|
131
|
+
signInAs: (email) => `Inloggen als ${email}`,
|
|
132
|
+
signInAsToJoin: (email) => `Inloggen als ${email} om lid te worden`,
|
|
133
|
+
otherAddress: (invited, signedIn) => `Deze uitnodiging is voor ${invited}, en je bent ingelogd als ${signedIn}.`,
|
|
134
|
+
signOutToAccept: "Uitloggen om die te accepteren",
|
|
135
|
+
inviteSomeone: "Iemand uitnodigen",
|
|
136
|
+
inviteDescription: "Die krijgt een e-mail met een link om lid te worden, of om eerst een account te maken. Je kunt de app-rollen geven die je zelf hebt, en die je rollen toekennen.",
|
|
137
|
+
organizationRole: "Rol in de organisatie",
|
|
138
|
+
peopleInvited: (organization) => `Mensen uitgenodigd voor ${organization}.`,
|
|
139
|
+
notAcceptedYet: "Nog niet geaccepteerd",
|
|
140
|
+
sendingAgain: "Opnieuw sturen geeft een nieuwe link, die de vorige vervangt.",
|
|
141
|
+
nobodyWaiting: "Er wacht niemand.",
|
|
142
|
+
roleOf: (name) => `Rol in de organisatie van ${name}`,
|
|
143
|
+
couldNotReadMembers: "Kon de leden niet lezen",
|
|
144
|
+
whoWorks: (organization) => `Wie in ${organization} werkt, en met welke rollen.`,
|
|
145
|
+
membersDescription: "Eigenaren en beheerders beheren de organisatie; app-rollen bepalen wat elk lid in de app ziet en doet.",
|
|
146
|
+
details: "Gegevens",
|
|
147
|
+
detailsEditable: "De naam die mensen zien, en de slug die haar in links noemt.",
|
|
148
|
+
detailsReadOnly: "Eigenaren en beheerders kunnen dit wijzigen.",
|
|
149
|
+
handOver: "Overdragen",
|
|
150
|
+
handOverDescription: "Maak een ander lid eigenaar. Jij blijft beheerder.",
|
|
151
|
+
newOwner: "Nieuwe eigenaar",
|
|
152
|
+
chooseMember: "Kies een lid",
|
|
153
|
+
deleteOrganization: "Organisatie verwijderen",
|
|
154
|
+
deleteDescription: "Verwijdert de organisatie met haar leden en uitnodigingen. Haar records moeten eerst worden verwijderd.",
|
|
155
|
+
deleteTitle: (name) => `${name} verwijderen?`,
|
|
156
|
+
deleteConfirm: "Typ de naam om te bevestigen. Dit kan niet ongedaan worden gemaakt.",
|
|
157
|
+
organizationName: "Naam van de organisatie",
|
|
158
|
+
leave: "Verlaten",
|
|
159
|
+
leaveOwner: "Een organisatie houdt een eigenaar: draag die rol over voordat je vertrekt, tenzij er nog een eigenaar is.",
|
|
160
|
+
leaveMember: "Je bent dan geen lid meer, en verliest je rollen hier.",
|
|
161
|
+
leaveName: (name) => `${name} verlaten`,
|
|
162
|
+
noOrganization: "Je werkt nu niet in een organisatie. Kies er een onder Organisaties.",
|
|
163
|
+
youAre: (role) => `Je bent hier ${role}.`,
|
|
164
|
+
throughGlobalRoles: "Je werkt hier via je globale rollen, zonder lid te zijn.",
|
|
165
|
+
newOrganization: "Nieuwe organisatie",
|
|
166
|
+
newOrganizationDescription: "Je wordt de eigenaar, met elke rol, en werkt erin zodra die is gemaakt.",
|
|
167
|
+
invitationsForYou: "Uitnodigingen voor jou",
|
|
168
|
+
invitationsForYouDescription: "Open de link in de uitnodigingsmail om er een te accepteren.",
|
|
169
|
+
anOrganization: "Een organisatie",
|
|
170
|
+
noAppRoles: "geen app-rollen",
|
|
171
|
+
until: (date) => `Tot ${date}`,
|
|
172
|
+
organizationsSubtitle: "Je werkt in één organisatie tegelijk; wat je ziet volgt uit je rollen daar.",
|
|
173
|
+
yourOrganizations: "Je organisaties",
|
|
174
|
+
memberOf: "De organisaties waar je lid van bent.",
|
|
175
|
+
notMember: "Je bent nog geen lid van een organisatie.",
|
|
176
|
+
couldNotReadOrganizations: "Kon je organisaties niet lezen"
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
//#endregion
|
|
180
|
+
export { text };
|