From fac7f3284d3cd8c3440ddc13c1b41606a2892233 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 15 Aug 2022 10:36:04 +0200 Subject: [PATCH 1/6] split current device section into component --- .../settings/devices/CurrentDeviceSection.tsx | 62 +++++++++++++++++++ .../settings/tabs/user/SessionManagerTab.tsx | 34 ++-------- 2 files changed, 67 insertions(+), 29 deletions(-) create mode 100644 src/components/views/settings/devices/CurrentDeviceSection.tsx diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx new file mode 100644 index 00000000000..ecc4a32362b --- /dev/null +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -0,0 +1,62 @@ +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React from 'react'; + +import { _t } from '../../../../languageHandler'; +import Spinner from '../../elements/Spinner'; +import SettingsSubsection from '../shared/SettingsSubsection'; +import DeviceSecurityCard from './DeviceSecurityCard'; +import DeviceTile from './DeviceTile'; +import { DeviceSecurityVariation } from './filter'; +import { DeviceWithVerification } from './useOwnDevices'; + +interface Props { + device?: DeviceWithVerification; + isLoading: boolean; +} + +const CurrentDeviceSection: React.FC = ({ + device, isLoading, +}) => { + const securityCardProps = device?.isVerified ? { + variation: DeviceSecurityVariation.Verified, + heading: _t('Verified session'), + description: _t('This session is ready for secure messaging.'), + } : { + variation: DeviceSecurityVariation.Unverified, + heading: _t('Unverified session'), + description: _t('Verify or sign out from this session for best security and reliability.'), + }; + return + { isLoading && } + { !!device && <> + +
+ + + } +
; +}; + +export default CurrentDeviceSection; diff --git a/src/components/views/settings/tabs/user/SessionManagerTab.tsx b/src/components/views/settings/tabs/user/SessionManagerTab.tsx index a7201e360aa..31bfa39c07f 100644 --- a/src/components/views/settings/tabs/user/SessionManagerTab.tsx +++ b/src/components/views/settings/tabs/user/SessionManagerTab.tsx @@ -17,13 +17,11 @@ limitations under the License. import React from 'react'; import { _t } from "../../../../../languageHandler"; -import Spinner from '../../../elements/Spinner'; import { useOwnDevices } from '../../devices/useOwnDevices'; -import DeviceTile from '../../devices/DeviceTile'; -import DeviceSecurityCard from '../../devices/DeviceSecurityCard'; import SettingsSubsection from '../../shared/SettingsSubsection'; import FilteredDeviceList from '../../devices/FilteredDeviceList'; import { DeviceSecurityVariation } from '../../devices/types'; +import CurrentDeviceSection from '../../devices/CurrentDeviceSection'; import SecurityRecommendations from '../../devices/SecurityRecommendations'; import SettingsTab from '../SettingsTab'; @@ -33,34 +31,12 @@ const SessionManagerTab: React.FC = () => { const { [currentDeviceId]: currentDevice, ...otherDevices } = devices; const shouldShowOtherSessions = Object.keys(otherDevices).length > 0; - const securityCardProps = currentDevice?.isVerified ? { - variation: DeviceSecurityVariation.Verified, - heading: _t('Verified session'), - description: _t('This session is ready for secure messaging.'), - } : { - variation: DeviceSecurityVariation.Unverified, - heading: _t('Unverified session'), - description: _t('Verify or sign out from this session for best security and reliability.'), - }; - return - - { isLoading && } - { !!currentDevice && <> - -
- - - } -
+ { shouldShowOtherSessions && Date: Mon, 15 Aug 2022 11:03:17 +0200 Subject: [PATCH 2/6] add dropdown button for currentsession device details --- res/css/_components.pcss | 3 +- .../settings/devices/_DeviceDetails.pcss | 2 + .../devices/_DeviceExpandDetailsButton.pcss | 41 ++++++++++++++++++ res/css/views/elements/_AccessibleButton.pcss | 6 +++ res/img/feather-customised/dropdown-arrow.svg | 2 +- .../views/elements/AccessibleButton.tsx | 3 +- .../settings/devices/CurrentDeviceSection.tsx | 13 +++++- .../devices/DeviceExpandDetailsButton.tsx | 42 +++++++++++++++++++ .../DeviceExpandDetailsButton-test.tsx | 31 ++++++++++++++ 9 files changed, 138 insertions(+), 5 deletions(-) create mode 100644 res/css/components/views/settings/devices/_DeviceExpandDetailsButton.pcss create mode 100644 src/components/views/settings/devices/DeviceExpandDetailsButton.tsx create mode 100644 test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx diff --git a/res/css/_components.pcss b/res/css/_components.pcss index 6515bd90d30..3f23e6de572 100644 --- a/res/css/_components.pcss +++ b/res/css/_components.pcss @@ -28,6 +28,7 @@ @import "./components/views/messages/_MBeaconBody.pcss"; @import "./components/views/messages/shared/_MediaProcessingError.pcss"; @import "./components/views/settings/devices/_DeviceDetails.pcss"; +@import "./components/views/settings/devices/_DeviceExpandDetailsButton.pcss"; @import "./components/views/settings/devices/_DeviceSecurityCard.pcss"; @import "./components/views/settings/devices/_DeviceTile.pcss"; @import "./components/views/settings/devices/_FilteredDeviceList.pcss"; @@ -333,12 +334,12 @@ @import "./views/toasts/_IncomingCallToast.pcss"; @import "./views/toasts/_NonUrgentEchoFailureToast.pcss"; @import "./views/typography/_Heading.pcss"; +@import "./views/user-onboarding/_UserOnboardingButton.pcss"; @import "./views/user-onboarding/_UserOnboardingFeedback.pcss"; @import "./views/user-onboarding/_UserOnboardingHeader.pcss"; @import "./views/user-onboarding/_UserOnboardingList.pcss"; @import "./views/user-onboarding/_UserOnboardingPage.pcss"; @import "./views/user-onboarding/_UserOnboardingTask.pcss"; -@import "./views/user-onboarding/_UserOnboardingButton.pcss"; @import "./views/verification/_VerificationShowSas.pcss"; @import "./views/voip/CallView/_CallViewButtons.pcss"; @import "./views/voip/_CallPreview.pcss"; diff --git a/res/css/components/views/settings/devices/_DeviceDetails.pcss b/res/css/components/views/settings/devices/_DeviceDetails.pcss index df1341dbb17..32546537833 100644 --- a/res/css/components/views/settings/devices/_DeviceDetails.pcss +++ b/res/css/components/views/settings/devices/_DeviceDetails.pcss @@ -17,9 +17,11 @@ limitations under the License. .mx_DeviceDetails { display: flex; flex-direction: column; + box-sizing: border-box; width: 100%; + margin-top: $spacing-16; padding: $spacing-16; border-radius: 8px; border: 1px solid $system; diff --git a/res/css/components/views/settings/devices/_DeviceExpandDetailsButton.pcss b/res/css/components/views/settings/devices/_DeviceExpandDetailsButton.pcss new file mode 100644 index 00000000000..4c9d787fdbe --- /dev/null +++ b/res/css/components/views/settings/devices/_DeviceExpandDetailsButton.pcss @@ -0,0 +1,41 @@ +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_DeviceExpandDetailsButton { + height: 32px; + width: 32px; + background: transparent; + + border-radius: 4px; + color: $secondary-content; + + --icon-transform: rotate(-90deg); +} + +.mx_DeviceExpandDetailsButton.mx_DeviceExpandDetailsButton_expanded { + --icon-transform: rotate(0deg); + + background: $system; +} + +.mx_DeviceExpandDetailsButton_icon { + height: 12px; + width: 12px; + + transition: all 0.3s; + transform: var(--icon-transform); + transform-origin: center; +} diff --git a/res/css/views/elements/_AccessibleButton.pcss b/res/css/views/elements/_AccessibleButton.pcss index 7d01c17e125..8718d862337 100644 --- a/res/css/views/elements/_AccessibleButton.pcss +++ b/res/css/views/elements/_AccessibleButton.pcss @@ -76,6 +76,12 @@ limitations under the License. mask-image: url('$(res)/img/feather-customised/x.svg'); } } + + &.mx_AccessibleButton_kind_icon { + padding: 0; + height: 32px; + width: 32px; + } } &.mx_AccessibleButton_kind_primary, diff --git a/res/img/feather-customised/dropdown-arrow.svg b/res/img/feather-customised/dropdown-arrow.svg index a1d46fa61a6..24645d2bbaa 100644 --- a/res/img/feather-customised/dropdown-arrow.svg +++ b/res/img/feather-customised/dropdown-arrow.svg @@ -1,5 +1,5 @@ - + diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index f54a8d4bff5..a2337444cfa 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -33,7 +33,8 @@ type AccessibleButtonKind = | 'primary' | 'link_inline' | 'link_sm' | 'confirm_sm' - | 'cancel_sm'; + | 'cancel_sm' + | 'icon'; /** * This type construct allows us to specifically pass those props down to the element we’re creating that the element diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx index ecc4a32362b..8b53a6c85cd 100644 --- a/src/components/views/settings/devices/CurrentDeviceSection.tsx +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -14,11 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; +import React, { useState } from 'react'; import { _t } from '../../../../languageHandler'; import Spinner from '../../elements/Spinner'; import SettingsSubsection from '../shared/SettingsSubsection'; +import DeviceDetails from './DeviceDetails'; +import DeviceExpandDetailsButton from './DeviceExpandDetailsButton'; import DeviceSecurityCard from './DeviceSecurityCard'; import DeviceTile from './DeviceTile'; import { DeviceSecurityVariation } from './filter'; @@ -32,6 +34,7 @@ interface Props { const CurrentDeviceSection: React.FC = ({ device, isLoading, }) => { + const [isExpanded, setIsExpanded] = useState(false); const securityCardProps = device?.isVerified ? { variation: DeviceSecurityVariation.Verified, heading: _t('Verified session'), @@ -49,7 +52,13 @@ const CurrentDeviceSection: React.FC = ({ { !!device && <> + > + setIsExpanded(!isExpanded)} + /> + + { isExpanded && }
, 'className'> { + isExpanded: boolean; + onClick: () => void; +} + +const DeviceExpandDetailsButton: React.FC = ({ isExpanded, onClick, ...rest }) => { + return + {...rest} + kind='icon' + element='button' + className={classNames('mx_DeviceExpandDetailsButton', { + mx_DeviceExpandDetailsButton_expanded: isExpanded, + })} + onClick={onClick} + > + + ; +}; + +export default DeviceExpandDetailsButton; diff --git a/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx b/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx new file mode 100644 index 00000000000..c9bc85d6767 --- /dev/null +++ b/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx @@ -0,0 +1,31 @@ +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import { render } from '@testing-library/react'; +import React from 'react'; + +import DeviceExpandDetailsButton from '../../../../../src/components/views/settings/devices/DeviceExpandDetailsButton'; + +describe('', () => { + const defaultProps = {}; + const getComponent = (props = {}) => + ; + + it('renders', () => { + const { container } = render(getComponent()); + expect({ container }).toBeTruthy(); + }); +}); From e8ed51c7193332411cd3f04bce3556d7d66c95a2 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 15 Aug 2022 13:36:02 +0200 Subject: [PATCH 3/6] test currentdevicesection --- .../settings/devices/_DeviceDetails.pcss | 4 +- .../settings/devices/CurrentDeviceSection.tsx | 3 +- .../devices/DeviceExpandDetailsButton.tsx | 7 +- .../devices/CurrentDeviceSection-test.tsx | 82 ++++++ .../DeviceExpandDetailsButton-test.tsx | 24 +- .../CurrentDeviceSection-test.tsx.snap | 267 ++++++++++++++++++ .../DeviceExpandDetailsButton-test.tsx.snap | 33 +++ .../SessionManagerTab-test.tsx.snap | 39 ++- 8 files changed, 445 insertions(+), 14 deletions(-) create mode 100644 test/components/views/settings/devices/CurrentDeviceSection-test.tsx create mode 100644 test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap create mode 100644 test/components/views/settings/devices/__snapshots__/DeviceExpandDetailsButton-test.tsx.snap diff --git a/res/css/components/views/settings/devices/_DeviceDetails.pcss b/res/css/components/views/settings/devices/_DeviceDetails.pcss index 32546537833..76cacfa1c95 100644 --- a/res/css/components/views/settings/devices/_DeviceDetails.pcss +++ b/res/css/components/views/settings/devices/_DeviceDetails.pcss @@ -24,13 +24,13 @@ limitations under the License. margin-top: $spacing-16; padding: $spacing-16; border-radius: 8px; - border: 1px solid $system; + border: 1px solid $quinary-content; } .mx_DeviceDetails_section { padding-bottom: $spacing-16; margin-bottom: $spacing-16; - border-bottom: 1px solid $system; + border-bottom: 1px solid $quinary-content; &:last-child { padding-bottom: 0; diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx index 8b53a6c85cd..3f9bcd11c1e 100644 --- a/src/components/views/settings/devices/CurrentDeviceSection.tsx +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -54,11 +54,12 @@ const CurrentDeviceSection: React.FC = ({ device={device} > setIsExpanded(!isExpanded)} /> - { isExpanded && } + { isExpanded && }
, 'className'> { +interface Props { isExpanded: boolean; onClick: () => void; } const DeviceExpandDetailsButton: React.FC = ({ isExpanded, onClick, ...rest }) => { - return + return ', () => { + const deviceId = 'alices_device'; + + const alicesVerifiedDevice = { + device_id: deviceId, + isVerified: false, + }; + const alicesUnverifiedDevice = { + device_id: deviceId, + isVerified: false, + }; + + const defaultProps = { + device: alicesVerifiedDevice, + isLoading: false, + }; + const getComponent = (props = {}): React.ReactElement => + (); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('renders spinner while device is loading', () => { + const { container } = render(getComponent({ device: undefined, isLoading: true })); + expect(container.getElementsByClassName('mx_Spinner').length).toBeTruthy(); + }); + + it('handles when device is falsy', async () => { + const { container } = render(getComponent({ device: undefined })); + expect(container).toMatchSnapshot(); + }); + + it('renders device and correct security card when device is verified', () => { + const { container } = render(getComponent()); + expect(container).toMatchSnapshot(); + }); + + it('renders device and correct security card when device is unverified', () => { + const { container } = render(getComponent({ device: alicesUnverifiedDevice })); + expect(container).toMatchSnapshot(); + }); + + it('displays device details on toggle click', () => { + const { container, getByTestId } = render(getComponent({ device: alicesUnverifiedDevice })); + + act(() => { + fireEvent.click(getByTestId('current-session-toggle-details')); + }); + + expect(container.getElementsByClassName('mx_DeviceDetails')).toMatchSnapshot(); + + act(() => { + fireEvent.click(getByTestId('current-session-toggle-details')); + }); + + // device details are hidden + expect(container.getElementsByClassName('mx_DeviceDetails').length).toBeFalsy(); + }); +}); diff --git a/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx b/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx index c9bc85d6767..3d790e43c2d 100644 --- a/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx +++ b/test/components/views/settings/devices/DeviceExpandDetailsButton-test.tsx @@ -14,18 +14,34 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { render } from '@testing-library/react'; import React from 'react'; +import { fireEvent, render } from '@testing-library/react'; import DeviceExpandDetailsButton from '../../../../../src/components/views/settings/devices/DeviceExpandDetailsButton'; describe('', () => { - const defaultProps = {}; + const defaultProps = { + isExpanded: false, + onClick: jest.fn(), + }; const getComponent = (props = {}) => ; - it('renders', () => { + it('renders when not expanded', () => { const { container } = render(getComponent()); - expect({ container }).toBeTruthy(); + expect({ container }).toMatchSnapshot(); + }); + + it('renders when expanded', () => { + const { container } = render(getComponent({ isExpanded: true })); + expect({ container }).toMatchSnapshot(); + }); + + it('calls onClick', () => { + const onClick = jest.fn(); + const { getByTestId } = render(getComponent({ 'data-testid': 'test', onClick })); + fireEvent.click(getByTestId('test')); + + expect(onClick).toHaveBeenCalled(); }); }); diff --git a/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap b/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap new file mode 100644 index 00000000000..d7ea1baa7d8 --- /dev/null +++ b/test/components/views/settings/devices/__snapshots__/CurrentDeviceSection-test.tsx.snap @@ -0,0 +1,267 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` displays device details on toggle click 1`] = ` +HTMLCollection [ +
+
+

+ alices_device +

+
+
+

+ Session details +

+ + + + + + + + + + +
+ Session ID + + alices_device +
+ Last activity + +
+ + + + + + + + + + + +
+ Device +
+ IP address + +
+
+
, +] +`; + +exports[` handles when device is falsy 1`] = ` +
+
+

+ Current session +

+
+
+
+`; + +exports[` renders device and correct security card when device is unverified 1`] = ` +
+
+

+ Current session +

+
+
+
+

+ alices_device +

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+

+ Unverified session +

+

+ Verify or sign out from this session for best security and reliability. +

+
+
+
+
+
+`; + +exports[` renders device and correct security card when device is verified 1`] = ` +
+
+

+ Current session +

+
+
+
+

+ alices_device +

+ +
+
+
+
+
+
+
+
+
+
+
+
+
+

+ Unverified session +

+

+ Verify or sign out from this session for best security and reliability. +

+
+
+
+
+
+`; diff --git a/test/components/views/settings/devices/__snapshots__/DeviceExpandDetailsButton-test.tsx.snap b/test/components/views/settings/devices/__snapshots__/DeviceExpandDetailsButton-test.tsx.snap new file mode 100644 index 00000000000..bcbc2c8592d --- /dev/null +++ b/test/components/views/settings/devices/__snapshots__/DeviceExpandDetailsButton-test.tsx.snap @@ -0,0 +1,33 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` renders when expanded 1`] = ` +Object { + "container":
+
+
+
+
, +} +`; + +exports[` renders when not expanded 1`] = ` +Object { + "container":
+
+
+
+
, +} +`; diff --git a/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap index 2e56729eadc..bb2094aa53d 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap @@ -39,7 +39,18 @@ exports[` renders current session section with a verified s
+ > +
+
+
+

renders current session section with an unverifie
+ > +
+
+
+

sets device verification status correctly 1`] = `
+ > +
+
+
+
`; From a3504ecea54e5ac49ddc3ee20f0a58d0187b338f Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 15 Aug 2022 13:39:50 +0200 Subject: [PATCH 4/6] remove unnecc beforeEach --- .../views/settings/devices/CurrentDeviceSection-test.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/components/views/settings/devices/CurrentDeviceSection-test.tsx b/test/components/views/settings/devices/CurrentDeviceSection-test.tsx index 7fa5bee7414..966db9f7f2a 100644 --- a/test/components/views/settings/devices/CurrentDeviceSection-test.tsx +++ b/test/components/views/settings/devices/CurrentDeviceSection-test.tsx @@ -39,10 +39,6 @@ describe('', () => { const getComponent = (props = {}): React.ReactElement => (); - beforeEach(() => { - jest.clearAllMocks(); - }); - it('renders spinner while device is loading', () => { const { container } = render(getComponent({ device: undefined, isLoading: true })); expect(container.getElementsByClassName('mx_Spinner').length).toBeTruthy(); From 996a5f08d8d2dbdd0f28928e3afe19ed2996d3e3 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 15 Aug 2022 13:44:11 +0200 Subject: [PATCH 5/6] update type imports --- .../views/settings/devices/CurrentDeviceSection.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx index 3f9bcd11c1e..2252ef71f65 100644 --- a/src/components/views/settings/devices/CurrentDeviceSection.tsx +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -23,8 +23,10 @@ import DeviceDetails from './DeviceDetails'; import DeviceExpandDetailsButton from './DeviceExpandDetailsButton'; import DeviceSecurityCard from './DeviceSecurityCard'; import DeviceTile from './DeviceTile'; -import { DeviceSecurityVariation } from './filter'; -import { DeviceWithVerification } from './useOwnDevices'; +import { + DeviceSecurityVariation, + DeviceWithVerification, + } from './types'; interface Props { device?: DeviceWithVerification; From 20b1f2e1b23e2bb8a9c8018f848f4f8b048c773f Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Mon, 15 Aug 2022 13:54:56 +0200 Subject: [PATCH 6/6] i18n and lint --- .../views/settings/devices/CurrentDeviceSection.tsx | 2 +- .../views/settings/tabs/user/SessionManagerTab.tsx | 1 - src/i18n/strings/en_EN.json | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx index 2252ef71f65..c0826d54122 100644 --- a/src/components/views/settings/devices/CurrentDeviceSection.tsx +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -26,7 +26,7 @@ import DeviceTile from './DeviceTile'; import { DeviceSecurityVariation, DeviceWithVerification, - } from './types'; +} from './types'; interface Props { device?: DeviceWithVerification; diff --git a/src/components/views/settings/tabs/user/SessionManagerTab.tsx b/src/components/views/settings/tabs/user/SessionManagerTab.tsx index 31bfa39c07f..3a0a9b976be 100644 --- a/src/components/views/settings/tabs/user/SessionManagerTab.tsx +++ b/src/components/views/settings/tabs/user/SessionManagerTab.tsx @@ -20,7 +20,6 @@ import { _t } from "../../../../../languageHandler"; import { useOwnDevices } from '../../devices/useOwnDevices'; import SettingsSubsection from '../../shared/SettingsSubsection'; import FilteredDeviceList from '../../devices/FilteredDeviceList'; -import { DeviceSecurityVariation } from '../../devices/types'; import CurrentDeviceSection from '../../devices/CurrentDeviceSection'; import SecurityRecommendations from '../../devices/SecurityRecommendations'; import SettingsTab from '../SettingsTab'; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2dc273e2631..335194891e6 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1555,12 +1555,7 @@ "Share anonymous data to help us identify issues. Nothing personal. No third parties.": "Share anonymous data to help us identify issues. Nothing personal. No third parties.", "Where you're signed in": "Where you're signed in", "Manage your signed-in devices below. A device's name is visible to people you communicate with.": "Manage your signed-in devices below. A device's name is visible to people you communicate with.", - "Verified session": "Verified session", - "This session is ready for secure messaging.": "This session is ready for secure messaging.", - "Unverified session": "Unverified session", - "Verify or sign out from this session for best security and reliability.": "Verify or sign out from this session for best security and reliability.", "Sessions": "Sessions", - "Current session": "Current session", "Other sessions": "Other sessions", "For best security, verify your sessions and sign out from any session that you don't recognize or use anymore.": "For best security, verify your sessions and sign out from any session that you don't recognize or use anymore.", "Sidebar": "Sidebar", @@ -1691,6 +1686,11 @@ "Please enter verification code sent via text.": "Please enter verification code sent via text.", "Verification code": "Verification code", "Discovery options will appear once you have added a phone number above.": "Discovery options will appear once you have added a phone number above.", + "Verified session": "Verified session", + "This session is ready for secure messaging.": "This session is ready for secure messaging.", + "Unverified session": "Unverified session", + "Verify or sign out from this session for best security and reliability.": "Verify or sign out from this session for best security and reliability.", + "Current session": "Current session", "Confirm logging out these devices by using Single Sign On to prove your identity.|other": "Confirm logging out these devices by using Single Sign On to prove your identity.", "Confirm logging out these devices by using Single Sign On to prove your identity.|one": "Confirm logging out this device by using Single Sign On to prove your identity.", "Confirm signing out these devices|other": "Confirm signing out these devices",