mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-30 21:42:00 +00:00
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:
+29
-4
@@ -9,11 +9,24 @@ HTMLCollection [
|
||||
<section
|
||||
class="mx_DeviceDetails_section"
|
||||
>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
<div
|
||||
class="mx_DeviceDetailHeading"
|
||||
data-testid="device-detail-heading"
|
||||
>
|
||||
alices_device
|
||||
</h3>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
>
|
||||
alices_device
|
||||
</h3>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_DeviceDetailHeading_renameCta mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
|
||||
data-testid="device-heading-rename-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Rename
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="mx_DeviceSecurityCard"
|
||||
>
|
||||
@@ -38,6 +51,18 @@ HTMLCollection [
|
||||
>
|
||||
Verify or sign out from this session for best security and reliability.
|
||||
</p>
|
||||
<div
|
||||
class="mx_DeviceSecurityCard_actions"
|
||||
>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
|
||||
data-testid="verification-status-button-alices_device"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Verify session
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<DeviceDetailHeading /> displays name edit form on rename button click 1`] = `
|
||||
Object {
|
||||
"container": <div>
|
||||
<form
|
||||
aria-disabled="false"
|
||||
class="mx_DeviceDetailHeading_renameForm"
|
||||
method="post"
|
||||
>
|
||||
<p
|
||||
class="mx_DeviceDetailHeading_renameFormHeading"
|
||||
id="device-rename-123"
|
||||
>
|
||||
Rename session
|
||||
</p>
|
||||
<div>
|
||||
<div
|
||||
class="mx_Field mx_Field_input mx_DeviceDetailHeading_renameFormInput"
|
||||
>
|
||||
<input
|
||||
aria-describedby="device-rename-description-123"
|
||||
aria-labelledby="device-rename-123"
|
||||
autocomplete="off"
|
||||
data-testid="device-rename-input"
|
||||
id="mx_Field_1"
|
||||
maxlength="100"
|
||||
type="text"
|
||||
value="My device"
|
||||
/>
|
||||
<label
|
||||
for="mx_Field_1"
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
class="mx_Caption"
|
||||
id="device-rename-description-123"
|
||||
>
|
||||
Please be aware that session names are also visible to people you communicate with
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="mx_DeviceDetailHeading_renameFormButtons"
|
||||
>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
|
||||
data-testid="device-rename-submit-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Save
|
||||
</div>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_secondary"
|
||||
data-testid="device-rename-cancel-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Cancel
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>,
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`<DeviceDetailHeading /> renders device name 1`] = `
|
||||
Object {
|
||||
"container": <div>
|
||||
<div
|
||||
class="mx_DeviceDetailHeading"
|
||||
data-testid="device-detail-heading"
|
||||
>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
>
|
||||
My device
|
||||
</h3>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_DeviceDetailHeading_renameCta mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
|
||||
data-testid="device-heading-rename-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Rename
|
||||
</div>
|
||||
</div>
|
||||
</div>,
|
||||
}
|
||||
`;
|
||||
@@ -9,11 +9,24 @@ exports[`<DeviceDetails /> renders a verified device 1`] = `
|
||||
<section
|
||||
class="mx_DeviceDetails_section"
|
||||
>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
<div
|
||||
class="mx_DeviceDetailHeading"
|
||||
data-testid="device-detail-heading"
|
||||
>
|
||||
my-device
|
||||
</h3>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
>
|
||||
my-device
|
||||
</h3>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_DeviceDetailHeading_renameCta mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
|
||||
data-testid="device-heading-rename-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Rename
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="mx_DeviceSecurityCard"
|
||||
>
|
||||
@@ -130,11 +143,24 @@ exports[`<DeviceDetails /> renders device with metadata 1`] = `
|
||||
<section
|
||||
class="mx_DeviceDetails_section"
|
||||
>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
<div
|
||||
class="mx_DeviceDetailHeading"
|
||||
data-testid="device-detail-heading"
|
||||
>
|
||||
My Device
|
||||
</h3>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
>
|
||||
My Device
|
||||
</h3>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_DeviceDetailHeading_renameCta mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
|
||||
data-testid="device-heading-rename-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Rename
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="mx_DeviceSecurityCard"
|
||||
>
|
||||
@@ -255,11 +281,24 @@ exports[`<DeviceDetails /> renders device without metadata 1`] = `
|
||||
<section
|
||||
class="mx_DeviceDetails_section"
|
||||
>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
<div
|
||||
class="mx_DeviceDetailHeading"
|
||||
data-testid="device-detail-heading"
|
||||
>
|
||||
my-device
|
||||
</h3>
|
||||
<h3
|
||||
class="mx_Heading_h3"
|
||||
>
|
||||
my-device
|
||||
</h3>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_DeviceDetailHeading_renameCta mx_AccessibleButton_hasKind mx_AccessibleButton_kind_link_inline"
|
||||
data-testid="device-heading-rename-cta"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Rename
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="mx_DeviceSecurityCard"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user