Skip to content

Commit

Permalink
fix(clerk-js): VerifiedDomainPage form checkbox label
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Aug 24, 2023
1 parent 9f9b5ae commit de4dbe6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ export const VerifiedDomainPage = withCardStateProvider(() => {
});

const deletePending = useFormControl('deleteExistingInvitationsSuggestions', '', {
label: localizationKeys(
enrollmentMode.value === 'automatic_suggestion'
? 'formFieldLabel__organizationDomainDeletePendingSuggestions'
: 'formFieldLabel__organizationDomainDeletePendingInvitations',
),
label: localizationKeys('formFieldLabel__organizationDomainDeletePending'),
type: 'checkbox',
});

Expand All @@ -104,6 +100,8 @@ export const VerifiedDomainPage = withCardStateProvider(() => {
},
);

const isFormDirty = deletePending.checked || domain?.enrollmentMode !== enrollmentMode.value;

const subtitle = localizationKeys('organizationProfile.verifiedDomainPage.subtitle', {
domain: domain?.name,
});
Expand Down Expand Up @@ -203,7 +201,7 @@ export const VerifiedDomainPage = withCardStateProvider(() => {
localizationKey={localizationKeys(
'organizationProfile.verifiedDomainPage.enrollmentTab.formButton__save',
)}
isDisabled={domainStatus.isLoading || !domain}
isDisabled={domainStatus.isLoading || !domain || !isFormDirty}
/>
</Form.Root>
</TabPanel>
Expand Down
4 changes: 1 addition & 3 deletions packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export const enUS: LocalizationResource = {
formFieldLabel__organizationDomainEmailAddress: 'Verification email address',
formFieldLabel__organizationDomainEmailAddressDescription:
'Enter an email address under this domain to receive a code and verify this domain.',
formFieldLabel__organizationDomainDeletePendingInvitations: 'Delete existing invitations',
formFieldLabel__organizationDomainDeletePendingSuggestions: 'Delete existing suggestions',

formFieldLabel__organizationDomainDeletePending: 'Delete pending invitations and suggestions',
formFieldLabel__confirmDeletion: 'Confirmation',
formFieldLabel__role: 'Role',
formFieldInputPlaceholder__emailAddress: '',
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ type _LocalizationResource = {
formFieldLabel__organizationDomain: LocalizationValue;
formFieldLabel__organizationDomainEmailAddress: LocalizationValue;
formFieldLabel__organizationDomainEmailAddressDescription: LocalizationValue;
formFieldLabel__organizationDomainDeletePendingInvitations: LocalizationValue;
formFieldLabel__organizationDomainDeletePendingSuggestions: LocalizationValue;
formFieldLabel__organizationDomainDeletePending: LocalizationValue;
formFieldLabel__confirmDeletion: LocalizationValue;
formFieldLabel__role: LocalizationValue;
formFieldInputPlaceholder__emailAddress: LocalizationValue;
Expand Down

0 comments on commit de4dbe6

Please sign in to comment.