diff --git a/src/attributes/components/AttributePage/AttributePage.tsx b/src/attributes/components/AttributePage/AttributePage.tsx index 6cc875c90..209397676 100644 --- a/src/attributes/components/AttributePage/AttributePage.tsx +++ b/src/attributes/components/AttributePage/AttributePage.tsx @@ -37,6 +37,7 @@ export interface AttributePageProps { } export interface AttributePageFormData { + availableInGrid: boolean; filterableInDashboard: boolean; inputType: AttributeInputTypeEnum; filterableInStorefront: boolean; @@ -64,6 +65,7 @@ const AttributePage: React.FC = ({ const initialForm: AttributePageFormData = attribute === null ? { + availableInGrid: true, filterableInDashboard: true, filterableInStorefront: true, inputType: AttributeInputTypeEnum.DROPDOWN, @@ -74,6 +76,7 @@ const AttributePage: React.FC = ({ visibleInStorefront: true } : { + availableInGrid: maybe(() => attribute.availableInGrid, true), filterableInDashboard: maybe( () => attribute.filterableInDashboard, true diff --git a/src/attributes/components/AttributeProperties/AttributeProperties.tsx b/src/attributes/components/AttributeProperties/AttributeProperties.tsx index 078d16882..e61df33be 100644 --- a/src/attributes/components/AttributeProperties/AttributeProperties.tsx +++ b/src/attributes/components/AttributeProperties/AttributeProperties.tsx @@ -105,6 +105,21 @@ const AttributeProperties: React.FC = ({ } onChange={onChange} /> + + + {i18n.t( + "If enable this attribute can be used as a column in product table." + )} + + } + onChange={onChange} + /> ); diff --git a/src/attributes/fixtures.ts b/src/attributes/fixtures.ts index b55cfa134..118cf9936 100644 --- a/src/attributes/fixtures.ts +++ b/src/attributes/fixtures.ts @@ -2,10 +2,12 @@ import { AttributeInputTypeEnum, AttributeValueType } from "@saleor/types/globalTypes"; +import { AttributeDetailsFragment } from "./types/AttributeDetailsFragment"; import { AttributeList_attributes_edges_node } from "./types/AttributeList"; -export const attribute = { +export const attribute: AttributeDetailsFragment = { __typename: "Attribute" as "Attribute", + availableInGrid: true, filterableInDashboard: false, filterableInStorefront: true, id: "UHJvZHVjdEF0dHJpYnV0ZTo5", @@ -20,7 +22,6 @@ export const attribute = { id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI0", name: "John Doe", slug: "john-doe", - sortOrder: 0, type: AttributeValueType.STRING, value: "" }, @@ -29,7 +30,6 @@ export const attribute = { id: "UHJvZHVjdEF0dHJpYnV0ZVZhbHVlOjI1", name: "Milionare Pirate", slug: "milionare-pirate", - sortOrder: 1, type: AttributeValueType.STRING, value: "" } diff --git a/src/attributes/queries.ts b/src/attributes/queries.ts index e18d7c8c0..5e38d6bec 100644 --- a/src/attributes/queries.ts +++ b/src/attributes/queries.ts @@ -22,6 +22,7 @@ export const attributeDetailsFragment = gql` ${attributeFragment} fragment AttributeDetailsFragment on Attribute { ...AttributeFragment + availableInGrid inputType storefrontSearchPosition valueRequired diff --git a/src/attributes/types/AttributeCreate.ts b/src/attributes/types/AttributeCreate.ts index 9d8eab0a0..9c88aceeb 100644 --- a/src/attributes/types/AttributeCreate.ts +++ b/src/attributes/types/AttributeCreate.ts @@ -31,6 +31,7 @@ export interface AttributeCreate_attributeCreate_attribute { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/attributes/types/AttributeDetails.ts b/src/attributes/types/AttributeDetails.ts index b1826d42e..bacb7d99f 100644 --- a/src/attributes/types/AttributeDetails.ts +++ b/src/attributes/types/AttributeDetails.ts @@ -25,6 +25,7 @@ export interface AttributeDetails_attribute { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/attributes/types/AttributeDetailsFragment.ts b/src/attributes/types/AttributeDetailsFragment.ts index f4c9375f2..1ff07f04e 100644 --- a/src/attributes/types/AttributeDetailsFragment.ts +++ b/src/attributes/types/AttributeDetailsFragment.ts @@ -25,6 +25,7 @@ export interface AttributeDetailsFragment { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/attributes/types/AttributeUpdate.ts b/src/attributes/types/AttributeUpdate.ts index 7ec2e5e7c..5939e98d0 100644 --- a/src/attributes/types/AttributeUpdate.ts +++ b/src/attributes/types/AttributeUpdate.ts @@ -31,6 +31,7 @@ export interface AttributeUpdate_attributeUpdate_attribute { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/attributes/types/AttributeValueCreate.ts b/src/attributes/types/AttributeValueCreate.ts index c5450d981..27eac390a 100644 --- a/src/attributes/types/AttributeValueCreate.ts +++ b/src/attributes/types/AttributeValueCreate.ts @@ -31,6 +31,7 @@ export interface AttributeValueCreate_attributeValueCreate_attribute { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/attributes/types/AttributeValueDelete.ts b/src/attributes/types/AttributeValueDelete.ts index 10c5924e0..9495f4fa7 100644 --- a/src/attributes/types/AttributeValueDelete.ts +++ b/src/attributes/types/AttributeValueDelete.ts @@ -31,6 +31,7 @@ export interface AttributeValueDelete_attributeValueDelete_attribute { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/attributes/types/AttributeValueUpdate.ts b/src/attributes/types/AttributeValueUpdate.ts index d1ccbee1f..ee2856eed 100644 --- a/src/attributes/types/AttributeValueUpdate.ts +++ b/src/attributes/types/AttributeValueUpdate.ts @@ -31,6 +31,7 @@ export interface AttributeValueUpdate_attributeValueUpdate_attribute { visibleInStorefront: boolean; filterableInDashboard: boolean; filterableInStorefront: boolean; + availableInGrid: boolean; inputType: AttributeInputTypeEnum | null; storefrontSearchPosition: number; valueRequired: boolean; diff --git a/src/types/globalTypes.ts b/src/types/globalTypes.ts index 9c48020e2..ee1d14bb7 100644 --- a/src/types/globalTypes.ts +++ b/src/types/globalTypes.ts @@ -161,6 +161,7 @@ export enum PermissionEnum { MANAGE_MENUS = "MANAGE_MENUS", MANAGE_ORDERS = "MANAGE_ORDERS", MANAGE_PAGES = "MANAGE_PAGES", + MANAGE_PLUGINS = "MANAGE_PLUGINS", MANAGE_PRODUCTS = "MANAGE_PRODUCTS", MANAGE_SETTINGS = "MANAGE_SETTINGS", MANAGE_SHIPPING = "MANAGE_SHIPPING",