Device manager - rename session (PSG-528) (#9282)

* split heading into component

* switch between editing and view

* style file

* basic tests

* style device rename component

* add loading state

* kind of handle missing current device in drilled props

* use local loading state, add basic error message

* integration-ish test rename

* tidy

* fussy import ordering

* strict errors
This commit is contained in:
Kerry 2022-09-15 16:34:50 +02:00 committed by GitHub
parent b8bb8f163a
commit 4fec436883
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 720 additions and 43 deletions

View file

@ -88,9 +88,10 @@ const SessionManagerTab: React.FC = () => {
const {
devices,
currentDeviceId,
isLoading,
isLoadingDeviceList,
requestDeviceVerification,
refreshDevices,
saveDeviceName,
} = useOwnDevices();
const [filter, setFilter] = useState<DeviceSecurityVariation>();
const [expandedDeviceIds, setExpandedDeviceIds] = useState<DeviceWithVerification['device_id'][]>([]);
@ -167,8 +168,9 @@ const SessionManagerTab: React.FC = () => {
/>
<CurrentDeviceSection
device={currentDevice}
isLoading={isLoading}
isSigningOut={signingOutDeviceIds.includes(currentDevice?.device_id)}
isLoading={isLoadingDeviceList}
saveDeviceName={(deviceName) => saveDeviceName(currentDevice?.device_id, deviceName)}
onVerifyCurrentDevice={onVerifyCurrentDevice}
onSignOutCurrentDevice={onSignOutCurrentDevice}
/>
@ -191,6 +193,7 @@ const SessionManagerTab: React.FC = () => {
onDeviceExpandToggle={onDeviceExpandToggle}
onRequestDeviceVerification={requestDeviceVerification ? onTriggerDeviceVerification : undefined}
onSignOutDevices={onSignOutOtherDevices}
saveDeviceName={saveDeviceName}
ref={filteredDeviceListRef}
/>
</SettingsSubsection>