chore: `Field` normalization (#31182)

pull/31231/head
Douglas Fabris 2 years ago committed by GitHub
parent b8e1c816cd
commit bfbfb8bc28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx
  2. 206
      apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx
  3. 62
      apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx
  4. 52
      apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx
  5. 86
      apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx
  6. 8
      apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx
  7. 20
      apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx
  8. 10
      apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx
  9. 194
      apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx
  10. 106
      apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx
  11. 4
      apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx
  12. 22
      apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx
  13. 61
      apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx
  14. 383
      apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx
  15. 52
      apps/meteor/client/views/admin/integrations/incoming/IncomingWebhookForm.tsx
  16. 128
      apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx
  17. 2
      apps/meteor/client/views/admin/mailer/MailerPage.tsx
  18. 6
      apps/meteor/client/views/admin/oauthApps/EditOauthApp.tsx
  19. 6
      apps/meteor/client/views/admin/oauthApps/OAuthAddApp.tsx
  20. 18
      apps/meteor/client/views/admin/permissions/RoleForm.tsx
  21. 176
      apps/meteor/client/views/admin/rooms/EditRoom.tsx
  22. 2
      apps/meteor/client/views/admin/settings/ResetSettingButton.tsx
  23. 11
      apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx
  24. 134
      apps/meteor/client/views/admin/users/AdminUserForm.tsx
  25. 29
      apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx
  26. 8
      apps/meteor/client/views/admin/workspace/WorkspaceRoute.tsx
  27. 125
      apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx
  28. 33
      apps/meteor/client/views/omnichannel/customFields/EditCustomFields.tsx
  29. 16
      apps/meteor/client/views/omnichannel/departments/DepartmentTags.tsx
  30. 289
      apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx
  31. 33
      apps/meteor/client/views/omnichannel/triggers/EditTrigger.tsx
  32. 2
      apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx
  33. 270
      apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
  34. 2
      apps/meteor/client/views/room/contextualBar/MessageSearchTab/components/MessageSearchForm.tsx
  35. 12
      apps/meteor/client/views/room/contextualBar/NotificationPreferences/components/NotificationToggle.tsx
  36. 10
      apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessages.tsx
  37. 6
      apps/meteor/client/views/room/contextualBar/Threads/components/ThreadChat.tsx
  38. 38
      apps/meteor/ee/client/omnichannel/additionalForms/CustomFieldsAdditionalForm.tsx
  39. 2
      apps/meteor/ee/client/omnichannel/additionalForms/DepartmentBusinessHours.tsx
  40. 25
      apps/meteor/ee/client/omnichannel/additionalForms/EeNumberInput.js
  41. 24
      apps/meteor/ee/client/omnichannel/additionalForms/EeNumberInput.tsx
  42. 25
      apps/meteor/ee/client/omnichannel/additionalForms/EeTextAreaInput.js
  43. 24
      apps/meteor/ee/client/omnichannel/additionalForms/EeTextAreaInput.tsx
  44. 18
      apps/meteor/ee/client/omnichannel/additionalForms/EeTextInput.js
  45. 24
      apps/meteor/ee/client/omnichannel/additionalForms/EeTextInput.tsx
  46. 98
      apps/meteor/ee/client/omnichannel/cannedResponses/components/cannedResponseForm.tsx
  47. 2
      apps/meteor/package.json
  48. 1
      apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
  49. 4
      apps/meteor/tests/e2e/page-objects/admin-email-inboxes.ts
  50. 4
      apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts
  51. 4
      apps/meteor/tests/e2e/page-objects/omnichannel-departments.ts
  52. 2
      ee/packages/ui-theming/package.json
  53. 2
      packages/fuselage-ui-kit/package.json
  54. 2
      packages/gazzodown/package.json
  55. 2
      packages/ui-client/package.json
  56. 2
      packages/ui-composer/package.json
  57. 2
      packages/ui-video-conf/package.json
  58. 2
      packages/uikit-playground/package.json
  59. 24
      yarn.lock

@ -141,16 +141,14 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug
)}
</Field>
<Field>
<Box display='flex' alignItems='center' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={encryptedField}>{t('Encrypted')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='encrypted'
render={({ field: { value, ...field } }) => <ToggleSwitch id={encryptedField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='encrypted'
render={({ field: { value, ...field } }) => <ToggleSwitch id={encryptedField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={discussionField} required>

@ -136,113 +136,113 @@ const CloseChatModal = ({
}
}, [transcriptEmail, setValue, visitorEmail, subject, t]);
return commentRequired || tagRequired || canSendTranscript ? (
<Modal wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(onSubmit)} {...props} />}>
<Modal.Header>
<Modal.Icon name='baloon-close-top-right' />
<Modal.Title>{t('Wrap_up_conversation')}</Modal.Title>
<Modal.Close onClick={onCancel} />
</Modal.Header>
<Modal.Content fontScale='p2'>
<Box color='annotation'>{t('Close_room_description')}</Box>
<FieldGroup>
<Field>
<FieldLabel required={commentRequired}>{t('Comment')}</FieldLabel>
<FieldRow>
<TextInput
{...register('comment')}
error={
errors.comment &&
t('error-the-field-is-required', {
field: t('Comment'),
})
}
flexGrow={1}
placeholder={t('Please_add_a_comment')}
/>
</FieldRow>
<FieldError>{errors.comment?.message}</FieldError>
</Field>
<Field>
<Tags tagRequired={tagRequired} tags={tags} handler={handleTags} {...(department && { department: department._id })} />
<FieldError>{errors.tags?.message}</FieldError>
</Field>
{canSendTranscript && (
<>
<Field>
<Divider />
<FieldLabel marginBlockStart={8}>{t('Chat_transcript')}</FieldLabel>
</Field>
{canSendTranscriptPDF && (
<Field marginBlockStart={10}>
<FieldRow>
<CheckBox id='transcript-pdf' {...register('transcriptPDF', { value: userTranscriptPDF })} />
<FieldLabel htmlFor='transcript-pdf' color='default' fontScale='c1'>
{t('Omnichannel_transcript_pdf')}
</FieldLabel>
</FieldRow>
if (commentRequired || tagRequired || canSendTranscript) {
return (
<Modal wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(onSubmit)} {...props} />}>
<Modal.Header>
<Modal.Icon name='baloon-close-top-right' />
<Modal.Title>{t('Wrap_up_conversation')}</Modal.Title>
<Modal.Close onClick={onCancel} />
</Modal.Header>
<Modal.Content fontScale='p2'>
<Box color='annotation'>{t('Close_room_description')}</Box>
<FieldGroup>
<Field>
<FieldLabel required={commentRequired}>{t('Comment')}</FieldLabel>
<FieldRow>
<TextInput
{...register('comment')}
error={
errors.comment &&
t('error-the-field-is-required', {
field: t('Comment'),
})
}
flexGrow={1}
placeholder={t('Please_add_a_comment')}
/>
</FieldRow>
<FieldError>{errors.comment?.message}</FieldError>
</Field>
<Field>
<Tags tagRequired={tagRequired} tags={tags} handler={handleTags} {...(department && { department: department._id })} />
<FieldError>{errors.tags?.message}</FieldError>
</Field>
{canSendTranscript && (
<>
<Field>
<Divider />
<FieldLabel marginBlockStart={8}>{t('Chat_transcript')}</FieldLabel>
</Field>
)}
{canSendTranscriptEmail && (
<>
{canSendTranscriptPDF && (
<Field marginBlockStart={10}>
<FieldRow>
<CheckBox id='transcript-email' {...register('transcriptEmail', { value: userTranscriptEmail })} />
<FieldLabel htmlFor='transcript-email' color='default' fontScale='c1'>
{t('Omnichannel_transcript_email')}
</FieldLabel>
<FieldLabel htmlFor='transcript-pdf'>{t('Omnichannel_transcript_pdf')}</FieldLabel>
<CheckBox id='transcript-pdf' {...register('transcriptPDF', { value: userTranscriptPDF })} />
</FieldRow>
</Field>
{transcriptEmail && (
<>
<Field marginBlockStart={14}>
<FieldLabel required>{t('Contact_email')}</FieldLabel>
<FieldRow>
<EmailInput value={visitorEmail} required disabled flexGrow={1} />
</FieldRow>
</Field>
<Field marginBlockStart={12}>
<FieldLabel required>{t('Subject')}</FieldLabel>
<FieldRow>
<TextInput
{...register('subject', { required: true })}
className='active'
error={
errors.subject &&
t('error-the-field-is-required', {
field: t('Subject'),
})
}
flexGrow={1}
/>
</FieldRow>
<FieldError>{errors.subject?.message}</FieldError>
</Field>
</>
)}
</>
)}
<Field marginBlockStart={16}>
<FieldLabel color='annotation' fontScale='c1'>
{canSendTranscriptPDF && canSendTranscriptEmail
? t('These_options_affect_this_conversation_only_To_set_default_selections_go_to_My_Account_Omnichannel')
: t('This_option_affect_this_conversation_only_To_set_default_selection_go_to_My_Account_Omnichannel')}
</FieldLabel>
</Field>
</>
)}
</FieldGroup>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
<Button onClick={onCancel}>{t('Cancel')}</Button>
<Button type='submit' disabled={cannotSubmit} primary>
{t('Confirm')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</Modal>
) : (
)}
{canSendTranscriptEmail && (
<>
<Field marginBlockStart={10}>
<FieldRow>
<FieldLabel htmlFor='transcript-email'>{t('Omnichannel_transcript_email')}</FieldLabel>
<CheckBox id='transcript-email' {...register('transcriptEmail', { value: userTranscriptEmail })} />
</FieldRow>
</Field>
{transcriptEmail && (
<>
<Field marginBlockStart={14}>
<FieldLabel required>{t('Contact_email')}</FieldLabel>
<FieldRow>
<EmailInput value={visitorEmail} required disabled flexGrow={1} />
</FieldRow>
</Field>
<Field marginBlockStart={12}>
<FieldLabel required>{t('Subject')}</FieldLabel>
<FieldRow>
<TextInput
{...register('subject', { required: true })}
className='active'
error={
errors.subject &&
t('error-the-field-is-required', {
field: t('Subject'),
})
}
flexGrow={1}
/>
</FieldRow>
<FieldError>{errors.subject?.message}</FieldError>
</Field>
</>
)}
</>
)}
<Field marginBlockStart={16}>
<FieldLabel color='annotation' fontScale='c1'>
{canSendTranscriptPDF && canSendTranscriptEmail
? t('These_options_affect_this_conversation_only_To_set_default_selections_go_to_My_Account_Omnichannel')
: t('This_option_affect_this_conversation_only_To_set_default_selection_go_to_My_Account_Omnichannel')}
</FieldLabel>
</Field>
</>
)}
</FieldGroup>
</Modal.Content>
<Modal.Footer>
<Modal.FooterControllers>
<Button onClick={onCancel}>{t('Cancel')}</Button>
<Button type='submit' disabled={cannotSubmit} primary>
{t('Confirm')}
</Button>
</Modal.FooterControllers>
</Modal.Footer>
</Modal>
);
}
return (
<GenericModal
variant='warning'
title={t('Are_you_sure_you_want_to_close_this_chat')}
@ -250,7 +250,7 @@ const CloseChatModal = ({
onCancel={onCancel}
onClose={onCancel}
confirmText={t('Confirm')}
></GenericModal>
/>
);
};

@ -240,13 +240,8 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
<FieldHint id={`${topicId}-hint`}>{t('Channel_what_is_this_channel_about')}</FieldHint>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={privateId}>{t('Private')}</FieldLabel>
<FieldHint id={`${privateId}-hint`}>
{isPrivate ? t('Only_invited_users_can_acess_this_channel') : t('Everyone_can_access_this_channel')}
</FieldHint>
</Box>
<FieldRow>
<FieldLabel htmlFor={privateId}>{t('Private')}</FieldLabel>
<Controller
control={control}
name='isPrivate'
@ -261,14 +256,14 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
/>
)}
/>
</Box>
</FieldRow>
<FieldHint id={`${privateId}-hint`}>
{isPrivate ? t('Only_invited_users_can_acess_this_channel') : t('Everyone_can_access_this_channel')}
</FieldHint>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={federatedId}>{t('Federation_Matrix_Federated')}</FieldLabel>
<FieldHint id={`${federatedId}-hint`}>{t(getFederationHintKey(federatedModule, federationEnabled))}</FieldHint>
</Box>
<FieldRow>
<FieldLabel htmlFor={federatedId}>{t('Federation_Matrix_Federated')}</FieldLabel>
<Controller
control={control}
name='federated'
@ -283,16 +278,12 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
/>
)}
/>
</Box>
</FieldRow>
<FieldHint id={`${federatedId}-hint`}>{t(getFederationHintKey(federatedModule, federationEnabled))}</FieldHint>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={readOnlyId}>{t('Read_only')}</FieldLabel>
<FieldHint id={`${readOnlyId}-hint`}>
{readOnly ? t('Only_authorized_users_can_write_new_messages') : t('All_users_in_the_channel_can_write_new_messages')}
</FieldHint>
</Box>
<FieldRow>
<FieldLabel htmlFor={readOnlyId}>{t('Read_only')}</FieldLabel>
<Controller
control={control}
name='readOnly'
@ -307,16 +298,14 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
/>
)}
/>
</Box>
</FieldRow>
<FieldHint id={`${readOnlyId}-hint`}>
{readOnly ? t('Only_authorized_users_can_write_new_messages') : t('All_users_in_the_channel_can_write_new_messages')}
</FieldHint>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={encryptedId}>{t('Encrypted')}</FieldLabel>
<FieldDescription id={`${encryptedId}-hint`}>
{isPrivate ? t('Encrypted_channel_Description') : t('Encrypted_not_available')}
</FieldDescription>
</Box>
<FieldRow>
<FieldLabel htmlFor={encryptedId}>{t('Encrypted')}</FieldLabel>
<Controller
control={control}
name='encrypted'
@ -332,14 +321,14 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
/>
)}
/>
</Box>
</FieldRow>
<FieldDescription id={`${encryptedId}-hint`}>
{isPrivate ? t('Encrypted_channel_Description') : t('Encrypted_not_available')}
</FieldDescription>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={broadcastId}>{t('Broadcast')}</FieldLabel>
<FieldHint id={`${broadcastId}-hint`}>{t('Broadcast_channel_Description')}</FieldHint>
</Box>
<FieldRow>
<FieldLabel htmlFor={broadcastId}>{t('Broadcast')}</FieldLabel>
<Controller
control={control}
name='broadcast'
@ -354,7 +343,8 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
/>
)}
/>
</Box>
</FieldRow>
<FieldHint id={`${broadcastId}-hint`}>{t('Broadcast_channel_Description')}</FieldHint>
</Field>
<Field>
<FieldLabel htmlFor={addMembersId}>{t('Add_members')}</FieldLabel>

@ -207,13 +207,8 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement =>
</FieldRow>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={privateId}>{t('Teams_New_Private_Label')}</FieldLabel>
<FieldDescription id={`${privateId}-hint`}>
{isPrivate ? t('Teams_New_Private_Description_Enabled') : t('Teams_New_Private_Description_Disabled')}
</FieldDescription>
</Box>
<FieldRow>
<FieldLabel htmlFor={privateId}>{t('Teams_New_Private_Label')}</FieldLabel>
<Controller
control={control}
name='isPrivate'
@ -221,16 +216,14 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement =>
<ToggleSwitch id={privateId} aria-describedby={`${privateId}-hint`} onChange={onChange} checked={value} ref={ref} />
)}
/>
</Box>
</FieldRow>
<FieldDescription id={`${privateId}-hint`}>
{isPrivate ? t('Teams_New_Private_Description_Enabled') : t('Teams_New_Private_Description_Disabled')}
</FieldDescription>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={readOnlyId}>{t('Teams_New_Read_only_Label')}</FieldLabel>
<FieldDescription id={`${readOnlyId}-hint`}>
{readOnly ? t('Only_authorized_users_can_write_new_messages') : t('Teams_New_Read_only_Description')}
</FieldDescription>
</Box>
<FieldRow>
<FieldLabel htmlFor={readOnlyId}>{t('Teams_New_Read_only_Label')}</FieldLabel>
<Controller
control={control}
name='readOnly'
@ -245,16 +238,14 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement =>
/>
)}
/>
</Box>
</FieldRow>
<FieldDescription id={`${readOnlyId}-hint`}>
{readOnly ? t('Only_authorized_users_can_write_new_messages') : t('Teams_New_Read_only_Description')}
</FieldDescription>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={encryptedId}>{t('Teams_New_Encrypted_Label')}</FieldLabel>
<FieldDescription id={`${encryptedId}-hint`}>
{isPrivate ? t('Teams_New_Encrypted_Description_Enabled') : t('Teams_New_Encrypted_Description_Disabled')}
</FieldDescription>
</Box>
<FieldRow>
<FieldLabel htmlFor={encryptedId}>{t('Teams_New_Encrypted_Label')}</FieldLabel>
<Controller
control={control}
name='encrypted'
@ -269,14 +260,14 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement =>
/>
)}
/>
</Box>
</FieldRow>
<FieldDescription id={`${encryptedId}-hint`}>
{isPrivate ? t('Teams_New_Encrypted_Description_Enabled') : t('Teams_New_Encrypted_Description_Disabled')}
</FieldDescription>
</Field>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column' width='full'>
<FieldLabel htmlFor={broadcastId}>{t('Teams_New_Broadcast_Label')}</FieldLabel>
<FieldDescription d={`${broadcastId}-hint`}>{t('Teams_New_Broadcast_Description')}</FieldDescription>
</Box>
<FieldRow>
<FieldLabel htmlFor={broadcastId}>{t('Teams_New_Broadcast_Label')}</FieldLabel>
<Controller
control={control}
name='broadcast'
@ -284,7 +275,8 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement =>
<ToggleSwitch aria-describedby={`${broadcastId}-hint`} id={broadcastId} onChange={onChange} checked={value} ref={ref} />
)}
/>
</Box>
</FieldRow>
<FieldDescription d={`${broadcastId}-hint`}>{t('Teams_New_Broadcast_Description')}</FieldDescription>
</Field>
<Field>
<FieldLabel htmlFor={addMembersId}>

@ -95,20 +95,18 @@ const AccessibilityPage = () => {
{themes.map(({ id, title, description }, index) => {
return (
<Field key={id} pbe={themes.length - 1 ? undefined : 'x28'} pbs={index === 0 ? undefined : 'x28'}>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel display='flex' alignItems='center' htmlFor={id}>
{t(title)}
</FieldLabel>
<FieldRow>
<Controller
control={control}
name='themeAppearence'
render={({ field: { onChange, value, ref } }) => (
<RadioButton id={id} ref={ref} onChange={() => onChange(id)} checked={value === id} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='themeAppearence'
render={({ field: { onChange, value, ref } }) => (
<RadioButton id={id} ref={ref} onChange={() => onChange(id)} checked={value === id} />
)}
/>
</FieldRow>
<FieldHint mbs={12} style={{ whiteSpace: 'break-spaces' }}>
{t(description)}
</FieldHint>
@ -134,18 +132,16 @@ const AccessibilityPage = () => {
<FieldDescription mb={12}>{t('Adjustable_font_size_description')}</FieldDescription>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={fontSizeId}>{t('Mentions_with_@_symbol')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='mentionsWithSymbol'
render={({ field: { onChange, value, ref } }) => (
<ToggleSwitch id={mentionsWithSymbolId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='mentionsWithSymbol'
render={({ field: { onChange, value, ref } }) => (
<ToggleSwitch id={mentionsWithSymbolId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
<FieldDescription
className={css`
white-space: break-spaces;
@ -168,15 +164,33 @@ const AccessibilityPage = () => {
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={hideUsernamesId}>{t('Show_usernames')}</FieldLabel>
<Controller
name='hideUsernames'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch
id={hideUsernamesId}
ref={ref}
checked={!value}
onChange={(e) => onChange(!(e.target as HTMLInputElement).checked)}
/>
)}
/>
</FieldRow>
<FieldDescription>{t('Show_or_hide_the_username_of_message_authors')}</FieldDescription>
</Field>
{displayRolesEnabled && (
<Field>
<FieldRow>
<FieldLabel htmlFor={hideRolesId}>{t('Show_roles')}</FieldLabel>
<Controller
name='hideUsernames'
name='hideRoles'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch
id={hideUsernamesId}
id={hideRolesId}
ref={ref}
checked={!value}
onChange={(e) => onChange(!(e.target as HTMLInputElement).checked)}
@ -184,28 +198,6 @@ const AccessibilityPage = () => {
)}
/>
</FieldRow>
</Box>
<FieldDescription>{t('Show_or_hide_the_username_of_message_authors')}</FieldDescription>
</Field>
{displayRolesEnabled && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldLabel htmlFor={hideRolesId}>{t('Show_roles')}</FieldLabel>
<FieldRow>
<Controller
name='hideRoles'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch
id={hideRolesId}
ref={ref}
checked={!value}
onChange={(e) => onChange(!(e.target as HTMLInputElement).checked)}
/>
)}
/>
</FieldRow>
</Box>
<FieldDescription>{t('Show_or_hide_the_user_roles_of_message_authors')}</FieldDescription>
</Field>
)}

@ -106,12 +106,10 @@ const AccountFeaturePreviewPage = () => {
{features.map((feature) => (
<Fragment key={feature.name}>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={feature.name}>{t(feature.i18n)}</FieldLabel>
<FieldRow>
<ToggleSwitch id={feature.name} checked={feature.value} name={feature.name} onChange={handleFeatures} />
</FieldRow>
</Box>
<ToggleSwitch id={feature.name} checked={feature.value} name={feature.name} onChange={handleFeatures} />
</FieldRow>
{feature.description && <FieldHint mbs={12}>{t(feature.description)}</FieldHint>}
</Field>
{feature.imageUrl && <Box is='img' width='100%' height='auto' mbs={16} src={feature.imageUrl} alt='' />}

@ -23,7 +23,7 @@ const PreferencesConversationTranscript = () => {
<Accordion.Item defaultExpanded title={t('Conversational_transcript')}>
<FieldGroup>
<Field>
<Box display='flex' alignItems='center' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={omnichannelTranscriptPDF}>
<Box display='flex' alignItems='center'>
{t('Omnichannel_transcript_pdf')}
@ -33,14 +33,12 @@ const PreferencesConversationTranscript = () => {
</Box>
</Box>
</FieldLabel>
<FieldRow>
<ToggleSwitch id={omnichannelTranscriptPDF} disabled={cantSendTranscriptPDF} {...register('omnichannelTranscriptPDF')} />
</FieldRow>
</Box>
<ToggleSwitch id={omnichannelTranscriptPDF} disabled={cantSendTranscriptPDF} {...register('omnichannelTranscriptPDF')} />
</FieldRow>
<FieldHint>{t('Accounts_Default_User_Preferences_omnichannelTranscriptPDF_Description')}</FieldHint>
</Field>
<Field>
<Box display='flex' alignItems='center' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={omnichannelTranscriptEmail}>
<Box display='flex' alignItems='center'>
{t('Omnichannel_transcript_email')}
@ -51,14 +49,8 @@ const PreferencesConversationTranscript = () => {
)}
</Box>
</FieldLabel>
<FieldRow>
<ToggleSwitch
id={omnichannelTranscriptEmail}
disabled={!canSendTranscriptEmail}
{...register('omnichannelTranscriptEmail')}
/>
</FieldRow>
</Box>
<ToggleSwitch id={omnichannelTranscriptEmail} disabled={!canSendTranscriptEmail} {...register('omnichannelTranscriptEmail')} />
</FieldRow>
<FieldHint>{t('Accounts_Default_User_Preferences_omnichannelTranscriptEmail_Description')}</FieldHint>
</Field>
</FieldGroup>

@ -1,4 +1,4 @@
import { Box, Field, FieldGroup, FieldHint, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage';
import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
@ -13,12 +13,10 @@ export const PreferencesGeneral = (): ReactElement => {
return (
<FieldGroup marginBlockEnd='1.5rem' paddingInline='0.5rem'>
<Field>
<Box display='flex' alignItems='center' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={omnichannelHideAfterClosing}>{t('Omnichannel_hide_conversation_after_closing')}</FieldLabel>
<FieldRow>
<ToggleSwitch id={omnichannelHideAfterClosing} {...register('omnichannelHideConversationAfterClosing')} />
</FieldRow>
</Box>
<ToggleSwitch id={omnichannelHideAfterClosing} {...register('omnichannelHideConversationAfterClosing')} />
</FieldRow>
<FieldHint>{t('Omnichannel_hide_conversation_after_closing_description')}</FieldHint>
</Field>
</FieldGroup>

@ -1,5 +1,5 @@
import type { SelectOption } from '@rocket.chat/fuselage';
import { FieldRow, FieldLink, FieldHint, FieldLabel, Accordion, Field, Select, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage';
import { FieldRow, FieldLink, FieldHint, FieldLabel, Accordion, Field, Select, FieldGroup, ToggleSwitch } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { useMemo } from 'react';
@ -43,38 +43,34 @@ const PreferencesMessagesSection = () => {
<Accordion.Item title={t('Messages')}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={unreadAlertId}>{t('Unread_Tray_Icon_Alert')}</FieldLabel>
<FieldRow>
<Controller
name='unreadAlert'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={unreadAlertId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='unreadAlert'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={unreadAlertId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={showThreadsInMainChannelId}>{t('Always_show_thread_replies_in_main_channel')}</FieldLabel>
<FieldRow>
<Controller
name='showThreadsInMainChannel'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch
aria-describedby={`${showThreadsInMainChannelId}-hint`}
id={showThreadsInMainChannelId}
ref={ref}
checked={value}
onChange={onChange}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='showThreadsInMainChannel'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch
aria-describedby={`${showThreadsInMainChannelId}-hint`}
id={showThreadsInMainChannelId}
ref={ref}
checked={value}
onChange={onChange}
/>
)}
/>
</FieldRow>
<FieldHint id={`${showThreadsInMainChannelId}-hint`}>
{t('Accounts_Default_User_Preferences_showThreadsInMainChannel_Description')}
</FieldHint>
@ -105,74 +101,64 @@ const PreferencesMessagesSection = () => {
<FieldLink href='/account/accessibility-and-appearance'>{t('Go_to_accessibility_and_appearance')}</FieldLink>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={useEmojisId}>{t('Use_Emojis')}</FieldLabel>
<FieldRow>
<Controller
name='useEmojis'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={useEmojisId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='useEmojis'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={useEmojisId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={convertAsciiEmojiId}>{t('Convert_Ascii_Emojis')}</FieldLabel>
<FieldRow>
<Controller
name='convertAsciiEmoji'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={convertAsciiEmojiId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='convertAsciiEmoji'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={convertAsciiEmojiId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={autoImageLoadId}>{t('Auto_Load_Images')}</FieldLabel>
<FieldRow>
<Controller
name='autoImageLoad'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={autoImageLoadId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='autoImageLoad'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={autoImageLoadId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={saveMobileBandwidthId}>{t('Save_Mobile_Bandwidth')}</FieldLabel>
<FieldRow>
<Controller
name='saveMobileBandwidth'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={saveMobileBandwidthId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='saveMobileBandwidth'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={saveMobileBandwidthId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={collapseMediaByDefaultId}>{t('Collapse_Embedded_Media_By_Default')}</FieldLabel>
<FieldRow>
<Controller
name='collapseMediaByDefault'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={collapseMediaByDefaultId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='collapseMediaByDefault'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={collapseMediaByDefaultId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Hide_usernames')}</FieldLabel>
@ -183,32 +169,28 @@ const PreferencesMessagesSection = () => {
<FieldLink href='/account/accessibility-and-appearance'>{t('Go_to_accessibility_and_appearance')}</FieldLink>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={hideFlexTabId}>{t('Hide_flextab')}</FieldLabel>
<FieldRow>
<Controller
name='hideFlexTab'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={hideFlexTabId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='hideFlexTab'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={hideFlexTabId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={displayAvatarsId}>{t('Display_avatars')}</FieldLabel>
<FieldRow>
<Controller
name='displayAvatars'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={displayAvatarsId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='displayAvatars'
control={control}
render={({ field: { value, onChange, ref } }) => (
<ToggleSwitch id={displayAvatarsId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={sendOnEnterId}>{t('Enter_Behaviour')}</FieldLabel>

@ -1,6 +1,6 @@
import type { INotificationDesktop } from '@rocket.chat/core-typings';
import type { SelectOption } from '@rocket.chat/fuselage';
import { Accordion, Field, FieldLabel, FieldRow, FieldHint, Select, FieldGroup, ToggleSwitch, Button, Box } from '@rocket.chat/fuselage';
import { Accordion, Field, FieldLabel, FieldRow, FieldHint, Select, FieldGroup, ToggleSwitch, Button } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import type { TranslationKey } from '@rocket.chat/ui-contexts';
import { useUserPreference, useSetting, useTranslation } from '@rocket.chat/ui-contexts';
@ -113,24 +113,22 @@ const PreferencesNotificationsSection = () => {
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={notificationRequireId}>{t('Notification_RequireInteraction')}</FieldLabel>
<FieldRow>
<Controller
name='desktopNotificationRequireInteraction'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch
aria-describedby={`${notificationRequireId}-hint`}
id={notificationRequireId}
ref={ref}
checked={value}
onChange={onChange}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='desktopNotificationRequireInteraction'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch
aria-describedby={`${notificationRequireId}-hint`}
id={notificationRequireId}
ref={ref}
checked={value}
onChange={onChange}
/>
)}
/>
</FieldRow>
<FieldHint id={`${notificationRequireId}-hint`}>{t('Only_works_with_chrome_version_greater_50')}</FieldHint>
</Field>
<Field>
@ -182,57 +180,51 @@ const PreferencesNotificationsSection = () => {
</Field>
{showNewLoginEmailPreference && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={receiveLoginDetectionEmailId}>{t('Receive_Login_Detection_Emails')}</FieldLabel>
<FieldRow>
<Controller
name='receiveLoginDetectionEmail'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch
aria-describedby={`${receiveLoginDetectionEmailId}-hint`}
id={receiveLoginDetectionEmailId}
ref={ref}
checked={value}
onChange={onChange}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='receiveLoginDetectionEmail'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch
aria-describedby={`${receiveLoginDetectionEmailId}-hint`}
id={receiveLoginDetectionEmailId}
ref={ref}
checked={value}
onChange={onChange}
/>
)}
/>
</FieldRow>
<FieldHint id={`${receiveLoginDetectionEmailId}-hint`}>{t('Receive_Login_Detection_Emails_Description')}</FieldHint>
</Field>
)}
{showCalendarPreference && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={notifyCalendarEventsId}>{t('Notify_Calendar_Events')}</FieldLabel>
<FieldRow>
<Controller
name='notifyCalendarEvents'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch id={notifyCalendarEventsId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='notifyCalendarEvents'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch id={notifyCalendarEventsId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
)}
{showMobileRinging && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={enableMobileRingingId}>{t('VideoConf_Mobile_Ringing')}</FieldLabel>
<FieldRow>
<Controller
name='enableMobileRinging'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch id={enableMobileRingingId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='enableMobileRinging'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch id={enableMobileRingingId} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
)}
</FieldGroup>

@ -62,9 +62,9 @@ const PreferencesSoundSection = () => {
/>
</FieldRow>
</Field>
<Field display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldLabel htmlFor={muteFocusedConversationsId}>{t('Mute_Focused_Conversations')}</FieldLabel>
<Field>
<FieldRow>
<FieldLabel htmlFor={muteFocusedConversationsId}>{t('Mute_Focused_Conversations')}</FieldLabel>
<Controller
name='muteFocusedConversations'
control={control}

@ -1,4 +1,4 @@
import { Accordion, Field, FieldLabel, FieldRow, NumberInput, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage';
import { Accordion, Field, FieldLabel, FieldRow, NumberInput, FieldGroup, ToggleSwitch } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';
@ -15,18 +15,16 @@ const PreferencesUserPresenceSection = () => {
<Accordion.Item title={t('User_Presence')}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={enableAutoAwayId}>{t('Enable_Auto_Away')}</FieldLabel>
<FieldRow>
<Controller
name='enableAutoAway'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch ref={ref} id={enableAutoAwayId} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Box>
<Controller
name='enableAutoAway'
control={control}
render={({ field: { ref, value, onChange } }) => (
<ToggleSwitch ref={ref} id={enableAutoAwayId} checked={value} onChange={onChange} />
)}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={idleTimeLimit}>{t('Idle_Time_Limit')}</FieldLabel>

@ -1,33 +1,41 @@
import { Box, TextInput, Button, Field, FieldGroup, FieldLabel, FieldRow, Margins, CheckBox } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import type { SelectOption } from '@rocket.chat/fuselage';
import { Box, TextInput, Button, Margins, Select } from '@rocket.chat/fuselage';
import { useSetModal, useToastMessageDispatch, useUserId, useMethod, useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React, { useCallback, useMemo, useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { Controller, useForm } from 'react-hook-form';
import GenericModal from '../../../../components/GenericModal';
const AddToken = ({ reload, ...props }: { reload: () => void }): ReactElement => {
const AddToken = ({ reload }: { reload: () => void }): ReactElement => {
const t = useTranslation();
const userId = useUserId();
const setModal = useSetModal();
const createTokenFn = useMethod('personalAccessTokens:generateToken');
const dispatchToastMessage = useToastMessageDispatch();
const bypassTwoFactorCheckboxId = useUniqueId();
const setModal = useSetModal();
const initialValues = useMemo(() => ({ name: '', bypassTwoFactor: false }), []);
const initialValues = useMemo(() => ({ name: '', bypassTwoFactor: 'require' }), []);
const {
register,
resetField,
handleSubmit,
formState: { isDirty, isSubmitted, submitCount },
control,
formState: { isSubmitted, submitCount },
} = useForm({ defaultValues: initialValues });
const twoFactorAuthOptions: SelectOption[] = useMemo(
() => [
['require', t('Require_Two_Factor_Authentication')],
['bypass', t('Ignore_Two_Factor_Authentication')],
],
[t],
);
const handleAddToken = useCallback(
async ({ name: tokenName, bypassTwoFactor }: typeof initialValues) => {
async ({ name: tokenName, bypassTwoFactor }) => {
try {
const token = await createTokenFn({ tokenName, bypassTwoFactor });
const token = await createTokenFn({ tokenName, bypassTwoFactor: bypassTwoFactor === 'bypass' });
setModal(
<GenericModal title={t('API_Personal_Access_Token_Generated')} onConfirm={() => setModal(null)} onClose={() => setModal(null)}>
@ -54,22 +62,23 @@ const AddToken = ({ reload, ...props }: { reload: () => void }): ReactElement =>
}, [isSubmitted, submitCount, reload, resetField]);
return (
<FieldGroup is='form' onSubmit={handleSubmit(handleAddToken)} marginBlock={8} {...props}>
<Field>
<FieldRow>
<Margins inlineEnd={4}>
<TextInput data-qa='PersonalTokenField' {...register('name')} placeholder={t('API_Add_Personal_Access_Token')} />
</Margins>
<Button primary disabled={!isDirty} type='submit'>
{t('Add')}
</Button>
</FieldRow>
<FieldRow>
<CheckBox id={bypassTwoFactorCheckboxId} {...register('bypassTwoFactor')} />
<FieldLabel htmlFor={bypassTwoFactorCheckboxId}>{t('Ignore_Two_Factor_Authentication')}</FieldLabel>
</FieldRow>
</Field>
</FieldGroup>
<Box display='flex' is='form' onSubmit={handleSubmit(handleAddToken)} mb={8}>
<Box display='flex' width='100%'>
<Margins inlineEnd={4}>
<TextInput data-qa='PersonalTokenField' {...register('name')} placeholder={t('API_Add_Personal_Access_Token')} />
<Box>
<Controller
name='bypassTwoFactor'
control={control}
render={({ field }) => <Select {...field} options={twoFactorAuthOptions} />}
/>
</Box>
</Margins>
</Box>
<Button primary type='submit'>
{t('Add')}
</Button>
</Box>
);
};

@ -17,7 +17,7 @@ import {
FieldError,
FieldHint,
} from '@rocket.chat/fuselage';
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { useMutableCallback, useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useSetModal, useToastMessageDispatch, useRoute, useEndpoint, useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React, { useCallback } from 'react';
@ -41,7 +41,6 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac
const emailAlreadyExistsAction = useEndpoint('GET', '/v1/email-inbox.search');
const {
register,
control,
handleSubmit,
formState: { errors, isDirty },
@ -166,6 +165,26 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac
return t('Email_already_exists');
});
const activeField = useUniqueId();
const nameField = useUniqueId();
const emailField = useUniqueId();
const descriptionField = useUniqueId();
const senderInfoField = useUniqueId();
const departmentField = useUniqueId();
const smtpServerField = useUniqueId();
const smtpPortField = useUniqueId();
const smtpUsernameField = useUniqueId();
const smtpPasswordField = useUniqueId();
const smtpSecureField = useUniqueId();
const imapServerField = useUniqueId();
const imapPortField = useUniqueId();
const imapUsernameField = useUniqueId();
const imapPasswordField = useUniqueId();
const imapRetriesField = useUniqueId();
const imapSecureField = useUniqueId();
return (
<PageScrollableContentWithShadow>
<Box maxWidth='x600' w='full' alignSelf='center'>
@ -173,185 +192,385 @@ const EmailInboxForm = ({ inboxData }: { inboxData?: IEmailInboxPayload }): Reac
<Accordion.Item defaultExpanded title={t('Inbox_Info')}>
<FieldGroup>
<Field>
<FieldLabel display='flex' justifyContent='space-between' w='full'>
{t('Active')}
<FieldRow>
<FieldLabel htmlFor={activeField}>{t('Active')}</FieldLabel>
<Controller
control={control}
name='active'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch ref={ref} checked={value} onChange={onChange} />
<ToggleSwitch id={activeField} ref={ref} checked={value} onChange={onChange} />
)}
/>
</FieldLabel>
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Name')}*</FieldLabel>
<FieldLabel htmlFor={nameField} required>
{t('Name')}
</FieldLabel>
<FieldRow>
<TextInput
{...register('name', { required: t('error-the-field-is-required', { field: t('Name') }) })}
error={errors.name?.message}
<Controller
name='name'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Name') }) }}
render={({ field }) => (
<TextInput
id={nameField}
{...field}
error={errors.name?.message}
aria-required={true}
aria-invalid={Boolean(errors.name)}
aria-describedby={`${nameField}-error`}
/>
)}
/>
</FieldRow>
{errors.name && <FieldError>{errors.name?.message}</FieldError>}
{errors.name && (
<FieldError aria-live='assertive' id={`${nameField}-error`}>
{errors.name?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Email')}*</FieldLabel>
<FieldLabel htmlFor={emailField} required>
{t('Email')}
</FieldLabel>
<FieldRow>
<TextInput
{...register('email', {
<Controller
name='email'
control={control}
rules={{
required: t('error-the-field-is-required', { field: t('Email') }),
validate: (value) => checkEmailExists(value),
})}
error={errors.email?.message}
}}
render={({ field }) => (
<TextInput
{...field}
id={emailField}
error={errors.email?.message}
aria-required={true}
aria-invalid={Boolean(errors.email)}
aria-describedby={`${emailField}-error`}
/>
)}
/>
</FieldRow>
{errors.email && <FieldError>{errors.email?.message}</FieldError>}
{errors.email && (
<FieldError aria-live='assertive' id={`${emailField}-error`}>
{errors.email?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Description')}</FieldLabel>
<FieldLabel htmlFor={descriptionField}>{t('Description')}</FieldLabel>
<FieldRow>
<TextAreaInput {...register('description')} rows={4} />
<Controller
name='description'
control={control}
render={({ field }) => <TextAreaInput id={descriptionField} {...field} rows={4} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Sender_Info')}</FieldLabel>
<FieldLabel htmlFor={senderInfoField}>{t('Sender_Info')}</FieldLabel>
<FieldRow>
<TextInput {...register('senderInfo')} placeholder={t('Optional')} />
<Controller
name='senderInfo'
control={control}
render={({ field }) => <TextInput id={senderInfoField} {...field} aria-describedby={`${senderInfoField}-hint`} />}
/>
</FieldRow>
<FieldHint>{t('Will_Appear_In_From')}</FieldHint>
<FieldHint id={`${senderInfoField}-hint`}>{t('Will_Appear_In_From')}</FieldHint>
</Field>
<Field>
<FieldLabel>{t('Department')}</FieldLabel>
<FieldLabel htmlFor={departmentField}>{t('Department')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='department'
render={({ field: { onChange, value } }): ReactElement => <AutoCompleteDepartment value={value} onChange={onChange} />}
render={({ field: { onChange, onBlur, name, value } }) => (
<AutoCompleteDepartment
id={departmentField}
name={name}
onBlur={onBlur}
value={value}
onChange={onChange}
aria-describedby={`${departmentField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint>{t('Only_Members_Selected_Department_Can_View_Channel')}</FieldHint>
<FieldHint id={`${departmentField}-hint`}>{t('Only_Members_Selected_Department_Can_View_Channel')}</FieldHint>
</Field>
</FieldGroup>
</Accordion.Item>
<Accordion.Item defaultExpanded={!inboxData?._id} title={t('Configure_Outgoing_Mail_SMTP')}>
<FieldGroup>
<Field>
<FieldLabel>{t('Server')}*</FieldLabel>
<FieldLabel htmlFor={smtpServerField} required>
{t('Server')}
</FieldLabel>
<FieldRow>
<TextInput
{...register('smtpServer', { required: t('error-the-field-is-required', { field: t('Server') }) })}
error={errors.smtpServer?.message}
<Controller
name='smtpServer'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Server') }) }}
render={({ field }) => (
<TextInput
id={smtpServerField}
{...field}
error={errors.smtpServer?.message}
aria-required={true}
aria-invalid={Boolean(errors.email)}
aria-describedby={`${smtpServerField}-error`}
/>
)}
/>
</FieldRow>
{errors.smtpServer && <FieldError>{errors.smtpServer?.message}</FieldError>}
{errors.smtpServer && (
<FieldError aria-live='assertive' id={`${smtpServerField}-error`}>
{errors.smtpServer?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Port')}*</FieldLabel>
<FieldLabel htmlFor={smtpPortField} required>
{t('Port')}
</FieldLabel>
<FieldRow>
<NumberInput
{...register('smtpPort', { required: t('error-the-field-is-required', { field: t('Port') }) })}
error={errors.smtpPort?.message}
<Controller
name='smtpPort'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Port') }) }}
render={({ field }) => (
<NumberInput
id={smtpPortField}
{...field}
error={errors.smtpPort?.message}
aria-required={true}
aria-invalid={Boolean(errors.email)}
aria-describedby={`${smtpPortField}-error`}
/>
)}
/>
</FieldRow>
{errors.smtpPort && <FieldError>{errors.smtpPort?.message}</FieldError>}
{errors.smtpPort && (
<FieldError aria-live='assertive' id={`${smtpPortField}-error`}>
{errors.smtpPort?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Username')}*</FieldLabel>
<FieldLabel htmlFor={smtpUsernameField} required>
{t('Username')}
</FieldLabel>
<FieldRow>
<TextInput
{...register('smtpUsername', { required: t('error-the-field-is-required', { field: t('Username') }) })}
error={errors.smtpUsername?.message}
<Controller
name='smtpUsername'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Username') }) }}
render={({ field }) => (
<TextInput
id={smtpUsernameField}
{...field}
error={errors.smtpUsername?.message}
aria-describedby={`${smtpUsernameField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.smtpUsername && <FieldError>{errors.smtpUsername?.message}</FieldError>}
{errors.smtpUsername && (
<FieldError aria-live='assertive' id={`${smtpUsernameField}-error`}>
{errors.smtpUsername?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Password')}*</FieldLabel>
<FieldLabel htmlFor={smtpPasswordField} required>
{t('Password')}
</FieldLabel>
<FieldRow>
<PasswordInput
{...register('smtpPassword', { required: t('error-the-field-is-required', { field: t('Password') }) })}
error={errors.smtpPassword?.message}
<Controller
name='smtpPassword'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Password') }) }}
render={({ field }) => (
<PasswordInput
id={smtpPasswordField}
{...field}
error={errors.smtpPassword?.message}
aria-describedby={`${smtpPasswordField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.smtpPassword && <FieldError>{errors.smtpPassword?.message}</FieldError>}
{errors.smtpPassword && (
<FieldError aria-live='assertive' id={`${smtpPasswordField}-error`}>
{errors.smtpPassword?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel display='flex' justifyContent='space-between' w='full'>
{t('Connect_SSL_TLS')}
<FieldRow>
<FieldLabel htmlFor={smtpSecureField}>{t('Connect_SSL_TLS')}</FieldLabel>
<Controller
control={control}
name='smtpSecure'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch ref={ref} checked={value} onChange={onChange} />
)}
render={({ field: { value, ...field } }) => <ToggleSwitch id={smtpSecureField} {...field} checked={value} />}
/>
</FieldLabel>
</FieldRow>
</Field>
</FieldGroup>
</Accordion.Item>
<Accordion.Item defaultExpanded={!inboxData?._id} title={t('Configure_Incoming_Mail_IMAP')}>
<FieldGroup>
<Field>
<FieldLabel>{t('Server')}*</FieldLabel>
<FieldLabel htmlFor={imapServerField} required>
{t('Server')}
</FieldLabel>
<FieldRow>
<TextInput
{...register('imapServer', { required: t('error-the-field-is-required', { field: t('Server') }) })}
error={errors.imapServer?.message}
<Controller
name='imapServer'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Server') }) }}
render={({ field }) => (
<TextInput
id={imapServerField}
{...field}
error={errors.imapServer?.message}
aria-describedby={`${imapServerField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.imapServer && <FieldError>{errors.imapServer?.message}</FieldError>}
{errors.imapServer && (
<FieldError aria-live='assertive' id={`${imapServerField}-error`}>
{errors.imapServer?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Port')}*</FieldLabel>
<FieldLabel htmlFor={imapPortField} required>
{t('Port')}
</FieldLabel>
<FieldRow>
<NumberInput
{...register('imapPort', { required: t('error-the-field-is-required', { field: t('Port') }) })}
error={errors.imapPort?.message}
<Controller
name='imapPort'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Port') }) }}
render={({ field }) => (
<NumberInput
id={imapPortField}
{...field}
error={errors.imapPort?.message}
aria-aria-describedby={`${imapPortField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.imapPort && <FieldError>{errors.imapPort?.message}</FieldError>}
{errors.imapPort && (
<FieldError aria-live='assertive' id={`${imapPortField}-error`}>
{errors.imapPort?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Username')}*</FieldLabel>
<FieldLabel htmlFor={imapUsernameField} required>
{t('Username')}
</FieldLabel>
<FieldRow>
<TextInput
{...register('imapUsername', { required: t('error-the-field-is-required', { field: t('Username') }) })}
error={errors.imapUsername?.message}
<Controller
name='imapUsername'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Username') }) }}
render={({ field }) => (
<TextInput
id={imapUsernameField}
{...field}
error={errors.imapUsername?.message}
aria-describedby={`${imapUsernameField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.imapUsername && <FieldError>{errors.imapUsername?.message}</FieldError>}
{errors.imapUsername && (
<FieldError aria-live='assertive' id={`${imapUsernameField}-error`}>
{errors.imapUsername?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Password')}*</FieldLabel>
<FieldLabel htmlFor={imapPasswordField} required>
{t('Password')}
</FieldLabel>
<FieldRow>
<PasswordInput
{...register('imapPassword', { required: t('error-the-field-is-required', { field: t('Password') }) })}
error={errors.imapPassword?.message}
<Controller
name='imapPassword'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Password') }) }}
render={({ field }) => (
<PasswordInput
id={imapPasswordField}
{...field}
error={errors.imapPassword?.message}
aria-describedby={`${imapPasswordField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.imapPassword && <FieldError>{errors.imapPassword?.message}</FieldError>}
{errors.imapPassword && (
<FieldError aria-live='assertive' id={`${imapPasswordField}-error`}>
{errors.imapPassword?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Max_Retry')}*</FieldLabel>
<FieldLabel htmlFor={imapRetriesField} required>
{t('Max_Retry')}
</FieldLabel>
<FieldRow>
<NumberInput
{...register('imapRetries', { required: t('error-the-field-is-required', { field: t('Max_Retry') }) })}
error={errors.imapRetries?.message}
<Controller
name='imapRetries'
control={control}
rules={{ required: t('error-the-field-is-required', { field: t('Max_Retry') }) }}
render={({ field }) => (
<NumberInput
id={imapRetriesField}
{...field}
error={errors.imapRetries?.message}
aria-describedby={`${imapRetriesField}-error`}
aria-required={true}
aria-invalid={Boolean(errors.email)}
/>
)}
/>
</FieldRow>
{errors.imapRetries && <FieldError>{errors.imapRetries?.message}</FieldError>}
{errors.imapRetries && (
<FieldError aria-live='assertive' id={`${imapRetriesField}-error`}>
{errors.imapRetries?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel display='flex' justifyContent='space-between' w='full'>
{t('Connect_SSL_TLS')}
<FieldRow>
<FieldLabel htmlFor={imapSecureField}>{t('Connect_SSL_TLS')}</FieldLabel>
<Controller
control={control}
name='imapSecure'
render={({ field: { onChange, value, ref } }): ReactElement => (
<ToggleSwitch ref={ref} checked={value} onChange={onChange} />
)}
render={({ field: { value, ...field } }) => <ToggleSwitch id={imapSecureField} {...field} checked={value} />}
/>
</FieldLabel>
</FieldRow>
</Field>
</FieldGroup>
</Accordion.Item>

@ -139,16 +139,14 @@ const IncomingWebhookForm = ({ webhookData }: { webhookData?: Serialized<IIncomi
<AccordionItem title={t('Settings')} defaultExpanded>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={enabledField}>{t('Enabled')}</FieldLabel>
<FieldRow>
<Controller
name='enabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={enabledField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='enabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={enabledField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={nameField}>{t('Name')}</FieldLabel>
@ -276,30 +274,26 @@ const IncomingWebhookForm = ({ webhookData }: { webhookData?: Serialized<IIncomi
<FieldHint id={`${emojiField}-hint-2`} dangerouslySetInnerHTML={{ __html: t('Example_s', ':ghost:') }} />
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={overrideDestinationChannelEnabledField}>{t('Override_Destination_Channel')}</FieldLabel>
<FieldRow>
<Controller
name='overrideDestinationChannelEnabled'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={overrideDestinationChannelEnabledField} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='overrideDestinationChannelEnabled'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={overrideDestinationChannelEnabledField} {...field} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={scriptEnabledField}>{t('Script_Enabled')}</FieldLabel>
<FieldRow>
<Controller
name='scriptEnabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={scriptEnabledField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='scriptEnabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={scriptEnabledField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={scriptEngineField}>{t('Script_Engine')}</FieldLabel>

@ -144,16 +144,14 @@ const OutgoingWebhookForm = () => {
<FieldHint id={`${eventField}-hint`}>{t('Event_Trigger_Description')}</FieldHint>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={enabledField}>{t('Enabled')}</FieldLabel>
<FieldRow>
<Controller
name='enabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={enabledField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='enabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={enabledField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={nameField}>{t('Name')}</FieldLabel>
@ -265,16 +263,14 @@ const OutgoingWebhookForm = () => {
)}
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={impersonateUserField}>{t('Impersonate_user')}</FieldLabel>
<FieldRow>
<Controller
name='impersonateUser'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={impersonateUserField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='impersonateUser'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={impersonateUserField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={usernameField} required>
@ -391,16 +387,14 @@ const OutgoingWebhookForm = () => {
)}
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={scriptEnabledField}>{t('Script_Enabled')}</FieldLabel>
<FieldRow>
<Controller
name='scriptEnabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={scriptEnabledField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='scriptEnabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={scriptEnabledField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={scriptEngineField}>{t('Script_Engine')}</FieldLabel>
@ -449,23 +443,21 @@ const OutgoingWebhookForm = () => {
<AccordionItem title={t('Integration_Advanced_Settings')}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={retryFailedCallsField}>{t('Integration_Retry_Failed_Url_Calls')}</FieldLabel>
<FieldRow>
<Controller
name='retryFailedCalls'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={retryFailedCallsField}
{...field}
checked={value}
aria-describedby={`${retryFailedCallsField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='retryFailedCalls'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={retryFailedCallsField}
{...field}
checked={value}
aria-describedby={`${retryFailedCallsField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${retryFailedCallsField}-hint`}>{t('Integration_Retry_Failed_Url_Calls_Description')}</FieldHint>
</Field>
<Field>
@ -495,38 +487,34 @@ const OutgoingWebhookForm = () => {
{event === 'sendMessage' && (
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={triggerWordAnywhereField}>{t('Integration_Word_Trigger_Placement')}</FieldLabel>
<FieldRow>
<Controller
name='triggerWordAnywhere'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={triggerWordAnywhereField}
{...field}
checked={value}
aria-describedby={`${triggerWordAnywhereField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='triggerWordAnywhere'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={triggerWordAnywhereField}
{...field}
checked={value}
aria-describedby={`${triggerWordAnywhereField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${triggerWordAnywhereField}-hint`}>{t('Integration_Word_Trigger_Placement_Description')}</FieldHint>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={runOnEditsField}>{t('Integration_Run_When_Message_Is_Edited')}</FieldLabel>
<FieldRow>
<Controller
name='runOnEdits'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={runOnEditsField} {...field} checked={value} aria-describedby={`${runOnEditsField}-hint`} />
)}
/>
</FieldRow>
</Box>
<Controller
name='runOnEdits'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={runOnEditsField} {...field} checked={value} aria-describedby={`${runOnEditsField}-hint`} />
)}
/>
</FieldRow>
<FieldHint id={`${runOnEditsField}-hint`}>{t('Integration_Run_When_Message_Is_Edited_Description')}</FieldHint>
</Field>
</FieldGroup>

@ -100,6 +100,7 @@ const MailerPage = () => {
</Field>
<Field>
<FieldRow>
<FieldLabel htmlFor={dryRunId}>{t('Dry_run')}</FieldLabel>
<Controller
control={control}
name='dryRun'
@ -107,7 +108,6 @@ const MailerPage = () => {
<CheckBox aria-describedby={`${dryRunId}-hint`} ref={ref} id={dryRunId} checked={value} onChange={onChange} />
)}
/>
<FieldLabel htmlFor={dryRunId}>{t('Dry_run')}</FieldLabel>
</FieldRow>
<FieldHint id={`${dryRunId}-hint`}>{t('Dry_run_description')}</FieldHint>
</Field>

@ -101,15 +101,15 @@ const EditOauthApp = ({ onChange, data, ...props }: EditOauthAppProps): ReactEle
<ContextualbarScrollableContent w='full' {...props}>
<FieldGroup maxWidth='x600' alignSelf='center' w='full'>
<Field>
<FieldLabel display='flex' justifyContent='space-between' w='full'>
{t('Active')}
<FieldRow>
<FieldLabel>{t('Active')}</FieldLabel>
<Controller
name='active'
control={control}
defaultValue={data.active}
render={({ field }): ReactElement => <ToggleSwitch onChange={field.onChange} checked={field.value} />}
/>
</FieldLabel>
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Application_Name')}</FieldLabel>

@ -56,15 +56,15 @@ const OAuthAddApp = (): ReactElement => {
<ContextualbarScrollableContent w='full'>
<FieldGroup maxWidth='x600' alignSelf='center' w='full'>
<Field>
<FieldLabel display='flex' justifyContent='space-between' w='full'>
{t('Active')}
<FieldRow>
<FieldLabel>{t('Active')}</FieldLabel>
<Controller
name='active'
control={control}
defaultValue={false}
render={({ field }): ReactElement => <ToggleSwitch onChange={field.onChange} checked={field.value} />}
/>
</FieldLabel>
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Application_Name')}</FieldLabel>

@ -1,5 +1,5 @@
import type { SelectOption } from '@rocket.chat/fuselage';
import { Box, Field, FieldLabel, FieldRow, FieldError, FieldHint, TextInput, Select, ToggleSwitch } from '@rocket.chat/fuselage';
import { Field, FieldLabel, FieldRow, FieldError, FieldHint, TextInput, Select, ToggleSwitch } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React, { useMemo } from 'react';
@ -57,16 +57,14 @@ const RoleForm = ({ className, editing = false, isProtected = false, isDisabled
</FieldRow>
</Field>
<Field className={className}>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel>{t('Users must use Two Factor Authentication')}</FieldLabel>
<FieldRow>
<Controller
name='mandatory2fa'
control={control}
render={({ field }): ReactElement => <ToggleSwitch {...field} checked={field.value} disabled={isDisabled} />}
/>
</FieldRow>
</Box>
<Controller
name='mandatory2fa'
control={control}
render={({ field }): ReactElement => <ToggleSwitch {...field} checked={field.value} disabled={isDisabled} />}
/>
</FieldRow>
</Field>
</>
);

@ -216,132 +216,118 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => {
)}
{canViewType && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={roomTypeField}>{t('Private')}</FieldLabel>
<FieldRow>
<Controller
name='roomType'
control={control}
render={({ field: { value, onChange, ...field } }) => (
<ToggleSwitch
{...field}
id={roomTypeField}
disabled={isDeleting || isRoomFederated(room)}
checked={roomType === 'p'}
onChange={() => onChange(value === 'p' ? 'c' : 'p')}
aria-describedby={`${roomTypeField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='roomType'
control={control}
render={({ field: { value, onChange, ...field } }) => (
<ToggleSwitch
{...field}
id={roomTypeField}
disabled={isDeleting || isRoomFederated(room)}
checked={roomType === 'p'}
onChange={() => onChange(value === 'p' ? 'c' : 'p')}
aria-describedby={`${roomTypeField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${roomTypeField}-hint`}>{t('Just_invited_people_can_access_this_channel')}</FieldHint>
</Field>
)}
{canViewReadOnly && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={readOnlyField}>{t('Read_only')}</FieldLabel>
<FieldRow>
<Controller
name='readOnly'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={readOnlyField}
{...field}
disabled={isDeleting || isRoomFederated(room)}
checked={value}
aria-aria-describedby={`${readOnlyField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='readOnly'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={readOnlyField}
{...field}
disabled={isDeleting || isRoomFederated(room)}
checked={value}
aria-aria-describedby={`${readOnlyField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${readOnlyField}-hint`}>{t('Only_authorized_users_can_write_new_messages')}</FieldHint>
</Field>
)}
{readOnly && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={reactWhenReadOnly}>{t('React_when_read_only')}</FieldLabel>
<FieldRow>
<Controller
name='reactWhenReadOnly'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={reactWhenReadOnly}
{...field}
checked={value || isRoomFederated(room)}
aria-describedby={`${reactWhenReadOnly}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='reactWhenReadOnly'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={reactWhenReadOnly}
{...field}
checked={value || isRoomFederated(room)}
aria-describedby={`${reactWhenReadOnly}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${reactWhenReadOnly}-hint`}>{t('React_when_read_only_changed_successfully')}</FieldHint>
</Field>
)}
{canViewArchived && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={archivedField}>{t('Room_archivation_state_true')}</FieldLabel>
<FieldRow>
<Controller
name='archived'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={archivedField} {...field} disabled={isDeleting || isRoomFederated(room)} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='archived'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={archivedField} {...field} disabled={isDeleting || isRoomFederated(room)} checked={value} />
)}
/>
</FieldRow>
</Field>
)}
</>
)}
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={isDefaultField}>{t('Default')}</FieldLabel>
<FieldRow>
<Controller
name='isDefault'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={isDefaultField} {...field} disabled={isDeleting || isRoomFederated(room)} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='isDefault'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={isDefaultField} {...field} disabled={isDeleting || isRoomFederated(room)} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={favoriteField}>{t('Favorite')}</FieldLabel>
<FieldRow>
<Controller
name='favorite'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={favoriteField} {...field} disabled={isDeleting} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='favorite'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={favoriteField} {...field} disabled={isDeleting} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={featuredField}>{t('Featured')}</FieldLabel>
<FieldRow>
<Controller
name='featured'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={featuredField} {...field} disabled={isDeleting || isRoomFederated(room)} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='featured'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={featuredField} {...field} disabled={isDeleting || isRoomFederated(room)} checked={value} />
)}
/>
</FieldRow>
</Field>
</ContextualbarScrollableContent>
<ContextualbarFooter>

@ -7,7 +7,7 @@ import React from 'react';
function ResetSettingButton(props: ComponentProps<typeof Button>): ReactElement {
const t = useTranslation();
return <IconButton icon='undo' type='button' aria-label={t('Reset')} danger small title={t('Reset')} style={{ padding: 0 }} {...props} />;
return <IconButton icon='undo' danger small title={t('Reset')} {...props} />;
}
export default ResetSettingButton;

@ -31,18 +31,11 @@ function BooleanSettingInput({
return (
<FieldRow marginBlockEnd={8}>
<ToggleSwitch
data-qa-setting-id={_id}
id={_id}
value='true'
checked={value === true}
disabled={disabled || readonly}
onChange={handleChange}
/>
<FieldLabel htmlFor={_id} title={_id}>
{label}
</FieldLabel>
{hasResetButton && <ResetSettingButton data-qa-reset-setting-id={_id} onClick={onResetButtonClick} />}
<ToggleSwitch data-qa-setting-id={_id} id={_id} checked={value === true} disabled={disabled || readonly} onChange={handleChange} />
{hasResetButton && <ResetSettingButton mis={8} data-qa-reset-setting-id={_id} onClick={onResetButtonClick} />}
</FieldRow>
);
}

@ -263,16 +263,14 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => {
)}
</Field>
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={verifiedId}>{t('Verified')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='verified'
render={({ field: { onChange, value } }) => <ToggleSwitch id={verifiedId} checked={value} onChange={onChange} />}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='verified'
render={({ field: { onChange, value } }) => <ToggleSwitch id={verifiedId} checked={value} onChange={onChange} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={statusTextId}>{t('StatusMessage')}</FieldLabel>
@ -370,45 +368,41 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => {
</Field>
)}
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={requirePasswordChangeId}>{t('Require_password_change')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='requirePasswordChange'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch
ref={ref}
id={requirePasswordChangeId}
disabled={setRandomPassword}
checked={setRandomPassword || value}
onChange={onChange}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='requirePasswordChange'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch
ref={ref}
id={requirePasswordChangeId}
disabled={setRandomPassword}
checked={setRandomPassword || value}
onChange={onChange}
/>
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={setRandomPasswordId}>{t('Set_random_password_and_send_by_email')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='setRandomPassword'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch
ref={ref}
id={setRandomPasswordId}
aria-describedby={`${setRandomPasswordId}-hint`}
checked={value}
onChange={onChange}
disabled={!isSmtpEnabled}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='setRandomPassword'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch
ref={ref}
id={setRandomPasswordId}
aria-describedby={`${setRandomPasswordId}-hint`}
checked={value}
onChange={onChange}
disabled={!isSmtpEnabled}
/>
)}
/>
</FieldRow>
{!isSmtpEnabled && (
<FieldHint
id={`${setRandomPasswordId}-hint`}
@ -441,38 +435,34 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => {
{errors?.roles && <FieldError>{errors.roles.message}</FieldError>}
</Field>
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={joinDefaultChannelsId}>{t('Join_default_channels')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='joinDefaultChannels'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch id={joinDefaultChannelsId} ref={ref} onChange={onChange} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='joinDefaultChannels'
render={({ field: { ref, onChange, value } }) => (
<ToggleSwitch id={joinDefaultChannelsId} ref={ref} onChange={onChange} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' alignItems='center' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={sendWelcomeEmailId}>{t('Send_welcome_email')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='sendWelcomeEmail'
render={({ field: { onChange, value } }) => (
<ToggleSwitch
id={sendWelcomeEmailId}
aria-describedby={`${sendWelcomeEmailId}-hint`}
onChange={onChange}
checked={value}
disabled={!isSmtpEnabled}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='sendWelcomeEmail'
render={({ field: { onChange, value } }) => (
<ToggleSwitch
id={sendWelcomeEmailId}
aria-describedby={`${sendWelcomeEmailId}-hint`}
onChange={onChange}
checked={value}
disabled={!isSmtpEnabled}
/>
)}
/>
</FieldRow>
{!isSmtpEnabled && (
<FieldHint
id={`${sendWelcomeEmailId}-hint`}

@ -1,4 +1,5 @@
import { Modal, Box, Field, FieldLabel, FieldRow, TextInput, CheckBox, ButtonGroup, Button } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { ExternalLink } from '@rocket.chat/ui-client';
import { useEndpoint, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';
@ -51,6 +52,9 @@ const RegisterWorkspaceSetupStepOneModal = ({
}
};
const emailField = useUniqueId();
const termsField = useUniqueId();
return (
<Modal {...props}>
<Modal.Header>
@ -66,9 +70,10 @@ const RegisterWorkspaceSetupStepOneModal = ({
{t('RegisterWorkspace_Setup_Subtitle')}
</Box>
<Field pbs={10}>
<FieldLabel>{t('RegisterWorkspace_Setup_Label')}</FieldLabel>
<FieldLabel htmlFor={emailField}>{t('RegisterWorkspace_Setup_Label')}</FieldLabel>
<FieldRow>
<TextInput
id={emailField}
onChange={(e) => {
setEmail((e.target as HTMLInputElement).value);
}}
@ -85,16 +90,18 @@ const RegisterWorkspaceSetupStepOneModal = ({
</Box>
<Box is='p'>{t('RegisterWorkspace_Setup_No_Account_Subtitle')}</Box>
</Box>
<Box display='flex'>
<CheckBox checked={terms} onChange={() => setTerms(!terms)} />
<Box is='p' fontSize='c1' pis={8}>
<Trans i18nKey='RegisterWorkspace_Setup_Terms_Privacy'>
I agree with <ExternalLink to='https://rocket.chat/terms'>Terms and Conditions </ExternalLink>
and
<ExternalLink to='https://rocket.chat/privacy'>Privacy Policy</ExternalLink>
</Trans>
</Box>
</Box>
<Field>
<FieldRow justifyContent='initial'>
<FieldLabel fontScale='c1' htmlFor={termsField} pie={8}>
<Trans i18nKey='RegisterWorkspace_Setup_Terms_Privacy'>
I agree with <ExternalLink to='https://rocket.chat/terms'>Terms and Conditions </ExternalLink>
and
<ExternalLink to='https://rocket.chat/privacy'>Privacy Policy</ExternalLink>
</Trans>
</FieldLabel>
<CheckBox id={termsField} checked={terms} onChange={() => setTerms(!terms)} />
</FieldRow>
</Field>
</Box>
</Modal.Content>
<Modal.Footer>

@ -30,6 +30,10 @@ const WorkspaceRoute = (): ReactElement => {
statisticsQuery.refetch();
};
const handleClickDownloadInfo = (): void => {
downloadJsonAs(statisticsQuery.data, 'statistics');
};
if (serverInfoQuery.isError || instancesQuery.isError || statisticsQuery.isError) {
return (
<Page>
@ -47,10 +51,6 @@ const WorkspaceRoute = (): ReactElement => {
);
}
const handleClickDownloadInfo = (): void => {
downloadJsonAs(statisticsQuery.data, 'statistics');
};
return (
<WorkspacePage
canViewStatistics={canViewStatistics}

@ -1,5 +1,4 @@
import {
Box,
Field,
FieldLabel,
FieldRow,
@ -68,18 +67,16 @@ const AppearanceForm = () => {
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatEnableMessageCharacterLimit}>{t('Livechat_enable_message_character_limit')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_enable_message_character_limit'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={livechatEnableMessageCharacterLimit} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_enable_message_character_limit'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={livechatEnableMessageCharacterLimit} {...field} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={livechatMessageCharacterLimit}>{t('Message_Characther_Limit')}</FieldLabel>
@ -100,44 +97,38 @@ const AppearanceForm = () => {
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatShowAgentInfo}>{t('Show_agent_info')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_show_agent_info'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatShowAgentInfo} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_show_agent_info'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatShowAgentInfo} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatShowAgentEmail}>{t('Show_agent_email')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_show_agent_email'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatShowAgentEmail} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_show_agent_email'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatShowAgentEmail} {...field} checked={value} />}
/>
</FieldRow>
</Field>
</FieldGroup>
</Accordion.Item>
<Accordion.Item title={t('Livechat_offline')}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatDisplayOfflineForm}>{t('Display_offline_form')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_display_offline_form'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatDisplayOfflineForm} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_display_offline_form'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatDisplayOfflineForm} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={livechatOfflineFormUnavailableField}>{t('Offline_form_unavailable_message')}</FieldLabel>
@ -204,44 +195,38 @@ const AppearanceForm = () => {
<Accordion.Item title={t('Livechat_registration_form')}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatRegistrationForm}>{t('Enabled')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_registration_form'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatRegistrationForm} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_registration_form'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={livechatRegistrationForm} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatNameFieldRegistrationForm}>{t('Show_name_field')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_name_field_registration_form'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={livechatNameFieldRegistrationForm} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_name_field_registration_form'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={livechatNameFieldRegistrationForm} {...field} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={livechatEmailFieldRegistrationForm}>{t('Show_email_field')}</FieldLabel>
<FieldRow>
<Controller
name='Livechat_email_field_registration_form'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={livechatEmailFieldRegistrationForm} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
name='Livechat_email_field_registration_form'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={livechatEmailFieldRegistrationForm} {...field} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={livechatRegistrationFormMessageField}>{t('Livechat_registration_form_message')}</FieldLabel>

@ -2,7 +2,6 @@ import type { ILivechatCustomField, Serialized } from '@rocket.chat/core-typings
import type { SelectOption } from '@rocket.chat/fuselage';
import {
FieldError,
Box,
Button,
ButtonGroup,
Field,
@ -170,28 +169,24 @@ const EditCustomFields = ({ customFieldData }: { customFieldData?: Serialized<IL
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={visibilityField}>{t('Visible')}</FieldLabel>
<FieldRow>
<Controller
name='visibility'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={visibilityField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='visibility'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={visibilityField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={searchableField}>{t('Searchable')}</FieldLabel>
<FieldRow>
<Controller
name='searchable'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={searchableField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='searchable'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={searchableField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={regexpField}>{t('Validation')}</FieldLabel>

@ -1,15 +1,15 @@
import { Button, Chip, FieldRow, FieldHint, TextInput } from '@rocket.chat/fuselage';
import { Button, Chip, FieldRow, TextInput } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { FormEvent } from 'react';
import type { ComponentProps, FormEvent } from 'react';
import React, { useCallback, useState } from 'react';
type DepartmentTagsProps = {
error: string;
value: string[];
onChange: (tags: string[]) => void;
};
} & ComponentProps<typeof TextInput>;
export const DepartmentTags = ({ error, value: tags, onChange }: DepartmentTagsProps) => {
const DepartmentTags = ({ error, value: tags, onChange, ...props }: DepartmentTagsProps) => {
const t = useTranslation();
const [tagText, setTagText] = useState('');
@ -35,6 +35,7 @@ export const DepartmentTags = ({ error, value: tags, onChange }: DepartmentTagsP
placeholder={t('Enter_a_tag')}
value={tagText}
onChange={(e: FormEvent<HTMLInputElement>) => setTagText(e.currentTarget.value)}
{...props}
/>
<Button
disabled={Boolean(!tagText.trim()) || tags.includes(tagText)}
@ -46,11 +47,8 @@ export const DepartmentTags = ({ error, value: tags, onChange }: DepartmentTagsP
{t('Add')}
</Button>
</FieldRow>
<FieldHint>{t('Conversation_closing_tags_description')}</FieldHint>
{tags?.length > 0 && (
<FieldRow justifyContent='flex-start'>
<FieldRow>
{tags.map((tag, i) => (
<Chip key={i} onClick={handleTagChipClick(tag)} mie={8}>
{tag}
@ -61,3 +59,5 @@ export const DepartmentTags = ({ error, value: tags, onChange }: DepartmentTagsP
</>
);
};
export default DepartmentTags;

@ -14,6 +14,7 @@ import {
ButtonGroup,
Button,
PaginatedSelectFiltered,
FieldHint,
} from '@rocket.chat/fuselage';
import { useDebouncedValue, useMutableCallback, useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useToastMessageDispatch, useRoute, useMethod, useEndpoint, useTranslation } from '@rocket.chat/ui-contexts';
@ -30,7 +31,7 @@ import { useRoomsList } from '../../../hooks/useRoomsList';
import { AsyncStatePhase } from '../../../lib/asyncState';
import { EeTextInput, EeTextAreaInput, EeNumberInput, DepartmentForwarding, DepartmentBusinessHours } from '../additionalForms';
import DepartmentsAgentsTable from './DepartmentAgentsTable/DepartmentAgentsTable';
import { DepartmentTags } from './DepartmentTags';
import DepartmentTags from './DepartmentTags';
export type EditDepartmentProps = {
id?: string;
@ -207,6 +208,16 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen
const isFormValid = isValid && isDirty;
const formId = useUniqueId();
const enabledField = useUniqueId();
const nameField = useUniqueId();
const descriptionField = useUniqueId();
const showOnRegistrationField = useUniqueId();
const emailField = useUniqueId();
const showOnOfflineFormField = useUniqueId();
const offlineMessageChannelNameField = useUniqueId();
const fallbackForwardDepartmentField = useUniqueId();
const requestTagBeforeClosingChatField = useUniqueId();
const chatClosingTagsField = useUniqueId();
return (
<Page flexDirection='row'>
@ -232,18 +243,18 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen
onSubmit={handleSubmit(handleSave)}
>
<Field>
<Box display='flex' data-qa='DepartmentEditToggle-Enabled' flexDirection='row'>
<FieldLabel>{t('Enabled')}</FieldLabel>
<FieldRow>
<ToggleSwitch flexGrow={1} {...register('enabled')} />
</FieldRow>
</Box>
<FieldRow>
<FieldLabel htmlFor={enabledField}>{t('Enabled')}</FieldLabel>
<ToggleSwitch id={enabledField} {...register('enabled')} />
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Name')}*</FieldLabel>
<FieldLabel htmlFor={nameField} required>
{t('Name')}
</FieldLabel>
<FieldRow>
<TextInput
id={nameField}
data-qa='DepartmentEditTextInput-Name'
flexGrow={1}
error={errors.name?.message as string}
@ -251,36 +262,37 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen
{...register('name', { required: t('The_field_is_required', 'name') })}
/>
</FieldRow>
{errors.name && <FieldError>{errors.name?.message}</FieldError>}
{errors.name && (
<FieldError aria-live='assertive' id={`${nameField}-error`}>
{errors.name?.message}
</FieldError>
)}
</Field>
<Field>
<FieldLabel>{t('Description')}</FieldLabel>
<FieldLabel htmlFor={descriptionField}>{t('Description')}</FieldLabel>
<FieldRow>
<TextAreaInput
id={descriptionField}
data-qa='DepartmentEditTextInput-Description'
flexGrow={1}
placeholder={t('Description')}
{...register('description')}
/>
</FieldRow>
</Field>
<Field>
<Box data-qa='DepartmentEditToggle-ShowOnRegistrationPage' display='flex' flexDirection='row'>
<FieldLabel>{t('Show_on_registration_page')}</FieldLabel>
<FieldRow>
<ToggleSwitch flexGrow={1} {...register('showOnRegistration')} />
</FieldRow>
</Box>
<Field data-qa='DepartmentEditToggle-ShowOnRegistrationPage'>
<FieldRow>
<FieldLabel htmlFor={showOnRegistrationField}>{t('Show_on_registration_page')}</FieldLabel>
<ToggleSwitch id={showOnRegistrationField} {...register('showOnRegistration')} />
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Email')}*</FieldLabel>
<FieldLabel htmlFor={emailField} required>
{t('Email')}
</FieldLabel>
<FieldRow>
<TextInput
id={emailField}
data-qa='DepartmentEditTextInput-Email'
flexGrow={1}
error={errors.email?.message as string}
addon={<Icon name='mail' size='x20' />}
placeholder={t('Email')}
@ -288,28 +300,30 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen
required: t('The_field_is_required', 'email'),
validate: (email) => validateEmail(email) || t('error-invalid-email-address'),
})}
aria-describedby={`${emailField}-error`}
/>
</FieldRow>
{errors.email && <FieldError>{errors.email?.message}</FieldError>}
{errors.email && (
<FieldError aria-live='assertive' id={`${emailField}-error`}>
{errors.email?.message}
</FieldError>
)}
</Field>
<Field>
<Box display='flex' data-qa='DepartmentEditToggle-ShowOnOfflinePage' flexDirection='row'>
<FieldLabel>{t('Show_on_offline_page')}</FieldLabel>
<FieldRow>
<ToggleSwitch flexGrow={1} {...register('showOnOfflineForm')} />
</FieldRow>
</Box>
<FieldRow>
<FieldLabel htmlFor={showOnOfflineFormField}>{t('Show_on_offline_page')}</FieldLabel>
<ToggleSwitch id={showOnOfflineFormField} {...register('showOnOfflineForm')} />
</FieldRow>
</Field>
<Field>
<FieldLabel>{t('Livechat_DepartmentOfflineMessageToChannel')}</FieldLabel>
<FieldLabel htmlFor={offlineMessageChannelNameField}>{t('Livechat_DepartmentOfflineMessageToChannel')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='offlineMessageChannelName'
render={({ field: { value, onChange } }) => (
<PaginatedSelectFiltered
id={offlineMessageChannelNameField}
data-qa='DepartmentSelect-LivechatDepartmentOfflineMessageToChannel'
value={value}
onChange={onChange}
@ -327,134 +341,129 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen
/>
</FieldRow>
</Field>
<Field>
<Controller
control={control}
name='maxNumberSimultaneousChat'
render={({ field: { value, onChange } }) => (
<EeNumberInput
value={value}
handler={onChange}
label='Max_number_of_chats_per_agent'
placeholder='Max_number_of_chats_per_agent_description'
{hasLicense && (
<>
<Field>
<Controller
control={control}
name='maxNumberSimultaneousChat'
render={({ field }) => (
<EeNumberInput
{...field}
label={t('Max_number_of_chats_per_agent')}
placeholder={t('Max_number_of_chats_per_agent_description')}
/>
)}
/>
)}
/>
</Field>
<Field>
<Controller
control={control}
name='visitorInactivityTimeoutInSeconds'
render={({ field: { value, onChange } }) => (
<EeNumberInput
value={value}
handler={onChange}
label='How_long_to_wait_to_consider_visitor_abandonment_in_seconds'
placeholder='Number_in_seconds'
</Field>
<Field>
<Controller
control={control}
name='visitorInactivityTimeoutInSeconds'
render={({ field }) => (
<EeNumberInput
{...field}
label={t('How_long_to_wait_to_consider_visitor_abandonment_in_seconds')}
placeholder={t('Number_in_seconds')}
/>
)}
/>
)}
/>
</Field>
<Field>
<Controller
control={control}
name='abandonedRoomsCloseCustomMessage'
render={({ field: { value, onChange } }) => (
<EeTextInput
value={value}
handler={onChange}
label='Livechat_abandoned_rooms_closed_custom_message'
placeholder='Enter_a_custom_message'
</Field>
<Field>
<Controller
control={control}
name='abandonedRoomsCloseCustomMessage'
render={({ field }) => (
<EeTextInput
{...field}
label={t('Livechat_abandoned_rooms_closed_custom_message')}
placeholder={t('Enter_a_custom_message')}
/>
)}
/>
)}
/>
</Field>
<Field>
<Controller
control={control}
name='waitingQueueMessage'
render={({ field: { value, onChange } }) => (
<EeTextAreaInput value={value} handler={onChange} label='Waiting_queue_message' placeholder='Waiting_queue_message' />
)}
/>
</Field>
{DepartmentForwarding && (
<Field>
<Controller
control={control}
name='departmentsAllowedToForward'
render={({ field: { value, onChange } }) => (
<DepartmentForwarding
departmentId={id ?? ''}
value={value}
handler={onChange}
label='List_of_departments_for_forward'
/>
)}
/>
</Field>
)}
{hasLicense && (
<Field>
<FieldLabel>{t('Fallback_forward_department')}</FieldLabel>
<Controller
control={control}
name='fallbackForwardDepartment'
render={({ field: { value, onChange } }) => (
<AutoCompleteDepartment
haveNone
excludeDepartmentId={department?._id}
value={value}
onChange={onChange}
onlyMyDepartments
showArchived
/>
)}
/>
</Field>
</Field>
<Field>
<Controller
control={control}
name='waitingQueueMessage'
render={({ field }) => (
<EeTextAreaInput {...field} label={t('Waiting_queue_message')} placeholder={t('Waiting_queue_message')} />
)}
/>
</Field>
<Field>
<Controller
control={control}
name='departmentsAllowedToForward'
render={({ field: { value, onChange } }) => (
<DepartmentForwarding
departmentId={id ?? ''}
value={value}
handler={onChange}
label='List_of_departments_for_forward'
/>
)}
/>
</Field>
<Field>
<FieldLabel htmlFor={fallbackForwardDepartmentField}>{t('Fallback_forward_department')}</FieldLabel>
<Controller
control={control}
name='fallbackForwardDepartment'
render={({ field: { value, onChange } }) => (
<AutoCompleteDepartment
id={fallbackForwardDepartmentField}
haveNone
excludeDepartmentId={department?._id}
value={value}
onChange={onChange}
onlyMyDepartments
showArchived
/>
)}
/>
</Field>
</>
)}
<Field>
<Box display='flex' data-qa='DiscussionToggle-RequestTagBeforeCLosingChat' flexDirection='row'>
<FieldLabel>{t('Request_tag_before_closing_chat')}</FieldLabel>
<FieldRow>
<ToggleSwitch
data-qa='DiscussionToggle-RequestTagBeforeCLosingChat'
flexGrow={1}
{...register('requestTagBeforeClosingChat')}
/>
</FieldRow>
</Box>
<FieldRow>
<FieldLabel htmlFor={requestTagBeforeClosingChatField}>{t('Request_tag_before_closing_chat')}</FieldLabel>
<ToggleSwitch id={requestTagBeforeClosingChatField} {...register('requestTagBeforeClosingChat')} />
</FieldRow>
</Field>
{requestTagBeforeClosingChat && (
<Field>
<FieldLabel alignSelf='stretch'>{t('Conversation_closing_tags')}*</FieldLabel>
<FieldLabel htmlFor={chatClosingTagsField} required>
{t('Conversation_closing_tags')}
</FieldLabel>
<Controller
control={control}
name='chatClosingTags'
rules={{ required: t('The_field_is_required', 'tags') }}
render={({ field: { value, onChange } }) => (
<DepartmentTags value={value} onChange={onChange} error={errors.chatClosingTags?.message as string} />
<DepartmentTags
id={chatClosingTagsField}
value={value}
onChange={onChange}
error={errors.chatClosingTags?.message as string}
aria-describedby={`${chatClosingTagsField}-hint ${chatClosingTagsField}-error`}
/>
)}
/>
{errors.chatClosingTags && <FieldError>{errors.chatClosingTags?.message}</FieldError>}
<FieldHint id={`${chatClosingTagsField}-hint`}>{t('Conversation_closing_tags_description')}</FieldHint>
{errors.chatClosingTags && (
<FieldError aria-live='assertive' id={`${chatClosingTagsField}-error`}>
{errors.chatClosingTags?.message}
</FieldError>
)}
</Field>
)}
<Field>
<DepartmentBusinessHours bhId={department?.businessHourId} />
</Field>
<Divider mb={16} />
<Field>
<FieldLabel mb={4}>{t('Agents')}:</FieldLabel>
<FieldLabel mb={4}>{t('Agents')}</FieldLabel>
<Box display='flex' flexDirection='column' height='50vh'>
<DepartmentsAgentsTable control={control} register={register} />
</Box>

@ -4,7 +4,6 @@ import {
FieldGroup,
Button,
ButtonGroup,
Box,
Field,
FieldLabel,
FieldRow,
@ -155,28 +154,24 @@ const EditTrigger = ({ triggerData }: { triggerData?: Serialized<ILivechatTrigge
<form id={formId} onSubmit={handleSubmit(handleSave)}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={enabledField}>{t('Enabled')}</FieldLabel>
<FieldRow>
<Controller
name='enabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={enabledField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='enabled'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={enabledField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={runOnceField}>{t('Run_only_once_for_each_visitor')}</FieldLabel>
<FieldRow>
<Controller
name='runOnce'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={runOnceField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='runOnce'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={runOnceField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<FieldLabel htmlFor={nameField} required>

@ -49,13 +49,13 @@ const AutoTranslate = ({
)}
<Field>
<FieldRow>
<FieldLabel htmlFor='automatic-translation'>{t('Automatic_Translation')}</FieldLabel>
<ToggleSwitch
id='automatic-translation'
onChange={handleSwitch}
defaultChecked={translateEnable}
disabled={room.encrypted && !translateEnable}
/>
<FieldLabel htmlFor='automatic-translation'>{t('Automatic_Translation')}</FieldLabel>
</FieldRow>
</Field>
<Field>

@ -209,106 +209,96 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
)}
{canViewType && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={roomTypeField}>{t('Private')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='roomType'
render={({ field: { name, onBlur, onChange, value, ref } }) => (
<ToggleSwitch
id={roomTypeField}
ref={ref}
name={name}
onBlur={onBlur}
disabled={!canChangeType || isFederated}
checked={value === 'p'}
onChange={() => onChange(value === 'p' ? 'c' : 'p')}
aria-describedby={`${roomTypeField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='roomType'
render={({ field: { name, onBlur, onChange, value, ref } }) => (
<ToggleSwitch
id={roomTypeField}
ref={ref}
name={name}
onBlur={onBlur}
disabled={!canChangeType || isFederated}
checked={value === 'p'}
onChange={() => onChange(value === 'p' ? 'c' : 'p')}
aria-describedby={`${roomTypeField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${roomTypeField}-hint`}>{t('Teams_New_Private_Description_Enabled')}</FieldHint>
</Field>
)}
{canViewReadOnly && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={readOnlyField}>{t('Read_only')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='readOnly'
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={readOnlyField}
{...field}
checked={value}
disabled={!canSetReadOnly || isFederated}
aria-describedby={`${readOnlyField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='readOnly'
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={readOnlyField}
{...field}
checked={value}
disabled={!canSetReadOnly || isFederated}
aria-describedby={`${readOnlyField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${readOnlyField}-hint`}>{t('Only_authorized_users_can_write_new_messages')}</FieldHint>
</Field>
)}
{readOnly && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={reactWhenReadOnlyField}>{t('React_when_read_only')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='reactWhenReadOnly'
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={reactWhenReadOnlyField}
{...field}
disabled={!canSetReactWhenReadOnly}
checked={value}
aria-describedby={`${reactWhenReadOnlyField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='reactWhenReadOnly'
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={reactWhenReadOnlyField}
{...field}
disabled={!canSetReactWhenReadOnly}
checked={value}
aria-describedby={`${reactWhenReadOnlyField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${reactWhenReadOnlyField}-hint`}>{t('Only_authorized_users_can_react_to_messages')}</FieldHint>
</Field>
)}
{canViewArchived && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={archivedField}>{t('Room_archivation_state_true')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='archived'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={archivedField} {...field} disabled={!canArchiveOrUnarchive} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='archived'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={archivedField} {...field} disabled={!canArchiveOrUnarchive} checked={value} />
)}
/>
</FieldRow>
</Field>
)}
{canViewJoinCode && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={joinCodeRequiredField}>{t('Password_to_access')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='joinCodeRequired'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={joinCodeRequiredField} {...field} disabled={isFederated} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='joinCodeRequired'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={joinCodeRequiredField} {...field} disabled={isFederated} checked={value} />
)}
/>
</FieldRow>
<FieldRow>
<Controller
name='joinCode'
@ -320,18 +310,16 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
)}
{canViewHideSysMes && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={hideSysMesField}>{t('Hide_System_Messages')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='hideSysMes'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={hideSysMesField} {...field} checked={value} disabled={isFederated} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='hideSysMes'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={hideSysMesField} {...field} checked={value} disabled={isFederated} />
)}
/>
</FieldRow>
<FieldRow>
<Controller
control={control}
@ -350,18 +338,16 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
)}
{canViewEncrypted && (
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={encryptedField}>{t('Encrypted')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='encrypted'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={encryptedField} {...field} disabled={!canToggleEncryption || isFederated} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='encrypted'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={encryptedField} {...field} disabled={!canToggleEncryption || isFederated} checked={value} />
)}
/>
</FieldRow>
</Field>
)}
</FieldGroup>
@ -370,37 +356,31 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
<Accordion.Item title={t('Prune')}>
<FieldGroup>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={retentionEnabledField}>{t('RetentionPolicyRoom_Enabled')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='retentionEnabled'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={retentionEnabledField} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='retentionEnabled'
render={({ field: { value, ...field } }) => <ToggleSwitch id={retentionEnabledField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={retentionOverrideGlobalField}>{t('RetentionPolicyRoom_OverrideGlobal')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='retentionOverrideGlobal'
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={retentionOverrideGlobalField}
{...field}
disabled={!retentionEnabled || !canEditRoomRetentionPolicy}
checked={value}
/>
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='retentionOverrideGlobal'
render={({ field: { value, ...field } }) => (
<ToggleSwitch
id={retentionOverrideGlobalField}
{...field}
disabled={!retentionEnabled || !canEditRoomRetentionPolicy}
checked={value}
/>
)}
/>
</FieldRow>
</Field>
{retentionOverrideGlobal && (
<>
@ -424,32 +404,28 @@ const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) =>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={retentionExcludePinnedField}>{t('RetentionPolicyRoom_ExcludePinned')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='retentionExcludePinned'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={retentionExcludePinnedField} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='retentionExcludePinned'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={retentionExcludePinnedField} {...field} checked={value} />
)}
/>
</FieldRow>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='space-between' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={retentionFilesOnlyField}>{t('RetentionPolicyRoom_FilesOnly')}</FieldLabel>
<FieldRow>
<Controller
control={control}
name='retentionFilesOnly'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={retentionFilesOnlyField} {...field} checked={value} />
)}
/>
</FieldRow>
</Box>
<Controller
control={control}
name='retentionFilesOnly'
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={retentionFilesOnlyField} {...field} checked={value} />
)}
/>
</FieldRow>
</Field>
</>
)}

@ -69,8 +69,8 @@ const MessageSearchForm = ({ provider, onSearch }: MessageSearchFormProps) => {
{globalSearchEnabled && (
<Field>
<FieldRow>
<ToggleSwitch id={globalSearchToggleId} {...register('globalSearch')} />
<FieldLabel htmlFor={globalSearchToggleId}>{t('Global_Search')}</FieldLabel>
<ToggleSwitch id={globalSearchToggleId} {...register('globalSearch')} />
</FieldRow>
</Field>
)}

@ -1,4 +1,4 @@
import { Box, Field, FieldLabel, FieldDescription, FieldGroup, ToggleSwitch } from '@rocket.chat/fuselage';
import { Field, FieldLabel, FieldDescription, FieldGroup, ToggleSwitch, FieldRow } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import type { ReactElement } from 'react';
import React, { memo } from 'react';
@ -16,13 +16,11 @@ const NotificationToggle = ({ label, description, onChange, defaultChecked }: No
return (
<FieldGroup>
<Field>
<Box display='flex' justifyContent='space-between' alignItems='start'>
<Box display='flex' flexDirection='column'>
<FieldLabel htmlFor={fieldId}>{label}</FieldLabel>
{description && <FieldDescription id={`${fieldId}-hint`}>{description}</FieldDescription>}
</Box>
<FieldRow>
<FieldLabel htmlFor={fieldId}>{label}</FieldLabel>
<ToggleSwitch id={fieldId} aria-describedby={`${fieldId}-hint`} onChange={onChange} defaultChecked={defaultChecked} />
</Box>
</FieldRow>
{description && <FieldDescription id={`${fieldId}-hint`}>{description}</FieldDescription>}
</Field>
</FieldGroup>
);

@ -56,32 +56,32 @@ const PruneMessages = ({ callOutText, validateText, onClickClose, onClickPrune }
</Field>
<Field>
<FieldRow>
<CheckBox id={inclusiveCheckboxId} {...register('inclusive')} />
<FieldLabel htmlFor={inclusiveCheckboxId}>{t('Inclusive')}</FieldLabel>
<CheckBox id={inclusiveCheckboxId} {...register('inclusive')} />
</FieldRow>
</Field>
<Field>
<FieldRow>
<CheckBox id={pinnedCheckboxId} {...register('pinned')} />
<FieldLabel htmlFor={pinnedCheckboxId}>{t('RetentionPolicy_DoNotPrunePinned')}</FieldLabel>
<CheckBox id={pinnedCheckboxId} {...register('pinned')} />
</FieldRow>
</Field>
<Field>
<FieldRow>
<CheckBox id={discussionCheckboxId} {...register('discussion')} />
<FieldLabel htmlFor={discussionCheckboxId}>{t('RetentionPolicy_DoNotPruneDiscussion')}</FieldLabel>
<CheckBox id={discussionCheckboxId} {...register('discussion')} />
</FieldRow>
</Field>
<Field>
<FieldRow>
<CheckBox id={threadsCheckboxId} {...register('threads')} />
<FieldLabel htmlFor={threadsCheckboxId}>{t('RetentionPolicy_DoNotPruneThreads')}</FieldLabel>
<CheckBox id={threadsCheckboxId} {...register('threads')} />
</FieldRow>
</Field>
<Field>
<FieldRow>
<CheckBox id={attachedCheckboxId} {...register('attached')} />
<FieldLabel htmlFor={attachedCheckboxId}>{t('Files_only')}</FieldLabel>
<CheckBox id={attachedCheckboxId} {...register('attached')} />
</FieldRow>
</Field>
{callOutText && !validateText && <Callout type='warning'>{callOutText}</Callout>}

@ -112,15 +112,15 @@ const ThreadChat = ({ mainMessage }: ThreadChatProps) => {
>
<Field>
<FieldRow marginBlock={8}>
<FieldLabel htmlFor={sendToChannelID} color='annotation' fontScale='p2'>
{t('Also_send_to_channel')}
</FieldLabel>
<CheckBox
id={sendToChannelID}
checked={sendToChannel}
onChange={() => setSendToChannel((checked) => !checked)}
name='alsoSendThreadToChannel'
/>
<FieldLabel htmlFor={sendToChannelID} color='annotation' fontScale='p2'>
{t('Also_send_to_channel')}
</FieldLabel>
</FieldRow>
</Field>
</ComposerContainer>

@ -1,5 +1,5 @@
import type { SelectOption } from '@rocket.chat/fuselage';
import { Field, FieldLabel, FieldRow, FieldError, FieldHint, ToggleSwitch, TextInput, Box, Select } from '@rocket.chat/fuselage';
import { Field, FieldLabel, FieldRow, FieldError, FieldHint, ToggleSwitch, TextInput, Select } from '@rocket.chat/fuselage';
import { useUniqueId } from '@rocket.chat/fuselage-hooks';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ComponentProps } from 'react';
@ -48,16 +48,14 @@ const CustomFieldsAdditionalForm = ({ className }: { className?: ComponentProps<
return (
<>
<Field className={className}>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={requiredField}>{t('Required')}</FieldLabel>
<FieldRow>
<Controller
name='required'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={requiredField} {...field} checked={value} />}
/>
</FieldRow>
</Box>
<Controller
name='required'
control={control}
render={({ field: { value, ...field } }) => <ToggleSwitch id={requiredField} {...field} checked={value} />}
/>
</FieldRow>
</Field>
<Field className={className}>
<FieldLabel htmlFor={typeField}>{t('Type')}</FieldLabel>
@ -99,18 +97,16 @@ const CustomFieldsAdditionalForm = ({ className }: { className?: ComponentProps<
)}
</Field>
<Field className={className}>
<Box display='flex' flexDirection='row'>
<FieldRow>
<FieldLabel htmlFor={publicField}>{t('Public')}</FieldLabel>
<FieldRow>
<Controller
name='public'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={publicField} {...field} disabled={!visibility} checked={value} aria-describedby={`${publicField}-hint`} />
)}
/>
</FieldRow>
</Box>
<Controller
name='public'
control={control}
render={({ field: { value, ...field } }) => (
<ToggleSwitch id={publicField} {...field} disabled={!visibility} checked={value} aria-describedby={`${publicField}-hint`} />
)}
/>
</FieldRow>
<FieldHint id={`${publicField}-hint`}>{t('Livechat_custom_fields_public_description')}</FieldHint>
</Field>
</>

@ -21,7 +21,7 @@ export const DepartmentBusinessHours = ({ bhId }: { bhId: string | undefined })
<Field>
<FieldLabel>{t('Business_Hour')}</FieldLabel>
<FieldRow>
<TextInput disabled value={name || ''} />
<TextInput readOnly value={name || ''} />
</FieldRow>
</Field>
);

@ -1,25 +0,0 @@
import { NumberInput, Field } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';
import { useHasLicenseModule } from '../../hooks/useHasLicenseModule';
export const EeNumberInput = ({ value, handler, label, placeholder }) => {
const t = useTranslation();
const hasLicense = useHasLicenseModule('livechat-enterprise');
if (!hasLicense) {
return null;
}
return (
<Field>
<Field.Label>{t(label)}</Field.Label>
<Field.Row>
<NumberInput value={value} onChange={handler} flexGrow={1} placeholder={t(placeholder)} />
</Field.Row>
</Field>
);
};
export default EeNumberInput;

@ -0,0 +1,24 @@
import { NumberInput, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage';
import type { ComponentProps } from 'react';
import React from 'react';
import { useHasLicenseModule } from '../../hooks/useHasLicenseModule';
export const EeNumberInput = ({ label, ...props }: { label: string } & ComponentProps<typeof NumberInput>) => {
const hasLicense = useHasLicenseModule('livechat-enterprise');
if (!hasLicense) {
return null;
}
return (
<Field>
<FieldLabel>{label}</FieldLabel>
<FieldRow>
<NumberInput {...props} flexGrow={1} />
</FieldRow>
</Field>
);
};
export default EeNumberInput;

@ -1,25 +0,0 @@
import { TextAreaInput, Field } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';
import { useHasLicenseModule } from '../../hooks/useHasLicenseModule';
export const EeTextAreaInput = ({ value, handler, label, placeholder }) => {
const t = useTranslation();
const hasLicense = useHasLicenseModule('livechat-enterprise');
if (!hasLicense) {
return null;
}
return (
<Field>
<Field.Label>{t(label)}</Field.Label>
<Field.Row>
<TextAreaInput flexGrow={1} value={value} onChange={handler} placeholder={t(placeholder)} />
</Field.Row>
</Field>
);
};
export default EeTextAreaInput;

@ -0,0 +1,24 @@
import { TextAreaInput, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage';
import type { ComponentProps } from 'react';
import React from 'react';
import { useHasLicenseModule } from '../../hooks/useHasLicenseModule';
export const EeTextAreaInput = ({ label, ...props }: { label: string } & ComponentProps<typeof TextAreaInput>) => {
const hasLicense = useHasLicenseModule('livechat-enterprise');
if (!hasLicense) {
return null;
}
return (
<Field>
<FieldLabel>{label}</FieldLabel>
<FieldRow>
<TextAreaInput {...props} />
</FieldRow>
</Field>
);
};
export default EeTextAreaInput;

@ -1,18 +0,0 @@
import { TextInput, Field } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React from 'react';
export const EeTextInput = ({ value, handler, label, placeholder }) => {
const t = useTranslation();
return (
<Field>
<Field.Label>{t(label)}</Field.Label>
<Field.Row>
<TextInput flexGrow={1} value={value} onChange={handler} placeholder={t(placeholder)} />
</Field.Row>
</Field>
);
};
export default EeTextInput;

@ -0,0 +1,24 @@
import { TextInput, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage';
import type { ComponentProps } from 'react';
import React from 'react';
import { useHasLicenseModule } from '../../hooks/useHasLicenseModule';
export const EeTextInput = ({ label, ...props }: { label: string } & ComponentProps<typeof TextInput>) => {
const hasLicense = useHasLicenseModule('livechat-enterprise');
if (!hasLicense) {
return null;
}
return (
<Field>
<FieldLabel>{label}</FieldLabel>
<FieldRow>
<TextInput {...props} />
</FieldRow>
</Field>
);
};
export default EeTextInput;

@ -90,67 +90,61 @@ const CannedResponseForm = () => {
{(hasManagerPermission || hasMonitorPermission) && (
<>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={publicRadioField}>{t('Public')}</FieldLabel>
<FieldRow>
<Controller
name='scope'
control={control}
render={({ field: { onChange, value, ...field } }) => (
<RadioButton
{...field}
id={publicRadioField}
onChange={() => onChange('global')}
disabled={hasMonitorPermission && !hasManagerPermission}
checked={value === 'global'}
aria-describedby={`${publicRadioField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='scope'
control={control}
render={({ field: { onChange, value, ...field } }) => (
<RadioButton
{...field}
id={publicRadioField}
onChange={() => onChange('global')}
disabled={hasMonitorPermission && !hasManagerPermission}
checked={value === 'global'}
aria-describedby={`${publicRadioField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${publicRadioField}-hint`}>{t('Canned_Response_Sharing_Public_Description')}</FieldHint>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={departmentRadioField}>{t('Department')}</FieldLabel>
<FieldRow>
<Controller
name='scope'
control={control}
render={({ field: { onChange, value, ...field } }) => (
<RadioButton
{...field}
id={departmentRadioField}
onChange={() => onChange('department')}
checked={value === 'department'}
aria-describedby={`${departmentRadioField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='scope'
control={control}
render={({ field: { onChange, value, ...field } }) => (
<RadioButton
{...field}
id={departmentRadioField}
onChange={() => onChange('department')}
checked={value === 'department'}
aria-describedby={`${departmentRadioField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${departmentRadioField}-hint`}>{t('Canned_Response_Sharing_Department_Description')}</FieldHint>
</Field>
<Field>
<Box display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
<FieldRow>
<FieldLabel htmlFor={privateRadioField}>{t('Private')}</FieldLabel>
<FieldRow>
<Controller
name='scope'
control={control}
render={({ field: { onChange, value, ...field } }) => (
<RadioButton
{...field}
id={privateRadioField}
onChange={() => onChange('user')}
checked={value === 'user'}
aria-describedby={`${privateRadioField}-hint`}
/>
)}
/>
</FieldRow>
</Box>
<Controller
name='scope'
control={control}
render={({ field: { onChange, value, ...field } }) => (
<RadioButton
{...field}
id={privateRadioField}
onChange={() => onChange('user')}
checked={value === 'user'}
aria-describedby={`${privateRadioField}-hint`}
/>
)}
/>
</FieldRow>
<FieldHint id={`${privateRadioField}-hint`}>{t('Canned_Response_Sharing_Private_Description')}</FieldHint>
</Field>
{scope === 'department' && (

@ -235,7 +235,7 @@
"@rocket.chat/favicon": "workspace:^",
"@rocket.chat/forked-matrix-appservice-bridge": "^4.0.2",
"@rocket.chat/forked-matrix-bot-sdk": "^0.6.0-beta.3",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/fuselage-toastbar": "~0.31.25",

@ -4330,6 +4330,7 @@
"Require_all_tokens": "Require all tokens",
"Require_any_token": "Require any token",
"Require_password_change": "Require password change",
"Require_Two_Factor_Authentication": "Require Two Factor Authentication",
"Resend_verification_email": "Resend verification email",
"Reset": "Reset",
"Reset_priorities": "Reset priorities",

@ -33,7 +33,7 @@ export class AdminEmailInboxes {
}
get inputSmtpSecure(): Locator {
return this.page.locator('label >> text="Connect with SSL/TLS" >> nth=0 >> i');
return this.page.locator('label >> text="Connect with SSL/TLS"').first();
}
// IMAP
@ -50,7 +50,7 @@ export class AdminEmailInboxes {
}
get inputImapSecure(): Locator {
return this.page.locator('label >> text="Connect with SSL/TLS" >> nth=1 >> i');
return this.page.locator('label >> text="Connect with SSL/TLS"').last();
}
get btnSave(): Locator {

@ -18,9 +18,7 @@ export class HomeSidenav {
}
get checkboxReadOnly(): Locator {
return this.page.locator(
'//*[@id="modal-root"]//*[contains(@class, "rcx-field") and contains(text(), "Read Only")]/../following-sibling::label/i',
);
return this.page.locator('role=dialog[name="Create Channel"] >> label >> text="Read Only"');
}
get inputChannelName(): Locator {

@ -26,7 +26,7 @@ export class OmnichannelDepartments {
}
get btnEnabled() {
return this.page.locator('[data-qa="DepartmentEditToggle-Enabled"] span label');
return this.page.locator('label >> text="Enabled"');
}
get inputName() {
@ -38,7 +38,7 @@ export class OmnichannelDepartments {
}
get toggleRequestTags() {
return this.page.locator('[data-qa="DiscussionToggle-RequestTagBeforeCLosingChat"] span label');
return this.page.locator('label >> text="Request tag(s) before closing conversation"');
}
get inputTags() {

@ -4,7 +4,7 @@
"private": true,
"devDependencies": {
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/icons": "~0.32.0",
"@rocket.chat/ui-contexts": "workspace:~",

@ -62,7 +62,7 @@
"@babel/preset-typescript": "~7.22.15",
"@rocket.chat/apps-engine": "1.41.0",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/icons": "~0.32.0",

@ -6,7 +6,7 @@
"@babel/core": "~7.22.20",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-tokens": "~0.32.0",
"@rocket.chat/message-parser": "~0.31.27",
"@rocket.chat/styled": "~0.31.25",

@ -5,7 +5,7 @@
"devDependencies": {
"@babel/core": "~7.22.20",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/icons": "~0.32.0",
"@rocket.chat/mock-providers": "workspace:^",

@ -5,7 +5,7 @@
"devDependencies": {
"@babel/core": "~7.22.20",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/icons": "~0.32.0",
"@storybook/addon-actions": "~6.5.16",
"@storybook/addon-docs": "~6.5.16",

@ -6,7 +6,7 @@
"@babel/core": "~7.22.20",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/icons": "~0.32.0",
"@rocket.chat/styled": "~0.31.25",

@ -15,7 +15,7 @@
"@codemirror/tooltip": "^0.19.16",
"@lezer/highlight": "^1.1.6",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "~0.38.1",
"@rocket.chat/fuselage": "0.39.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/fuselage-tokens": "~0.32.0",

@ -9033,7 +9033,7 @@ __metadata:
"@babel/preset-typescript": ~7.22.15
"@rocket.chat/apps-engine": 1.41.0
"@rocket.chat/eslint-config": "workspace:^"
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-hooks": ~0.32.1
"@rocket.chat/fuselage-polyfills": ~0.31.25
"@rocket.chat/gazzodown": "workspace:^"
@ -9086,9 +9086,9 @@ __metadata:
languageName: unknown
linkType: soft
"@rocket.chat/fuselage@npm:~0.38.1":
version: 0.38.1
resolution: "@rocket.chat/fuselage@npm:0.38.1"
"@rocket.chat/fuselage@npm:0.39.0":
version: 0.39.0
resolution: "@rocket.chat/fuselage@npm:0.39.0"
dependencies:
"@rocket.chat/css-in-js": ^0.31.25
"@rocket.chat/css-supports": ^0.31.25
@ -9106,7 +9106,7 @@ __metadata:
react: ^17.0.2
react-dom: ^17.0.2
react-virtuoso: 1.2.4
checksum: 91d59bead6710a60835e6dfd5f93af2923f3a2998cf5eb3107a97f8cb301bd8e98a3f8bbc4edcc75496e622b5f158fb4491155016bc60e17e76d737f536855dc
checksum: 5e9c182479d5a450068fd682967267cddd533e1101083b5b59764a5f159261fc0cae6134fe934401e02753b40c1fcad84cf0a7a05801cc0f5a31b2a60df0649d
languageName: node
linkType: hard
@ -9117,7 +9117,7 @@ __metadata:
"@babel/core": ~7.22.20
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/css-in-js": ~0.31.25
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-tokens": ~0.32.0
"@rocket.chat/message-parser": ~0.31.27
"@rocket.chat/styled": ~0.31.25
@ -9448,7 +9448,7 @@ __metadata:
"@rocket.chat/favicon": "workspace:^"
"@rocket.chat/forked-matrix-appservice-bridge": ^4.0.2
"@rocket.chat/forked-matrix-bot-sdk": ^0.6.0-beta.3
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-hooks": ~0.32.1
"@rocket.chat/fuselage-polyfills": ~0.31.25
"@rocket.chat/fuselage-toastbar": ~0.31.25
@ -10288,7 +10288,7 @@ __metadata:
dependencies:
"@babel/core": ~7.22.20
"@rocket.chat/css-in-js": ~0.31.25
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-hooks": ~0.32.1
"@rocket.chat/icons": ~0.32.0
"@rocket.chat/mock-providers": "workspace:^"
@ -10339,7 +10339,7 @@ __metadata:
dependencies:
"@babel/core": ~7.22.20
"@rocket.chat/eslint-config": "workspace:^"
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/icons": ~0.32.0
"@storybook/addon-actions": ~6.5.16
"@storybook/addon-docs": ~6.5.16
@ -10428,7 +10428,7 @@ __metadata:
resolution: "@rocket.chat/ui-theming@workspace:ee/packages/ui-theming"
dependencies:
"@rocket.chat/css-in-js": ~0.31.25
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-hooks": ~0.32.1
"@rocket.chat/icons": ~0.32.0
"@rocket.chat/ui-contexts": "workspace:~"
@ -10471,7 +10471,7 @@ __metadata:
"@rocket.chat/css-in-js": ~0.31.25
"@rocket.chat/emitter": ~0.31.25
"@rocket.chat/eslint-config": "workspace:^"
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-hooks": ~0.32.1
"@rocket.chat/icons": ~0.32.0
"@rocket.chat/styled": ~0.31.25
@ -10514,7 +10514,7 @@ __metadata:
"@codemirror/tooltip": ^0.19.16
"@lezer/highlight": ^1.1.6
"@rocket.chat/css-in-js": ~0.31.25
"@rocket.chat/fuselage": ~0.38.1
"@rocket.chat/fuselage": 0.39.0
"@rocket.chat/fuselage-hooks": ~0.32.1
"@rocket.chat/fuselage-polyfills": ~0.31.25
"@rocket.chat/fuselage-tokens": ~0.32.0

Loading…
Cancel
Save