@remit/web-client 0.0.229 → 0.0.230
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/package.json +1 -1
- package/src/components/config-import/ConfigImportWizard.flow.test.ts +338 -0
- package/src/components/config-import/ConfigImportWizard.tsx +720 -0
- package/src/components/config-import/config-import.fixtures.ts +229 -0
- package/src/components/config-import/config-import.stories.tsx +449 -0
- package/src/components/config-import/steps.tsx +772 -0
- package/src/components/onboarding/OnboardingWizard.tsx +64 -390
- package/src/components/onboarding/credential-steps.tsx +441 -0
- package/src/components/settings/ConfigExportCard.tsx +114 -0
- package/src/components/settings/ConfigTransferPanel.tsx +72 -0
- package/src/lib/config-import.test.ts +306 -0
- package/src/lib/config-import.ts +492 -0
- package/src/lib/json.ts +11 -0
- package/src/routeTree.gen.ts +21 -0
- package/src/routes/import.tsx +51 -0
- package/src/routes/onboarding.tsx +9 -2
- package/src/routes/settings/accounts.tsx +30 -8
- package/src/routes/settings/advanced.tsx +5 -1
- package/src/routing/sections.ts +3 -1
|
@@ -126,6 +126,17 @@ function needsReauth(account: RemitImapAccountResponse): boolean {
|
|
|
126
126
|
return account.connectionState === "reauth_required";
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* The account arrived from a config file, which never carries a password, so it
|
|
131
|
+
* has none yet (#1021). It cannot sync until someone enters one, and the import
|
|
132
|
+
* wizard's "Finish later" leaves exactly these rows behind — so this screen has
|
|
133
|
+
* to offer the same way in, or the account is stranded with a red dot and no
|
|
134
|
+
* control that fixes it.
|
|
135
|
+
*/
|
|
136
|
+
function needsPassword(account: RemitImapAccountResponse): boolean {
|
|
137
|
+
return account.connectionState === "credentials_missing";
|
|
138
|
+
}
|
|
139
|
+
|
|
129
140
|
/* ------------------------------------------------------------------ */
|
|
130
141
|
/* Loading skeleton */
|
|
131
142
|
/* ------------------------------------------------------------------ */
|
|
@@ -410,6 +421,7 @@ function AccountsSettings() {
|
|
|
410
421
|
<div className="space-y-3">
|
|
411
422
|
{config.accounts.map((account) => {
|
|
412
423
|
const isReauth = needsReauth(account);
|
|
424
|
+
const isMissingPassword = needsPassword(account);
|
|
413
425
|
const isOAuthAccount = account.authType === "oauthMicrosoft";
|
|
414
426
|
// The mutation settling does not mean the window has gone anywhere:
|
|
415
427
|
// `assign` leaves the page here while the browser fetches Microsoft's
|
|
@@ -432,17 +444,23 @@ function AccountsSettings() {
|
|
|
432
444
|
});
|
|
433
445
|
},
|
|
434
446
|
}
|
|
435
|
-
:
|
|
447
|
+
: isMissingPassword
|
|
436
448
|
? {
|
|
437
|
-
label: "
|
|
449
|
+
label: "Enter password",
|
|
438
450
|
variant: "secondary",
|
|
439
451
|
onClick: () => setEditingAccountId(account.accountId),
|
|
440
452
|
}
|
|
441
|
-
:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
453
|
+
: deriveState(account) === "error"
|
|
454
|
+
? {
|
|
455
|
+
label: "Reconnect",
|
|
456
|
+
variant: "secondary",
|
|
457
|
+
onClick: () => setEditingAccountId(account.accountId),
|
|
458
|
+
}
|
|
459
|
+
: {
|
|
460
|
+
label: "Manage",
|
|
461
|
+
variant: "ghost",
|
|
462
|
+
onClick: () => setEditingAccountId(account.accountId),
|
|
463
|
+
};
|
|
446
464
|
|
|
447
465
|
const trailingButton = (
|
|
448
466
|
<RowActions
|
|
@@ -465,7 +483,11 @@ function AccountsSettings() {
|
|
|
465
483
|
syncLabel={deriveSyncLabel(account)}
|
|
466
484
|
state={deriveState(account)}
|
|
467
485
|
errorDetail={
|
|
468
|
-
isReauth
|
|
486
|
+
isReauth
|
|
487
|
+
? "Re-authentication required"
|
|
488
|
+
: isMissingPassword
|
|
489
|
+
? "Imported from a config file, which carries no password. Enter one to start syncing."
|
|
490
|
+
: account.lastError
|
|
469
491
|
}
|
|
470
492
|
trailing={trailingButton}
|
|
471
493
|
/>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { SettingsShell } from "@remit/ui";
|
|
7
7
|
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
|
8
8
|
import { useState } from "react";
|
|
9
|
+
import { ConfigTransferPanel } from "@/components/settings/ConfigTransferPanel";
|
|
9
10
|
import { QuarantinePanel } from "@/components/settings/QuarantinePanel";
|
|
10
11
|
import { SelfUpdatePanel } from "@/components/settings/SelfUpdatePanel";
|
|
11
12
|
import { TlsRootCaDownload } from "@/components/settings/TlsRootCaDownload";
|
|
@@ -40,9 +41,12 @@ function AdvancedSettings() {
|
|
|
40
41
|
>
|
|
41
42
|
<SelfUpdatePanel />
|
|
42
43
|
<QuarantinePanel />
|
|
44
|
+
<div className="mt-6 border-t border-line pt-4">
|
|
45
|
+
<ConfigTransferPanel />
|
|
46
|
+
</div>
|
|
43
47
|
<div className="mt-6 border-t border-line pt-4">
|
|
44
48
|
<p className="text-sm text-fg-muted">
|
|
45
|
-
Notification rules
|
|
49
|
+
Notification rules are coming in a future release.
|
|
46
50
|
</p>
|
|
47
51
|
</div>
|
|
48
52
|
<TlsRootCaDownload />
|
package/src/routing/sections.ts
CHANGED
|
@@ -11,7 +11,8 @@ export type AppSection =
|
|
|
11
11
|
| "flagged"
|
|
12
12
|
| "outbox"
|
|
13
13
|
| "settings"
|
|
14
|
-
| "accounts"
|
|
14
|
+
| "accounts"
|
|
15
|
+
| "importConfig";
|
|
15
16
|
|
|
16
17
|
const sectionRoute = {
|
|
17
18
|
brief: "/mail/brief",
|
|
@@ -19,6 +20,7 @@ const sectionRoute = {
|
|
|
19
20
|
outbox: "/mail/outbox",
|
|
20
21
|
settings: "/settings",
|
|
21
22
|
accounts: "/settings/accounts",
|
|
23
|
+
importConfig: "/import",
|
|
22
24
|
} as const satisfies Record<AppSection, string>;
|
|
23
25
|
|
|
24
26
|
/** Go to a top-level section by name, so no caller writes a path. */
|