Skip to content

Commit 854c685

Browse files
author
SeRoNet Concourse
committed
Merge remote-tracking branch 'rocket.chat/develop' into HEAD
2 parents 3e27b3d + 09dd337 commit 854c685

8 files changed

Lines changed: 134 additions & 112 deletions

File tree

app/theme/client/imports/general/rtl.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
}
416416
}
417417

418-
/* Override toastr messages to show on hte left side */
418+
/* Override toastr messages to show on the left side */
419419
& .toast-top-right {
420420
right: auto;
421421
left: 12px;

app/ui-message/client/messageBox/messageBoxAudioMessage.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ const stopRecording = () => new Promise((resolve) => AudioRecorder.stop(resolve)
1414
const recordingInterval = new ReactiveVar(null);
1515
const recordingRoomId = new ReactiveVar(null);
1616

17+
const cancelRecording = (instance) => new Promise(async () => {
18+
if (recordingInterval.get()) {
19+
clearInterval(recordingInterval.get());
20+
recordingInterval.set(null);
21+
recordingRoomId.set(null);
22+
}
23+
24+
instance.time.set('00:00');
25+
26+
await stopRecording();
27+
28+
instance.state.set(null);
29+
});
30+
1731
Template.messageBoxAudioMessage.onCreated(async function() {
1832
this.state = new ReactiveVar(null);
1933
this.time = new ReactiveVar('00:00');
@@ -47,6 +61,12 @@ Template.messageBoxAudioMessage.onCreated(async function() {
4761
}
4862
});
4963

64+
Template.messageBoxAudioMessage.onDestroyed(async function() {
65+
if (this.state.get() === 'recording') {
66+
await cancelRecording(this);
67+
}
68+
});
69+
5070
Template.messageBoxAudioMessage.helpers({
5171
isAllowed() {
5272
return AudioRecorder.isSupported()
@@ -105,17 +125,7 @@ Template.messageBoxAudioMessage.events({
105125
async 'click .js-audio-message-cancel'(event, instance) {
106126
event.preventDefault();
107127

108-
if (recordingInterval.get()) {
109-
clearInterval(recordingInterval.get());
110-
recordingInterval.set(null);
111-
recordingRoomId.set(null);
112-
}
113-
114-
instance.time.set('00:00');
115-
116-
await stopRecording();
117-
118-
instance.state.set(null);
128+
await cancelRecording(instance);
119129
},
120130

121131
async 'click .js-audio-message-done'(event, instance) {

client/components/CreateDiscussion/CreateDiscussion.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
ButtonGroup,
99
Button,
1010
Icon,
11+
Box,
1112
} from '@rocket.chat/fuselage';
1213
import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
1314
import React, { ReactElement } from 'react';
@@ -120,11 +121,17 @@ const CreateDiscussion = ({
120121
)}
121122
</Field.Row>
122123
</Field>
123-
<Field display='flex' flexDirection='row' justifyContent='spaceBetween' flexGrow={1}>
124-
<Field.Label>{t('Encrypted')}</Field.Label>
125-
<Field.Row>
126-
<ToggleSwitch checked={encrypted} onChange={handleEncrypted} />
127-
</Field.Row>
124+
<Field
125+
display='flex'
126+
alignItems='center'
127+
flexDirection='row'
128+
justifyContent='spaceBetween'
129+
flexGrow={1}
130+
>
131+
<Box display='flex' flexDirection='column' width='full'>
132+
<Field.Label>{t('Encrypted')}</Field.Label>
133+
</Box>
134+
<ToggleSwitch checked={encrypted} onChange={handleEncrypted} />
128135
</Field>
129136
<Field>
130137
<Field.Label>{t('Discussion_name')}</Field.Label>

client/sidebar/footer/SidebarFooter.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
import { css } from '@rocket.chat/css-in-js';
22
import { Box } from '@rocket.chat/fuselage';
3+
import colors from '@rocket.chat/fuselage-tokens/colors.json';
34
import React, { ReactElement } from 'react';
45

56
import { settings } from '../../../app/settings/client';
67

78
const SidebarFooter = (): ReactElement => {
89
const sidebarFooterStyle = css`
9-
width: auto;
10-
height: var(--sidebar-footer-height);
11-
padding: var(--sidebar-extra-small-default-padding) var(--sidebar-default-padding);
12-
1310
& img {
1411
max-width: 100%;
1512
height: 100%;
1613
}
1714
1815
& a:any-link {
19-
color: var(--rc-color-primary-light);
16+
color: ${colors.n600};
17+
color: var(--rc-color-primary-light, ${colors.n600});
2018
}
2119
`;
2220

2321
return (
2422
<Box
2523
is='footer'
24+
pb='x12'
25+
pi='x16'
26+
height='x48'
27+
width='auto'
2628
className={sidebarFooterStyle}
2729
dangerouslySetInnerHTML={{ __html: String(settings.get('Layout_Sidenav_Footer')).trim() }}
2830
/>

client/sidebar/header/CreateChannel.js

Lines changed: 85 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Icon,
88
Field,
99
ToggleSwitch,
10+
FieldGroup,
1011
} from '@rocket.chat/fuselage';
1112
import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks';
1213
import React, { useEffect, useMemo, useState } from 'react';
@@ -77,92 +78,94 @@ const CreateChannel = ({
7778
<Modal.Close onClick={onClose} />
7879
</Modal.Header>
7980
<Modal.Content>
80-
<Field mbe='x24'>
81-
<Field.Label>{t('Name')}</Field.Label>
82-
<Field.Row>
83-
<TextInput
84-
error={hasUnsavedChanges ? nameError : undefined}
85-
addon={<Icon name={values.type ? 'lock' : 'hash'} size='x20' />}
86-
placeholder={t('Channel_name')}
87-
onChange={handlers.handleName}
88-
/>
89-
</Field.Row>
90-
{hasUnsavedChanges && nameError && <Field.Error>{nameError}</Field.Error>}
91-
</Field>
92-
<Field mbe='x24'>
93-
<Field.Label>
94-
{t('Topic')}{' '}
95-
<Box is='span' color='neutral-600'>
96-
({t('optional')})
81+
<FieldGroup>
82+
<Field>
83+
<Field.Label>{t('Name')}</Field.Label>
84+
<Field.Row>
85+
<TextInput
86+
error={hasUnsavedChanges ? nameError : undefined}
87+
addon={<Icon name={values.type ? 'lock' : 'hash'} size='x20' />}
88+
placeholder={t('Channel_name')}
89+
onChange={handlers.handleName}
90+
/>
91+
</Field.Row>
92+
{hasUnsavedChanges && nameError && <Field.Error>{nameError}</Field.Error>}
93+
</Field>
94+
<Field>
95+
<Field.Label>
96+
{t('Topic')}{' '}
97+
<Box is='span' color='neutral-600'>
98+
({t('optional')})
99+
</Box>
100+
</Field.Label>
101+
<Field.Row>
102+
<TextInput
103+
placeholder={t('Channel_what_is_this_channel_about')}
104+
onChange={handlers.handleDescription}
105+
/>
106+
</Field.Row>
107+
</Field>
108+
<Field>
109+
<Box display='flex' justifyContent='space-between' alignItems='start'>
110+
<Box display='flex' flexDirection='column' width='full'>
111+
<Field.Label>{t('Private')}</Field.Label>
112+
<Field.Description>
113+
{values.type
114+
? t('Only_invited_users_can_acess_this_channel')
115+
: t('Everyone_can_access_this_channel')}
116+
</Field.Description>
117+
</Box>
118+
<ToggleSwitch
119+
checked={values.type}
120+
disabled={!!canOnlyCreateOneType}
121+
onChange={onChangeType}
122+
/>
97123
</Box>
98-
</Field.Label>
99-
<Field.Row>
100-
<TextInput
101-
placeholder={t('Channel_what_is_this_channel_about')}
102-
onChange={handlers.handleDescription}
103-
/>
104-
</Field.Row>
105-
</Field>
106-
<Field mbe='x24'>
107-
<Box display='flex' justifyContent='space-between' alignItems='start'>
108-
<Box display='flex' flexDirection='column'>
109-
<Field.Label>{t('Private')}</Field.Label>
110-
<Field.Description>
111-
{values.type
112-
? t('Only_invited_users_can_acess_this_channel')
113-
: t('Everyone_can_access_this_channel')}
114-
</Field.Description>
124+
</Field>
125+
<Field>
126+
<Box display='flex' justifyContent='space-between' alignItems='start'>
127+
<Box display='flex' flexDirection='column' width='full'>
128+
<Field.Label>{t('Read_only')}</Field.Label>
129+
<Field.Description>
130+
{t('All_users_in_the_channel_can_write_new_messages')}
131+
</Field.Description>
132+
</Box>
133+
<ToggleSwitch
134+
checked={values.readOnly}
135+
disabled={values.broadcast}
136+
onChange={handlers.handleReadOnly}
137+
/>
115138
</Box>
116-
<ToggleSwitch
117-
checked={values.type}
118-
disabled={!!canOnlyCreateOneType}
119-
onChange={onChangeType}
120-
/>
121-
</Box>
122-
</Field>
123-
<Field mbe='x24'>
124-
<Box display='flex' justifyContent='space-between' alignItems='start'>
125-
<Box display='flex' flexDirection='column'>
126-
<Field.Label>{t('Read_only')}</Field.Label>
127-
<Field.Description>
128-
{t('All_users_in_the_channel_can_write_new_messages')}
129-
</Field.Description>
139+
</Field>
140+
<Field>
141+
<Box display='flex' justifyContent='space-between' alignItems='start'>
142+
<Box display='flex' flexDirection='column' width='full'>
143+
<Field.Label>{t('Encrypted')}</Field.Label>
144+
<Field.Description>
145+
{values.type ? t('Encrypted_channel_Description') : t('Encrypted_not_available')}
146+
</Field.Description>
147+
</Box>
148+
<ToggleSwitch
149+
checked={values.encrypted}
150+
disabled={e2edisabled}
151+
onChange={handlers.handleEncrypted}
152+
/>
130153
</Box>
131-
<ToggleSwitch
132-
checked={values.readOnly}
133-
disabled={values.broadcast}
134-
onChange={handlers.handleReadOnly}
135-
/>
136-
</Box>
137-
</Field>
138-
<Field mbe='x24'>
139-
<Box display='flex' justifyContent='space-between' alignItems='start'>
140-
<Box display='flex' flexDirection='column'>
141-
<Field.Label>{t('Encrypted')}</Field.Label>
142-
<Field.Description>
143-
{values.type ? t('Encrypted_channel_Description') : t('Encrypted_not_available')}
144-
</Field.Description>
154+
</Field>
155+
<Field>
156+
<Box display='flex' justifyContent='space-between' alignItems='start'>
157+
<Box display='flex' flexDirection='column' width='full'>
158+
<Field.Label>{t('Broadcast')}</Field.Label>
159+
<Field.Description>{t('Broadcast_channel_Description')}</Field.Description>
160+
</Box>
161+
<ToggleSwitch checked={values.broadcast} onChange={onChangeBroadcast} />
145162
</Box>
146-
<ToggleSwitch
147-
checked={values.encrypted}
148-
disabled={e2edisabled}
149-
onChange={handlers.handleEncrypted}
150-
/>
151-
</Box>
152-
</Field>
153-
<Field mbe='x24'>
154-
<Box display='flex' justifyContent='space-between' alignItems='start'>
155-
<Box display='flex' flexDirection='column'>
156-
<Field.Label>{t('Broadcast')}</Field.Label>
157-
<Field.Description>{t('Broadcast_channel_Description')}</Field.Description>
158-
</Box>
159-
<ToggleSwitch checked={values.broadcast} onChange={onChangeBroadcast} />
160-
</Box>
161-
</Field>
162-
<Field mbe='x24'>
163-
<Field.Label>{`${t('Add_members')} (${t('optional')})`}</Field.Label>
164-
<UserAutoCompleteMultiple value={values.users} onChange={onChangeUsers} />
165-
</Field>
163+
</Field>
164+
<Field>
165+
<Field.Label>{`${t('Add_members')} (${t('optional')})`}</Field.Label>
166+
<UserAutoCompleteMultiple value={values.users} onChange={onChangeUsers} />
167+
</Field>
168+
</FieldGroup>
166169
</Modal.Content>
167170
<Modal.Footer>
168171
<ButtonGroup align='end'>

client/views/teams/CreateTeamModal/CreateTeamModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
281281
</Field>
282282
<Field mbe='x24'>
283283
<Box display='flex' justifyContent='space-between' alignItems='start'>
284-
<Box display='flex' flexDirection='column'>
284+
<Box display='flex' flexDirection='column' width='full'>
285285
<Field.Label>{t('Teams_New_Private_Label')}</Field.Label>
286286
<Field.Description>
287287
{type
@@ -294,7 +294,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
294294
</Field>
295295
<Field mbe='x24' disabled={!canChangeReadOnly}>
296296
<Box display='flex' justifyContent='space-between' alignItems='start'>
297-
<Box display='flex' flexDirection='column'>
297+
<Box display='flex' flexDirection='column' width='full'>
298298
<Field.Label>{t('Teams_New_Read_only_Label')}</Field.Label>
299299
<Field.Description>{t('Teams_New_Read_only_Description')}</Field.Description>
300300
</Box>
@@ -307,7 +307,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
307307
</Field>
308308
<Field disabled={!canChangeEncrypted} mbe='x24'>
309309
<Box display='flex' justifyContent='space-between' alignItems='start'>
310-
<Box display='flex' flexDirection='column'>
310+
<Box display='flex' flexDirection='column' width='full'>
311311
<Field.Label>{t('Teams_New_Encrypted_Label')}</Field.Label>
312312
<Field.Description>
313313
{type
@@ -324,7 +324,7 @@ const CreateTeamModal: FC<CreateTeamModalProps> = ({ onClose }) => {
324324
</Field>
325325
<Field mbe='x24'>
326326
<Box display='flex' justifyContent='space-between' alignItems='start'>
327-
<Box display='flex' flexDirection='column'>
327+
<Box display='flex' flexDirection='column' width='full'>
328328
<Field.Label>{t('Teams_New_Broadcast_Label')}</Field.Label>
329329
<Field.Description>{t('Teams_New_Broadcast_Description')}</Field.Description>
330330
</Box>

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
"@rocket.chat/apps-engine": "1.27.1",
159159
"@rocket.chat/css-in-js": "^0.28.0",
160160
"@rocket.chat/emitter": "^0.28.0",
161-
"@rocket.chat/fuselage": "^0.6.3-dev.303",
161+
"@rocket.chat/fuselage": "^0.6.3-dev.306",
162162
"@rocket.chat/fuselage-hooks": "^0.28.0",
163163
"@rocket.chat/fuselage-polyfills": "^0.28.0",
164164
"@rocket.chat/fuselage-tokens": "^0.28.0",

0 commit comments

Comments
 (0)