@rapidmx/web-client 0.4.0 → 0.6.0
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/README.md +88 -0
- package/apps/admin/audit-log/index.tsx +35 -8
- package/apps/admin/data-requests/index.tsx +480 -485
- package/apps/admin/distribution-lists/[uid].tsx +19 -1
- package/apps/admin/escrow-scopes/[uid].tsx +348 -237
- package/apps/admin/escrow-scopes/new/index.tsx +8 -2
- package/apps/admin/index.tsx +19 -1
- package/apps/admin/ingest-queue/index.tsx +44 -5
- package/apps/admin/mailboxes/[uid].tsx +211 -184
- package/apps/admin/quarantine/index.tsx +46 -14
- package/apps/admin/transport-rules/[uid].tsx +30 -1
- package/apps/admin/transport-rules/_transportRuleConfig.tsx +38 -2
- package/apps/admin/transport-rules/index.tsx +24 -6
- package/apps/admin/transport-rules/new/index.tsx +30 -1
- package/apps/escrow/_layout.tsx +2 -3
- package/apps/escrow/audit-log/index.tsx +196 -168
- package/apps/escrow/matters/[uid].tsx +621 -521
- package/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.tsx +22 -1
- package/apps/shared/components/admin/layout/AdminShell.tsx +28 -9
- package/apps/shared/components/admin/mailboxes/EscrowScopeCard.tsx +152 -0
- package/apps/shared/components/admin/mailboxes/ResourceSettingsCard.tsx +3 -3
- package/apps/shared/components/admin/mailboxes/ShareAccessCard.tsx +55 -11
- package/apps/shared/components/admin/settings/BrandingForm.tsx +15 -4
- package/apps/shared/components/admin/settings/DomainDnsSetup.tsx +18 -7
- package/apps/shared/components/admin/settings/EncryptionPolicyForm.tsx +10 -2
- package/apps/shared/components/admin/settings/MailboxCreateForm.tsx +6 -0
- package/apps/shared/components/admin/settings/MailboxPolicyForm.tsx +45 -12
- package/apps/shared/components/admin/settings/PluginsManager.tsx +1235 -595
- package/apps/shared/components/admin/settings/RetentionPolicyForm.tsx +174 -98
- package/apps/shared/components/admin/setup/EscrowSetupStep.tsx +49 -13
- package/apps/shared/components/admin/setup/SetupWizard.tsx +150 -34
- package/apps/shared/components/admin/signOut.ts +79 -0
- package/apps/shared/components/admin/usePagedList.tsx +129 -0
- package/apps/shared/components/calendar/EventModal.tsx +717 -549
- package/apps/shared/components/calendar/MonthView.tsx +173 -139
- package/apps/shared/components/calendar/RecurrenceEditor.tsx +222 -180
- package/apps/shared/components/calendar/SplitDayView.tsx +143 -137
- package/apps/shared/components/calendar/TimeGridView.tsx +244 -198
- package/apps/shared/components/calendar/allDay.ts +124 -0
- package/apps/shared/components/calendar/layout/CalendarShell.tsx +194 -192
- package/apps/shared/components/contacts/ContactDetailPane.tsx +100 -21
- package/apps/shared/components/contacts/ContactForm.tsx +377 -348
- package/apps/shared/components/contacts/ContactsSidebar.tsx +6 -2
- package/apps/shared/components/contacts/KeyChangeReview.tsx +192 -0
- package/apps/shared/components/contacts/contactKeys.ts +78 -0
- package/apps/shared/components/contacts/layout/ContactsShell.tsx +199 -197
- package/apps/shared/components/escrow/layout/EscrowShell.tsx +148 -134
- package/apps/shared/components/layout/AppShell.tsx +123 -33
- package/apps/shared/components/layout/BrandingChrome.tsx +48 -10
- package/apps/shared/components/layout/KeyEnrollmentGate.tsx +389 -298
- package/apps/shared/components/layout/MailboxProvisioning.tsx +19 -3
- package/apps/shared/components/layout/RecoveryCodeUnlock.tsx +350 -0
- package/apps/shared/components/layout/UnlockPromptProvider.tsx +257 -128
- package/apps/shared/components/mail/ConversationThreadPane.tsx +216 -181
- package/apps/shared/components/mail/MessageDetailPane.tsx +1318 -630
- package/apps/shared/components/mail/compose/ComposeContext.tsx +20 -15
- package/apps/shared/components/mail/compose/ComposeWindow.tsx +854 -132
- package/apps/shared/components/mail/compose/composeFlushRegistry.ts +60 -0
- package/apps/shared/components/mail/layout/MailShell.tsx +420 -408
- package/apps/shared/components/mail/pinnedSigners.ts +124 -0
- package/apps/shared/components/mail/verificationSeals.ts +125 -0
- package/apps/shared/components/mail/writableMailboxes.ts +101 -0
- package/apps/shared/components/rules/RuleBuilder.tsx +311 -276
- package/apps/shared/components/settings/layout/SettingsShell.tsx +23 -9
- package/apps/shared/components/tasks/layout/TasksShell.tsx +201 -199
- package/apps/shared/mail/listAllPages.ts +39 -0
- package/apps/shared/plugins/pluginNav.ts +73 -0
- package/apps/shared/search/LocalIndexLifecycle.tsx +64 -55
- package/apps/shared/search/localIndexBuilder.ts +481 -179
- package/apps/shared/search/localIndexRpcClient.ts +231 -29
- package/apps/shared/search/localIndexSchema.ts +15 -6
- package/apps/shared/search/localIndexStorage.ts +98 -0
- package/apps/shared/search/localIndexVFS.ts +32 -1
- package/apps/shared/search/localIndexWorker.ts +648 -186
- package/apps/www/calendar/index.tsx +438 -417
- package/apps/www/contacts/[uid].tsx +21 -2
- package/apps/www/contacts/index.tsx +116 -12
- package/apps/www/index.tsx +1314 -1041
- package/apps/www/messages/[uid].tsx +18 -6
- package/apps/www/settings/auto-reply/index.tsx +134 -129
- package/apps/www/settings/encryption/index.tsx +739 -216
- package/apps/www/settings/filters/[uid].tsx +171 -155
- package/apps/www/settings/filters/new/index.tsx +8 -1
- package/apps/www/settings/focused-inbox/index.tsx +150 -148
- package/apps/www/settings/privacy/index.tsx +494 -436
- package/apps/www/settings/read-receipts/index.tsx +148 -125
- package/apps/www/settings/sharing/index.tsx +17 -14
- package/apps/www/tasks/index.tsx +638 -579
- package/dist/apps/admin/_404.d.ts +2 -0
- package/dist/apps/admin/_500.d.ts +2 -0
- package/dist/apps/admin/_layout.d.ts +8 -0
- package/dist/apps/admin/audit-log/index.d.ts +11 -0
- package/dist/apps/admin/audit-log/index.js +38 -8
- package/dist/apps/admin/branding/index.d.ts +3 -0
- package/dist/apps/admin/data-requests/index.d.ts +3 -0
- package/dist/apps/admin/data-requests/index.js +52 -72
- package/dist/apps/admin/distribution-lists/[uid].d.ts +7 -0
- package/dist/apps/admin/distribution-lists/[uid].js +1 -1
- package/dist/apps/admin/distribution-lists/index.d.ts +3 -0
- package/dist/apps/admin/distribution-lists/new/index.d.ts +3 -0
- package/dist/apps/admin/domains/[uid].d.ts +7 -0
- package/dist/apps/admin/domains/index.d.ts +3 -0
- package/dist/apps/admin/domains/new/index.d.ts +3 -0
- package/dist/apps/admin/encryption-policy/index.d.ts +3 -0
- package/dist/apps/admin/escrow-scopes/[uid].d.ts +21 -0
- package/dist/apps/admin/escrow-scopes/[uid].js +91 -12
- package/dist/apps/admin/escrow-scopes/index.d.ts +3 -0
- package/dist/apps/admin/escrow-scopes/new/index.d.ts +3 -0
- package/dist/apps/admin/escrow-scopes/new/index.js +8 -3
- package/dist/apps/admin/index.d.ts +3 -0
- package/dist/apps/admin/index.js +4 -1
- package/dist/apps/admin/ingest-queue/index.d.ts +4 -0
- package/dist/apps/admin/ingest-queue/index.js +24 -6
- package/dist/apps/admin/mailbox-policy/index.d.ts +3 -0
- package/dist/apps/admin/mailboxes/[uid].d.ts +7 -0
- package/dist/apps/admin/mailboxes/[uid].js +20 -4
- package/dist/apps/admin/mailboxes/new/index.d.ts +3 -0
- package/dist/apps/admin/plugins/index.d.ts +3 -0
- package/dist/apps/admin/quarantine/index.d.ts +6 -0
- package/dist/apps/admin/quarantine/index.js +20 -11
- package/dist/apps/admin/retention-policy/index.d.ts +3 -0
- package/dist/apps/admin/setup/index.d.ts +3 -0
- package/dist/apps/admin/transport-rules/[uid].d.ts +7 -0
- package/dist/apps/admin/transport-rules/[uid].js +18 -2
- package/dist/apps/admin/transport-rules/_transportRuleConfig.d.ts +21 -0
- package/dist/apps/admin/transport-rules/_transportRuleConfig.js +19 -0
- package/dist/apps/admin/transport-rules/index.d.ts +3 -0
- package/dist/apps/admin/transport-rules/index.js +22 -6
- package/dist/apps/admin/transport-rules/new/index.d.ts +3 -0
- package/dist/apps/admin/transport-rules/new/index.js +18 -2
- package/dist/apps/escrow/_layout.d.ts +10 -0
- package/dist/apps/escrow/_layout.js +3 -3
- package/dist/apps/escrow/audit-log/index.d.ts +9 -0
- package/dist/apps/escrow/audit-log/index.js +26 -1
- package/dist/apps/escrow/index.d.ts +3 -0
- package/dist/apps/escrow/matters/[uid].d.ts +7 -0
- package/dist/apps/escrow/matters/[uid].js +77 -42
- package/dist/apps/escrow/matters/new/index.d.ts +3 -0
- package/dist/apps/shared/components/admin/distributionLists/MemberListCard.d.ts +17 -0
- package/dist/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.d.ts +32 -0
- package/dist/apps/shared/components/admin/escrowScopes/EscrowScopeKeyAndHoldersFields.js +11 -2
- package/dist/apps/shared/components/admin/layout/AdminShell.d.ts +32 -0
- package/dist/apps/shared/components/admin/layout/AdminShell.js +15 -6
- package/dist/apps/shared/components/admin/mailboxes/EscrowScopeCard.d.ts +12 -0
- package/dist/apps/shared/components/admin/mailboxes/EscrowScopeCard.js +72 -0
- package/dist/apps/shared/components/admin/mailboxes/MailboxTable.d.ts +6 -0
- package/dist/apps/shared/components/admin/mailboxes/ResourceSettingsCard.d.ts +19 -0
- package/dist/apps/shared/components/admin/mailboxes/ResourceSettingsCard.js +3 -3
- package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.d.ts +12 -0
- package/dist/apps/shared/components/admin/mailboxes/ShareAccessCard.js +22 -4
- package/dist/apps/shared/components/admin/settings/BrandingForm.d.ts +9 -0
- package/dist/apps/shared/components/admin/settings/BrandingForm.js +15 -4
- package/dist/apps/shared/components/admin/settings/DomainDnsSetup.d.ts +12 -0
- package/dist/apps/shared/components/admin/settings/DomainDnsSetup.js +13 -7
- package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.d.ts +12 -0
- package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.js +7 -2
- package/dist/apps/shared/components/admin/settings/LoadedSettingsForm.d.ts +9 -0
- package/dist/apps/shared/components/admin/settings/MailboxCreateForm.d.ts +19 -0
- package/dist/apps/shared/components/admin/settings/MailboxCreateForm.js +6 -0
- package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.d.ts +10 -0
- package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.js +34 -12
- package/dist/apps/shared/components/admin/settings/PluginsManager.d.ts +4 -0
- package/dist/apps/shared/components/admin/settings/PluginsManager.js +390 -78
- package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.d.ts +9 -0
- package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.js +40 -11
- package/dist/apps/shared/components/admin/setup/EscrowSetupStep.d.ts +14 -0
- package/dist/apps/shared/components/admin/setup/EscrowSetupStep.js +29 -13
- package/dist/apps/shared/components/admin/setup/SetupWizard.d.ts +36 -0
- package/dist/apps/shared/components/admin/setup/SetupWizard.js +87 -21
- package/dist/apps/shared/components/admin/signOut.d.ts +23 -0
- package/dist/apps/shared/components/admin/signOut.js +75 -0
- package/dist/apps/shared/components/admin/usePagedList.d.ts +39 -0
- package/dist/apps/shared/components/admin/usePagedList.js +99 -0
- package/dist/apps/shared/components/calendar/CalendarListSidebar.d.ts +26 -0
- package/dist/apps/shared/components/calendar/EventModal.d.ts +46 -0
- package/dist/apps/shared/components/calendar/EventModal.js +142 -21
- package/dist/apps/shared/components/calendar/MonthView.d.ts +15 -0
- package/dist/apps/shared/components/calendar/MonthView.js +12 -5
- package/dist/apps/shared/components/calendar/RecurrenceEditor.d.ts +20 -0
- package/dist/apps/shared/components/calendar/RecurrenceEditor.js +40 -5
- package/dist/apps/shared/components/calendar/ResourcePicker.d.ts +19 -0
- package/dist/apps/shared/components/calendar/SplitDayView.d.ts +28 -0
- package/dist/apps/shared/components/calendar/SplitDayView.js +10 -4
- package/dist/apps/shared/components/calendar/TimeGridView.d.ts +17 -0
- package/dist/apps/shared/components/calendar/TimeGridView.js +23 -7
- package/dist/apps/shared/components/calendar/allDay.d.ts +51 -0
- package/dist/apps/shared/components/calendar/allDay.js +111 -0
- package/dist/apps/shared/components/calendar/layout/CalendarShell.d.ts +40 -0
- package/dist/apps/shared/components/calendar/layout/CalendarShell.js +3 -3
- package/dist/apps/shared/components/contacts/ContactDetailPane.d.ts +23 -0
- package/dist/apps/shared/components/contacts/ContactDetailPane.js +43 -5
- package/dist/apps/shared/components/contacts/ContactForm.d.ts +20 -0
- package/dist/apps/shared/components/contacts/ContactForm.js +32 -10
- package/dist/apps/shared/components/contacts/ContactsSidebar.d.ts +40 -0
- package/dist/apps/shared/components/contacts/ContactsSidebar.js +2 -2
- package/dist/apps/shared/components/contacts/ContactsToolbar.d.ts +25 -0
- package/dist/apps/shared/components/contacts/KeyChangeReview.d.ts +40 -0
- package/dist/apps/shared/components/contacts/KeyChangeReview.js +63 -0
- package/dist/apps/shared/components/contacts/contactKeys.d.ts +29 -0
- package/dist/apps/shared/components/contacts/contactKeys.js +64 -0
- package/dist/apps/shared/components/contacts/layout/ContactsShell.d.ts +21 -0
- package/dist/apps/shared/components/contacts/layout/ContactsShell.js +2 -2
- package/dist/apps/shared/components/escrow/layout/EscrowShell.d.ts +25 -0
- package/dist/apps/shared/components/escrow/layout/EscrowShell.js +24 -5
- package/dist/apps/shared/components/forms/StringListField.d.ts +22 -0
- package/dist/apps/shared/components/layout/AppShell.d.ts +49 -0
- package/dist/apps/shared/components/layout/AppShell.js +97 -26
- package/dist/apps/shared/components/layout/BrandingChrome.d.ts +18 -0
- package/dist/apps/shared/components/layout/BrandingChrome.js +45 -10
- package/dist/apps/shared/components/layout/KeyEnrollmentGate.d.ts +51 -0
- package/dist/apps/shared/components/layout/KeyEnrollmentGate.js +49 -12
- package/dist/apps/shared/components/layout/MailboxProvisioning.d.ts +13 -0
- package/dist/apps/shared/components/layout/MailboxProvisioning.js +10 -2
- package/dist/apps/shared/components/layout/RecoveryCodeUnlock.d.ts +66 -0
- package/dist/apps/shared/components/layout/RecoveryCodeUnlock.js +174 -0
- package/dist/apps/shared/components/layout/UnlockPromptProvider.d.ts +45 -0
- package/dist/apps/shared/components/layout/UnlockPromptProvider.js +73 -14
- package/dist/apps/shared/components/layout/UserMenu.d.ts +23 -0
- package/dist/apps/shared/components/mail/ConversationList.d.ts +11 -0
- package/dist/apps/shared/components/mail/ConversationThreadPane.d.ts +23 -0
- package/dist/apps/shared/components/mail/ConversationThreadPane.js +50 -12
- package/dist/apps/shared/components/mail/MessageDetailPane.d.ts +93 -0
- package/dist/apps/shared/components/mail/MessageDetailPane.js +441 -36
- package/dist/apps/shared/components/mail/compose/ComposeContext.d.ts +58 -0
- package/dist/apps/shared/components/mail/compose/ComposeContext.js +9 -6
- package/dist/apps/shared/components/mail/compose/ComposeToolbar.d.ts +15 -0
- package/dist/apps/shared/components/mail/compose/ComposeWindow.d.ts +37 -0
- package/dist/apps/shared/components/mail/compose/ComposeWindow.js +699 -128
- package/dist/apps/shared/components/mail/compose/EmojiPicker.d.ts +14 -0
- package/dist/apps/shared/components/mail/compose/GifPicker.d.ts +13 -0
- package/dist/apps/shared/components/mail/compose/RichTextEditor.d.ts +34 -0
- package/dist/apps/shared/components/mail/compose/ScheduleSendPicker.d.ts +16 -0
- package/dist/apps/shared/components/mail/compose/composeFlushRegistry.d.ts +27 -0
- package/dist/apps/shared/components/mail/compose/composeFlushRegistry.js +50 -0
- package/dist/apps/shared/components/mail/layout/MailShell.d.ts +57 -0
- package/dist/apps/shared/components/mail/layout/MailShell.js +13 -4
- package/dist/apps/shared/components/mail/pinnedSigners.d.ts +33 -0
- package/dist/apps/shared/components/mail/pinnedSigners.js +98 -0
- package/dist/apps/shared/components/mail/verificationSeals.d.ts +22 -0
- package/dist/apps/shared/components/mail/verificationSeals.js +112 -0
- package/dist/apps/shared/components/mail/writableMailboxes.d.ts +15 -0
- package/dist/apps/shared/components/mail/writableMailboxes.js +87 -0
- package/dist/apps/shared/components/rules/RuleBuilder.d.ts +70 -0
- package/dist/apps/shared/components/rules/RuleBuilder.js +34 -6
- package/dist/apps/shared/components/settings/layout/SettingsShell.d.ts +41 -0
- package/dist/apps/shared/components/settings/layout/SettingsShell.js +19 -9
- package/dist/apps/shared/components/tasks/TasksSidebar.d.ts +41 -0
- package/dist/apps/shared/components/tasks/TasksToolbar.d.ts +14 -0
- package/dist/apps/shared/components/tasks/layout/TasksShell.d.ts +24 -0
- package/dist/apps/shared/components/tasks/layout/TasksShell.js +2 -2
- package/dist/apps/shared/mail/findWellKnownFolderUid.d.ts +5 -0
- package/dist/apps/shared/mail/listAllPages.d.ts +17 -0
- package/dist/apps/shared/mail/listAllPages.js +25 -0
- package/dist/apps/shared/plugins/pluginNav.d.ts +39 -0
- package/dist/apps/shared/plugins/pluginNav.js +33 -0
- package/dist/apps/shared/search/LocalIndexLifecycle.d.ts +13 -0
- package/dist/apps/shared/search/LocalIndexLifecycle.js +58 -54
- package/dist/apps/shared/search/localIndexBlockCipher.d.ts +36 -0
- package/dist/apps/shared/search/localIndexBuilder.d.ts +85 -0
- package/dist/apps/shared/search/localIndexBuilder.js +292 -37
- package/dist/apps/shared/search/localIndexKey.d.ts +4 -0
- package/dist/apps/shared/search/localIndexRpcClient.d.ts +71 -0
- package/dist/apps/shared/search/localIndexRpcClient.js +191 -26
- package/dist/apps/shared/search/localIndexSchema.d.ts +111 -0
- package/dist/apps/shared/search/localIndexSchema.js +12 -6
- package/dist/apps/shared/search/localIndexSizePreference.d.ts +27 -0
- package/dist/apps/shared/search/localIndexStorage.d.ts +28 -0
- package/dist/apps/shared/search/localIndexStorage.js +86 -0
- package/dist/apps/shared/search/localIndexVFS.d.ts +101 -0
- package/dist/apps/shared/search/localIndexVFS.js +68 -40
- package/dist/apps/shared/search/localIndexWorker.d.ts +145 -0
- package/dist/apps/shared/search/localIndexWorker.js +519 -173
- package/dist/apps/shared/search/searchTier2.d.ts +30 -0
- package/dist/apps/www/_404.d.ts +2 -0
- package/dist/apps/www/_500.d.ts +2 -0
- package/dist/apps/www/_layout.d.ts +14 -0
- package/dist/apps/www/calendar/index.d.ts +3 -0
- package/dist/apps/www/calendar/index.js +28 -10
- package/dist/apps/www/contacts/[uid].d.ts +13 -0
- package/dist/apps/www/contacts/[uid].js +13 -2
- package/dist/apps/www/contacts/index.d.ts +3 -0
- package/dist/apps/www/contacts/index.js +80 -10
- package/dist/apps/www/index.d.ts +3 -0
- package/dist/apps/www/index.js +339 -108
- package/dist/apps/www/messages/[uid].d.ts +11 -0
- package/dist/apps/www/messages/[uid].js +18 -6
- package/dist/apps/www/settings/auto-reply/index.d.ts +4 -0
- package/dist/apps/www/settings/auto-reply/index.js +9 -4
- package/dist/apps/www/settings/encryption/index.d.ts +7 -0
- package/dist/apps/www/settings/encryption/index.js +514 -97
- package/dist/apps/www/settings/filters/[uid].d.ts +8 -0
- package/dist/apps/www/settings/filters/[uid].js +22 -7
- package/dist/apps/www/settings/filters/_mailFilterRuleConfig.d.ts +11 -0
- package/dist/apps/www/settings/filters/index.d.ts +4 -0
- package/dist/apps/www/settings/filters/new/index.d.ts +4 -0
- package/dist/apps/www/settings/filters/new/index.js +8 -2
- package/dist/apps/www/settings/focused-inbox/index.d.ts +4 -0
- package/dist/apps/www/settings/focused-inbox/index.js +3 -1
- package/dist/apps/www/settings/labels/index.d.ts +4 -0
- package/dist/apps/www/settings/privacy/index.d.ts +4 -0
- package/dist/apps/www/settings/privacy/index.js +57 -22
- package/dist/apps/www/settings/read-receipts/index.d.ts +4 -0
- package/dist/apps/www/settings/read-receipts/index.js +10 -3
- package/dist/apps/www/settings/sharing/index.d.ts +4 -0
- package/dist/apps/www/settings/sharing/index.js +7 -11
- package/dist/apps/www/settings/signatures/[uid].d.ts +8 -0
- package/dist/apps/www/settings/signatures/index.d.ts +4 -0
- package/dist/apps/www/settings/signatures/new/index.d.ts +4 -0
- package/dist/apps/www/settings/signatures/signatureDefaults.d.ts +10 -0
- package/dist/apps/www/tasks/index.d.ts +3 -0
- package/dist/apps/www/tasks/index.js +50 -10
- package/package.json +3 -3
- package/apps/shared/components/booking/AvailabilityEditor.tsx +0 -118
- package/apps/www/settings/booking-types/[uid].tsx +0 -300
- package/apps/www/settings/booking-types/index.tsx +0 -98
- package/apps/www/settings/booking-types/new/index.tsx +0 -212
- package/dist/apps/shared/components/booking/AvailabilityEditor.js +0 -45
- package/dist/apps/www/settings/booking-types/[uid].js +0 -129
- package/dist/apps/www/settings/booking-types/index.js +0 -29
- package/dist/apps/www/settings/booking-types/new/index.js +0 -86
|
@@ -31,6 +31,8 @@ export interface EscrowScopeKeyAndHoldersFieldsProps {
|
|
|
31
31
|
value: EscrowScopeKeyAndHoldersValue;
|
|
32
32
|
onChange: (value: EscrowScopeKeyAndHoldersValue) => void;
|
|
33
33
|
disabled?: boolean;
|
|
34
|
+
/** Shows the public key fields without letting them be edited, e.g. for keys generated in the browser. */
|
|
35
|
+
keyReadOnly?: boolean;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
/** Builds an all-zeroes starting point for the "new" page — `notBefore`/`notAfter` default to "now" so an
|
|
@@ -49,7 +51,21 @@ export function emptyEscrowScopeKeyAndHoldersValue(): EscrowScopeKeyAndHoldersVa
|
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
/** The message shown when an administrator tries to make themselves a holder: whoever configures a scope must not
|
|
55
|
+
* also be able to approve access under it (separation of duties - the server refuses it too). Holders who were
|
|
56
|
+
* already on the scope (`existingHolderUserUids`) aren't treated as newly added. */
|
|
57
|
+
export function selfAsHolderError(
|
|
58
|
+
holderUserUids: string[],
|
|
59
|
+
adminUid: string | undefined,
|
|
60
|
+
existingHolderUserUids: string[] = [],
|
|
61
|
+
): string | null {
|
|
62
|
+
if (!adminUid || !holderUserUids.includes(adminUid) || existingHolderUserUids.includes(adminUid)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return "You can't add yourself as a holder of an escrow scope you configure. Ask another administrator to add you, or choose different holders.";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default function EscrowScopeKeyAndHoldersFields({ value, onChange, disabled, keyReadOnly }: EscrowScopeKeyAndHoldersFieldsProps) {
|
|
53
69
|
function set<K extends keyof EscrowScopeKeyAndHoldersValue>(key: K, next: EscrowScopeKeyAndHoldersValue[K]) {
|
|
54
70
|
onChange({ ...value, [key]: next });
|
|
55
71
|
}
|
|
@@ -70,6 +86,7 @@ export default function EscrowScopeKeyAndHoldersFields({ value, onChange, disabl
|
|
|
70
86
|
rows={4}
|
|
71
87
|
value={value.publicKey}
|
|
72
88
|
disabled={disabled}
|
|
89
|
+
readOnly={keyReadOnly}
|
|
73
90
|
onChange={(e) => set("publicKey", e.target.value)}
|
|
74
91
|
/>
|
|
75
92
|
</FormField>
|
|
@@ -81,6 +98,7 @@ export default function EscrowScopeKeyAndHoldersFields({ value, onChange, disabl
|
|
|
81
98
|
className={INPUT_CLASS}
|
|
82
99
|
value={value.keyType}
|
|
83
100
|
disabled={disabled}
|
|
101
|
+
readOnly={keyReadOnly}
|
|
84
102
|
onChange={(e) => set("keyType", e.target.value)}
|
|
85
103
|
placeholder="x509"
|
|
86
104
|
/>
|
|
@@ -93,6 +111,7 @@ export default function EscrowScopeKeyAndHoldersFields({ value, onChange, disabl
|
|
|
93
111
|
className={`${INPUT_CLASS} font-mono`}
|
|
94
112
|
value={value.fingerprint}
|
|
95
113
|
disabled={disabled}
|
|
114
|
+
readOnly={keyReadOnly}
|
|
96
115
|
onChange={(e) => set("fingerprint", e.target.value)}
|
|
97
116
|
/>
|
|
98
117
|
</FormField>
|
|
@@ -105,6 +124,7 @@ export default function EscrowScopeKeyAndHoldersFields({ value, onChange, disabl
|
|
|
105
124
|
className={INPUT_CLASS}
|
|
106
125
|
value={value.notBefore}
|
|
107
126
|
disabled={disabled}
|
|
127
|
+
readOnly={keyReadOnly}
|
|
108
128
|
onChange={(e) => set("notBefore", e.target.value)}
|
|
109
129
|
/>
|
|
110
130
|
</FormField>
|
|
@@ -116,6 +136,7 @@ export default function EscrowScopeKeyAndHoldersFields({ value, onChange, disabl
|
|
|
116
136
|
className={INPUT_CLASS}
|
|
117
137
|
value={value.notAfter}
|
|
118
138
|
disabled={disabled}
|
|
139
|
+
readOnly={keyReadOnly}
|
|
119
140
|
onChange={(e) => set("notAfter", e.target.value)}
|
|
120
141
|
/>
|
|
121
142
|
</FormField>
|
|
@@ -29,6 +29,8 @@ import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
|
|
|
29
29
|
import BottomTabBar, { NavItem } from "@rapidmx/react-shared/components/navigation/BottomTabBar.js";
|
|
30
30
|
import { BrandingFooter, BrandingHeader } from "../../layout/BrandingChrome.js";
|
|
31
31
|
import UserMenu from "../../layout/UserMenu.js";
|
|
32
|
+
import { signOutOfConsole } from "../signOut.js";
|
|
33
|
+
import { mergePluginNavItems, PluginNav, PluginNavProps } from "../../../plugins/pluginNav.js";
|
|
32
34
|
|
|
33
35
|
export type AdminSection =
|
|
34
36
|
| "mailboxes"
|
|
@@ -47,9 +49,13 @@ export type AdminSection =
|
|
|
47
49
|
| "plugins"
|
|
48
50
|
| "branding";
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
/** A core `AdminSection`, or a plugin's `adminNav` item id (see `PluginNav`). */
|
|
53
|
+
export type AdminShellActive = AdminSection | (string & {});
|
|
54
|
+
|
|
55
|
+
export interface AdminShellProps extends PluginNavProps {
|
|
56
|
+
/** Which icon in the rail is highlighted as the current section - a plugin admin page passes its own
|
|
57
|
+
* `adminNav` item id. */
|
|
58
|
+
active: AdminShellActive;
|
|
53
59
|
/** Populated automatically by the framework from an authenticated request (e.g. a valid `jwt` cookie). */
|
|
54
60
|
userUid?: string;
|
|
55
61
|
/** auth-server's base URL, injected via the route's `fetchProps` — see `src/mongo/routes/AdminConsoleRoute.ts`. */
|
|
@@ -128,7 +134,18 @@ const MAILBOX_SCOPED_ITEMS: NavItem[] = [
|
|
|
128
134
|
/** The setup wizard - reached by redirect or from the Mailboxes page, not from the rail. */
|
|
129
135
|
const SETUP_ITEM: NavItem = { id: "setup", href: "/admin/setup", label: "Setup", icon: HiOutlineRocketLaunch };
|
|
130
136
|
|
|
131
|
-
const
|
|
137
|
+
const OFF_RAIL_ITEMS: NavItem[] = [...MAILBOX_SCOPED_ITEMS, SETUP_ITEM];
|
|
138
|
+
|
|
139
|
+
/** `NAV_ITEMS` followed by the plugins' `adminNav` items (generic icon). Core ids win, including the
|
|
140
|
+
* off-rail sections' - see `mergePluginNavItems`. */
|
|
141
|
+
export function adminNavItems(pluginNav?: PluginNav): NavItem[] {
|
|
142
|
+
return mergePluginNavItems<NavItem>(
|
|
143
|
+
NAV_ITEMS,
|
|
144
|
+
pluginNav?.adminNav,
|
|
145
|
+
({ id, href, label }) => ({ id, href, label, icon: HiOutlinePuzzlePiece }),
|
|
146
|
+
OFF_RAIL_ITEMS.map((item) => item.id),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
132
149
|
|
|
133
150
|
/**
|
|
134
151
|
* Gates every `apps/admin` page behind the `admin` trusted role. Uses `GET /api/admin/release-notes` (any
|
|
@@ -136,7 +153,7 @@ const ALL_ITEMS: NavItem[] = [...NAV_ITEMS, ...MAILBOX_SCOPED_ITEMS, SETUP_ITEM]
|
|
|
136
153
|
* caller's JWT carries a trusted role, a 403 means it doesn't. There is no local step-up/elevation flow
|
|
137
154
|
* (that would need a cross-origin call to auth-server's own elevation endpoint — not wired up yet).
|
|
138
155
|
*/
|
|
139
|
-
export default function AdminShell({ active, userUid, authServerUrl, children }: PropsWithChildren<AdminShellProps>) {
|
|
156
|
+
export default function AdminShell({ active, userUid, authServerUrl, pluginNav, children }: PropsWithChildren<AdminShellProps>) {
|
|
140
157
|
const [status, setStatus] = useState<Status>("checking");
|
|
141
158
|
const [error, setError] = useState<string | null>(null);
|
|
142
159
|
const { branding, iconSrc } = useBranding();
|
|
@@ -174,7 +191,8 @@ export default function AdminShell({ active, userUid, authServerUrl, children }:
|
|
|
174
191
|
}, [userUid]);
|
|
175
192
|
|
|
176
193
|
function handleSignOut() {
|
|
177
|
-
|
|
194
|
+
// Ends the auth-server session and tells other tabs, not just navigates - see `signOutOfConsole()`.
|
|
195
|
+
void signOutOfConsole(authServerUrl);
|
|
178
196
|
}
|
|
179
197
|
|
|
180
198
|
let content: ReactNode;
|
|
@@ -197,7 +215,8 @@ export default function AdminShell({ active, userUid, authServerUrl, children }:
|
|
|
197
215
|
</div>
|
|
198
216
|
);
|
|
199
217
|
} else {
|
|
200
|
-
const
|
|
218
|
+
const navItems = adminNavItems(pluginNav);
|
|
219
|
+
const activeItem = [...navItems, ...OFF_RAIL_ITEMS].find((item) => item.id === active);
|
|
201
220
|
content = (
|
|
202
221
|
<div className="min-h-screen flex flex-col bg-surface-alt">
|
|
203
222
|
<div className="flex-1 flex min-h-0">
|
|
@@ -206,7 +225,7 @@ export default function AdminShell({ active, userUid, authServerUrl, children }:
|
|
|
206
225
|
className="hidden md:flex w-16 shrink-0 bg-surface border-r border-border flex-col items-center py-3 gap-1"
|
|
207
226
|
>
|
|
208
227
|
<img src={iconSrc} width="96" height="96" alt="" className="mb-3" />
|
|
209
|
-
{
|
|
228
|
+
{navItems.map(({ id, href, label, icon: Icon }) => (
|
|
210
229
|
<a
|
|
211
230
|
key={id}
|
|
212
231
|
href={href}
|
|
@@ -224,7 +243,7 @@ export default function AdminShell({ active, userUid, authServerUrl, children }:
|
|
|
224
243
|
</a>
|
|
225
244
|
))}
|
|
226
245
|
</nav>
|
|
227
|
-
<BottomTabBar apps={
|
|
246
|
+
<BottomTabBar apps={navItems} active={active} />
|
|
228
247
|
<div className="flex-1 flex flex-col min-w-0">
|
|
229
248
|
<header className="h-16 shrink-0 bg-surface border-b border-border flex items-center justify-between gap-4 px-6">
|
|
230
249
|
<span className="font-display font-bold text-lg uppercase tracking-wide">{activeItem?.label}</span>
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
+
import React, { FormEvent, useEffect, useState } from "react";
|
|
6
|
+
import { ApiRequestError } from "@rapidmx/react-shared/util/api.js";
|
|
7
|
+
import { EscrowScope, listEscrowScopes } from "@rapidmx/react-shared/admin/escrowScopesApi.js";
|
|
8
|
+
import { Mailbox, updateMailbox } from "@rapidmx/react-shared/mail/mailApi.js";
|
|
9
|
+
import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
|
|
10
|
+
import Button from "@rapidmx/react-shared/components/buttons/Button.js";
|
|
11
|
+
import Modal from "@rapidmx/react-shared/components/overlays/Modal.js";
|
|
12
|
+
|
|
13
|
+
const SELECT_CLASS =
|
|
14
|
+
"text-sm py-2 px-3 border border-border rounded-sm bg-surface text-text focus:outline-none focus:border-primary";
|
|
15
|
+
|
|
16
|
+
/** Enough for any realistic deployment's scopes in one list. */
|
|
17
|
+
const SCOPE_LIST_LIMIT = 200;
|
|
18
|
+
|
|
19
|
+
export interface EscrowScopeCardProps {
|
|
20
|
+
mailbox: Mailbox;
|
|
21
|
+
/** Called with the saved mailbox, same push-up pattern as `ResourceSettingsCard`. */
|
|
22
|
+
onUpdate: (mailbox: Mailbox) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Assigns a mailbox to an escrow scope (or none), which decides whose holders can recover its encrypted mail. Only
|
|
27
|
+
* shown in the admin console, whose trusted-role gate the server enforces again for `escrowScopeId`.
|
|
28
|
+
*/
|
|
29
|
+
export default function EscrowScopeCard({ mailbox, onUpdate }: EscrowScopeCardProps) {
|
|
30
|
+
const [scopes, setScopes] = useState<EscrowScope[] | null>(null);
|
|
31
|
+
const [loadError, setLoadError] = useState<string | null>(null);
|
|
32
|
+
const [escrowScopeId, setEscrowScopeId] = useState(mailbox.escrowScopeId ?? "");
|
|
33
|
+
const [saving, setSaving] = useState(false);
|
|
34
|
+
const [saveError, setSaveError] = useState<string | null>(null);
|
|
35
|
+
const [saved, setSaved] = useState(false);
|
|
36
|
+
const [confirming, setConfirming] = useState(false);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
listEscrowScopes({ limit: SCOPE_LIST_LIMIT })
|
|
40
|
+
.then(setScopes)
|
|
41
|
+
.catch((err) => setLoadError(err instanceof ApiRequestError ? err.message : "Could not load escrow scopes."));
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
// Changing the scope changes who can recover this mailbox's encrypted mail, so it's confirmed first.
|
|
45
|
+
function handleSubmit(e: FormEvent) {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
setConfirming(true);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function save() {
|
|
51
|
+
setConfirming(false);
|
|
52
|
+
setSaveError(null);
|
|
53
|
+
setSaved(false);
|
|
54
|
+
setSaving(true);
|
|
55
|
+
try {
|
|
56
|
+
const updated = await updateMailbox({ uid: mailbox.uid, version: mailbox.version, escrowScopeId: escrowScopeId || null });
|
|
57
|
+
onUpdate(updated);
|
|
58
|
+
setSaved(true);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
setSaveError(err instanceof ApiRequestError ? err.message : "Could not save the escrow scope.");
|
|
61
|
+
} finally {
|
|
62
|
+
setSaving(false);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const current = mailbox.escrowScopeId ?? "";
|
|
67
|
+
const unknownCurrent = !!current && !!scopes && !scopes.some((scope) => scope.uid === current);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<div className="bg-surface border border-border rounded-md p-6">
|
|
71
|
+
<h2 className="text-base font-bold uppercase tracking-wide mb-1">Escrow scope</h2>
|
|
72
|
+
<p className="text-sm text-text-muted mb-4">
|
|
73
|
+
The holders of this scope can jointly recover this mailbox’s encrypted mail, for example for legal
|
|
74
|
+
discovery. With no scope, nobody can.
|
|
75
|
+
</p>
|
|
76
|
+
|
|
77
|
+
{loadError && <Alert>{loadError}</Alert>}
|
|
78
|
+
{saveError && <Alert>{saveError}</Alert>}
|
|
79
|
+
{saved && !saveError && <div className="mb-4 text-sm text-success font-medium">Saved.</div>}
|
|
80
|
+
|
|
81
|
+
{scopes && (
|
|
82
|
+
<form onSubmit={handleSubmit} className="flex items-end gap-3 flex-wrap">
|
|
83
|
+
<label className="flex flex-col gap-1.5 text-sm">
|
|
84
|
+
<span className="font-semibold">Scope</span>
|
|
85
|
+
<select
|
|
86
|
+
aria-label="Escrow scope"
|
|
87
|
+
className={SELECT_CLASS}
|
|
88
|
+
value={escrowScopeId}
|
|
89
|
+
onChange={(e) => {
|
|
90
|
+
setEscrowScopeId(e.target.value);
|
|
91
|
+
setSaved(false);
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<option value="">No escrow</option>
|
|
95
|
+
{unknownCurrent && <option value={current}>Unknown scope ({current})</option>}
|
|
96
|
+
{scopes.map((scope) => (
|
|
97
|
+
<option key={scope.uid} value={scope.uid}>
|
|
98
|
+
{scope.name}
|
|
99
|
+
</option>
|
|
100
|
+
))}
|
|
101
|
+
</select>
|
|
102
|
+
</label>
|
|
103
|
+
<Button type="submit" className="!w-auto" loading={saving} disabled={saving || escrowScopeId === current}>
|
|
104
|
+
Save escrow scope
|
|
105
|
+
</Button>
|
|
106
|
+
</form>
|
|
107
|
+
)}
|
|
108
|
+
|
|
109
|
+
<Modal open={confirming} onClose={() => setConfirming(false)} title="Change escrow scope">
|
|
110
|
+
<p className="text-sm mb-3">
|
|
111
|
+
This changes who can jointly recover <strong className="break-all">{mailbox.primarySmtpAddress}</strong>
|
|
112
|
+
’s encrypted mail.
|
|
113
|
+
</p>
|
|
114
|
+
<dl className="grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm mb-4">
|
|
115
|
+
<dt className="text-text-muted">From</dt>
|
|
116
|
+
<dd className="break-all">
|
|
117
|
+
<ScopeSummary uid={current} scopes={scopes ?? []} />
|
|
118
|
+
</dd>
|
|
119
|
+
<dt className="text-text-muted">To</dt>
|
|
120
|
+
<dd className="break-all">
|
|
121
|
+
<ScopeSummary uid={escrowScopeId} scopes={scopes ?? []} />
|
|
122
|
+
</dd>
|
|
123
|
+
</dl>
|
|
124
|
+
<div className="flex gap-3 justify-end">
|
|
125
|
+
<Button type="button" variant="secondary" className="!w-auto" onClick={() => setConfirming(false)}>
|
|
126
|
+
Cancel
|
|
127
|
+
</Button>
|
|
128
|
+
<Button type="button" className="!w-auto" onClick={() => void save()}>
|
|
129
|
+
Confirm and save
|
|
130
|
+
</Button>
|
|
131
|
+
</div>
|
|
132
|
+
</Modal>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** A scope's name, holders and required approvals - or what having no (or an unlisted) scope means. */
|
|
138
|
+
function ScopeSummary({ uid, scopes }: { uid: string; scopes: EscrowScope[] }) {
|
|
139
|
+
if (!uid) {
|
|
140
|
+
return <span>No escrow - nobody can recover this mailbox’s encrypted mail</span>;
|
|
141
|
+
}
|
|
142
|
+
const scope = scopes.find((candidate) => candidate.uid === uid);
|
|
143
|
+
if (!scope) {
|
|
144
|
+
return <span>Unknown scope ({uid})</span>;
|
|
145
|
+
}
|
|
146
|
+
return (
|
|
147
|
+
<span>
|
|
148
|
+
<strong>{scope.name}</strong> - holders {scope.holderUserUids.join(", ")}; {scope.requiredHolders} of{" "}
|
|
149
|
+
{scope.holderUserUids.length} must approve
|
|
150
|
+
</span>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -51,11 +51,11 @@ export default function ResourceSettingsCard({ mailbox, onUpdate }: ResourceSett
|
|
|
51
51
|
uid: mailbox.uid,
|
|
52
52
|
version: mailbox.version,
|
|
53
53
|
resourceType,
|
|
54
|
-
resourceCapacity: resourceCapacity ? Number(resourceCapacity) :
|
|
54
|
+
resourceCapacity: resourceCapacity ? Number(resourceCapacity) : null,
|
|
55
55
|
autoAcceptBookings,
|
|
56
56
|
allowConflicts,
|
|
57
|
-
bookingWindowDays: bookingWindowDays ? Number(bookingWindowDays) :
|
|
58
|
-
maxDurationMinutes: maxDurationMinutes ? Number(maxDurationMinutes) :
|
|
57
|
+
bookingWindowDays: bookingWindowDays ? Number(bookingWindowDays) : null,
|
|
58
|
+
maxDurationMinutes: maxDurationMinutes ? Number(maxDurationMinutes) : null,
|
|
59
59
|
});
|
|
60
60
|
onUpdate(updated);
|
|
61
61
|
setSaved(true);
|
|
@@ -7,11 +7,14 @@ import { ApiRequestError } from "@rapidmx/react-shared/util/api.js";
|
|
|
7
7
|
import { AccessControlList, getMailboxAcl, grantMailboxAccess, revokeMailboxAccess } from "@rapidmx/react-shared/mail/mailApi.js";
|
|
8
8
|
import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
|
|
9
9
|
import Button from "@rapidmx/react-shared/components/buttons/Button.js";
|
|
10
|
+
import Modal from "@rapidmx/react-shared/components/overlays/Modal.js";
|
|
10
11
|
|
|
11
12
|
const DEFAULT_DELEGATE_ACTIONS = ["read", "list", "count", "exists"];
|
|
12
13
|
|
|
13
14
|
export interface ShareAccessCardProps {
|
|
14
15
|
mailboxUid: string;
|
|
16
|
+
/** The mailbox's owner - their own grant is shown but can't be revoked from here. */
|
|
17
|
+
ownerUserUid?: string;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
/**
|
|
@@ -19,12 +22,14 @@ export interface ShareAccessCardProps {
|
|
|
19
22
|
* mechanism behind Exchange-style shared mailboxes. `records` on a mailbox's own ACL doubles as both the
|
|
20
23
|
* owner's grant (if any) and every delegate's — see `BaseMailboxRoute`'s doc comment in `@rapidmx/restapi`.
|
|
21
24
|
*/
|
|
22
|
-
export default function ShareAccessCard({ mailboxUid }: ShareAccessCardProps) {
|
|
25
|
+
export default function ShareAccessCard({ mailboxUid, ownerUserUid }: ShareAccessCardProps) {
|
|
23
26
|
const [acl, setAcl] = useState<AccessControlList | null>(null);
|
|
24
27
|
const [loading, setLoading] = useState(true);
|
|
25
28
|
const [error, setError] = useState<string | null>(null);
|
|
29
|
+
const [notice, setNotice] = useState<string | null>(null);
|
|
26
30
|
const [newUserUid, setNewUserUid] = useState("");
|
|
27
31
|
const [saving, setSaving] = useState(false);
|
|
32
|
+
const [revokeTarget, setRevokeTarget] = useState<string | null>(null);
|
|
28
33
|
|
|
29
34
|
function reload() {
|
|
30
35
|
setLoading(true);
|
|
@@ -45,8 +50,19 @@ export default function ShareAccessCard({ mailboxUid }: ShareAccessCardProps) {
|
|
|
45
50
|
}
|
|
46
51
|
setSaving(true);
|
|
47
52
|
setError(null);
|
|
53
|
+
setNotice(null);
|
|
48
54
|
try {
|
|
49
|
-
|
|
55
|
+
// `grantMailboxAccess()` replaces any existing record for this uid, so granting read access to someone
|
|
56
|
+
// who already has more (e.g. the owner) would silently downgrade them. Merge with their current actions.
|
|
57
|
+
const current = await getMailboxAcl(mailboxUid);
|
|
58
|
+
const existing = current.records.find((record) => record.userOrRoleId === userUid)?.actions ?? [];
|
|
59
|
+
const missing = DEFAULT_DELEGATE_ACTIONS.filter((action) => !existing.includes(action));
|
|
60
|
+
if (missing.length === 0) {
|
|
61
|
+
setNotice(`${userUid} already has this access.`);
|
|
62
|
+
setNewUserUid("");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
await grantMailboxAccess(mailboxUid, userUid, [...existing, ...missing]);
|
|
50
66
|
setNewUserUid("");
|
|
51
67
|
reload();
|
|
52
68
|
} catch (err) {
|
|
@@ -56,9 +72,13 @@ export default function ShareAccessCard({ mailboxUid }: ShareAccessCardProps) {
|
|
|
56
72
|
}
|
|
57
73
|
}
|
|
58
74
|
|
|
59
|
-
|
|
75
|
+
// Only ever invoked from the revoke-confirmation modal below, which only renders once `revokeTarget` is set.
|
|
76
|
+
async function handleRevoke() {
|
|
77
|
+
const userOrRoleId = revokeTarget!;
|
|
78
|
+
setRevokeTarget(null);
|
|
60
79
|
setSaving(true);
|
|
61
80
|
setError(null);
|
|
81
|
+
setNotice(null);
|
|
62
82
|
try {
|
|
63
83
|
await revokeMailboxAccess(mailboxUid, userOrRoleId);
|
|
64
84
|
reload();
|
|
@@ -77,6 +97,7 @@ export default function ShareAccessCard({ mailboxUid }: ShareAccessCardProps) {
|
|
|
77
97
|
</p>
|
|
78
98
|
|
|
79
99
|
{error && <Alert>{error}</Alert>}
|
|
100
|
+
{notice && !error && <div className="mb-4 text-sm text-text-muted">{notice}</div>}
|
|
80
101
|
|
|
81
102
|
{loading ? (
|
|
82
103
|
<p className="text-sm text-text-muted">Loading…</p>
|
|
@@ -94,14 +115,18 @@ export default function ShareAccessCard({ mailboxUid }: ShareAccessCardProps) {
|
|
|
94
115
|
<div className="text-sm font-medium">{record.userOrRoleId}</div>
|
|
95
116
|
<div className="text-xs text-text-muted">{record.actions.join(", ")}</div>
|
|
96
117
|
</div>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
118
|
+
{record.userOrRoleId === ownerUserUid ? (
|
|
119
|
+
<span className="text-xs font-bold uppercase tracking-wide text-text-muted">Owner</span>
|
|
120
|
+
) : (
|
|
121
|
+
<button
|
|
122
|
+
type="button"
|
|
123
|
+
onClick={() => setRevokeTarget(record.userOrRoleId)}
|
|
124
|
+
disabled={saving}
|
|
125
|
+
className="text-sm text-danger hover:underline disabled:opacity-55"
|
|
126
|
+
>
|
|
127
|
+
Revoke
|
|
128
|
+
</button>
|
|
129
|
+
)}
|
|
105
130
|
</li>
|
|
106
131
|
))}
|
|
107
132
|
</ul>
|
|
@@ -119,6 +144,25 @@ export default function ShareAccessCard({ mailboxUid }: ShareAccessCardProps) {
|
|
|
119
144
|
Grant
|
|
120
145
|
</Button>
|
|
121
146
|
</form>
|
|
147
|
+
|
|
148
|
+
<Modal open={revokeTarget !== null} onClose={() => setRevokeTarget(null)} title="Revoke access">
|
|
149
|
+
<p className="text-sm mb-5">
|
|
150
|
+
Revoke <strong className="break-all">{revokeTarget}</strong>’s access to this mailbox? They lose it
|
|
151
|
+
immediately.
|
|
152
|
+
</p>
|
|
153
|
+
<div className="flex gap-3 justify-end">
|
|
154
|
+
<Button type="button" variant="secondary" className="!w-auto" onClick={() => setRevokeTarget(null)}>
|
|
155
|
+
Cancel
|
|
156
|
+
</Button>
|
|
157
|
+
<Button
|
|
158
|
+
type="button"
|
|
159
|
+
className="!w-auto !bg-none !bg-danger !border-danger hover:!bg-danger"
|
|
160
|
+
onClick={() => void handleRevoke()}
|
|
161
|
+
>
|
|
162
|
+
Revoke
|
|
163
|
+
</Button>
|
|
164
|
+
</div>
|
|
165
|
+
</Modal>
|
|
122
166
|
</div>
|
|
123
167
|
);
|
|
124
168
|
}
|
|
@@ -22,6 +22,13 @@ const INPUT_CLASS =
|
|
|
22
22
|
|
|
23
23
|
const MAX_UPLOAD_BYTES = 5 * 1024 * 1024;
|
|
24
24
|
|
|
25
|
+
/** SVG logo/icon uploads are refused (the server refuses them too): an SVG served from this origin can carry script. */
|
|
26
|
+
export function isSvgFile(file: File): boolean {
|
|
27
|
+
return file.type === "image/svg+xml" || file.name.toLowerCase().endsWith(".svg");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const RASTER_IMAGE_ACCEPT = "image/png,image/jpeg,image/gif,image/webp,image/x-icon,image/vnd.microsoft.icon";
|
|
31
|
+
|
|
25
32
|
/** The branding editor, shared by the Branding page and the setup wizard. */
|
|
26
33
|
export default function BrandingForm({ branding, onChange }: { branding: Branding; onChange: (b: Branding) => void }) {
|
|
27
34
|
const [companyName, setCompanyName] = useState(branding.companyName);
|
|
@@ -58,7 +65,9 @@ export default function BrandingForm({ branding, onChange }: { branding: Brandin
|
|
|
58
65
|
function handleLogoFileChange(e: ChangeEvent<HTMLInputElement>) {
|
|
59
66
|
const file = e.target.files?.[0];
|
|
60
67
|
if (!file) return;
|
|
61
|
-
if (file
|
|
68
|
+
if (isSvgFile(file)) {
|
|
69
|
+
setError(`"${file.name}" is an SVG — upload a PNG, JPEG, GIF, or WebP logo instead.`);
|
|
70
|
+
} else if (file.size > MAX_UPLOAD_BYTES) {
|
|
62
71
|
setError(`"${file.name}" is too large — logos must be 5MB or smaller.`);
|
|
63
72
|
} else {
|
|
64
73
|
void runAsset("logo-upload", () => uploadBrandingLogo(file));
|
|
@@ -69,7 +78,9 @@ export default function BrandingForm({ branding, onChange }: { branding: Brandin
|
|
|
69
78
|
function handleIconFileChange(e: ChangeEvent<HTMLInputElement>) {
|
|
70
79
|
const file = e.target.files?.[0];
|
|
71
80
|
if (!file) return;
|
|
72
|
-
if (file
|
|
81
|
+
if (isSvgFile(file)) {
|
|
82
|
+
setError(`"${file.name}" is an SVG — upload a PNG, JPEG, GIF, WebP, or ICO icon instead.`);
|
|
83
|
+
} else if (file.size > MAX_UPLOAD_BYTES) {
|
|
73
84
|
setError(`"${file.name}" is too large — icons must be 5MB or smaller.`);
|
|
74
85
|
} else {
|
|
75
86
|
void runAsset("icon-upload", () => uploadBrandingIcon(file));
|
|
@@ -140,7 +151,7 @@ export default function BrandingForm({ branding, onChange }: { branding: Brandin
|
|
|
140
151
|
<input
|
|
141
152
|
ref={logoFileRef}
|
|
142
153
|
type="file"
|
|
143
|
-
accept=
|
|
154
|
+
accept={RASTER_IMAGE_ACCEPT}
|
|
144
155
|
aria-label="Upload logo"
|
|
145
156
|
className="hidden"
|
|
146
157
|
onChange={handleLogoFileChange}
|
|
@@ -212,7 +223,7 @@ export default function BrandingForm({ branding, onChange }: { branding: Brandin
|
|
|
212
223
|
<input
|
|
213
224
|
ref={iconFileRef}
|
|
214
225
|
type="file"
|
|
215
|
-
accept=
|
|
226
|
+
accept={RASTER_IMAGE_ACCEPT}
|
|
216
227
|
aria-label="Upload icon"
|
|
217
228
|
className="hidden"
|
|
218
229
|
onChange={handleIconFileChange}
|
|
@@ -32,12 +32,13 @@ export default function DomainDnsSetup({ uid, onLoaded }: DomainDnsSetupProps) {
|
|
|
32
32
|
const [loading, setLoading] = useState(true);
|
|
33
33
|
const [error, setError] = useState<string | null>(null);
|
|
34
34
|
const [verifying, setVerifying] = useState(false);
|
|
35
|
+
const [verifyError, setVerifyError] = useState<string | null>(null);
|
|
35
36
|
const [copied, setCopied] = useState(false);
|
|
36
37
|
|
|
37
38
|
function reload(id: string) {
|
|
38
39
|
setLoading(true);
|
|
39
40
|
setError(null);
|
|
40
|
-
Promise.all([getDomain(id), getDnsSetup(id)])
|
|
41
|
+
return Promise.all([getDomain(id), getDnsSetup(id)])
|
|
41
42
|
.then(([d, checks]) => {
|
|
42
43
|
setDomain(d);
|
|
43
44
|
setDnsSetup(checks);
|
|
@@ -48,18 +49,23 @@ export default function DomainDnsSetup({ uid, onLoaded }: DomainDnsSetupProps) {
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
useEffect(() => {
|
|
51
|
-
reload(uid);
|
|
52
|
+
void reload(uid);
|
|
52
53
|
}, [uid]);
|
|
53
54
|
|
|
54
|
-
// Only ever invoked from the "Verify now" button below, which only renders once `domain` is loaded.
|
|
55
|
+
// Only ever invoked from the "Verify now" button below, which only renders once `domain` is loaded. Any failure -
|
|
56
|
+
// verifying, or refreshing afterwards - is shown next to the button with the panel kept, so it can be retried
|
|
57
|
+
// (e.g. once a DNS record has propagated) instead of the whole panel being replaced by an error.
|
|
55
58
|
async function handleVerify() {
|
|
56
59
|
setVerifying(true);
|
|
57
|
-
|
|
60
|
+
setVerifyError(null);
|
|
58
61
|
try {
|
|
59
62
|
await verifyDomain(domain!.uid);
|
|
60
|
-
|
|
63
|
+
const [d, checks] = await Promise.all([getDomain(domain!.uid), getDnsSetup(domain!.uid)]);
|
|
64
|
+
setDomain(d);
|
|
65
|
+
setDnsSetup(checks);
|
|
66
|
+
onLoaded?.(d);
|
|
61
67
|
} catch (err) {
|
|
62
|
-
|
|
68
|
+
setVerifyError(err instanceof ApiRequestError ? err.message : "Could not verify this domain.");
|
|
63
69
|
} finally {
|
|
64
70
|
setVerifying(false);
|
|
65
71
|
}
|
|
@@ -120,8 +126,13 @@ export default function DomainDnsSetup({ uid, onLoaded }: DomainDnsSetupProps) {
|
|
|
120
126
|
{copied ? "Copied" : "Copy"}
|
|
121
127
|
</Button>
|
|
122
128
|
</div>
|
|
129
|
+
{verifyError && (
|
|
130
|
+
<div className="mt-3">
|
|
131
|
+
<Alert>{verifyError}</Alert>
|
|
132
|
+
</div>
|
|
133
|
+
)}
|
|
123
134
|
<Button type="button" className="!w-auto mt-3" loading={verifying} disabled={verifying} onClick={handleVerify}>
|
|
124
|
-
Verify now
|
|
135
|
+
{verifyError ? "Try again" : "Verify now"}
|
|
125
136
|
</Button>
|
|
126
137
|
</div>
|
|
127
138
|
)}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (C) 2026 Jean-Philippe Steinmetz
|
|
3
3
|
// SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
-
import React, { FormEvent, useState } from "react";
|
|
5
|
+
import React, { FormEvent, useEffect, useState } from "react";
|
|
6
6
|
import { ApiRequestError } from "@rapidmx/react-shared/util/api.js";
|
|
7
7
|
import { EncryptionPolicy, PolicyState, updateEncryptionPolicy } from "@rapidmx/react-shared/crypto/keyvaultApi.js";
|
|
8
8
|
import Alert from "@rapidmx/react-shared/components/feedback/Alert.js";
|
|
@@ -35,15 +35,22 @@ export function isEncryptionEnabled(policy: EncryptionPolicy): boolean {
|
|
|
35
35
|
export interface EncryptionPolicyFormProps {
|
|
36
36
|
policy: EncryptionPolicy;
|
|
37
37
|
onChange: (policy: EncryptionPolicy) => void;
|
|
38
|
+
/** Told whether the form has edits that haven't been saved. */
|
|
39
|
+
onDirtyChange?: (dirty: boolean) => void;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
/** The end-to-end encryption policy editor, shared by the Encryption Policy page and the setup wizard. */
|
|
41
|
-
export default function EncryptionPolicyForm({ policy, onChange }: EncryptionPolicyFormProps) {
|
|
43
|
+
export default function EncryptionPolicyForm({ policy, onChange, onDirtyChange }: EncryptionPolicyFormProps) {
|
|
42
44
|
const [values, setValues] = useState<EncryptionPolicy>(policy);
|
|
43
45
|
const [error, setError] = useState<string | null>(null);
|
|
44
46
|
const [saving, setSaving] = useState(false);
|
|
45
47
|
const [saved, setSaved] = useState(false);
|
|
46
48
|
|
|
49
|
+
// Edits are unsaved until they match what was loaded or last saved.
|
|
50
|
+
const [savedValues, setSavedValues] = useState<EncryptionPolicy>(policy);
|
|
51
|
+
const dirty: boolean = TIERS.some((tier) => values[tier.key] !== savedValues[tier.key]);
|
|
52
|
+
useEffect(() => onDirtyChange?.(dirty), [dirty]);
|
|
53
|
+
|
|
47
54
|
async function handleSubmit(e: FormEvent) {
|
|
48
55
|
e.preventDefault();
|
|
49
56
|
setError(null);
|
|
@@ -52,6 +59,7 @@ export default function EncryptionPolicyForm({ policy, onChange }: EncryptionPol
|
|
|
52
59
|
try {
|
|
53
60
|
const updated = await updateEncryptionPolicy(values);
|
|
54
61
|
onChange(updated);
|
|
62
|
+
setSavedValues(values);
|
|
55
63
|
setSaved(true);
|
|
56
64
|
} catch (err) {
|
|
57
65
|
setError(err instanceof ApiRequestError ? err.message : "Could not save the encryption policy.");
|
|
@@ -84,6 +84,12 @@ export default function MailboxCreateForm({ onCreated, defaults, submitLabel = "
|
|
|
84
84
|
setError("A display name is required.");
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
+
// restapi refuses these (400): a display name shown in From must not look like an address. The fullwidth and
|
|
88
|
+
// small look-alike @ signs are refused too (restapi's `AT_SIGN_LIKE`).
|
|
89
|
+
if (/[@@﹫\r\n]/.test(displayName)) {
|
|
90
|
+
setError("A display name can't contain \"@\" (or a look-alike) or line breaks.");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
87
93
|
|
|
88
94
|
setSaving(true);
|
|
89
95
|
try {
|