|
|
|
|
@ -12,6 +12,8 @@ import { |
|
|
|
|
FieldError, |
|
|
|
|
FieldHint, |
|
|
|
|
FieldDescription, |
|
|
|
|
Accordion, |
|
|
|
|
AccordionItem, |
|
|
|
|
} from '@rocket.chat/fuselage'; |
|
|
|
|
import { useUniqueId } from '@rocket.chat/fuselage-hooks'; |
|
|
|
|
import type { TranslationKey } from '@rocket.chat/ui-contexts'; |
|
|
|
|
@ -210,7 +212,7 @@ const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModal |
|
|
|
|
<Modal.Close tabIndex={-1} title={t('Close')} onClick={onClose} /> |
|
|
|
|
</Modal.Header> |
|
|
|
|
<Modal.Content mbe={2}> |
|
|
|
|
<FieldGroup> |
|
|
|
|
<FieldGroup mbe={24}> |
|
|
|
|
<Field> |
|
|
|
|
<FieldLabel required htmlFor={nameId}> |
|
|
|
|
{t('Name')} |
|
|
|
|
@ -276,90 +278,99 @@ const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModal |
|
|
|
|
{isPrivate ? t('People_can_only_join_by_being_invited') : t('Anyone_can_access')} |
|
|
|
|
</FieldHint> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={federatedId}>{t('Federation_Matrix_Federated')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='federated' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
aria-describedby={`${federatedId}-hint`} |
|
|
|
|
id={federatedId} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={!canUseFederation} |
|
|
|
|
onChange={onChange} |
|
|
|
|
</FieldGroup> |
|
|
|
|
<Accordion> |
|
|
|
|
<AccordionItem title={t('Advanced_settings')}> |
|
|
|
|
<FieldGroup> |
|
|
|
|
<Box is='h5' fontScale='h5' color='titles-labels'> |
|
|
|
|
{t('Security_and_permissions')} |
|
|
|
|
</Box> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={federatedId}>{t('Federation_Matrix_Federated')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='federated' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
aria-describedby={`${federatedId}-hint`} |
|
|
|
|
id={federatedId} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={!canUseFederation} |
|
|
|
|
onChange={onChange} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
</FieldRow> |
|
|
|
|
<FieldHint id={`${federatedId}-hint`}>{t(getFederationHintKey(federatedModule, federationEnabled))}</FieldHint> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={encryptedId}>{t('Encrypted')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='encrypted' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
id={encryptedId} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={e2eDisabled || federated} |
|
|
|
|
onChange={onChange} |
|
|
|
|
aria-describedby={`${encryptedId}-hint`} |
|
|
|
|
aria-labelledby='Encrypted_channel_Label' |
|
|
|
|
</FieldRow> |
|
|
|
|
<FieldHint id={`${federatedId}-hint`}>{t(getFederationHintKey(federatedModule, federationEnabled))}</FieldHint> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={encryptedId}>{t('Encrypted')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='encrypted' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
id={encryptedId} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={e2eDisabled || federated} |
|
|
|
|
onChange={onChange} |
|
|
|
|
aria-describedby={`${encryptedId}-hint`} |
|
|
|
|
aria-labelledby='Encrypted_channel_Label' |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
</FieldRow> |
|
|
|
|
<FieldDescription id={`${encryptedId}-hint`}>{getEncryptedHint({ isPrivate, broadcast, encrypted })}</FieldDescription> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={readOnlyId}>{t('Read_only')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='readOnly' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
id={readOnlyId} |
|
|
|
|
aria-describedby={`${readOnlyId}-hint`} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={!canSetReadOnly || broadcast || federated} |
|
|
|
|
onChange={onChange} |
|
|
|
|
</FieldRow> |
|
|
|
|
<FieldDescription id={`${encryptedId}-hint`}>{getEncryptedHint({ isPrivate, broadcast, encrypted })}</FieldDescription> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={readOnlyId}>{t('Read_only')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='readOnly' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
id={readOnlyId} |
|
|
|
|
aria-describedby={`${readOnlyId}-hint`} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={!canSetReadOnly || broadcast || federated} |
|
|
|
|
onChange={onChange} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
</FieldRow> |
|
|
|
|
<FieldHint id={`${readOnlyId}-hint`}> |
|
|
|
|
{readOnly ? t('Read_only_field_hint_enabled', { roomType: 'channel' }) : t('Anyone_can_send_new_messages')} |
|
|
|
|
</FieldHint> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={broadcastId}>{t('Broadcast')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='broadcast' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
aria-describedby={`${broadcastId}-hint`} |
|
|
|
|
id={broadcastId} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={!!federated} |
|
|
|
|
onChange={onChange} |
|
|
|
|
</FieldRow> |
|
|
|
|
<FieldHint id={`${readOnlyId}-hint`}> |
|
|
|
|
{readOnly ? t('Read_only_field_hint_enabled', { roomType: 'channel' }) : t('Anyone_can_send_new_messages')} |
|
|
|
|
</FieldHint> |
|
|
|
|
</Field> |
|
|
|
|
<Field> |
|
|
|
|
<FieldRow> |
|
|
|
|
<FieldLabel htmlFor={broadcastId}>{t('Broadcast')}</FieldLabel> |
|
|
|
|
<Controller |
|
|
|
|
control={control} |
|
|
|
|
name='broadcast' |
|
|
|
|
render={({ field: { onChange, value, ref } }): ReactElement => ( |
|
|
|
|
<ToggleSwitch |
|
|
|
|
aria-describedby={`${broadcastId}-hint`} |
|
|
|
|
id={broadcastId} |
|
|
|
|
ref={ref} |
|
|
|
|
checked={value} |
|
|
|
|
disabled={!!federated} |
|
|
|
|
onChange={onChange} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
</FieldRow> |
|
|
|
|
{broadcast && <FieldHint id={`${broadcastId}-hint`}>{t('Broadcast_hint_enabled', { roomType: 'channel' })}</FieldHint>} |
|
|
|
|
</Field> |
|
|
|
|
</FieldGroup> |
|
|
|
|
</FieldRow> |
|
|
|
|
{broadcast && <FieldHint id={`${broadcastId}-hint`}>{t('Broadcast_hint_enabled', { roomType: 'channel' })}</FieldHint>} |
|
|
|
|
</Field> |
|
|
|
|
</FieldGroup> |
|
|
|
|
</AccordionItem> |
|
|
|
|
</Accordion> |
|
|
|
|
</Modal.Content> |
|
|
|
|
<Modal.Footer> |
|
|
|
|
<Modal.FooterControllers> |
|
|
|
|
|