Skip to content

Commit

Permalink
fixed UX on security management menu
Browse files Browse the repository at this point in the history
  • Loading branch information
al-rosenthal committed Dec 19, 2023
1 parent 634d02f commit 6a6b04b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions app/src/components/security/ManageSecurity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const ManageSecurity = (props: IManageSecurityProps) => {

const open = Boolean(anchorEl);

Check warning on line 19 in app/src/components/security/ManageSecurity.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/security/ManageSecurity.tsx#L19

Added line #L19 was not covered by tests

const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
const handleMenuClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget);

Check warning on line 22 in app/src/components/security/ManageSecurity.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/security/ManageSecurity.tsx#L21-L22

Added lines #L21 - L22 were not covered by tests
};
const handleClose = () => {
const handleMenuClose = () => {
setAnchorEl(null);

Check warning on line 25 in app/src/components/security/ManageSecurity.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/security/ManageSecurity.tsx#L24-L25

Added lines #L24 - L25 were not covered by tests
};

Expand All @@ -30,26 +30,32 @@ const ManageSecurity = (props: IManageSecurityProps) => {
<SecuritiesDialog
features={props.features}
isOpen={isSecuritiesDialogOpen}
onClose={() => setIsSecuritiesDialogOpen(false)}
onClose={() => {
setIsSecuritiesDialogOpen(false);
handleMenuClose();

Check warning on line 35 in app/src/components/security/ManageSecurity.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/security/ManageSecurity.tsx#L34-L35

Added lines #L34 - L35 were not covered by tests
}}
/>
<UnsecureDialog
features={props.features}
isOpen={isUnsecureDialogOpen}
onClose={() => setIsUnsecuredDialogOpen(false)}
onClose={() => {
setIsUnsecuredDialogOpen(false);
handleMenuClose();

Check warning on line 43 in app/src/components/security/ManageSecurity.tsx

View check run for this annotation

Codecov / codecov/patch

app/src/components/security/ManageSecurity.tsx#L42-L43

Added lines #L42 - L43 were not covered by tests
}}
/>
<Button
color="primary"
data-testid="manage-security"
variant="outlined"
onClick={handleClick}
onClick={handleMenuClick}
startIcon={<Icon path={mdiSecurity} size={0.75} />}
endIcon={open ? <Icon path={mdiChevronUp} size={0.75} /> : <Icon path={mdiChevronDown} size={0.75} />}>
Manage Security
</Button>
<Menu
open={open}
anchorEl={anchorEl}
onClose={handleClose}
onClose={handleMenuClose}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'right'
Expand Down

0 comments on commit 6a6b04b

Please sign in to comment.