Skip to content

Commit

Permalink
Upgrade Fuselage
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Jan 4, 2024
1 parent e5ab11b commit 85602ab
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 90 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@
},
"dependencies": {
"@bugsnag/js": "~7.22.3",
"@emotion/css": "^11.7.1",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@emotion/css": "~11.11.2",
"@emotion/react": "~11.11.3",
"@emotion/styled": "~11.11.0",
"@ewsjs/xhr": "^2.0.1",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "~0.36.0",
"@rocket.chat/fuselage": "~0.42.0",
"@rocket.chat/fuselage-hooks": "~0.32.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/icons": "~0.32.0",
"abort-controller": "^3.0.0",
"axios": "^1.4.0",
"dotenv": "~16.3.1",
"electron-dl": "~3.5.1",
Expand Down
6 changes: 3 additions & 3 deletions src/ui/components/AboutDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ export const AboutDialog = () => {

<Field>
<FieldRow>
<FieldLabel htmlFor={checkForUpdatesOnStartupToggleSwitchId}>
{t('dialog.about.checkUpdatesOnStart')}
</FieldLabel>
<ToggleSwitch
id={checkForUpdatesOnStartupToggleSwitchId}
checked={isCheckForUpdatesOnStartupChecked}
disabled={!canSetCheckForUpdatesOnStartup}
onChange={handleCheckForUpdatesOnStartCheckBoxChange}
/>
<FieldLabel htmlFor={checkForUpdatesOnStartupToggleSwitchId}>
{t('dialog.about.checkUpdatesOnStart')}
</FieldLabel>
</FieldRow>
</Field>
</Margins>
Expand Down
9 changes: 3 additions & 6 deletions src/ui/components/DownloadsManagerView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Box,
SearchInput,
Icon,
Button,
Pagination,
Scrollable,
IconButton,
Expand Down Expand Up @@ -252,13 +251,11 @@ const DownloadsManagerView = () => {
/>
</Box>
<Box display='flex' flexGrow={1} flexShrink={1} paddingInline={2}>
<Button
small
<IconButton
icon='trash'
title={t('downloads.filters.clear')}
onClick={handleClearAll}
>
<Icon name='trash' size={24} />
</Button>
/>
</Box>
</Box>
<Scrollable>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/ServersView/UnsupportedServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const UnsupportedServer = ({
return (
<ErrorPane isVisible={isSupported === false}>
<Box
backgroundColor='white'
backgroundColor='surface-light'
display='flex'
flexDirection='column'
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/SettingsView/GeneralTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SideBar } from './features/SideBar';
import { TrayIcon } from './features/TrayIcon';

export const GeneralTab = () => (
<Box is='form' margin={24} maxWidth={960} flexGrow={1} flexShrink={1}>
<Box is='form' padding={24} maxWidth={960} flexGrow={1} flexShrink={1}>
<FieldGroup>
<ReportErrors />
<FlashFrame />
Expand Down
1 change: 0 additions & 1 deletion src/ui/components/SettingsView/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const SettingsView = () => {
>
<Box
width='full'
minHeight={64}
padding={24}
display='flex'
flexDirection='row'
Expand Down
12 changes: 9 additions & 3 deletions src/ui/components/SettingsView/features/FlashFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -37,15 +37,21 @@ export const FlashFrame = (props: FlashFrameProps) => {
[dispatch]
);

const isFlashFrameEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<ToggleSwitch onChange={handleChange} checked={isFlashFrameEnabled} />
<FieldLabel htmlFor='toggle-switch'>
<FieldLabel htmlFor={isFlashFrameEnabledId}>
{process.platform !== 'darwin'
? t('settings.options.flashFrame.title')
: t('settings.options.flashFrame.titleDarwin')}
</FieldLabel>
<ToggleSwitch
id={isFlashFrameEnabledId}
checked={isFlashFrameEnabled}
onChange={handleChange}
/>
</FieldRow>
{process.platform === 'linux' && (
<Callout
Expand Down
13 changes: 8 additions & 5 deletions src/ui/components/SettingsView/features/HardwareAcceleration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -37,16 +37,19 @@ export const HardwareAcceleration = (props: HardwareAccelerationProps) => {
[dispatch]
);

const isHardwareAccelerationEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<FieldLabel htmlFor={isHardwareAccelerationEnabledId}>
{t('settings.options.hardwareAcceleration.title')}
</FieldLabel>
<ToggleSwitch
onChange={handleChange}
id={isHardwareAccelerationEnabledId}
checked={isHardwareAccelerationEnabled}
onChange={handleChange}
/>
<FieldLabel htmlFor='toggle-switch'>
{t('settings.options.hardwareAcceleration.title')}
</FieldLabel>
</FieldRow>
<FieldRow>
<FieldHint>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation, Trans } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -39,17 +39,20 @@ export const InternalVideoChatWindow = (
[dispatch]
);

const isInternalVideoChatWindowEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<FieldLabel htmlFor={isInternalVideoChatWindowEnabledId}>
{t('settings.options.internalVideoChatWindow.title')}
</FieldLabel>
<ToggleSwitch
id={isInternalVideoChatWindowEnabledId}
disabled={process.mas}
onChange={handleChange}
checked={isInternalVideoChatWindowEnabled}
onChange={handleChange}
/>
<FieldLabel htmlFor='toggle-switch'>
{t('settings.options.internalVideoChatWindow.title')}
</FieldLabel>
</FieldRow>
<FieldRow>
{process.mas ? (
Expand Down
12 changes: 9 additions & 3 deletions src/ui/components/SettingsView/features/MenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -36,13 +36,19 @@ export const MenuBar = (props: MenuBarProps) => {
[dispatch]
);

const isMenuBarEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<ToggleSwitch onChange={handleChange} checked={isMenuBarEnabled} />
<FieldLabel htmlFor='toggle-switch'>
<FieldLabel htmlFor={isMenuBarEnabledId}>
{t('settings.options.menubar.title')}
</FieldLabel>
<ToggleSwitch
id={isMenuBarEnabledId}
checked={isMenuBarEnabled}
onChange={handleChange}
/>
</FieldRow>
<FieldRow>
<FieldHint>{t('settings.options.menubar.description')}</FieldHint>
Expand Down
13 changes: 8 additions & 5 deletions src/ui/components/SettingsView/features/MinimizeOnClose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -39,17 +39,20 @@ export const MinimizeOnClose = (props: MinimizeOnCloseProps) => {
[dispatch]
);

const isMinimizeOnCloseEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<FieldLabel htmlFor={isMinimizeOnCloseEnabledId}>
{t('settings.options.minimizeOnClose.title')}
</FieldLabel>
<ToggleSwitch
id={isMinimizeOnCloseEnabledId}
disabled={isTrayIconEnabled}
onChange={handleChange}
checked={isMinimizeOnCloseEnabled}
onChange={handleChange}
/>
<FieldLabel htmlFor='toggle-switch'>
{t('settings.options.minimizeOnClose.title')}
</FieldLabel>
</FieldRow>
<FieldRow>
<FieldHint>
Expand Down
13 changes: 8 additions & 5 deletions src/ui/components/SettingsView/features/NTLMCredentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ToggleSwitch,
} from '@rocket.chat/fuselage';
import type { FocusEvent } from 'react';
import { useCallback, type ChangeEvent } from 'react';
import { useCallback, type ChangeEvent, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -54,16 +54,19 @@ export const NTLMCredentials = (props: NTLMCredentialsProps) => {
[dispatch]
);

const isNTLMCredentialsEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<FieldLabel htmlFor={isNTLMCredentialsEnabledId}>
{t('settings.options.ntlmCredentials.title')}
</FieldLabel>
<ToggleSwitch
onChange={handleToggleChange}
id={isNTLMCredentialsEnabledId}
checked={isNTLMCredentialsEnabled}
onChange={handleToggleChange}
/>
<FieldLabel htmlFor='toggle-switch'>
{t('settings.options.ntlmCredentials.title')}
</FieldLabel>
</FieldRow>
<FieldRow>
<FieldHint>
Expand Down
13 changes: 8 additions & 5 deletions src/ui/components/SettingsView/features/ReportErrors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -36,17 +36,20 @@ export const ReportErrors = (props: ReportErrorsProps) => {
[dispatch]
);

const isReportEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<FieldLabel htmlFor={isReportEnabledId}>
{t('settings.options.report.title')}
</FieldLabel>
<ToggleSwitch
id={isReportEnabledId}
disabled={process.mas}
onChange={handleChange}
checked={isReportEnabled}
onChange={handleChange}
/>
<FieldLabel htmlFor='toggle-switch'>
{t('settings.options.report.title')}
</FieldLabel>
</FieldRow>
<FieldRow>
{process.mas ? (
Expand Down
12 changes: 9 additions & 3 deletions src/ui/components/SettingsView/features/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -36,13 +36,19 @@ export const SideBar = (props: SideBarProps) => {
[dispatch]
);

const isSideBarEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<ToggleSwitch onChange={handleChange} checked={isSideBarEnabled} />
<FieldLabel htmlFor='toggle-switch'>
<FieldLabel htmlFor={isSideBarEnabledId}>
{t('settings.options.sidebar.title')}
</FieldLabel>
<ToggleSwitch
id={isSideBarEnabledId}
checked={isSideBarEnabled}
onChange={handleChange}
/>
</FieldRow>
<FieldRow>
<FieldHint>{t('settings.options.sidebar.description')}</FieldHint>
Expand Down
12 changes: 9 additions & 3 deletions src/ui/components/SettingsView/features/TrayIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
FieldHint,
} from '@rocket.chat/fuselage';
import type { ChangeEvent } from 'react';
import { useCallback } from 'react';
import { useCallback, useId } from 'react';
import { useTranslation } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import type { Dispatch } from 'redux';
Expand Down Expand Up @@ -36,13 +36,19 @@ export const TrayIcon = (props: TrayIconProps) => {
[dispatch]
);

const isTrayIconEnabledId = useId();

return (
<Field className={props.className}>
<FieldRow>
<ToggleSwitch onChange={handleChange} checked={isTrayIconEnabled} />
<FieldLabel htmlFor='toggle-switch'>
<FieldLabel htmlFor={isTrayIconEnabledId}>
{t('settings.options.trayIcon.title')}
</FieldLabel>
<ToggleSwitch
id={isTrayIconEnabledId}
checked={isTrayIconEnabled}
onChange={handleChange}
/>
</FieldRow>
<FieldRow>
<FieldHint>{t('settings.options.trayIcon.description')}</FieldHint>
Expand Down
1 change: 0 additions & 1 deletion src/ui/components/SupportedVersionDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export const SupportedVersionDialog = () => {

useEffect(() => {
checkServerVersion();
console.log('checkServerVersion');
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [server?.supportedVersions, server?.lastPath, currentView]);

Expand Down
Loading

0 comments on commit 85602ab

Please sign in to comment.