Skip to content

Commit 5d0ff39

Browse files
committed
chore(swingset): read Mosaic messages from the nested key tree
1 parent a9ecb4b commit 5d0ff39

7 files changed

Lines changed: 14 additions & 8 deletions

‎packages/swingset/src/stories/fixtures/api-keys-table.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function useAPIKeysTableFixture({
7474
showDescription?: boolean;
7575
} = {}): APIKeysTableViewProps {
7676
const locale = useLocale();
77-
const messages = resolveAPIKeysTableMessages(useMessages('apiKeysTable'), subjectKind);
77+
const messages = resolveAPIKeysTableMessages(useMessages('apiKeys'), subjectKind);
7878
const seed = useChaosFixture(initialKeys, items =>
7979
chaosRows(items).map((key, index) => ({ ...key, name: chaosPick(chaosAPIKeyNames, index) })),
8080
);

‎packages/swingset/src/stories/fixtures/organization-profile-invite-members.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function useInviteMembersFixture(): {
1818
onInvite: (event: MouseEvent<HTMLButtonElement>) => void;
1919
inviteDialog: OrganizationProfileInviteMembersDialogProps;
2020
} {
21-
const m = useMessages('organizationProfileInviteMembers');
21+
const m = useMessages('organizationProfile').members.invite;
2222
const locale = useLocale();
2323
const roles = useChaosFixture(exampleRoles, items => items.map((role, index) => ({ ...role, ...chaosRole(index) })));
2424
const toast = useToastManager();

‎packages/swingset/src/stories/fixtures/user-profile-edit-password.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function useUserProfileEditPasswordFixture({
2424
latency = 800,
2525
failWith,
2626
}: UserProfileEditPasswordFixtureOptions = {}) {
27-
const m = useMessages('userProfilePasswordSection');
27+
const m = useMessages('userProfile').password;
2828
const [hasPassword, setHasPassword] = useState(initialHasPassword);
2929
const [hasFailed, setHasFailed] = useState(false);
3030
const policy: UserProfilePasswordPolicy = hasPassword

‎packages/swingset/src/stories/fixtures/user-profile-mfa-example.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ describe('Profile MFA flows', () => {
4343
'returns from %s to the method picker without closing the dialog',
4444
async method => {
4545
const user = userEvent.setup();
46-
render(<ProfileExample localization={{ messages: { userProfileMfa: { addLabel: 'Add a second factor' } } }} />);
46+
render(
47+
<ProfileExample localization={{ messages: { userProfile: { mfa: { addLabel: 'Add a second factor' } } } }} />,
48+
);
4749
const add = screen.getByRole('button', { name: 'Add a second factor' });
4850
await user.click(add);
4951
const dialog = screen.getByRole('dialog', { name: 'Add 2-step verification' });

‎packages/swingset/src/stories/fixtures/user-profile-profile.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function useUserProfileProfileFixture({
3939
nameFailWith,
4040
usernameFailWith,
4141
}: UserProfileProfileFixtureOptions = {}): UserProfileProfileSectionViewProps {
42-
const m = useMessages('userProfileProfileSection');
42+
const m = useMessages('userProfile').profile;
4343
const seed = useChaosFixture({ firstName: initialFirstName, lastName: initialLastName }, () => chaosPerson(0));
4444
const [value, setValue] = useState<UserProfileEditNameValue>(seed);
4545
const usernameSeed = useChaosFixture(initialUsername, () => chaosUsername(0));

‎packages/swingset/src/stories/localization.mdx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ is left unused, and a placeholder the values do not cover is rendered literally.
9090
"members": { "one": "{count} miembro", "other": "{count} miembros" }
9191
}
9292
},
93-
"userProfileAddEmail": {
94-
"link": { "resendCountdown": "¿No recibiste el enlace? Reenviar ({seconds})" }
93+
"userProfile": {
94+
"email": {
95+
"addDialog": {
96+
"link": { "resendCountdown": "¿No recibiste el enlace? Reenviar ({seconds})" }
97+
}
98+
}
9599
}
96100
}
97101
```

‎packages/swingset/src/stories/localization.stories.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function Rows({ rows }: { rows: Array<[string, ReactNode]> }) {
129129
// helper its placeholders call for.
130130
function Strings() {
131131
const m = useMessages('userButton');
132-
const link = useMessages('userProfileAddEmail');
132+
const link = useMessages('userProfile').email.addDialog;
133133
const locale = useLocale();
134134
return (
135135
<Rows

0 commit comments

Comments
 (0)