Update product permission pages access
This commit is contained in:
parent
0f3a2907d3
commit
e0a1d11991
4 changed files with 282 additions and 101 deletions
|
@ -44,7 +44,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] {
|
|||
id: "configurationMenuAttributes"
|
||||
}),
|
||||
icon: <Attributes fontSize="inherit" viewBox="0 0 44 44" />,
|
||||
permission: PermissionEnum.MANAGE_PRODUCTS,
|
||||
permission: PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,
|
||||
title: intl.formatMessage(sectionNames.attributes),
|
||||
url: attributeListUrl()
|
||||
},
|
||||
|
@ -54,7 +54,7 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] {
|
|||
id: "configurationMenuProductTypes"
|
||||
}),
|
||||
icon: <ProductTypes fontSize="inherit" viewBox="0 0 44 44" />,
|
||||
permission: PermissionEnum.MANAGE_PRODUCTS,
|
||||
permission: PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,
|
||||
title: intl.formatMessage(sectionNames.productTypes),
|
||||
url: productTypeListUrl()
|
||||
}
|
||||
|
|
|
@ -345,6 +345,10 @@ export const permissions: ShopInfo_shop_permissions[] = [
|
|||
code: PermissionEnum.MANAGE_PRODUCTS,
|
||||
name: "Manage products."
|
||||
},
|
||||
{
|
||||
code: PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,
|
||||
name: "Manage product types and attributes."
|
||||
},
|
||||
{
|
||||
code: PermissionEnum.MANAGE_SETTINGS,
|
||||
name: "Manage settings."
|
||||
|
@ -439,6 +443,11 @@ export const adminUserPermissions: User_userPermissions[] = [
|
|||
code: PermissionEnum.MANAGE_PRODUCTS,
|
||||
name: "Manage products."
|
||||
},
|
||||
{
|
||||
__typename: "UserPermission",
|
||||
code: PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,
|
||||
name: "Manage product types and attributes."
|
||||
},
|
||||
{
|
||||
__typename: "UserPermission",
|
||||
code: PermissionEnum.MANAGE_SERVICE_ACCOUNTS,
|
||||
|
|
|
@ -191,7 +191,9 @@ const Routes: React.FC = () => {
|
|||
component={ProductSection}
|
||||
/>
|
||||
<SectionRoute
|
||||
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
||||
permissions={[
|
||||
PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES
|
||||
]}
|
||||
path="/product-types"
|
||||
component={ProductTypesSection}
|
||||
/>
|
||||
|
@ -231,7 +233,9 @@ const Routes: React.FC = () => {
|
|||
component={NavigationSection}
|
||||
/>
|
||||
<SectionRoute
|
||||
permissions={[PermissionEnum.MANAGE_PRODUCTS]}
|
||||
permissions={[
|
||||
PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES
|
||||
]}
|
||||
path={attributeSection}
|
||||
component={AttributeSection}
|
||||
/>
|
||||
|
|
|
@ -53828,63 +53828,6 @@ exports[`Storyshots Views / Configuration partial access 1`] = `
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ConfigurationPage-configurationCategory-id"
|
||||
>
|
||||
<div
|
||||
class="ConfigurationPage-configurationLabel-id"
|
||||
>
|
||||
<div
|
||||
class="MuiTypography-root-id MuiTypography-body1-id"
|
||||
>
|
||||
Product Settings
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ConfigurationPage-configurationItem-id"
|
||||
>
|
||||
<div
|
||||
class="MuiPaper-root-id MuiPaper-elevation0-id MuiCard-root-id ConfigurationPage-card-id MuiPaper-rounded-id"
|
||||
data-test="settingsSubsection"
|
||||
data-testid="taxes"
|
||||
>
|
||||
<div
|
||||
class="MuiCardContent-root-id ConfigurationPage-cardContent-id"
|
||||
>
|
||||
<div
|
||||
class="ConfigurationPage-icon-id"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id MuiSvgIcon-fontSizeInherit-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 44 44"
|
||||
>
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="M2 0H34.6316V21.0526H32.5263V2.10526H4.10526V37.8947H32.5263V35.2632H34.6316V40H2V0ZM8.31579 20H11.4737V23.1579H8.31579V20ZM16.7368 20H13.5789V23.1579H16.7368V20ZM18.8421 20H22V23.1579H18.8421V20ZM27.2632 20H24.1053V23.1579H27.2632V20ZM8.31579 25.2632H11.4737V28.4211H8.31579V25.2632ZM16.7368 25.2632H13.5789V28.4211H16.7368V25.2632ZM18.8421 25.2632H22V28.4211H18.8421V25.2632ZM11.4737 30.5263H8.31579V33.6842H11.4737V30.5263ZM13.5789 30.5263H16.7368V33.6842H13.5789V30.5263ZM22 30.5263H18.8421V33.6842H22V30.5263ZM26.2105 9.47368H10.4211V14.7368H26.2105V9.47368ZM8.31579 7.36842V16.8421H28.3158V7.36842H8.31579ZM37.7895 30.5263H34.6316V33.6842H37.7895V30.5263ZM28.3158 24.2105H31.4737V27.3684H28.3158V24.2105ZM29.0602 34.4285L38.5339 24.9548L37.0452 23.4662L27.5715 32.9398L29.0602 34.4285Z"
|
||||
fill="#06847B"
|
||||
fill-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
class="MuiTypography-root-id ConfigurationPage-sectionTitle-id MuiTypography-body1-id MuiTypography-colorPrimary-id"
|
||||
>
|
||||
Taxes
|
||||
</div>
|
||||
<div
|
||||
class="MuiTypography-root-id ConfigurationPage-sectionDescription-id MuiTypography-body1-id"
|
||||
>
|
||||
Manage how your store charges tax
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ConfigurationPage-configurationCategory-id"
|
||||
>
|
||||
|
@ -53957,46 +53900,6 @@ exports[`Storyshots Views / Configuration partial access 1`] = `
|
|||
<div
|
||||
class="ConfigurationPage-configurationItem-id"
|
||||
>
|
||||
<div
|
||||
class="MuiPaper-root-id MuiPaper-elevation0-id MuiCard-root-id ConfigurationPage-card-id MuiPaper-rounded-id"
|
||||
data-test="settingsSubsection"
|
||||
data-testid="site settings"
|
||||
>
|
||||
<div
|
||||
class="MuiCardContent-root-id ConfigurationPage-cardContent-id"
|
||||
>
|
||||
<div
|
||||
class="ConfigurationPage-icon-id"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id MuiSvgIcon-fontSizeInherit-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 44 44"
|
||||
>
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="M31.8208 5.55248L30.7926 8.35093L31.545 9.18475C33.147 10.9601 34.3637 13.1054 35.0581 15.4817L35.3837 16.596L38.1395 17.0712V23.1349L35.3838 23.6101L35.0582 24.7244C34.4073 26.9518 33.2976 28.9763 31.8417 30.6834L31.1357 31.5111L32.2146 34.4475L26.7281 37.6084L24.9142 35.4411L23.7814 35.7276C22.572 36.0334 21.3058 36.1961 20 36.1961C18.6942 36.1961 17.428 36.0334 16.2186 35.7276L15.0858 35.4411L13.2719 37.6084L7.78535 34.4475L8.86424 31.5111L8.15831 30.6834C6.70243 28.9763 5.59267 26.9518 4.94182 24.7244L4.61622 23.6101L1.86047 23.1349L1.86047 17.0712L4.61625 16.596L4.94186 15.4817C5.63625 13.1054 6.85296 10.9601 8.45495 9.18475L9.20736 8.35093L8.17916 5.55248L13.6657 2.39164L15.5348 4.62486L16.6397 4.37851C17.7208 4.1375 18.8448 4.01018 20 4.01018C21.1552 4.01018 22.2792 4.1375 23.3603 4.37851L24.4652 4.62486L26.3343 2.39164L31.8208 5.55248ZM40 24.702V15.5042L36.8439 14.9599C36.0699 12.311 34.7134 9.91885 32.9263 7.93836L34.1077 4.72285L25.9098 0L23.7651 2.56262C22.5521 2.2922 21.2924 2.14972 20 2.14972C18.7076 2.14972 17.4479 2.2922 16.2349 2.56262L14.0902 0L5.89227 4.72285L7.07371 7.93836C5.28657 9.91885 3.93009 12.311 3.15607 14.9599L0 15.5042V24.702L3.15603 25.2462C3.88152 27.7291 5.11876 29.9864 6.74273 31.8906L5.49846 35.2772L13.6964 40L15.7625 37.5313C17.1197 37.8744 18.539 38.0565 20 38.0565C21.461 38.0565 22.8803 37.8744 24.2375 37.5313L26.3036 40L34.5015 35.2772L33.2573 31.8906C34.8812 29.9864 36.1185 27.7291 36.844 25.2462L40 24.702ZM28.4425 20C28.4425 24.6627 24.6627 28.4425 20 28.4425C15.3373 28.4425 11.5574 24.6627 11.5574 20C11.5574 15.3373 15.3373 11.5574 20 11.5574C24.6627 11.5574 28.4425 15.3373 28.4425 20ZM30.303 20C30.303 25.6902 25.6902 30.303 20 30.303C14.3097 30.303 9.69693 25.6902 9.69693 20C9.69693 14.3097 14.3097 9.69693 20 9.69693C25.6902 9.69693 30.303 14.3097 30.303 20Z"
|
||||
fill="#06847B"
|
||||
fill-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
class="MuiTypography-root-id ConfigurationPage-sectionTitle-id MuiTypography-body1-id MuiTypography-colorPrimary-id"
|
||||
>
|
||||
Site Settings
|
||||
</div>
|
||||
<div
|
||||
class="MuiTypography-root-id ConfigurationPage-sectionDescription-id MuiTypography-body1-id"
|
||||
>
|
||||
View and update your site settings
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="MuiPaper-root-id MuiPaper-elevation0-id MuiCard-root-id ConfigurationPage-card-id MuiPaper-rounded-id"
|
||||
data-test="settingsSubsection"
|
||||
|
@ -116756,6 +116659,59 @@ exports[`Storyshots Views / Permission Groups / Permission Group Create default
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemIcon-root-id"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id MuiIconButton-edgeStart-id"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label-id"
|
||||
>
|
||||
<input
|
||||
aria-labelledby="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
class="PrivateSwitchBase-input-id"
|
||||
data-indeterminate="false"
|
||||
name="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
tabindex="-1"
|
||||
type="checkbox"
|
||||
/>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<rect
|
||||
fill="none"
|
||||
height="14"
|
||||
stroke="currentColor"
|
||||
width="14"
|
||||
x="5"
|
||||
y="5"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="MuiListItemText-root-id MuiListItemText-dense-id"
|
||||
id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root-id MuiListItemText-primary-id MuiTypography-body2-id"
|
||||
>
|
||||
Manage product types and attributes
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
|
@ -117569,6 +117525,59 @@ exports[`Storyshots Views / Permission Groups / Permission Group Create errors 1
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemIcon-root-id"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id MuiIconButton-edgeStart-id"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label-id"
|
||||
>
|
||||
<input
|
||||
aria-labelledby="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
class="PrivateSwitchBase-input-id"
|
||||
data-indeterminate="false"
|
||||
name="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
tabindex="-1"
|
||||
type="checkbox"
|
||||
/>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<rect
|
||||
fill="none"
|
||||
height="14"
|
||||
stroke="currentColor"
|
||||
width="14"
|
||||
x="5"
|
||||
y="5"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="MuiListItemText-root-id MuiListItemText-dense-id"
|
||||
id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root-id MuiListItemText-primary-id MuiTypography-body2-id"
|
||||
>
|
||||
Manage product types and attributes
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
|
@ -118380,6 +118389,59 @@ exports[`Storyshots Views / Permission Groups / Permission Group Create loading
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemIcon-root-id"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id MuiIconButton-edgeStart-id"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label-id"
|
||||
>
|
||||
<input
|
||||
aria-labelledby="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
class="PrivateSwitchBase-input-id"
|
||||
data-indeterminate="false"
|
||||
name="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
tabindex="-1"
|
||||
type="checkbox"
|
||||
/>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<rect
|
||||
fill="none"
|
||||
height="14"
|
||||
stroke="currentColor"
|
||||
width="14"
|
||||
x="5"
|
||||
y="5"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="MuiListItemText-root-id MuiListItemText-dense-id"
|
||||
id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root-id MuiListItemText-primary-id MuiTypography-body2-id"
|
||||
>
|
||||
Manage product types and attributes
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
|
@ -119722,6 +119784,59 @@ exports[`Storyshots Views / Permission Groups / Permission Group Details default
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemIcon-root-id"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id MuiIconButton-edgeStart-id"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label-id"
|
||||
>
|
||||
<input
|
||||
aria-labelledby="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
class="PrivateSwitchBase-input-id"
|
||||
data-indeterminate="false"
|
||||
name="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
tabindex="-1"
|
||||
type="checkbox"
|
||||
/>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<rect
|
||||
fill="none"
|
||||
height="14"
|
||||
stroke="currentColor"
|
||||
width="14"
|
||||
x="5"
|
||||
y="5"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="MuiListItemText-root-id MuiListItemText-dense-id"
|
||||
id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root-id MuiListItemText-primary-id MuiTypography-body2-id"
|
||||
>
|
||||
Manage product types and attributes
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
|
@ -121313,6 +121428,59 @@ exports[`Storyshots Views / Permission Groups / Permission Group Details no memb
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
tabindex="0"
|
||||
>
|
||||
<div
|
||||
class="MuiListItemIcon-root-id"
|
||||
>
|
||||
<span
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id MuiIconButton-edgeStart-id"
|
||||
>
|
||||
<span
|
||||
class="MuiIconButton-label-id"
|
||||
>
|
||||
<input
|
||||
aria-labelledby="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
class="PrivateSwitchBase-input-id"
|
||||
data-indeterminate="false"
|
||||
name="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
tabindex="-1"
|
||||
type="checkbox"
|
||||
/>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root-id"
|
||||
focusable="false"
|
||||
role="presentation"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<rect
|
||||
fill="none"
|
||||
height="14"
|
||||
stroke="currentColor"
|
||||
width="14"
|
||||
x="5"
|
||||
y="5"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="MuiListItemText-root-id MuiListItemText-dense-id"
|
||||
id="MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES"
|
||||
>
|
||||
<span
|
||||
class="MuiTypography-root-id MuiListItemText-primary-id MuiTypography-body2-id"
|
||||
>
|
||||
Manage product types and attributes
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-disabled="false"
|
||||
class="MuiButtonBase-root-id MuiListItem-root-id MuiListItem-dense-id MuiListItem-gutters-id MuiListItem-button-id"
|
||||
|
|
Loading…
Reference in a new issue