Skip to content

Commit 3cda31d

Browse files
committed
chore(swingset): read Mosaic messages from the nested key tree
1 parent 374b7ea commit 3cda31d

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
@@ -90,7 +90,7 @@ export function useAPIKeysTableFixture({
9090
showDescription?: boolean;
9191
} = {}): APIKeysTableViewProps {
9292
const locale = useLocale();
93-
const messages = resolveAPIKeysTableMessages(useMessages('apiKeysTable'), subjectKind);
93+
const messages = resolveAPIKeysTableMessages(useMessages('apiKeys'), subjectKind);
9494
const seed = useChaosFixture(initialKeys, items =>
9595
chaosRows(items).map(key => ({ ...key, name: chaosText(key.name) })),
9696
);

‎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 =>
2424
items.map(role => ({ ...role, label: chaosText(role.label), description: chaosText(role.description) })),

‎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 }, () => ({
4444
firstName: chaosName(0),
4545
lastName: chaosName(7),

‎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)