App Permissions Modal - QA fixes (#3853)

* Fix App Permissions Modal scrolling

* change changeset to be minor

* fix height of permissions modal - confimration step
This commit is contained in:
Lukasz Ostrowski 2023-07-05 08:06:36 +02:00 committed by GitHub
parent 07fa3bc0cc
commit b0214c6454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 29 deletions

View file

@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---
Apps: Fixed problem with Permissions Modal that was clipped on smaller screens. Now long permissions list is scrollable.

View file

@ -27,7 +27,7 @@ export const AppPermissionsDialogConfirmation = ({
const { mapCodesToNames } = useGetAvailableAppPermissions();
return (
<Box>
<Box __maxHeight={"50vh"} overflow={"auto"}>
<Text marginBottom={2} as={"p"}>
{intl.formatMessage(messages.summaryText)}
</Text>

View file

@ -15,6 +15,12 @@ interface AppPermissionsDialogPermissionPickerProps {
onClose(): void;
}
/**
* Approximate height that clips list and makes it scrollable.
* This makes it avaialble on small devices, including horizontal ipad air
*/
const LIST_MAX_HEIGHT = "50vh";
export const AppPermissionsDialogPermissionPicker = ({
onSubmit,
onChange,
@ -39,6 +45,7 @@ export const AppPermissionsDialogPermissionPicker = ({
onChange(values);
}}
>
<Box overflow={"scroll"} __maxHeight={LIST_MAX_HEIGHT}>
<List>
{allPermissions.map(perm => {
const isAssigned = Boolean(selected.find(p => p === perm.code));
@ -67,7 +74,8 @@ export const AppPermissionsDialogPermissionPicker = ({
);
})}
</List>
<Box display={"flex"} justifyContent={"flex-end"} gap={2}>
</Box>
<Box display={"flex"} justifyContent={"flex-end"} gap={2} marginTop={2}>
<Button onClick={onClose} type={"button"} variant={"tertiary"}>
{intl.formatMessage(messages.closeButton)}
</Button>