@protobase/ui 0.25.2 → 0.25.4
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-section.js +1 -1
- 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 +4 -3
- package/dist/account/sign-in-policy-form.js +14 -13
- 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 +19 -18
- package/dist/action-card/action-card.js +2 -1
- package/dist/action-card/field-list.js +1 -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 +7 -6
- 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/timeline-row.js +1 -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/error-banner.js +1 -1
- package/dist/app/export/builder-port.js +2 -1
- package/dist/app/export/export-dialog.js +39 -43
- 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 +21 -37
- 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/field.js +1 -1
- package/dist/app/pages/blocks/modal-form.js +5 -4
- package/dist/app/pages/blocks/progress.js +1 -1
- 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 +13 -20
- package/dist/app-shell/global-search.js +2 -2
- package/dist/app-shell/messages.js +4 -2
- package/dist/app-shell/sidebar-group.js +1 -1
- package/dist/app-shell/sidebar-item.js +1 -1
- package/dist/app-shell/sidebar.js +1 -1
- package/dist/assistant-dock/assistant-dock.js +6 -6
- 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 +4 -3
- 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 +15 -17
- 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 +12 -11
- package/dist/auth/reset-password-page.js +4 -3
- package/dist/auth/setup-required-form.js +8 -10
- package/dist/auth/setup-required-page.js +7 -2
- package/dist/auth/sign-in-form.js +18 -21
- 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 +15 -22
- package/dist/auth/sign-up-email-form.js +9 -8
- package/dist/auth/sign-up-page.js +2 -1
- package/dist/auth/staff-sign-in-form.js +16 -19
- package/dist/auth/two-factor-form.js +19 -18
- 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/data-grid/grid-header.js +1 -1
- package/dist/filter-panel/date-presets.js +1 -1
- package/dist/forms/public-form-page.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 +41 -51
- package/dist/organizations/invitations-page.js +11 -10
- package/dist/organizations/members-page.js +16 -11
- 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/button.js +1 -1
- package/dist/primitives/messages.js +16 -0
- package/dist/primitives/segmented.js +1 -1
- 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/field.js +2 -2
- 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-yCMYvqMX.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-BRkDA5KD.css → index-Bkc7w8I4.css} +1 -1
- package/dist/shell/assets/{index-xY0Mvv6V.js → index-HkjqX_O-.js} +2 -2
- package/dist/shell/assets/maplibre-DUTS_eJM.js +814 -0
- package/dist/shell/assets/{markdown-content-ukDTCu6u.js → markdown-content-CtGUP4W6.js} +1 -1
- package/dist/shell/assets/parse-worker-UhbwEjS0.js +5 -0
- package/dist/shell/assets/preload-helper-BZ3hrQDD.js +1 -0
- package/dist/shell/assets/{record-map-BJmYZ7kQ.js → record-map-DFy7sJEU.js} +1 -1
- package/dist/shell/assets/records-map-MfQEuiFB.js +1 -0
- package/dist/shell/assets/shared-protobase-ui-Bfa59vx6.js +1 -0
- package/dist/shell/index.html +6 -4
- 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-C-OLrsRR.js +0 -69
- package/dist/shell/assets/export-worker-Bz57Pf5g.js +0 -2
- package/dist/shell/assets/maplibre-Dov6nhPX.js +0 -814
- package/dist/shell/assets/parse-worker-BtcY0dQw.js +0 -5
- package/dist/shell/assets/records-map-C1_gDKHR.js +0 -1
- package/dist/shell/assets/shared-protobase-ui-CFYJAbMR.js +0 -1
|
@@ -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 };
|
|
@@ -4,7 +4,8 @@ import { useAuth } from "../auth/auth-provider.js";
|
|
|
4
4
|
import { Button } from "../primitives/button.js";
|
|
5
5
|
import { Dialog } from "../primitives/dialog.js";
|
|
6
6
|
import { AccountSection, SectionError } from "../account/account-section.js";
|
|
7
|
-
import {
|
|
7
|
+
import { text } from "./messages.js";
|
|
8
|
+
import { managesOrganization, organizationRoleLabel } from "./organization-paths.js";
|
|
8
9
|
import { useAction } from "./use-action.js";
|
|
9
10
|
import { reopenIn } from "./use-organizations.js";
|
|
10
11
|
import { useEffect, useState } from "react";
|
|
@@ -17,8 +18,8 @@ const Details = ({ organization, editable, onSaved }) => {
|
|
|
17
18
|
const { busy, error, run } = useAction();
|
|
18
19
|
const changed = name.trim() !== organization.name || slug !== organization.slug;
|
|
19
20
|
return /* @__PURE__ */ jsxs(AccountSection, {
|
|
20
|
-
title: "
|
|
21
|
-
description: editable ? "
|
|
21
|
+
title: text("details"),
|
|
22
|
+
description: editable ? text("detailsEditable") : text("detailsReadOnly"),
|
|
22
23
|
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */ jsxs("form", {
|
|
23
24
|
className: "flex flex-col gap-2 sm:flex-row",
|
|
24
25
|
onSubmit: (event) => {
|
|
@@ -33,14 +34,14 @@ const Details = ({ organization, editable, onSaved }) => {
|
|
|
33
34
|
},
|
|
34
35
|
children: [
|
|
35
36
|
/* @__PURE__ */ jsx(Input, {
|
|
36
|
-
"aria-label": "
|
|
37
|
+
"aria-label": text("name"),
|
|
37
38
|
value: name,
|
|
38
39
|
disabled: !editable,
|
|
39
40
|
onChange: (event) => setName(event.target.value),
|
|
40
41
|
wrapperClassName: "flex-1"
|
|
41
42
|
}),
|
|
42
43
|
/* @__PURE__ */ jsx(Input, {
|
|
43
|
-
"aria-label": "
|
|
44
|
+
"aria-label": text("slug"),
|
|
44
45
|
value: slug,
|
|
45
46
|
disabled: !editable,
|
|
46
47
|
onChange: (event) => setSlug(event.target.value),
|
|
@@ -51,7 +52,7 @@ const Details = ({ organization, editable, onSaved }) => {
|
|
|
51
52
|
variant: "primary",
|
|
52
53
|
loading: busy,
|
|
53
54
|
disabled: !changed || !name.trim(),
|
|
54
|
-
children: "
|
|
55
|
+
children: text("save")
|
|
55
56
|
})
|
|
56
57
|
]
|
|
57
58
|
})]
|
|
@@ -70,18 +71,18 @@ const HandOver = ({ organization, memberId }) => {
|
|
|
70
71
|
memberId
|
|
71
72
|
]);
|
|
72
73
|
return /* @__PURE__ */ jsxs(AccountSection, {
|
|
73
|
-
title: "
|
|
74
|
-
description: "
|
|
74
|
+
title: text("handOver"),
|
|
75
|
+
description: text("handOverDescription"),
|
|
75
76
|
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */ jsxs("div", {
|
|
76
77
|
className: "flex flex-col gap-2 sm:flex-row",
|
|
77
78
|
children: [/* @__PURE__ */ jsxs("select", {
|
|
78
|
-
"aria-label": "
|
|
79
|
+
"aria-label": text("newOwner"),
|
|
79
80
|
value: target,
|
|
80
81
|
onChange: (event) => setTarget(event.target.value),
|
|
81
82
|
className: "h-8 flex-1 rounded-md border border-border-strong bg-background px-2",
|
|
82
83
|
children: [/* @__PURE__ */ jsx("option", {
|
|
83
84
|
value: "",
|
|
84
|
-
children: "
|
|
85
|
+
children: text("chooseMember")
|
|
85
86
|
}), members.map((member) => /* @__PURE__ */ jsxs("option", {
|
|
86
87
|
value: member.id,
|
|
87
88
|
children: [
|
|
@@ -98,7 +99,7 @@ const HandOver = ({ organization, memberId }) => {
|
|
|
98
99
|
await session.organizations.transferOwnership(target);
|
|
99
100
|
window.location.reload();
|
|
100
101
|
}),
|
|
101
|
-
children: "
|
|
102
|
+
children: text("handOver")
|
|
102
103
|
})]
|
|
103
104
|
})]
|
|
104
105
|
});
|
|
@@ -113,31 +114,31 @@ const Delete = ({ organization, basePath }) => {
|
|
|
113
114
|
reopenIn(basePath);
|
|
114
115
|
});
|
|
115
116
|
return /* @__PURE__ */ jsxs(AccountSection, {
|
|
116
|
-
title: "
|
|
117
|
-
description: "
|
|
117
|
+
title: text("deleteOrganization"),
|
|
118
|
+
description: text("deleteDescription"),
|
|
118
119
|
children: [
|
|
119
120
|
/* @__PURE__ */ jsx(SectionError, { message: confirming ? void 0 : error }),
|
|
120
121
|
/* @__PURE__ */ jsx(Button, {
|
|
121
122
|
variant: "danger",
|
|
122
123
|
onClick: () => setConfirming(true),
|
|
123
|
-
children: "
|
|
124
|
+
children: text("deleteOrganization")
|
|
124
125
|
}),
|
|
125
126
|
confirming && /* @__PURE__ */ jsxs(Dialog, {
|
|
126
|
-
title:
|
|
127
|
-
description: "
|
|
127
|
+
title: text("deleteTitle", organization.name),
|
|
128
|
+
description: text("deleteConfirm"),
|
|
128
129
|
onClose: () => setConfirming(false),
|
|
129
130
|
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
130
131
|
onClick: () => setConfirming(false),
|
|
131
|
-
children: "
|
|
132
|
+
children: text("cancel")
|
|
132
133
|
}), /* @__PURE__ */ jsx(Button, {
|
|
133
134
|
variant: "danger",
|
|
134
135
|
loading: busy,
|
|
135
136
|
disabled: typed !== organization.name,
|
|
136
137
|
onClick: () => void remove(),
|
|
137
|
-
children: "
|
|
138
|
+
children: text("delete")
|
|
138
139
|
})] }),
|
|
139
140
|
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */ jsx(Input, {
|
|
140
|
-
"aria-label": "
|
|
141
|
+
"aria-label": text("organizationName"),
|
|
141
142
|
value: typed,
|
|
142
143
|
onChange: (event) => setTyped(event.target.value)
|
|
143
144
|
})]
|
|
@@ -149,15 +150,15 @@ const Leave = ({ organization, basePath, owner }) => {
|
|
|
149
150
|
const { session } = useAuth();
|
|
150
151
|
const { busy, error, run } = useAction();
|
|
151
152
|
return /* @__PURE__ */ jsxs(AccountSection, {
|
|
152
|
-
title: "
|
|
153
|
-
description: owner ? "
|
|
154
|
-
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */
|
|
153
|
+
title: text("leave"),
|
|
154
|
+
description: owner ? text("leaveOwner") : text("leaveMember"),
|
|
155
|
+
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */ jsx(Button, {
|
|
155
156
|
loading: busy,
|
|
156
157
|
onClick: () => void run(async () => {
|
|
157
158
|
await session.organizations.leave(organization.id);
|
|
158
159
|
reopenIn(basePath);
|
|
159
160
|
}),
|
|
160
|
-
children:
|
|
161
|
+
children: text("leaveName", organization.name)
|
|
161
162
|
})]
|
|
162
163
|
});
|
|
163
164
|
};
|
|
@@ -167,8 +168,8 @@ const OrganizationPage = ({ current, basePath, onChanged }) => {
|
|
|
167
168
|
if (!organization) return /* @__PURE__ */ jsx("div", {
|
|
168
169
|
className: "mx-auto w-full max-w-3xl px-4 py-6 md:px-6",
|
|
169
170
|
children: /* @__PURE__ */ jsx(PageHeader, {
|
|
170
|
-
title: "
|
|
171
|
-
subtitle: "
|
|
171
|
+
title: text("organization"),
|
|
172
|
+
subtitle: text("noOrganization")
|
|
172
173
|
})
|
|
173
174
|
});
|
|
174
175
|
const owner = current.role === "owner";
|
|
@@ -177,7 +178,7 @@ const OrganizationPage = ({ current, basePath, onChanged }) => {
|
|
|
177
178
|
children: [
|
|
178
179
|
/* @__PURE__ */ jsx(PageHeader, {
|
|
179
180
|
title: organization.name,
|
|
180
|
-
subtitle: current.role ?
|
|
181
|
+
subtitle: current.role ? text("youAre", organizationRoleLabel(current.role).toLowerCase()) : text("throughGlobalRoles")
|
|
181
182
|
}),
|
|
182
183
|
/* @__PURE__ */ jsx(Details, {
|
|
183
184
|
organization,
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import { text } from "./messages.js";
|
|
1
2
|
import { Building2, Mail, Network, Users } from "lucide-react";
|
|
2
3
|
//#region src/organizations/organization-paths.ts
|
|
3
4
|
const organizationsPath = "/-/organizations";
|
|
4
5
|
const organizationPath = "/-/organization";
|
|
5
6
|
const membersPath = "/-/organization/members";
|
|
6
7
|
const invitationsPath = "/-/organization/invitations";
|
|
7
|
-
const
|
|
8
|
-
[organizationsPath]: "
|
|
9
|
-
[organizationPath]: "
|
|
10
|
-
[membersPath]: "
|
|
11
|
-
[invitationsPath]: "
|
|
8
|
+
const pageTitles = {
|
|
9
|
+
[organizationsPath]: "organizations",
|
|
10
|
+
[organizationPath]: "organization",
|
|
11
|
+
[membersPath]: "members",
|
|
12
|
+
[invitationsPath]: "invitations"
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/** The title of the organization page at `path`; undefined for any other path. */
|
|
15
|
+
const organizationPageTitle = (path) => {
|
|
16
|
+
const id = pageTitles[path];
|
|
17
|
+
return id && text(id);
|
|
17
18
|
};
|
|
19
|
+
/** The word for an organization role. */
|
|
20
|
+
const organizationRoleLabel = (role) => text(role);
|
|
18
21
|
/** The label of an app role, as the server names it. */
|
|
19
22
|
const roleLabel = (roles, name) => roles.find((role) => role.name === name)?.label ?? name;
|
|
20
23
|
/** Whether the person manages the current organization: its owners and admins. */
|
|
@@ -32,9 +35,9 @@ const organizationMenuItems = (basePath, path, current) => {
|
|
|
32
35
|
active: path === target
|
|
33
36
|
});
|
|
34
37
|
return [
|
|
35
|
-
item("organizations", "
|
|
36
|
-
...current?.organization ? [item("organization", "
|
|
37
|
-
...managesOrganization(current) ? [item("members", "
|
|
38
|
+
item("organizations", text("organizations"), Network, organizationsPath),
|
|
39
|
+
...current?.organization ? [item("organization", text("organization"), Building2, organizationPath)] : [],
|
|
40
|
+
...managesOrganization(current) ? [item("members", text("members"), Users, membersPath), item("invitations", text("invitations"), Mail, invitationsPath)] : []
|
|
38
41
|
];
|
|
39
42
|
};
|
|
40
43
|
/** The app roles someone may give or take away: those they hold, those their roles grant, and every one for a superuser. */
|
|
@@ -46,4 +49,4 @@ const grantableRoles = (roles, current) => {
|
|
|
46
49
|
return new Set([...held, ...granted].filter((name) => membership.includes(name)));
|
|
47
50
|
};
|
|
48
51
|
//#endregion
|
|
49
|
-
export { grantableRoles, invitationsPath, managesOrganization, membersPath, organizationMenuItems,
|
|
52
|
+
export { grantableRoles, invitationsPath, managesOrganization, membersPath, organizationMenuItems, organizationPageTitle, organizationPath, organizationRoleLabel, organizationsPath, roleLabel };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Badge } from "../primitives/badge.js";
|
|
2
2
|
import { Button } from "../primitives/button.js";
|
|
3
|
+
import { text } from "./messages.js";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/organizations/organization-row.tsx
|
|
5
6
|
/** An organization with Open, or a Current badge when the person works in it. */
|
|
@@ -16,12 +17,12 @@ const OrganizationRow = ({ organization, current, busy, onOpen }) => /* @__PURE_
|
|
|
16
17
|
})]
|
|
17
18
|
}), current ? /* @__PURE__ */ jsx(Badge, {
|
|
18
19
|
tone: "green",
|
|
19
|
-
children: "
|
|
20
|
+
children: text("current")
|
|
20
21
|
}) : /* @__PURE__ */ jsx(Button, {
|
|
21
22
|
size: "sm",
|
|
22
23
|
loading: busy,
|
|
23
24
|
onClick: onOpen,
|
|
24
|
-
children: "
|
|
25
|
+
children: text("open")
|
|
25
26
|
})]
|
|
26
27
|
});
|
|
27
28
|
//#endregion
|
|
@@ -4,6 +4,7 @@ import { PageHeader } from "../app-shell/page-header.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 { text } from "./messages.js";
|
|
7
8
|
import { roleLabel } from "./organization-paths.js";
|
|
8
9
|
import { useAction } from "./use-action.js";
|
|
9
10
|
import { isAdmin } from "../auth/user-to-shell.js";
|
|
@@ -28,8 +29,8 @@ const NewOrganization = ({ basePath }) => {
|
|
|
28
29
|
reopenIn(basePath);
|
|
29
30
|
});
|
|
30
31
|
return /* @__PURE__ */ jsxs(AccountSection, {
|
|
31
|
-
title: "
|
|
32
|
-
description: "
|
|
32
|
+
title: text("newOrganization"),
|
|
33
|
+
description: text("newOrganizationDescription"),
|
|
33
34
|
children: [/* @__PURE__ */ jsx(SectionError, { message: error }), /* @__PURE__ */ jsxs("form", {
|
|
34
35
|
className: "flex flex-col gap-2 sm:flex-row",
|
|
35
36
|
onSubmit: (event) => {
|
|
@@ -38,14 +39,14 @@ const NewOrganization = ({ basePath }) => {
|
|
|
38
39
|
},
|
|
39
40
|
children: [
|
|
40
41
|
/* @__PURE__ */ jsx(Input, {
|
|
41
|
-
"aria-label": "
|
|
42
|
-
placeholder: "
|
|
42
|
+
"aria-label": text("name"),
|
|
43
|
+
placeholder: text("name"),
|
|
43
44
|
value: name,
|
|
44
45
|
onChange: (event) => setName(event.target.value),
|
|
45
46
|
wrapperClassName: "flex-1"
|
|
46
47
|
}),
|
|
47
48
|
/* @__PURE__ */ jsx(Input, {
|
|
48
|
-
"aria-label": "
|
|
49
|
+
"aria-label": text("slug"),
|
|
49
50
|
placeholder: "slug",
|
|
50
51
|
value: slug ?? slugOf(name),
|
|
51
52
|
onChange: (event) => setSlug(event.target.value),
|
|
@@ -56,7 +57,7 @@ const NewOrganization = ({ basePath }) => {
|
|
|
56
57
|
variant: "primary",
|
|
57
58
|
loading: busy,
|
|
58
59
|
disabled: !name.trim(),
|
|
59
|
-
children: "
|
|
60
|
+
children: text("create")
|
|
60
61
|
})
|
|
61
62
|
]
|
|
62
63
|
})]
|
|
@@ -71,8 +72,8 @@ const YourInvitations = () => {
|
|
|
71
72
|
if (invitations.length === 0) return null;
|
|
72
73
|
const roles = organizations?.roles ?? [];
|
|
73
74
|
return /* @__PURE__ */ jsx(AccountSection, {
|
|
74
|
-
title: "
|
|
75
|
-
description: "
|
|
75
|
+
title: text("invitationsForYou"),
|
|
76
|
+
description: text("invitationsForYouDescription"),
|
|
76
77
|
children: /* @__PURE__ */ jsx("ul", {
|
|
77
78
|
className: "divide-y rounded-md border",
|
|
78
79
|
children: invitations.map((invitation) => /* @__PURE__ */ jsxs("li", {
|
|
@@ -80,13 +81,13 @@ const YourInvitations = () => {
|
|
|
80
81
|
children: [
|
|
81
82
|
/* @__PURE__ */ jsx("span", {
|
|
82
83
|
className: "font-medium",
|
|
83
|
-
children: invitation.organizationName ?? "
|
|
84
|
+
children: invitation.organizationName ?? text("anOrganization")
|
|
84
85
|
}),
|
|
85
86
|
": ",
|
|
86
|
-
invitation.appRoles.map((name) => roleLabel(roles, name)).join(", ") || "
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
invitation.appRoles.map((name) => roleLabel(roles, name)).join(", ") || text("noAppRoles"),
|
|
88
|
+
/* @__PURE__ */ jsx("span", {
|
|
88
89
|
className: "block text-xs text-muted-foreground",
|
|
89
|
-
children:
|
|
90
|
+
children: text("until", new Date(invitation.expiresAt).toLocaleDateString(formatTag()))
|
|
90
91
|
})
|
|
91
92
|
]
|
|
92
93
|
}, invitation.id))
|
|
@@ -107,12 +108,12 @@ const OrganizationsPage = ({ state, basePath }) => {
|
|
|
107
108
|
className: "mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6",
|
|
108
109
|
children: [
|
|
109
110
|
/* @__PURE__ */ jsx(PageHeader, {
|
|
110
|
-
title: "
|
|
111
|
-
subtitle: "
|
|
111
|
+
title: text("organizations"),
|
|
112
|
+
subtitle: text("organizationsSubtitle")
|
|
112
113
|
}),
|
|
113
114
|
/* @__PURE__ */ jsxs(AccountSection, {
|
|
114
|
-
title: "
|
|
115
|
-
description: state.organizations.length > 0 ? "
|
|
115
|
+
title: text("yourOrganizations"),
|
|
116
|
+
description: state.organizations.length > 0 ? text("memberOf") : text("notMember"),
|
|
116
117
|
children: [/* @__PURE__ */ jsx(SectionError, { message: error ?? state.error }), state.organizations.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
117
118
|
className: "divide-y rounded-md border",
|
|
118
119
|
children: state.organizations.map((organization) => /* @__PURE__ */ jsx(OrganizationRow, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { authMessage } from "../auth/auth-messages.js";
|
|
2
2
|
import { useAuth } from "../auth/auth-provider.js";
|
|
3
|
+
import { text } from "./messages.js";
|
|
3
4
|
import { useCallback, useEffect, useState } from "react";
|
|
4
5
|
import { AuthError } from "@protobase/client";
|
|
5
6
|
//#region src/organizations/use-organizations.ts
|
|
@@ -16,7 +17,7 @@ const useOrganizations = (enabled) => {
|
|
|
16
17
|
Promise.all([session.organizations.current(), session.organizations.list()]).then(([currentOrganization, list]) => {
|
|
17
18
|
setCurrent(currentOrganization);
|
|
18
19
|
setOrganizations(list);
|
|
19
|
-
}, (failure) => setError(failure instanceof AuthError ? authMessage(failure) : "
|
|
20
|
+
}, (failure) => setError(failure instanceof AuthError ? authMessage(failure) : text("couldNotReadOrganizations")));
|
|
20
21
|
}, [
|
|
21
22
|
enabled,
|
|
22
23
|
session,
|
package/dist/package.js
CHANGED
|
@@ -3,6 +3,7 @@ import { useAuth } from "../auth/auth-provider.js";
|
|
|
3
3
|
import { useRouter } from "../app/router.js";
|
|
4
4
|
import { CustomBoundary } from "../app/pages/custom-boundary.js";
|
|
5
5
|
import { mergePlugins } from "./merge-plugins.js";
|
|
6
|
+
import { text } from "./messages.js";
|
|
6
7
|
import { usePluginSource } from "./plugin-source.js";
|
|
7
8
|
import { usePluginLoads } from "./use-plugin-loads.js";
|
|
8
9
|
import { useCallback, useMemo } from "react";
|
|
@@ -31,7 +32,11 @@ const BeforeSignIn = ({ children }) => {
|
|
|
31
32
|
if (state.kind !== "signed-out" && state.kind !== "visitor") return children;
|
|
32
33
|
if (!settled) return /* @__PURE__ */ jsxs("div", {
|
|
33
34
|
className: "flex h-full min-h-48 items-center justify-center gap-2 text-muted-foreground",
|
|
34
|
-
children: [
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Spinner, {}),
|
|
37
|
+
" ",
|
|
38
|
+
text("loading")
|
|
39
|
+
]
|
|
35
40
|
});
|
|
36
41
|
if (!Around) return children;
|
|
37
42
|
return /* @__PURE__ */ jsx(CustomBoundary, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../app/pages/project-ui.js";
|
|
2
|
-
import { PluginRef } from "@protobase/client";
|
|
3
2
|
import "@protobase/schema/internal";
|
|
3
|
+
import { PluginRef } from "@protobase/client";
|
|
4
4
|
//#region src/plugins/load-plugin.d.ts
|
|
5
5
|
/** What loading a plugin needs from the page: reading its plugin.json, adding its stylesheet and importing its module. */
|
|
6
6
|
export type PluginLoader = {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { text } from "./messages.js";
|
|
1
2
|
import { parseManifest } from "./plugin-manifest.js";
|
|
2
3
|
import { pluginUi } from "./plugin-ui.js";
|
|
3
4
|
import { pluginApi, protobaseVersion } from "./plugin-api.js";
|
|
@@ -45,7 +46,7 @@ const loadPlugin = async (ref, loader, base, host = thisApp) => {
|
|
|
45
46
|
let name;
|
|
46
47
|
try {
|
|
47
48
|
const read = await loader.readJson(url);
|
|
48
|
-
if ("status" in read) return off(
|
|
49
|
+
if ("status" in read) return off(text("answered", read.status));
|
|
49
50
|
const parsed = parseManifest(read.json);
|
|
50
51
|
if ("problem" in parsed) return off(parsed.problem);
|
|
51
52
|
const { manifest } = parsed;
|
|
@@ -66,7 +67,7 @@ const loadPlugin = async (ref, loader, base, host = thisApp) => {
|
|
|
66
67
|
ui: pluginUi(plugin, module)
|
|
67
68
|
};
|
|
68
69
|
} catch (error) {
|
|
69
|
-
return off(
|
|
70
|
+
return off(text("couldNotLoad", describe(error)), name);
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineMessages } from "../locale/messages.js";
|
|
2
|
+
//#region src/plugins/messages.ts
|
|
3
|
+
const text = defineMessages({
|
|
4
|
+
en: {
|
|
5
|
+
loading: "Loading",
|
|
6
|
+
pluginsOff: "Plugins off",
|
|
7
|
+
pluginOff: "The plugin {} is off: {}.",
|
|
8
|
+
dismiss: "Dismiss",
|
|
9
|
+
answered: (status) => `its plugin.json answered ${status}`,
|
|
10
|
+
couldNotLoad: (reason) => `it could not be loaded: ${reason}`,
|
|
11
|
+
notObject: "its plugin.json is not an object",
|
|
12
|
+
noName: "its plugin.json names no plugin",
|
|
13
|
+
noApi: "its plugin.json names no plugin API",
|
|
14
|
+
noVersions: "its plugin.json names no Protobase versions",
|
|
15
|
+
noModule: "its plugin.json names no module",
|
|
16
|
+
badStylesheet: "its plugin.json names a stylesheet that is no URL",
|
|
17
|
+
badVersion: "its plugin.json has a version that is no text"
|
|
18
|
+
},
|
|
19
|
+
nl: {
|
|
20
|
+
loading: "Laden",
|
|
21
|
+
pluginsOff: "Plug-ins uit",
|
|
22
|
+
pluginOff: "De plug-in {} staat uit: {}.",
|
|
23
|
+
dismiss: "Sluiten",
|
|
24
|
+
answered: (status) => `de plugin.json antwoordde ${status}`,
|
|
25
|
+
couldNotLoad: (reason) => `hij kon niet worden geladen: ${reason}`,
|
|
26
|
+
notObject: "de plugin.json is geen object",
|
|
27
|
+
noName: "de plugin.json noemt geen plug-in",
|
|
28
|
+
noApi: "de plugin.json noemt geen plug-in-API",
|
|
29
|
+
noVersions: "de plugin.json noemt geen Protobase-versies",
|
|
30
|
+
noModule: "de plugin.json noemt geen module",
|
|
31
|
+
badStylesheet: "de plugin.json noemt een stylesheet die geen URL is",
|
|
32
|
+
badVersion: "de plugin.json heeft een versie die geen tekst is"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { text };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Spinner } from "../primitives/spinner.js";
|
|
2
2
|
import { mergePlugins } from "./merge-plugins.js";
|
|
3
|
+
import { text } from "./messages.js";
|
|
3
4
|
import { usePluginSource } from "./plugin-source.js";
|
|
4
5
|
import { usePluginLoads } from "./use-plugin-loads.js";
|
|
5
6
|
import { useAdminMeta } from "../app/meta-gate.js";
|
|
@@ -21,7 +22,11 @@ const PluginGate = ({ ui, children }) => {
|
|
|
21
22
|
const merged = useMemo(() => mergePlugins(ui, loads), [ui, loads]);
|
|
22
23
|
if (!settled) return /* @__PURE__ */ jsxs("div", {
|
|
23
24
|
className: "flex h-full min-h-48 items-center justify-center gap-2 text-muted-foreground",
|
|
24
|
-
children: [
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Spinner, {}),
|
|
27
|
+
" ",
|
|
28
|
+
text("loading")
|
|
29
|
+
]
|
|
25
30
|
});
|
|
26
31
|
return /* @__PURE__ */ jsx(ProjectUiContext.Provider, {
|
|
27
32
|
value: merged.ui,
|