[SALEOR-3090] Boolean attribute (#1157)

This commit is contained in:
Piotr Grundas 2021-06-20 01:13:16 +02:00 committed by GitHub
parent a114a39f45
commit a0dce99b5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 971 additions and 271 deletions

View file

@ -167,6 +167,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Update product stock management to newest design - #515 by @dominik-zeglen - Update product stock management to newest design - #515 by @dominik-zeglen
- Handle untracked products - #523 by @dominik-zeglen - Handle untracked products - #523 by @dominik-zeglen
- Display correct error if there were no graphql errors - #525 by @dominik-zeglen - Display correct error if there were no graphql errors - #525 by @dominik-zeglen
- Add boolean attributes - #1157 by @piotrgrundas
## 2.0.0 ## 2.0.0

View file

@ -953,6 +953,10 @@
"context": "attribute slug input field helper text", "context": "attribute slug input field helper text",
"string": "This is used internally. Make sure you dont use spaces" "string": "This is used internally. Make sure you dont use spaces"
}, },
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_boolean": {
"context": "boolean attribute type",
"string": "Boolean"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_distance": { "src_dot_attributes_dot_components_dot_AttributeDetails_dot_distance": {
"context": "distance units type", "context": "distance units type",
"string": "Distance" "string": "Distance"

View file

@ -519,6 +519,7 @@ input AttributeInput {
slug: String! slug: String!
values: [String] values: [String]
valuesRange: IntRangeInput valuesRange: IntRangeInput
boolean: Boolean
} }
enum AttributeInputTypeEnum { enum AttributeInputTypeEnum {
@ -528,6 +529,7 @@ enum AttributeInputTypeEnum {
REFERENCE REFERENCE
NUMERIC NUMERIC
RICH_TEXT RICH_TEXT
BOOLEAN
} }
type AttributeReorderValues { type AttributeReorderValues {
@ -608,6 +610,7 @@ type AttributeValue implements Node {
reference: ID reference: ID
file: File file: File
richText: JSONString richText: JSONString
boolean: Boolean
} }
type AttributeValueBulkDelete { type AttributeValueBulkDelete {
@ -658,6 +661,7 @@ input AttributeValueInput {
contentType: String contentType: String
references: [ID!] references: [ID!]
richText: JSONString richText: JSONString
boolean: Boolean
} }
type AttributeValueTranslatableContent implements Node { type AttributeValueTranslatableContent implements Node {

View file

@ -96,6 +96,10 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = props => {
{ {
label: intl.formatMessage(inputTypeMessages.numeric), label: intl.formatMessage(inputTypeMessages.numeric),
value: AttributeInputTypeEnum.NUMERIC value: AttributeInputTypeEnum.NUMERIC
},
{
label: intl.formatMessage(inputTypeMessages.boolean),
value: AttributeInputTypeEnum.BOOLEAN
} }
]; ];
const entityTypeChoices = [ const entityTypeChoices = [

View file

@ -69,6 +69,10 @@ export const inputTypeMessages = defineMessages({
numeric: { numeric: {
defaultMessage: "Numeric", defaultMessage: "Numeric",
description: "numeric attribute type" description: "numeric attribute type"
},
boolean: {
defaultMessage: "Boolean",
description: "boolean attribute type"
} }
}); });

View file

@ -1,5 +1,5 @@
import { Card, CardContent, TextField, Typography } from "@material-ui/core"; import { Card, CardContent, TextField, Typography } from "@material-ui/core";
import { ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES } from "@saleor/attributes/utils/data"; import { ATTRIBUTE_TYPES_WITH_CONFIGURABLE_FACED_NAVIGATION } from "@saleor/attributes/utils/data";
import CardSpacer from "@saleor/components/CardSpacer"; import CardSpacer from "@saleor/components/CardSpacer";
import CardTitle from "@saleor/components/CardTitle"; import CardTitle from "@saleor/components/CardTitle";
import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
@ -78,13 +78,14 @@ const AttributeProperties: React.FC<AttributePropertiesProps> = ({
const formErrors = getFormErrors(["storefrontSearchPosition"], errors); const formErrors = getFormErrors(["storefrontSearchPosition"], errors);
const dashboardProperties = ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES.includes( const dashboardProperties = ATTRIBUTE_TYPES_WITH_CONFIGURABLE_FACED_NAVIGATION.includes(
data.inputType data.inputType
); );
const storefrontFacetedNavigationProperties = const storefrontFacetedNavigationProperties =
ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES.includes(data.inputType) && ATTRIBUTE_TYPES_WITH_CONFIGURABLE_FACED_NAVIGATION.includes(
data.type === AttributeTypeEnum.PRODUCT_TYPE; data.inputType
) && data.type === AttributeTypeEnum.PRODUCT_TYPE;
return ( return (
<Card> <Card>

View file

@ -49,7 +49,8 @@ export const attribute: AttributeDetails_attribute = {
name: "John Doe", name: "John Doe",
reference: null, reference: null,
slug: "john-doe", slug: "john-doe",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -62,7 +63,8 @@ export const attribute: AttributeDetails_attribute = {
name: "Milionare Pirate", name: "Milionare Pirate",
reference: null, reference: null,
slug: "milionare-pirate", slug: "milionare-pirate",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -81,6 +83,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Author", name: "Author",
slug: "author", slug: "author",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -104,7 +107,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "john-doe", slug: "john-doe",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -119,7 +123,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "milionare-pirate", slug: "milionare-pirate",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -136,6 +141,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Box Size", name: "Box Size",
slug: "box-size", slug: "box-size",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -159,7 +165,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "100g", slug: "100g",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -174,7 +181,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "250g", slug: "250g",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -189,7 +197,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "500g", slug: "500g",
sortOrder: 2, sortOrder: 2,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -204,7 +213,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "1kg", slug: "1kg",
sortOrder: 3, sortOrder: 3,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -221,6 +231,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Brand", name: "Brand",
slug: "brand", slug: "brand",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -244,7 +255,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "saleor", slug: "saleor",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -261,6 +273,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Candy Box Size", name: "Candy Box Size",
slug: "candy-box-size", slug: "candy-box-size",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -284,7 +297,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "100g", slug: "100g",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -299,7 +313,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "250g", slug: "250g",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -314,7 +329,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "500g", slug: "500g",
sortOrder: 2, sortOrder: 2,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -331,6 +347,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Coffee Genre", name: "Coffee Genre",
slug: "coffee-genre", slug: "coffee-genre",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -354,7 +371,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "arabica", slug: "arabica",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -369,7 +387,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "robusta", slug: "robusta",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -386,6 +405,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Collar", name: "Collar",
slug: "collar", slug: "collar",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -409,7 +429,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "round", slug: "round",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -424,7 +445,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "v-neck", slug: "v-neck",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -439,7 +461,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "polo", slug: "polo",
sortOrder: 2, sortOrder: 2,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -456,6 +479,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Color", name: "Color",
slug: "color", slug: "color",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -479,7 +503,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "blue", slug: "blue",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -494,7 +519,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "white", slug: "white",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -511,6 +537,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Cover", name: "Cover",
slug: "cover", slug: "cover",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -534,7 +561,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "soft", slug: "soft",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -549,7 +577,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "hard", slug: "hard",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -564,7 +593,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "middle-soft", slug: "middle-soft",
sortOrder: 2, sortOrder: 2,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -579,7 +609,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "middle-hard", slug: "middle-hard",
sortOrder: 3, sortOrder: 3,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -594,7 +625,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "middle", slug: "middle",
sortOrder: 4, sortOrder: 4,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -609,7 +641,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "very-hard", slug: "very-hard",
sortOrder: 5, sortOrder: 5,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -626,6 +659,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Flavor", name: "Flavor",
slug: "flavor", slug: "flavor",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -649,7 +683,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "sour", slug: "sour",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -664,7 +699,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "sweet", slug: "sweet",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -681,6 +717,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Language", name: "Language",
slug: "language", slug: "language",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -704,7 +741,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "english", slug: "english",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -719,7 +757,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "pirate", slug: "pirate",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -736,6 +775,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
name: "Publisher", name: "Publisher",
slug: "publisher", slug: "publisher",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null, unit: null,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
@ -759,7 +799,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "mirumee-press", slug: "mirumee-press",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -774,7 +815,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "saleor-publishing", slug: "saleor-publishing",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -792,6 +834,7 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "size", slug: "size",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
unit: null, unit: null,
inputType: AttributeInputTypeEnum.DROPDOWN,
choices: { choices: {
__typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection", __typename: "AttributeValueCountableConnection" as "AttributeValueCountableConnection",
pageInfo: { pageInfo: {
@ -814,7 +857,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "xs", slug: "xs",
sortOrder: 0, sortOrder: 0,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -829,7 +873,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "s", slug: "s",
sortOrder: 1, sortOrder: 1,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -844,7 +889,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "m", slug: "m",
sortOrder: 2, sortOrder: 2,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -859,7 +905,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "l", slug: "l",
sortOrder: 3, sortOrder: 3,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -874,7 +921,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "xl", slug: "xl",
sortOrder: 4, sortOrder: 4,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -889,7 +937,8 @@ export const attributes: Array<AttributeList_attributes_edges_node &
slug: "xxl", slug: "xxl",
sortOrder: 5, sortOrder: 5,
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]

View file

@ -43,6 +43,7 @@ export interface AttributeDetails_attribute_choices_edges_node {
file: AttributeDetails_attribute_choices_edges_node_file | null; file: AttributeDetails_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface AttributeDetails_attribute_choices_edges { export interface AttributeDetails_attribute_choices_edges {
@ -67,10 +68,10 @@ export interface AttributeDetails_attribute {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
metadata: (AttributeDetails_attribute_metadata | null)[]; metadata: (AttributeDetails_attribute_metadata | null)[];
privateMetadata: (AttributeDetails_attribute_privateMetadata | null)[]; privateMetadata: (AttributeDetails_attribute_privateMetadata | null)[];
availableInGrid: boolean; availableInGrid: boolean;
inputType: AttributeInputTypeEnum | null;
entityType: AttributeEntityTypeEnum | null; entityType: AttributeEntityTypeEnum | null;
storefrontSearchPosition: number; storefrontSearchPosition: number;
valueRequired: boolean; valueRequired: boolean;

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeFilterInput, AttributeSortingInput, AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { AttributeFilterInput, AttributeSortingInput, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL query operation: AttributeList // GraphQL query operation: AttributeList
@ -19,6 +19,7 @@ export interface AttributeList_attributes_edges_node {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface AttributeList_attributes_edges { export interface AttributeList_attributes_edges {

View file

@ -31,10 +31,10 @@ export interface AttributeUpdate_attributeUpdate_attribute {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
metadata: (AttributeUpdate_attributeUpdate_attribute_metadata | null)[]; metadata: (AttributeUpdate_attributeUpdate_attribute_metadata | null)[];
privateMetadata: (AttributeUpdate_attributeUpdate_attribute_privateMetadata | null)[]; privateMetadata: (AttributeUpdate_attributeUpdate_attribute_privateMetadata | null)[];
availableInGrid: boolean; availableInGrid: boolean;
inputType: AttributeInputTypeEnum | null;
entityType: AttributeEntityTypeEnum | null; entityType: AttributeEntityTypeEnum | null;
storefrontSearchPosition: number; storefrontSearchPosition: number;
valueRequired: boolean; valueRequired: boolean;

View file

@ -31,6 +31,7 @@ export interface AttributeValueCreate_attributeValueCreate_attribute_choices_edg
file: AttributeValueCreate_attributeValueCreate_attribute_choices_edges_node_file | null; file: AttributeValueCreate_attributeValueCreate_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface AttributeValueCreate_attributeValueCreate_attribute_choices_edges { export interface AttributeValueCreate_attributeValueCreate_attribute_choices_edges {

View file

@ -31,6 +31,7 @@ export interface AttributeValueDelete_attributeValueDelete_attribute_choices_edg
file: AttributeValueDelete_attributeValueDelete_attribute_choices_edges_node_file | null; file: AttributeValueDelete_attributeValueDelete_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface AttributeValueDelete_attributeValueDelete_attribute_choices_edges { export interface AttributeValueDelete_attributeValueDelete_attribute_choices_edges {

View file

@ -31,6 +31,7 @@ export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_edg
file: AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges_node_file | null; file: AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges { export interface AttributeValueUpdate_attributeValueUpdate_attribute_choices_edges {

View file

@ -28,6 +28,12 @@ export const ATTRIBUTE_TYPES_WITH_DEDICATED_VALUES = [
AttributeInputTypeEnum.MULTISELECT AttributeInputTypeEnum.MULTISELECT
]; ];
export const ATTRIBUTE_TYPES_WITH_CONFIGURABLE_FACED_NAVIGATION = [
AttributeInputTypeEnum.DROPDOWN,
AttributeInputTypeEnum.MULTISELECT,
AttributeInputTypeEnum.BOOLEAN
];
export interface AttributeReference { export interface AttributeReference {
label: string; label: string;
value: string; value: string;
@ -87,6 +93,9 @@ export function getSelectedAttributeValues(
case AttributeInputTypeEnum.NUMERIC: case AttributeInputTypeEnum.NUMERIC:
return [attribute.values[0]?.name]; return [attribute.values[0]?.name];
case AttributeInputTypeEnum.BOOLEAN:
return [attribute.values[0]?.boolean ?? "false"];
default: default:
return attribute.values.map(value => value.slug); return attribute.values.map(value => value.slug);
} }

View file

@ -16,7 +16,8 @@ const attributes: FormsetData<AttributeInputData, string[]> = [
name: "Attribute 1 Value 1", name: "Attribute 1 Value 1",
reference: null, reference: null,
slug: "attr-1-v-1", slug: "attr-1-v-1",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -36,7 +37,8 @@ const attributes: FormsetData<AttributeInputData, string[]> = [
name: "Attribute 2 Value 1", name: "Attribute 2 Value 1",
reference: null, reference: null,
slug: "attr-2-v-1", slug: "attr-2-v-1",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -45,7 +47,8 @@ const attributes: FormsetData<AttributeInputData, string[]> = [
name: "Attribute 2 Value 2", name: "Attribute 2 Value 2",
reference: null, reference: null,
slug: "attr-2-v-2", slug: "attr-2-v-2",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -54,7 +57,8 @@ const attributes: FormsetData<AttributeInputData, string[]> = [
name: "Attribute 2 Value 3", name: "Attribute 2 Value 3",
reference: null, reference: null,
slug: "attr-2-v-3", slug: "attr-2-v-3",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -78,7 +82,8 @@ const attributes: FormsetData<AttributeInputData, string[]> = [
name: "File First Value", name: "File First Value",
reference: null, reference: null,
slug: "file-first-value", slug: "file-first-value",
richText: null richText: null,
boolean: null
} }
] ]
}, },

View file

@ -177,44 +177,75 @@ interface AttributesArgs {
updatedFileAttributes: AttributeValueInput[]; updatedFileAttributes: AttributeValueInput[];
} }
function getFileInput(
attribute: AttributeInput,
updatedFileAttributes: AttributeValueInput[]
) {
const updatedFileAttribute = updatedFileAttributes.find(
attributeWithNewFile => attribute.id === attributeWithNewFile.id
);
if (updatedFileAttribute) {
return {
file: updatedFileAttribute.file,
id: updatedFileAttribute.id
};
}
return {
file: updatedFileAttribute.file,
id: updatedFileAttribute.id
};
}
function getReferenceInput(attribute: AttributeInput) {
return {
id: attribute.id,
references: attribute.value
};
}
function getRichTextInput(attribute: AttributeInput) {
return {
id: attribute.id,
richText: attribute.value[0]
};
}
function getBooleanInput(attribute: AttributeInput) {
return {
id: attribute.id,
boolean: JSON.parse(attribute.value[0] ?? "false")
};
}
function getDefaultInput(attribute: AttributeInput) {
return {
id: attribute.id,
values: attribute.value[0] === "" ? [] : attribute.value
};
}
export const prepareAttributesInput = ({ export const prepareAttributesInput = ({
attributes, attributes,
updatedFileAttributes updatedFileAttributes
}: AttributesArgs): AttributeValueInput[] => }: AttributesArgs): AttributeValueInput[] =>
attributes.map(attribute => { attributes.map(attribute => {
if (attribute.data.inputType === AttributeInputTypeEnum.FILE) { switch (attribute.data.inputType) {
const updatedFileAttribute = updatedFileAttributes.find( case AttributeInputTypeEnum.FILE:
attributeWithNewFile => attribute.id === attributeWithNewFile.id return getFileInput(attribute, updatedFileAttributes);
);
if (updatedFileAttribute) { case AttributeInputTypeEnum.REFERENCE:
return { return getReferenceInput(attribute);
file: updatedFileAttribute.file,
id: updatedFileAttribute.id case AttributeInputTypeEnum.RICH_TEXT:
}; return getRichTextInput(attribute);
}
return { case AttributeInputTypeEnum.BOOLEAN:
file: return getBooleanInput(attribute);
attribute.data.selectedValues &&
attribute.data.selectedValues[0]?.file?.url, default:
id: attribute.id return getDefaultInput(attribute);
};
} }
if (attribute.data.inputType === AttributeInputTypeEnum.REFERENCE) {
return {
id: attribute.id,
references: attribute.value
};
}
if (attribute.data.inputType === AttributeInputTypeEnum.RICH_TEXT) {
return {
id: attribute.id,
richText: attribute.value[0]
};
}
return {
id: attribute.id,
values: attribute.value[0] === "" ? [] : attribute.value
};
}); });
export const handleUploadMultipleFiles = async ( export const handleUploadMultipleFiles = async (

View file

@ -206,6 +206,7 @@ const AttributeDetails: React.FC<AttributeDetailsProps> = ({ params }) => {
sortOrder: valueIndex, sortOrder: valueIndex,
value: null, value: null,
richText: null, richText: null,
boolean: null,
...value ...value
} }
})) }))

View file

@ -14,6 +14,7 @@ import {
getSingleChoices, getSingleChoices,
getSingleDisplayValue getSingleDisplayValue
} from "@saleor/components/Attributes/utils"; } from "@saleor/components/Attributes/utils";
import Checkbox from "@saleor/components/Checkbox";
import FileUploadField from "@saleor/components/FileUploadField"; import FileUploadField from "@saleor/components/FileUploadField";
import MultiAutocompleteSelectField from "@saleor/components/MultiAutocompleteSelectField"; import MultiAutocompleteSelectField from "@saleor/components/MultiAutocompleteSelectField";
import RichTextEditor from "@saleor/components/RichTextEditor"; import RichTextEditor from "@saleor/components/RichTextEditor";
@ -43,6 +44,10 @@ const useStyles = makeStyles(
() => ({ () => ({
fileField: { fileField: {
float: "right" float: "right"
},
pullRight: {
display: "flex",
justifyContent: "flex-end"
} }
}), }),
{ name: "AttributeRow" } { name: "AttributeRow" }
@ -193,6 +198,24 @@ const AttributeRow: React.FC<AttributeRowProps> = ({
/> />
</BasicAttributeRow> </BasicAttributeRow>
); );
case AttributeInputTypeEnum.BOOLEAN:
return (
<BasicAttributeRow label={attribute.label}>
<div className={classes.pullRight}>
<Checkbox
disabled={disabled}
name={`attribute:${attribute.label}`}
onChange={event =>
onChange(attribute.id, JSON.stringify(event.target.checked))
}
checked={JSON.parse(attribute.value[0] ?? "false")}
className={classes.pullRight}
helperText={getErrorMessage(error, intl)}
error={!!error}
/>
</div>
</BasicAttributeRow>
);
default: default:
return ( return (
<BasicAttributeRow label={attribute.label}> <BasicAttributeRow label={attribute.label}>

View file

@ -9,7 +9,8 @@ const useStyles = makeStyles(
"&:last-of-type": { "&:last-of-type": {
paddingBottom: 0 paddingBottom: 0
}, },
padding: theme.spacing(2, 0) padding: theme.spacing(2, 0),
wordBreak: "break-word"
}, },
attributeSectionLabel: { attributeSectionLabel: {
alignItems: "center", alignItems: "center",

View file

@ -1,6 +1,7 @@
import { import {
AttributeEntityTypeEnum, AttributeEntityTypeEnum,
AttributeInputTypeEnum AttributeInputTypeEnum,
MeasurementUnitsEnum
} from "@saleor/types/globalTypes"; } from "@saleor/types/globalTypes";
import { AttributeInput } from "./Attributes"; import { AttributeInput } from "./Attributes";
@ -17,7 +18,8 @@ const DROPDOWN_ATTRIBUTE: AttributeInput = {
name: "Dropdown First Value", name: "Dropdown First Value",
reference: null, reference: null,
slug: "dropdown-first-value", slug: "dropdown-first-value",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -26,7 +28,8 @@ const DROPDOWN_ATTRIBUTE: AttributeInput = {
name: "Dropdown Second Value", name: "Dropdown Second Value",
reference: null, reference: null,
slug: "dropdown-second-value", slug: "dropdown-second-value",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -47,7 +50,8 @@ const MULTISELECT_ATTRIBUTE: AttributeInput = {
name: "Multiselect First Value", name: "Multiselect First Value",
reference: null, reference: null,
slug: "multiselect-first-value", slug: "multiselect-first-value",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -56,7 +60,8 @@ const MULTISELECT_ATTRIBUTE: AttributeInput = {
name: "Multiselect Second Value", name: "Multiselect Second Value",
reference: null, reference: null,
slug: "multiselect-second-value", slug: "multiselect-second-value",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -65,7 +70,8 @@ const MULTISELECT_ATTRIBUTE: AttributeInput = {
name: "Multiselect Third Value", name: "Multiselect Third Value",
reference: null, reference: null,
slug: "multiselect-third-value", slug: "multiselect-third-value",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -90,7 +96,8 @@ const FILE_ATTRIBUTE: AttributeInput = {
name: "File First Value", name: "File First Value",
reference: null, reference: null,
slug: "file-first-value", slug: "file-first-value",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -126,7 +133,8 @@ const REFERENCE_ATTRIBUTE: AttributeInput = {
name: "References First Value", name: "References First Value",
reference: null, reference: null,
slug: "references-first-value", slug: "references-first-value",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -135,7 +143,8 @@ const REFERENCE_ATTRIBUTE: AttributeInput = {
name: "References Second Value", name: "References Second Value",
reference: null, reference: null,
slug: "references-second-value", slug: "references-second-value",
richText: null richText: null,
boolean: null
}, },
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
@ -144,7 +153,8 @@ const REFERENCE_ATTRIBUTE: AttributeInput = {
name: "References Third Value", name: "References Third Value",
reference: null, reference: null,
slug: "references-third-value", slug: "references-third-value",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -169,24 +179,11 @@ const RICH_TEXT_ATTRIBUTE: AttributeInput = {
time: 1617788754145, time: 1617788754145,
blocks: [{ data: { text: "Some cool text" }, type: "paragraph" }], blocks: [{ data: { text: "Some cool text" }, type: "paragraph" }],
version: "2.19.3" version: "2.19.3"
}) }),
boolean: null
} }
], ],
selectedValues: [ selectedValues: []
{
__typename: "AttributeValue",
file: null,
id: "asdfafd",
name: "Some cool text",
reference: null,
slug: "text",
richText: JSON.stringify({
time: 1617788754145,
blocks: [{ data: { text: "Some cool text" }, type: "paragraph" }],
version: "2.19.3"
})
}
]
}, },
id: "asdfafd", id: "asdfafd",
label: "Text Attribute", label: "Text Attribute",
@ -197,14 +194,16 @@ const NUMERIC_ATTRIBUTE: AttributeInput = {
data: { data: {
inputType: AttributeInputTypeEnum.NUMERIC, inputType: AttributeInputTypeEnum.NUMERIC,
isRequired: true, isRequired: true,
unit: MeasurementUnitsEnum.CM,
values: [ values: [
{ {
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
id: "QXR0cmlidXRlVmFsdWU6MTAx", id: "QXR0cmlidXRlVmFsdWU6MTAx",
name: "12cm", name: "12",
reference: null, reference: null,
richText: null, richText: null,
boolean: null,
slug: "319_35" slug: "319_35"
} }
] ]
@ -214,13 +213,36 @@ const NUMERIC_ATTRIBUTE: AttributeInput = {
value: [] value: []
}; };
const BOOLEAN_ATTRIBUTE: AttributeInput = {
data: {
inputType: AttributeInputTypeEnum.BOOLEAN,
isRequired: true,
values: [
{
__typename: "AttributeValue",
file: null,
id: "asdfasdfasdfasdf",
name: "Boolean Attribute: Yes",
reference: null,
richText: null,
boolean: true,
slug: "319_True"
}
]
},
id: "QXR0cmlidXRlOjMasdfasdf1",
label: "Boolean Attribute",
value: []
};
export const ATTRIBUTES: AttributeInput[] = [ export const ATTRIBUTES: AttributeInput[] = [
DROPDOWN_ATTRIBUTE, DROPDOWN_ATTRIBUTE,
MULTISELECT_ATTRIBUTE, MULTISELECT_ATTRIBUTE,
FILE_ATTRIBUTE, FILE_ATTRIBUTE,
REFERENCE_ATTRIBUTE, REFERENCE_ATTRIBUTE,
RICH_TEXT_ATTRIBUTE, RICH_TEXT_ATTRIBUTE,
NUMERIC_ATTRIBUTE NUMERIC_ATTRIBUTE,
BOOLEAN_ATTRIBUTE
]; ];
export const ATTRIBUTES_SELECTED: AttributeInput[] = [ export const ATTRIBUTES_SELECTED: AttributeInput[] = [
@ -249,10 +271,18 @@ export const ATTRIBUTES_SELECTED: AttributeInput[] = [
}, },
{ {
...RICH_TEXT_ATTRIBUTE, ...RICH_TEXT_ATTRIBUTE,
value: [RICH_TEXT_ATTRIBUTE.data.values[0].richText] data: {
...RICH_TEXT_ATTRIBUTE.data,
selectedValues: [RICH_TEXT_ATTRIBUTE.data.values[0]]
},
value: []
}, },
{ {
...NUMERIC_ATTRIBUTE, ...NUMERIC_ATTRIBUTE,
value: [NUMERIC_ATTRIBUTE.data.values[0].name] value: [NUMERIC_ATTRIBUTE.data.values[0].name]
},
{
...BOOLEAN_ATTRIBUTE,
value: [JSON.stringify(BOOLEAN_ATTRIBUTE.data.values[0].boolean)]
} }
]; ];

View file

@ -1,24 +1,46 @@
import { Checkbox as MuiCheckbox } from "@material-ui/core"; import MuiCheckbox, {
import { CheckboxProps as MuiCheckboxProps } from "@material-ui/core/Checkbox"; CheckboxProps as MuiCheckboxProps
} from "@material-ui/core/Checkbox";
import FormHelperText from "@material-ui/core/FormHelperText";
import { makeStyles } from "@saleor/theme";
import React from "react"; import React from "react";
const useStyles = makeStyles(
theme => ({
error: {
color: theme.palette.error.main
}
}),
{ name: "Checkbox" }
);
export type CheckboxProps = Omit< export type CheckboxProps = Omit<
MuiCheckboxProps, MuiCheckboxProps,
"checkedIcon" | "color" | "icon" | "indeterminateIcon" | "classes" | "onClick" "checkedIcon" | "color" | "icon" | "indeterminateIcon" | "classes" | "onClick"
> & { > & {
disableClickPropagation?: boolean; disableClickPropagation?: boolean;
helperText?: string;
error?: boolean;
}; };
const Checkbox: React.FC<CheckboxProps> = props => { const Checkbox: React.FC<CheckboxProps> = ({ helperText, error, ...props }) => {
const { disableClickPropagation, ...rest } = props; const { disableClickPropagation, ...rest } = props;
const classes = useStyles();
return ( return (
<MuiCheckbox <>
{...rest} <MuiCheckbox
onClick={ {...rest}
disableClickPropagation ? event => event.stopPropagation() : undefined onClick={
} disableClickPropagation ? event => event.stopPropagation() : undefined
/> }
/>
{helperText && (
<FormHelperText classes={{ root: error && classes.error }}>
{helperText}
</FormHelperText>
)}
</>
); );
}; };
Checkbox.displayName = "Checkbox"; Checkbox.displayName = "Checkbox";

View file

@ -42,8 +42,10 @@ const RichTextEditor: React.FC<RichTextEditorProps> = ({
holder: editorContainer.current, holder: editorContainer.current,
logLevel: "ERROR" as LogLevels, logLevel: "ERROR" as LogLevels,
onChange: async api => { onChange: async api => {
const savedData = await api.saver.save(); if (!api.readOnly) {
onChange(savedData); const savedData = await api.saver.save();
onChange(savedData);
}
}, },
onReady: () => { onReady: () => {
// FIXME: This throws an error and is not working // FIXME: This throws an error and is not working

View file

@ -15,6 +15,7 @@ export const attributeValueFragment = gql`
} }
reference reference
richText richText
boolean
} }
`; `;
@ -28,6 +29,7 @@ export const attributeFragment = gql`
filterableInDashboard filterableInDashboard
filterableInStorefront filterableInStorefront
unit unit
inputType
} }
`; `;

View file

@ -31,10 +31,10 @@ export interface AttributeDetailsFragment {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
metadata: (AttributeDetailsFragment_metadata | null)[]; metadata: (AttributeDetailsFragment_metadata | null)[];
privateMetadata: (AttributeDetailsFragment_privateMetadata | null)[]; privateMetadata: (AttributeDetailsFragment_privateMetadata | null)[];
availableInGrid: boolean; availableInGrid: boolean;
inputType: AttributeInputTypeEnum | null;
entityType: AttributeEntityTypeEnum | null; entityType: AttributeEntityTypeEnum | null;
storefrontSearchPosition: number; storefrontSearchPosition: number;
valueRequired: boolean; valueRequired: boolean;

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL fragment: AttributeFragment // GraphQL fragment: AttributeFragment
@ -19,4 +19,5 @@ export interface AttributeFragment {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }

View file

@ -21,4 +21,5 @@ export interface AttributeValueFragment {
file: AttributeValueFragment_file | null; file: AttributeValueFragment_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }

View file

@ -29,6 +29,7 @@ export interface AttributeValueListFragment_edges_node {
file: AttributeValueListFragment_edges_node_file | null; file: AttributeValueListFragment_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface AttributeValueListFragment_edges { export interface AttributeValueListFragment_edges {

View file

@ -31,6 +31,7 @@ export interface PageAttributesFragment_attributes_attribute_choices_edges_node
file: PageAttributesFragment_attributes_attribute_choices_edges_node_file | null; file: PageAttributesFragment_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageAttributesFragment_attributes_attribute_choices_edges { export interface PageAttributesFragment_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface PageAttributesFragment_attributes_values {
file: PageAttributesFragment_attributes_values_file | null; file: PageAttributesFragment_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageAttributesFragment_attributes { export interface PageAttributesFragment_attributes {
@ -101,6 +103,7 @@ export interface PageAttributesFragment_pageType_attributes_choices_edges_node {
file: PageAttributesFragment_pageType_attributes_choices_edges_node_file | null; file: PageAttributesFragment_pageType_attributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageAttributesFragment_pageType_attributes_choices_edges { export interface PageAttributesFragment_pageType_attributes_choices_edges {

View file

@ -31,6 +31,7 @@ export interface PageDetailsFragment_attributes_attribute_choices_edges_node {
file: PageDetailsFragment_attributes_attribute_choices_edges_node_file | null; file: PageDetailsFragment_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageDetailsFragment_attributes_attribute_choices_edges { export interface PageDetailsFragment_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface PageDetailsFragment_attributes_values {
file: PageDetailsFragment_attributes_values_file | null; file: PageDetailsFragment_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageDetailsFragment_attributes { export interface PageDetailsFragment_attributes {
@ -101,6 +103,7 @@ export interface PageDetailsFragment_pageType_attributes_choices_edges_node {
file: PageDetailsFragment_pageType_attributes_choices_edges_node_file | null; file: PageDetailsFragment_pageType_attributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageDetailsFragment_pageType_attributes_choices_edges { export interface PageDetailsFragment_pageType_attributes_choices_edges {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL fragment: PageTypeDetailsFragment // GraphQL fragment: PageTypeDetailsFragment
@ -31,6 +31,7 @@ export interface PageTypeDetailsFragment_attributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface PageTypeDetailsFragment { export interface PageTypeDetailsFragment {

View file

@ -31,6 +31,7 @@ export interface Product_attributes_attribute_choices_edges_node {
file: Product_attributes_attribute_choices_edges_node_file | null; file: Product_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface Product_attributes_attribute_choices_edges { export interface Product_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface Product_attributes_values {
file: Product_attributes_values_file | null; file: Product_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface Product_attributes { export interface Product_attributes {
@ -101,6 +103,7 @@ export interface Product_productType_variantAttributes_choices_edges_node {
file: Product_productType_variantAttributes_choices_edges_node_file | null; file: Product_productType_variantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface Product_productType_variantAttributes_choices_edges { export interface Product_productType_variantAttributes_choices_edges {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL fragment: ProductTypeDetailsFragment // GraphQL fragment: ProductTypeDetailsFragment
@ -37,6 +37,7 @@ export interface ProductTypeDetailsFragment_productAttributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeDetailsFragment_variantAttributes { export interface ProductTypeDetailsFragment_variantAttributes {
@ -49,6 +50,7 @@ export interface ProductTypeDetailsFragment_variantAttributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeDetailsFragment_weight { export interface ProductTypeDetailsFragment_weight {

View file

@ -43,6 +43,7 @@ export interface ProductVariant_selectionAttributes_attribute_choices_edges_node
file: ProductVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: ProductVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariant_selectionAttributes_attribute_choices_edges { export interface ProductVariant_selectionAttributes_attribute_choices_edges {
@ -83,6 +84,7 @@ export interface ProductVariant_selectionAttributes_values {
file: ProductVariant_selectionAttributes_values_file | null; file: ProductVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariant_selectionAttributes { export interface ProductVariant_selectionAttributes {
@ -113,6 +115,7 @@ export interface ProductVariant_nonSelectionAttributes_attribute_choices_edges_n
file: ProductVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: ProductVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariant_nonSelectionAttributes_attribute_choices_edges { export interface ProductVariant_nonSelectionAttributes_attribute_choices_edges {
@ -153,6 +156,7 @@ export interface ProductVariant_nonSelectionAttributes_values {
file: ProductVariant_nonSelectionAttributes_values_file | null; file: ProductVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariant_nonSelectionAttributes { export interface ProductVariant_nonSelectionAttributes {

View file

@ -31,6 +31,7 @@ export interface ProductVariantAttributesFragment_attributes_attribute_choices_e
file: ProductVariantAttributesFragment_attributes_attribute_choices_edges_node_file | null; file: ProductVariantAttributesFragment_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantAttributesFragment_attributes_attribute_choices_edges { export interface ProductVariantAttributesFragment_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface ProductVariantAttributesFragment_attributes_values {
file: ProductVariantAttributesFragment_attributes_values_file | null; file: ProductVariantAttributesFragment_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantAttributesFragment_attributes { export interface ProductVariantAttributesFragment_attributes {
@ -101,6 +103,7 @@ export interface ProductVariantAttributesFragment_productType_variantAttributes_
file: ProductVariantAttributesFragment_productType_variantAttributes_choices_edges_node_file | null; file: ProductVariantAttributesFragment_productType_variantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantAttributesFragment_productType_variantAttributes_choices_edges { export interface ProductVariantAttributesFragment_productType_variantAttributes_choices_edges {

View file

@ -31,6 +31,7 @@ export interface SelectedVariantAttributeFragment_attribute_choices_edges_node {
file: SelectedVariantAttributeFragment_attribute_choices_edges_node_file | null; file: SelectedVariantAttributeFragment_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SelectedVariantAttributeFragment_attribute_choices_edges { export interface SelectedVariantAttributeFragment_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface SelectedVariantAttributeFragment_values {
file: SelectedVariantAttributeFragment_values_file | null; file: SelectedVariantAttributeFragment_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SelectedVariantAttributeFragment { export interface SelectedVariantAttributeFragment {

View file

@ -31,6 +31,7 @@ export interface VariantAttributeFragment_choices_edges_node {
file: VariantAttributeFragment_choices_edges_node_file | null; file: VariantAttributeFragment_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantAttributeFragment_choices_edges { export interface VariantAttributeFragment_choices_edges {

View file

@ -16,8 +16,8 @@ const ChevronDown: React.FC = () => {
<path <path
d="M1 1L5 5L9 1" d="M1 1L5 5L9 1"
stroke={isDark ? "#FAFAFA" : "#28234A"} stroke={isDark ? "#FAFAFA" : "#28234A"}
stroke-opacity="0.4" strokeOpacity="0.4"
stroke-width="2" strokeWidth="2"
/> />
</svg> </svg>
); );

View file

@ -1,5 +1,8 @@
/* eslint-disable sort-keys */ /* eslint-disable sort-keys */
import { AttributeTypeEnum } from "@saleor/types/globalTypes"; import {
AttributeInputTypeEnum,
AttributeTypeEnum
} from "@saleor/types/globalTypes";
import { PageTypeDetails_pageType } from "./types/PageTypeDetails"; import { PageTypeDetails_pageType } from "./types/PageTypeDetails";
import { PageTypeList_pageTypes_edges_node } from "./types/PageTypeList"; import { PageTypeList_pageTypes_edges_node } from "./types/PageTypeList";
@ -47,6 +50,7 @@ export const pageType: PageTypeDetails_pageType = {
filterableInDashboard: true, filterableInDashboard: true,
filterableInStorefront: true, filterableInStorefront: true,
type: AttributeTypeEnum.PAGE_TYPE, type: AttributeTypeEnum.PAGE_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null unit: null
}, },
{ {
@ -58,6 +62,7 @@ export const pageType: PageTypeDetails_pageType = {
filterableInDashboard: true, filterableInDashboard: true,
filterableInStorefront: true, filterableInStorefront: true,
type: AttributeTypeEnum.PAGE_TYPE, type: AttributeTypeEnum.PAGE_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null unit: null
}, },
{ {
@ -69,6 +74,7 @@ export const pageType: PageTypeDetails_pageType = {
filterableInDashboard: true, filterableInDashboard: true,
filterableInStorefront: true, filterableInStorefront: true,
type: AttributeTypeEnum.PAGE_TYPE, type: AttributeTypeEnum.PAGE_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
unit: null unit: null
} }
], ],

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: AssignPageAttribute // GraphQL mutation operation: AssignPageAttribute
@ -37,6 +37,7 @@ export interface AssignPageAttribute_pageAttributeAssign_pageType_attributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface AssignPageAttribute_pageAttributeAssign_pageType { export interface AssignPageAttribute_pageAttributeAssign_pageType {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { ReorderInput, PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { ReorderInput, PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: PageTypeAttributeReorder // GraphQL mutation operation: PageTypeAttributeReorder
@ -37,6 +37,7 @@ export interface PageTypeAttributeReorder_pageTypeReorderAttributes_pageType_att
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface PageTypeAttributeReorder_pageTypeReorderAttributes_pageType { export interface PageTypeAttributeReorder_pageTypeReorderAttributes_pageType {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { PageTypeCreateInput, PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { PageTypeCreateInput, PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: PageTypeCreate // GraphQL mutation operation: PageTypeCreate
@ -37,6 +37,7 @@ export interface PageTypeCreate_pageTypeCreate_pageType_attributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface PageTypeCreate_pageTypeCreate_pageType { export interface PageTypeCreate_pageTypeCreate_pageType {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL query operation: PageTypeDetails // GraphQL query operation: PageTypeDetails
@ -31,6 +31,7 @@ export interface PageTypeDetails_pageType_attributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface PageTypeDetails_pageType { export interface PageTypeDetails_pageType {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { PageTypeUpdateInput, PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { PageTypeUpdateInput, PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: PageTypeUpdate // GraphQL mutation operation: PageTypeUpdate
@ -37,6 +37,7 @@ export interface PageTypeUpdate_pageTypeUpdate_pageType_attributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface PageTypeUpdate_pageTypeUpdate_pageType { export interface PageTypeUpdate_pageTypeUpdate_pageType {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum } from "./../../types/globalTypes"; import { PageErrorCode, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: UnassignPageAttribute // GraphQL mutation operation: UnassignPageAttribute
@ -37,6 +37,7 @@ export interface UnassignPageAttribute_pageAttributeUnassign_pageType_attributes
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface UnassignPageAttribute_pageAttributeUnassign_pageType { export interface UnassignPageAttribute_pageAttributeUnassign_pageType {

View file

@ -69,7 +69,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -82,7 +83,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -95,7 +97,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -110,7 +113,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
], ],
__typename: "SelectedAttribute" __typename: "SelectedAttribute"
@ -144,7 +148,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -157,7 +162,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -170,7 +176,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -183,7 +190,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -198,7 +206,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
], ],
__typename: "SelectedAttribute" __typename: "SelectedAttribute"
@ -245,7 +254,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -258,7 +268,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -271,7 +282,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -304,7 +316,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -317,7 +330,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -330,7 +344,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -343,7 +358,8 @@ export const page: PageDetails_page = {
reference: null, reference: null,
__typename: "AttributeValue", __typename: "AttributeValue",
file: null, file: null,
richText: null richText: null,
boolean: null
} }
} }
] ]

View file

@ -31,6 +31,7 @@ export interface PageDetails_page_attributes_attribute_choices_edges_node {
file: PageDetails_page_attributes_attribute_choices_edges_node_file | null; file: PageDetails_page_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageDetails_page_attributes_attribute_choices_edges { export interface PageDetails_page_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface PageDetails_page_attributes_values {
file: PageDetails_page_attributes_values_file | null; file: PageDetails_page_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageDetails_page_attributes { export interface PageDetails_page_attributes {
@ -101,6 +103,7 @@ export interface PageDetails_page_pageType_attributes_choices_edges_node {
file: PageDetails_page_pageType_attributes_choices_edges_node_file | null; file: PageDetails_page_pageType_attributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageDetails_page_pageType_attributes_choices_edges { export interface PageDetails_page_pageType_attributes_choices_edges {

View file

@ -31,6 +31,7 @@ export interface PageType_pageType_attributes_choices_edges_node {
file: PageType_pageType_attributes_choices_edges_node_file | null; file: PageType_pageType_attributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageType_pageType_attributes_choices_edges { export interface PageType_pageType_attributes_choices_edges {

View file

@ -38,6 +38,7 @@ export interface PageUpdate_pageUpdate_page_attributes_attribute_choices_edges_n
file: PageUpdate_pageUpdate_page_attributes_attribute_choices_edges_node_file | null; file: PageUpdate_pageUpdate_page_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageUpdate_pageUpdate_page_attributes_attribute_choices_edges { export interface PageUpdate_pageUpdate_page_attributes_attribute_choices_edges {
@ -78,6 +79,7 @@ export interface PageUpdate_pageUpdate_page_attributes_values {
file: PageUpdate_pageUpdate_page_attributes_values_file | null; file: PageUpdate_pageUpdate_page_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageUpdate_pageUpdate_page_attributes { export interface PageUpdate_pageUpdate_page_attributes {
@ -108,6 +110,7 @@ export interface PageUpdate_pageUpdate_page_pageType_attributes_choices_edges_no
file: PageUpdate_pageUpdate_page_pageType_attributes_choices_edges_node_file | null; file: PageUpdate_pageUpdate_page_pageType_attributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface PageUpdate_pageUpdate_page_pageType_attributes_choices_edges { export interface PageUpdate_pageUpdate_page_pageType_attributes_choices_edges {

View file

@ -46,7 +46,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -62,7 +63,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -102,7 +104,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -118,7 +121,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -134,7 +138,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 2, sortOrder: 2,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -150,7 +155,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 3, sortOrder: 3,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -190,7 +196,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -230,7 +237,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -246,7 +254,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -262,7 +271,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 2, sortOrder: 2,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -302,7 +312,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -318,7 +329,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -358,7 +370,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -374,7 +387,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -390,7 +404,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 2, sortOrder: 2,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -430,7 +445,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -446,7 +462,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -486,7 +503,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -502,7 +520,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -518,7 +537,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 2, sortOrder: 2,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -534,7 +554,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 3, sortOrder: 3,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -550,7 +571,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 4, sortOrder: 4,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -566,7 +588,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 5, sortOrder: 5,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -606,7 +629,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -622,7 +646,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -662,7 +687,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -678,7 +704,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -718,7 +745,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -734,7 +762,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -774,7 +803,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 0, sortOrder: 0,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -790,7 +820,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 1, sortOrder: 1,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -806,7 +837,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 2, sortOrder: 2,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -822,7 +854,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 3, sortOrder: 3,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -838,7 +871,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 4, sortOrder: 4,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -854,7 +888,8 @@ export const attributes: ProductType_productType_productAttributes[] = [
sortOrder: 5, sortOrder: 5,
type: "STRING", type: "STRING",
value: "", value: "",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -976,6 +1011,7 @@ export const productType: ProductTypeDetails_productType = {
name: "Author", name: "Author",
slug: "author", slug: "author",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
visibleInStorefront: true, visibleInStorefront: true,
unit: null unit: null
}, },
@ -987,6 +1023,7 @@ export const productType: ProductTypeDetails_productType = {
name: "Language", name: "Language",
slug: "language", slug: "language",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
visibleInStorefront: true, visibleInStorefront: true,
unit: null unit: null
}, },
@ -998,6 +1035,7 @@ export const productType: ProductTypeDetails_productType = {
name: "Publisher", name: "Publisher",
slug: "publisher", slug: "publisher",
type: AttributeTypeEnum.PRODUCT_TYPE, type: AttributeTypeEnum.PRODUCT_TYPE,
inputType: AttributeInputTypeEnum.DROPDOWN,
visibleInStorefront: true, visibleInStorefront: true,
unit: null unit: null
} }

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { ProductAttributeAssignInput, AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { ProductAttributeAssignInput, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: AssignProductAttribute // GraphQL mutation operation: AssignProductAttribute
@ -43,6 +43,7 @@ export interface AssignProductAttribute_productAttributeAssign_productType_produ
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface AssignProductAttribute_productAttributeAssign_productType_variantAttributes { export interface AssignProductAttribute_productAttributeAssign_productType_variantAttributes {
@ -55,6 +56,7 @@ export interface AssignProductAttribute_productAttributeAssign_productType_varia
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface AssignProductAttribute_productAttributeAssign_productType_weight { export interface AssignProductAttribute_productAttributeAssign_productType_weight {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { ReorderInput, ProductAttributeType, AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { ReorderInput, ProductAttributeType, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: ProductTypeAttributeReorder // GraphQL mutation operation: ProductTypeAttributeReorder
@ -43,6 +43,7 @@ export interface ProductTypeAttributeReorder_productTypeReorderAttributes_produc
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeAttributeReorder_productTypeReorderAttributes_productType_variantAttributes { export interface ProductTypeAttributeReorder_productTypeReorderAttributes_productType_variantAttributes {
@ -55,6 +56,7 @@ export interface ProductTypeAttributeReorder_productTypeReorderAttributes_produc
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeAttributeReorder_productTypeReorderAttributes_productType_weight { export interface ProductTypeAttributeReorder_productTypeReorderAttributes_productType_weight {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { ProductTypeInput, AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { ProductTypeInput, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: ProductTypeCreate // GraphQL mutation operation: ProductTypeCreate
@ -43,6 +43,7 @@ export interface ProductTypeCreate_productTypeCreate_productType_productAttribut
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeCreate_productTypeCreate_productType_variantAttributes { export interface ProductTypeCreate_productTypeCreate_productType_variantAttributes {
@ -55,6 +56,7 @@ export interface ProductTypeCreate_productTypeCreate_productType_variantAttribut
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeCreate_productTypeCreate_productType_weight { export interface ProductTypeCreate_productTypeCreate_productType_weight {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL query operation: ProductTypeDetails // GraphQL query operation: ProductTypeDetails
@ -37,6 +37,7 @@ export interface ProductTypeDetails_productType_productAttributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeDetails_productType_variantAttributes { export interface ProductTypeDetails_productType_variantAttributes {
@ -49,6 +50,7 @@ export interface ProductTypeDetails_productType_variantAttributes {
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeDetails_productType_weight { export interface ProductTypeDetails_productType_weight {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { ProductTypeInput, AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { ProductTypeInput, AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: ProductTypeUpdate // GraphQL mutation operation: ProductTypeUpdate
@ -43,6 +43,7 @@ export interface ProductTypeUpdate_productTypeUpdate_productType_productAttribut
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeUpdate_productTypeUpdate_productType_variantAttributes { export interface ProductTypeUpdate_productTypeUpdate_productType_variantAttributes {
@ -55,6 +56,7 @@ export interface ProductTypeUpdate_productTypeUpdate_productType_variantAttribut
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface ProductTypeUpdate_productTypeUpdate_productType_weight { export interface ProductTypeUpdate_productTypeUpdate_productType_weight {

View file

@ -3,7 +3,7 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeTypeEnum, MeasurementUnitsEnum, WeightUnitsEnum } from "./../../types/globalTypes"; import { AttributeTypeEnum, MeasurementUnitsEnum, AttributeInputTypeEnum, WeightUnitsEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL mutation operation: UnassignProductAttribute // GraphQL mutation operation: UnassignProductAttribute
@ -43,6 +43,7 @@ export interface UnassignProductAttribute_productAttributeUnassign_productType_p
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface UnassignProductAttribute_productAttributeUnassign_productType_variantAttributes { export interface UnassignProductAttribute_productAttributeUnassign_productType_variantAttributes {
@ -55,6 +56,7 @@ export interface UnassignProductAttribute_productAttributeUnassign_productType_v
filterableInDashboard: boolean; filterableInDashboard: boolean;
filterableInStorefront: boolean; filterableInStorefront: boolean;
unit: MeasurementUnitsEnum | null; unit: MeasurementUnitsEnum | null;
inputType: AttributeInputTypeEnum | null;
} }
export interface UnassignProductAttribute_productAttributeUnassign_productType_weight { export interface UnassignProductAttribute_productAttributeUnassign_productType_weight {

View file

@ -1,9 +1,13 @@
import { IFilter } from "@saleor/components/Filter"; import { IFilter } from "@saleor/components/Filter";
import { sectionNames } from "@saleor/intl"; import { commonMessages, sectionNames } from "@saleor/intl";
import { AutocompleteFilterOpts, FilterOpts, MinMax } from "@saleor/types"; import { AutocompleteFilterOpts, FilterOpts, MinMax } from "@saleor/types";
import { StockAvailability } from "@saleor/types/globalTypes"; import {
AttributeInputTypeEnum,
StockAvailability
} from "@saleor/types/globalTypes";
import { import {
createAutocompleteField, createAutocompleteField,
createBooleanField,
createOptionsField, createOptionsField,
createPriceField createPriceField
} from "@saleor/utils/filters/fields"; } from "@saleor/utils/filters/fields";
@ -24,6 +28,7 @@ export interface ProductListFilterOpts {
id: string; id: string;
name: string; name: string;
slug: string; slug: string;
inputType: AttributeInputTypeEnum;
} }
>; >;
attributeChoices: FilterOpts<string[]> & AutocompleteFilterOpts; attributeChoices: FilterOpts<string[]> & AutocompleteFilterOpts;
@ -67,7 +72,14 @@ const messages = defineMessages({
export function createFilterStructure( export function createFilterStructure(
intl: IntlShape, intl: IntlShape,
opts: ProductListFilterOpts opts: ProductListFilterOpts
): IFilter<ProductFilterKeys> { ): IFilter<string> {
const booleanAttributes = opts.attributes.filter(
({ inputType }) => inputType === AttributeInputTypeEnum.BOOLEAN
);
const defaultAttributes = opts.attributes.filter(
({ inputType }) => !inputType.includes(AttributeInputTypeEnum.BOOLEAN)
);
return [ return [
{ {
...createOptionsField( ...createOptionsField(
@ -150,7 +162,22 @@ export function createFilterStructure(
), ),
active: opts.productType.active active: opts.productType.active
}, },
...opts.attributes.map(attr => ({ ...booleanAttributes.map(attr => ({
...createBooleanField(
attr.slug,
attr.name,
Array.isArray(attr.value)
? undefined
: (attr.value as unknown) === "true",
{
positive: intl.formatMessage(commonMessages.yes),
negative: intl.formatMessage(commonMessages.no)
}
),
active: attr.active,
group: ProductFilterKeys.attributes
})),
...defaultAttributes.map(attr => ({
...createAutocompleteField( ...createAutocompleteField(
attr.slug as any, attr.slug as any,
attr.name, attr.name,

View file

@ -10,6 +10,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -22,6 +23,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -39,6 +41,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -51,6 +54,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -68,6 +72,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -80,6 +85,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -631,6 +637,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -643,6 +650,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -660,6 +668,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -672,6 +681,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -689,6 +699,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -701,6 +712,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -1252,6 +1264,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -1264,6 +1277,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -1281,6 +1295,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -1293,6 +1308,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -1310,6 +1326,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -1322,6 +1339,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -1373,6 +1391,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -1385,6 +1404,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -1402,6 +1422,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -1414,6 +1435,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -1431,6 +1453,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -1443,6 +1466,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -1945,6 +1969,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -1957,6 +1982,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -1974,6 +2000,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -1986,6 +2013,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -2003,6 +2031,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -2015,6 +2044,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -2472,6 +2502,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -2484,6 +2515,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -2501,6 +2533,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -2513,6 +2546,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -2530,6 +2564,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -2542,6 +2577,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -3044,6 +3080,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -3056,6 +3093,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -3073,6 +3111,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -3085,6 +3124,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -3102,6 +3142,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -3114,6 +3155,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",
@ -3533,6 +3575,7 @@ Object {
"slug": "val-1-1", "slug": "val-1-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-1", "id": "val-1-1",
"name": "val-1-1", "name": "val-1-1",
@ -3545,6 +3588,7 @@ Object {
"slug": "val-1-7", "slug": "val-1-7",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-1-7", "id": "val-1-7",
"name": "val-1-7", "name": "val-1-7",
@ -3562,6 +3606,7 @@ Object {
"slug": "val-2-2", "slug": "val-2-2",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-2", "id": "val-2-2",
"name": "val-2-2", "name": "val-2-2",
@ -3574,6 +3619,7 @@ Object {
"slug": "val-2-4", "slug": "val-2-4",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-2-4", "id": "val-2-4",
"name": "val-2-4", "name": "val-2-4",
@ -3591,6 +3637,7 @@ Object {
"slug": "val-4-1", "slug": "val-4-1",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-1", "id": "val-4-1",
"name": "val-4-1", "name": "val-4-1",
@ -3603,6 +3650,7 @@ Object {
"slug": "val-4-5", "slug": "val-4-5",
"value": Object { "value": Object {
"__typename": "AttributeValue", "__typename": "AttributeValue",
"boolean": null,
"file": null, "file": null,
"id": "val-4-5", "id": "val-4-5",
"name": "val-4-5", "name": "val-4-5",

View file

@ -29,7 +29,8 @@ export const attributes = [
slug: `val-1-${index + 1}`, slug: `val-1-${index + 1}`,
file: null, file: null,
reference: null, reference: null,
richText: null richText: null,
boolean: null
} }
})) }))
}, },
@ -46,7 +47,8 @@ export const attributes = [
slug: `val-2-${index + 1}`, slug: `val-2-${index + 1}`,
file: null, file: null,
reference: null, reference: null,
richText: null richText: null,
boolean: null
} }
})) }))
}, },
@ -63,7 +65,8 @@ export const attributes = [
slug: `val-3-${index + 1}`, slug: `val-3-${index + 1}`,
file: null, file: null,
reference: null, reference: null,
richText: null richText: null,
boolean: null
} }
})) }))
}, },
@ -80,7 +83,8 @@ export const attributes = [
slug: `val-4-${index + 1}`, slug: `val-4-${index + 1}`,
file: null, file: null,
reference: null, reference: null,
richText: null richText: null,
boolean: null
} }
})) }))
} }

View file

@ -144,18 +144,16 @@ const VariantDetailsChannelsAvailabilityCard: React.FC<VariantDetailsChannelsAva
classes={summaryClasses} classes={summaryClasses}
data-test-id="channels-variant-availability-summary" data-test-id="channels-variant-availability-summary"
> >
<> <Typography variant="caption">
<Typography variant="caption"> {intl.formatMessage(messages.subtitle, {
{intl.formatMessage(messages.subtitle, { publishedInChannelsCount: publishedInChannelsListings.length,
publishedInChannelsCount: publishedInChannelsListings.length, availableChannelsCount: allAvailableChannelsListings.length
availableChannelsCount: allAvailableChannelsListings.length })}
})} </Typography>
</Typography>
</>
</ExpansionPanelSummary> </ExpansionPanelSummary>
{channelListings.map(({ channel }) => ( {channelListings.map(({ channel }) => (
<> <React.Fragment key={channel.id}>
<Divider /> <Divider />
<CardContent> <CardContent>
<Typography <Typography
@ -170,7 +168,7 @@ const VariantDetailsChannelsAvailabilityCard: React.FC<VariantDetailsChannelsAva
{getItemSubtitle(channel.id)} {getItemSubtitle(channel.id)}
</Typography> </Typography>
</CardContent> </CardContent>
</> </React.Fragment>
))} ))}
</ExpansionPanel> </ExpansionPanel>
</CardContainer> </CardContainer>

View file

@ -50,7 +50,8 @@ export const product: (
name: "portals", name: "portals",
reference: null, reference: null,
slug: "portals", slug: "portals",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -63,7 +64,8 @@ export const product: (
name: "Baht", name: "Baht",
reference: null, reference: null,
slug: "Baht", slug: "Baht",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -77,7 +79,8 @@ export const product: (
name: "portals", name: "portals",
reference: null, reference: null,
slug: "portals", slug: "portals",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -112,7 +115,8 @@ export const product: (
name: "payment", name: "payment",
reference: null, reference: null,
slug: "payment", slug: "payment",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -125,7 +129,8 @@ export const product: (
name: "Auto Loan Account", name: "Auto Loan Account",
reference: null, reference: null,
slug: "Auto-Loan-Account", slug: "Auto-Loan-Account",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -138,7 +143,8 @@ export const product: (
name: "Garden", name: "Garden",
reference: null, reference: null,
slug: "Garden", slug: "Garden",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -151,7 +157,8 @@ export const product: (
name: "override", name: "override",
reference: null, reference: null,
slug: "override", slug: "override",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -165,7 +172,8 @@ export const product: (
name: "Auto Loan Account", name: "Auto Loan Account",
reference: null, reference: null,
slug: "Auto-Loan-Account", slug: "Auto-Loan-Account",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -360,7 +368,8 @@ export const product: (
name: "File First Value", name: "File First Value",
reference: null, reference: null,
slug: "file-first-value", slug: "file-first-value",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -397,7 +406,8 @@ export const product: (
name: "Black", name: "Black",
reference: null, reference: null,
slug: "black", slug: "black",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -410,7 +420,8 @@ export const product: (
name: "White", name: "White",
reference: null, reference: null,
slug: "white", slug: "white",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -451,7 +462,8 @@ export const product: (
name: "File First Value", name: "File First Value",
reference: null, reference: null,
slug: "file-first-value", slug: "file-first-value",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -481,7 +493,8 @@ export const product: (
name: "Black", name: "Black",
reference: null, reference: null,
slug: "black", slug: "black",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -494,7 +507,8 @@ export const product: (
name: "White", name: "White",
reference: null, reference: null,
slug: "white", slug: "white",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -953,7 +967,8 @@ export const products = (
name: "Pineapple", name: "Pineapple",
reference: null, reference: null,
slug: "pineapple", slug: "pineapple",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1062,7 +1077,8 @@ export const products = (
name: "Coconut", name: "Coconut",
reference: null, reference: null,
slug: "coconut", slug: "coconut",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1171,7 +1187,8 @@ export const products = (
name: "Apple", name: "Apple",
reference: null, reference: null,
slug: "apple", slug: "apple",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1281,7 +1298,8 @@ export const products = (
name: "Orange", name: "Orange",
reference: null, reference: null,
slug: "orange", slug: "orange",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1390,7 +1408,8 @@ export const products = (
name: "Banana", name: "Banana",
reference: null, reference: null,
slug: "banana", slug: "banana",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1499,7 +1518,8 @@ export const products = (
name: "Bean", name: "Bean",
reference: null, reference: null,
slug: "bean", slug: "bean",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1608,7 +1628,8 @@ export const products = (
name: "Carrot", name: "Carrot",
reference: null, reference: null,
slug: "carrot", slug: "carrot",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1717,7 +1738,8 @@ export const products = (
name: "Sprouty", name: "Sprouty",
reference: null, reference: null,
slug: "sprouty", slug: "sprouty",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1826,7 +1848,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -1935,7 +1958,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2044,7 +2068,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2153,7 +2178,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2262,7 +2288,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2371,7 +2398,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2480,7 +2508,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2589,7 +2618,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2698,7 +2728,8 @@ export const products = (
name: "Cotton", name: "Cotton",
reference: null, reference: null,
slug: "cotton", slug: "cotton",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -2909,7 +2940,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "File First Value", name: "File First Value",
reference: null, reference: null,
slug: "file-first-value", slug: "file-first-value",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -2927,7 +2959,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "File First Value", name: "File First Value",
reference: null, reference: null,
slug: "file-first-value", slug: "file-first-value",
richText: null richText: null,
boolean: null
} }
] ]
} }
@ -3188,7 +3221,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "portals", name: "portals",
reference: null, reference: null,
slug: "portals", slug: "portals",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -3201,7 +3235,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "Baht", name: "Baht",
reference: null, reference: null,
slug: "Baht", slug: "Baht",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -3215,7 +3250,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "portals", name: "portals",
reference: null, reference: null,
slug: "portals", slug: "portals",
richText: null richText: null,
boolean: null
} }
] ]
}, },
@ -3250,7 +3286,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "payment", name: "payment",
reference: null, reference: null,
slug: "payment", slug: "payment",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -3263,7 +3300,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "Auto Loan Account", name: "Auto Loan Account",
reference: null, reference: null,
slug: "Auto-Loan-Account", slug: "Auto-Loan-Account",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -3276,7 +3314,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "Garden", name: "Garden",
reference: null, reference: null,
slug: "Garden", slug: "Garden",
richText: null richText: null,
boolean: null
} }
}, },
{ {
@ -3289,7 +3328,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "override", name: "override",
reference: null, reference: null,
slug: "override", slug: "override",
richText: null richText: null,
boolean: null
} }
} }
] ]
@ -3303,7 +3343,8 @@ export const variant = (placeholderImage: string): ProductVariant => ({
name: "Auto Loan Account", name: "Auto Loan Account",
reference: null, reference: null,
slug: "Auto-Loan-Account", slug: "Auto-Loan-Account",
richText: null richText: null,
boolean: null
} }
] ]
} }

View file

@ -66,12 +66,14 @@ const initialProductFilterAttributesQuery = gql`
node { node {
id id
name name
inputType
slug slug
} }
} }
} }
} }
`; `;
export const useInitialProductFilterAttributesQuery = makeQuery< export const useInitialProductFilterAttributesQuery = makeQuery<
InitialProductFilterAttributes, InitialProductFilterAttributes,
never never

View file

@ -31,6 +31,7 @@ export interface CreateMultipleVariantsData_product_attributes_attribute_choices
file: CreateMultipleVariantsData_product_attributes_attribute_choices_edges_node_file | null; file: CreateMultipleVariantsData_product_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface CreateMultipleVariantsData_product_attributes_attribute_choices_edges { export interface CreateMultipleVariantsData_product_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface CreateMultipleVariantsData_product_attributes_values {
file: CreateMultipleVariantsData_product_attributes_values_file | null; file: CreateMultipleVariantsData_product_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface CreateMultipleVariantsData_product_attributes { export interface CreateMultipleVariantsData_product_attributes {
@ -101,6 +103,7 @@ export interface CreateMultipleVariantsData_product_productType_variantAttribute
file: CreateMultipleVariantsData_product_productType_variantAttributes_choices_edges_node_file | null; file: CreateMultipleVariantsData_product_productType_variantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface CreateMultipleVariantsData_product_productType_variantAttributes_choices_edges { export interface CreateMultipleVariantsData_product_productType_variantAttributes_choices_edges {

View file

@ -3,6 +3,8 @@
// @generated // @generated
// This file was automatically generated and should not be edited. // This file was automatically generated and should not be edited.
import { AttributeInputTypeEnum } from "./../../types/globalTypes";
// ==================================================== // ====================================================
// GraphQL query operation: InitialProductFilterAttributes // GraphQL query operation: InitialProductFilterAttributes
// ==================================================== // ====================================================
@ -11,6 +13,7 @@ export interface InitialProductFilterAttributes_attributes_edges_node {
__typename: "Attribute"; __typename: "Attribute";
id: string; id: string;
name: string | null; name: string | null;
inputType: AttributeInputTypeEnum | null;
slug: string | null; slug: string | null;
} }

View file

@ -31,6 +31,7 @@ export interface ProductDetails_product_attributes_attribute_choices_edges_node
file: ProductDetails_product_attributes_attribute_choices_edges_node_file | null; file: ProductDetails_product_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductDetails_product_attributes_attribute_choices_edges { export interface ProductDetails_product_attributes_attribute_choices_edges {
@ -71,6 +72,7 @@ export interface ProductDetails_product_attributes_values {
file: ProductDetails_product_attributes_values_file | null; file: ProductDetails_product_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductDetails_product_attributes { export interface ProductDetails_product_attributes {
@ -101,6 +103,7 @@ export interface ProductDetails_product_productType_variantAttributes_choices_ed
file: ProductDetails_product_productType_variantAttributes_choices_edges_node_file | null; file: ProductDetails_product_productType_variantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductDetails_product_productType_variantAttributes_choices_edges { export interface ProductDetails_product_productType_variantAttributes_choices_edges {

View file

@ -91,6 +91,7 @@ export interface ProductList_products_edges_node_attributes_values {
file: ProductList_products_edges_node_attributes_values_file | null; file: ProductList_products_edges_node_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductList_products_edges_node_attributes { export interface ProductList_products_edges_node_attributes {

View file

@ -31,6 +31,7 @@ export interface ProductType_productType_productAttributes_choices_edges_node {
file: ProductType_productType_productAttributes_choices_edges_node_file | null; file: ProductType_productType_productAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductType_productType_productAttributes_choices_edges { export interface ProductType_productType_productAttributes_choices_edges {

View file

@ -38,6 +38,7 @@ export interface ProductUpdate_productUpdate_product_attributes_attribute_choice
file: ProductUpdate_productUpdate_product_attributes_attribute_choices_edges_node_file | null; file: ProductUpdate_productUpdate_product_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductUpdate_productUpdate_product_attributes_attribute_choices_edges { export interface ProductUpdate_productUpdate_product_attributes_attribute_choices_edges {
@ -78,6 +79,7 @@ export interface ProductUpdate_productUpdate_product_attributes_values {
file: ProductUpdate_productUpdate_product_attributes_values_file | null; file: ProductUpdate_productUpdate_product_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductUpdate_productUpdate_product_attributes { export interface ProductUpdate_productUpdate_product_attributes {
@ -108,6 +110,7 @@ export interface ProductUpdate_productUpdate_product_productType_variantAttribut
file: ProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges_node_file | null; file: ProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges { export interface ProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges {

View file

@ -50,6 +50,7 @@ export interface ProductVariantCreateData_product_productType_selectionVariantAt
file: ProductVariantCreateData_product_productType_selectionVariantAttributes_choices_edges_node_file | null; file: ProductVariantCreateData_product_productType_selectionVariantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantCreateData_product_productType_selectionVariantAttributes_choices_edges { export interface ProductVariantCreateData_product_productType_selectionVariantAttributes_choices_edges {
@ -98,6 +99,7 @@ export interface ProductVariantCreateData_product_productType_nonSelectionVarian
file: ProductVariantCreateData_product_productType_nonSelectionVariantAttributes_choices_edges_node_file | null; file: ProductVariantCreateData_product_productType_nonSelectionVariantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantCreateData_product_productType_nonSelectionVariantAttributes_choices_edges { export interface ProductVariantCreateData_product_productType_nonSelectionVariantAttributes_choices_edges {

View file

@ -43,6 +43,7 @@ export interface ProductVariantDetails_productVariant_selectionAttributes_attrib
file: ProductVariantDetails_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: ProductVariantDetails_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantDetails_productVariant_selectionAttributes_attribute_choices_edges { export interface ProductVariantDetails_productVariant_selectionAttributes_attribute_choices_edges {
@ -83,6 +84,7 @@ export interface ProductVariantDetails_productVariant_selectionAttributes_values
file: ProductVariantDetails_productVariant_selectionAttributes_values_file | null; file: ProductVariantDetails_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantDetails_productVariant_selectionAttributes { export interface ProductVariantDetails_productVariant_selectionAttributes {
@ -113,6 +115,7 @@ export interface ProductVariantDetails_productVariant_nonSelectionAttributes_att
file: ProductVariantDetails_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: ProductVariantDetails_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantDetails_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface ProductVariantDetails_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -153,6 +156,7 @@ export interface ProductVariantDetails_productVariant_nonSelectionAttributes_val
file: ProductVariantDetails_productVariant_nonSelectionAttributes_values_file | null; file: ProductVariantDetails_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface ProductVariantDetails_productVariant_nonSelectionAttributes { export interface ProductVariantDetails_productVariant_nonSelectionAttributes {

View file

@ -38,6 +38,7 @@ export interface SimpleProductUpdate_productUpdate_product_attributes_attribute_
file: SimpleProductUpdate_productUpdate_product_attributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productUpdate_product_attributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productUpdate_product_attributes_attribute_choices_edges { export interface SimpleProductUpdate_productUpdate_product_attributes_attribute_choices_edges {
@ -78,6 +79,7 @@ export interface SimpleProductUpdate_productUpdate_product_attributes_values {
file: SimpleProductUpdate_productUpdate_product_attributes_values_file | null; file: SimpleProductUpdate_productUpdate_product_attributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productUpdate_product_attributes { export interface SimpleProductUpdate_productUpdate_product_attributes {
@ -108,6 +110,7 @@ export interface SimpleProductUpdate_productUpdate_product_productType_variantAt
file: SimpleProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges_node_file | null; file: SimpleProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges { export interface SimpleProductUpdate_productUpdate_product_productType_variantAttributes_choices_edges {
@ -375,6 +378,7 @@ export interface SimpleProductUpdate_productVariantUpdate_productVariant_selecti
file: SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges {
@ -415,6 +419,7 @@ export interface SimpleProductUpdate_productVariantUpdate_productVariant_selecti
file: SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes { export interface SimpleProductUpdate_productVariantUpdate_productVariant_selectionAttributes {
@ -445,6 +450,7 @@ export interface SimpleProductUpdate_productVariantUpdate_productVariant_nonSele
file: SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -485,6 +491,7 @@ export interface SimpleProductUpdate_productVariantUpdate_productVariant_nonSele
file: SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes { export interface SimpleProductUpdate_productVariantUpdate_productVariant_nonSelectionAttributes {
@ -706,6 +713,7 @@ export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_s
file: SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes_attribute_choices_edges {
@ -746,6 +754,7 @@ export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_s
file: SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes { export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_selectionAttributes {
@ -776,6 +785,7 @@ export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_n
file: SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -816,6 +826,7 @@ export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_n
file: SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes { export interface SimpleProductUpdate_productVariantStocksCreate_productVariant_nonSelectionAttributes {
@ -1036,6 +1047,7 @@ export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_s
file: SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes_attribute_choices_edges {
@ -1076,6 +1088,7 @@ export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_s
file: SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes { export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_selectionAttributes {
@ -1106,6 +1119,7 @@ export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_n
file: SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -1146,6 +1160,7 @@ export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_n
file: SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes { export interface SimpleProductUpdate_productVariantStocksDelete_productVariant_nonSelectionAttributes {
@ -1367,6 +1382,7 @@ export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_s
file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges {
@ -1407,6 +1423,7 @@ export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_s
file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes { export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_selectionAttributes {
@ -1437,6 +1454,7 @@ export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_n
file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -1477,6 +1495,7 @@ export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_n
file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_values_file | null; file: SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes { export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes {

View file

@ -50,6 +50,7 @@ export interface VariantCreate_productVariantCreate_productVariant_selectionAttr
file: VariantCreate_productVariantCreate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: VariantCreate_productVariantCreate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantCreate_productVariantCreate_productVariant_selectionAttributes_attribute_choices_edges { export interface VariantCreate_productVariantCreate_productVariant_selectionAttributes_attribute_choices_edges {
@ -90,6 +91,7 @@ export interface VariantCreate_productVariantCreate_productVariant_selectionAttr
file: VariantCreate_productVariantCreate_productVariant_selectionAttributes_values_file | null; file: VariantCreate_productVariantCreate_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantCreate_productVariantCreate_productVariant_selectionAttributes { export interface VariantCreate_productVariantCreate_productVariant_selectionAttributes {
@ -120,6 +122,7 @@ export interface VariantCreate_productVariantCreate_productVariant_nonSelectionA
file: VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -160,6 +163,7 @@ export interface VariantCreate_productVariantCreate_productVariant_nonSelectionA
file: VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes_values_file | null; file: VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes { export interface VariantCreate_productVariantCreate_productVariant_nonSelectionAttributes {

View file

@ -50,6 +50,7 @@ export interface VariantUpdate_productVariantUpdate_productVariant_selectionAttr
file: VariantUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: VariantUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges { export interface VariantUpdate_productVariantUpdate_productVariant_selectionAttributes_attribute_choices_edges {
@ -90,6 +91,7 @@ export interface VariantUpdate_productVariantUpdate_productVariant_selectionAttr
file: VariantUpdate_productVariantUpdate_productVariant_selectionAttributes_values_file | null; file: VariantUpdate_productVariantUpdate_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantUpdate_productVariant_selectionAttributes { export interface VariantUpdate_productVariantUpdate_productVariant_selectionAttributes {
@ -120,6 +122,7 @@ export interface VariantUpdate_productVariantUpdate_productVariant_nonSelectionA
file: VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -160,6 +163,7 @@ export interface VariantUpdate_productVariantUpdate_productVariant_nonSelectionA
file: VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_values_file | null; file: VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes { export interface VariantUpdate_productVariantUpdate_productVariant_nonSelectionAttributes {
@ -381,6 +385,7 @@ export interface VariantUpdate_productVariantStocksUpdate_productVariant_selecti
file: VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null; file: VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges { export interface VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_attribute_choices_edges {
@ -421,6 +426,7 @@ export interface VariantUpdate_productVariantStocksUpdate_productVariant_selecti
file: VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_values_file | null; file: VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes { export interface VariantUpdate_productVariantStocksUpdate_productVariant_selectionAttributes {
@ -451,6 +457,7 @@ export interface VariantUpdate_productVariantStocksUpdate_productVariant_nonSele
file: VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null; file: VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges { export interface VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_attribute_choices_edges {
@ -491,6 +498,7 @@ export interface VariantUpdate_productVariantStocksUpdate_productVariant_nonSele
file: VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_values_file | null; file: VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes_values_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes { export interface VariantUpdate_productVariantStocksUpdate_productVariant_nonSelectionAttributes {

View file

@ -83,6 +83,7 @@ export function getFilterOpts(
id: attr.id, id: attr.id,
name: attr.name, name: attr.name,
slug: attr.slug, slug: attr.slug,
inputType: attr.inputType,
value: value:
!!params.attributes && params.attributes[attr.slug] !!params.attributes && params.attributes[attr.slug]
? dedupeFilter(params.attributes[attr.slug]) ? dedupeFilter(params.attributes[attr.slug])
@ -198,20 +199,35 @@ export function getFilterOpts(
}; };
} }
function getFilteredAttributeValue(
params: ProductListUrlFilters
): Array<({ boolean: boolean } | { values: string[] }) & { slug: string }> {
return !!params.attributes
? Object.keys(params.attributes).map(key => {
const value = params.attributes[key];
const isMulti = isArray(params.attributes[key]);
const isBooleanValue =
!isMulti && ["true", "false"].includes((value as unknown) as string);
return {
slug: key,
...(isBooleanValue
? { boolean: JSON.parse((value as unknown) as string) }
: {
// It is possible for qs to parse values not as string[] but string
values: isMulti ? value : (([value] as unknown) as string[])
})
};
})
: null;
}
export function getFilterVariables( export function getFilterVariables(
params: ProductListUrlFilters, params: ProductListUrlFilters,
channel: string | undefined channel: string | undefined
): ProductFilterInput { ): ProductFilterInput {
return { return {
attributes: !!params.attributes attributes: getFilteredAttributeValue(params),
? Object.keys(params.attributes).map(key => ({
slug: key,
// It is possible for qs to parse values not as string[] but string
values: isArray(params.attributes[key])
? params.attributes[key]
: (([params.attributes[key]] as unknown) as string[])
}))
: null,
categories: params.categories !== undefined ? params.categories : null, categories: params.categories !== undefined ? params.categories : null,
channel: channel || null, channel: channel || null,
collections: params.collections !== undefined ? params.collections : null, collections: params.collections !== undefined ? params.collections : null,

View file

@ -11,6 +11,7 @@ export const productListFilterOpts: ProductListFilterOpts = {
attributes: attributes.map(attr => ({ attributes: attributes.map(attr => ({
id: attr.id, id: attr.id,
active: false, active: false,
inputType: attr.inputType,
name: attr.name, name: attr.name,
slug: attr.slug, slug: attr.slug,
value: [ value: [

View file

@ -21,6 +21,7 @@ export interface SearchAttributeValues_attribute_choices_edges_node {
file: SearchAttributeValues_attribute_choices_edges_node_file | null; file: SearchAttributeValues_attribute_choices_edges_node_file | null;
reference: string | null; reference: string | null;
richText: any | null; richText: any | null;
boolean: boolean | null;
} }
export interface SearchAttributeValues_attribute_choices_edges { export interface SearchAttributeValues_attribute_choices_edges {

View file

@ -61,7 +61,7 @@ exports[`Storyshots Attributes / Attributes default 1`] = `
<div <div
class="MuiTypography-root-id Attributes-expansionBarLabel-id MuiTypography-caption-id" class="MuiTypography-root-id Attributes-expansionBarLabel-id MuiTypography-caption-id"
> >
6 Attributes 7 Attributes
</div> </div>
</div> </div>
<button <button
@ -395,14 +395,23 @@ exports[`Storyshots Attributes / Attributes default 1`] = `
Value Value
</label> </label>
<div <div
class="MuiInputBase-root-id MuiOutlinedInput-root-id MuiInputBase-fullWidth-id MuiInputBase-formControl-id" class="MuiInputBase-root-id MuiOutlinedInput-root-id MuiInputBase-fullWidth-id MuiInputBase-formControl-id MuiInputBase-adornedEnd-id MuiOutlinedInput-adornedEnd-id"
> >
<input <input
aria-invalid="false" aria-invalid="false"
class="MuiInputBase-input-id MuiOutlinedInput-input-id" class="MuiInputBase-input-id MuiOutlinedInput-input-id MuiInputBase-inputAdornedEnd-id MuiOutlinedInput-inputAdornedEnd-id"
name="attribute:Numeric Attribute" name="attribute:Numeric Attribute"
type="number" type="number"
/> />
<div
class="MuiInputAdornment-root-id MuiInputAdornment-positionEnd-id"
>
<div
class="MuiTypography-root-id MuiTypography-body1-id MuiTypography-colorTextSecondary-id"
>
cm
</div>
</div>
<fieldset <fieldset
aria-hidden="true" aria-hidden="true"
class="PrivateNotchedOutline-root-id MuiOutlinedInput-notchedOutline-id" class="PrivateNotchedOutline-root-id MuiOutlinedInput-notchedOutline-id"
@ -419,6 +428,61 @@ exports[`Storyshots Attributes / Attributes default 1`] = `
</div> </div>
</div> </div>
</div> </div>
<hr
class="Hr-root-id"
/>
<div
class="BasicAttributeRow-attributeSection-id Grid-root-id Grid-uniform-id"
>
<div
class="BasicAttributeRow-attributeSectionLabel-id"
data-test="attribute-label"
>
<div
class="MuiTypography-root-id MuiTypography-body1-id"
>
Boolean Attribute
</div>
</div>
<div
data-test="attribute-value"
>
<div
class="AttributeRow-pullRight-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id AttributeRow-pullRight-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="attribute:Boolean Attribute"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -461,7 +525,7 @@ exports[`Storyshots Attributes / Attributes disabled 1`] = `
<div <div
class="MuiTypography-root-id Attributes-expansionBarLabel-id MuiTypography-caption-id" class="MuiTypography-root-id Attributes-expansionBarLabel-id MuiTypography-caption-id"
> >
6 Attributes 7 Attributes
</div> </div>
</div> </div>
<button <button
@ -799,15 +863,24 @@ exports[`Storyshots Attributes / Attributes disabled 1`] = `
Value Value
</label> </label>
<div <div
class="MuiInputBase-root-id MuiOutlinedInput-root-id MuiInputBase-disabled-id MuiOutlinedInput-disabled-id MuiInputBase-fullWidth-id MuiInputBase-formControl-id" class="MuiInputBase-root-id MuiOutlinedInput-root-id MuiInputBase-disabled-id MuiOutlinedInput-disabled-id MuiInputBase-fullWidth-id MuiInputBase-formControl-id MuiInputBase-adornedEnd-id MuiOutlinedInput-adornedEnd-id"
> >
<input <input
aria-invalid="false" aria-invalid="false"
class="MuiInputBase-input-id MuiOutlinedInput-input-id MuiInputBase-disabled-id MuiOutlinedInput-disabled-id" class="MuiInputBase-input-id MuiOutlinedInput-input-id MuiInputBase-disabled-id MuiOutlinedInput-disabled-id MuiInputBase-inputAdornedEnd-id MuiOutlinedInput-inputAdornedEnd-id"
disabled="" disabled=""
name="attribute:Numeric Attribute" name="attribute:Numeric Attribute"
type="number" type="number"
/> />
<div
class="MuiInputAdornment-root-id MuiInputAdornment-positionEnd-id"
>
<div
class="MuiTypography-root-id MuiTypography-body1-id MuiTypography-colorTextSecondary-id"
>
cm
</div>
</div>
<fieldset <fieldset
aria-hidden="true" aria-hidden="true"
class="PrivateNotchedOutline-root-id MuiOutlinedInput-notchedOutline-id" class="PrivateNotchedOutline-root-id MuiOutlinedInput-notchedOutline-id"
@ -824,6 +897,63 @@ exports[`Storyshots Attributes / Attributes disabled 1`] = `
</div> </div>
</div> </div>
</div> </div>
<hr
class="Hr-root-id"
/>
<div
class="BasicAttributeRow-attributeSection-id Grid-root-id Grid-uniform-id"
>
<div
class="BasicAttributeRow-attributeSectionLabel-id"
data-test="attribute-label"
>
<div
class="MuiTypography-root-id MuiTypography-body1-id"
>
Boolean Attribute
</div>
</div>
<div
data-test="attribute-value"
>
<div
class="AttributeRow-pullRight-id"
>
<span
aria-disabled="true"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id AttributeRow-pullRight-id PrivateSwitchBase-disabled-id MuiCheckbox-disabled-id MuiIconButton-colorPrimary-id MuiIconButton-disabled-id MuiButtonBase-disabled-id"
tabindex="-1"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
disabled=""
name="attribute:Boolean Attribute"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -866,7 +996,7 @@ exports[`Storyshots Attributes / Attributes selected 1`] = `
<div <div
class="MuiTypography-root-id Attributes-expansionBarLabel-id MuiTypography-caption-id" class="MuiTypography-root-id Attributes-expansionBarLabel-id MuiTypography-caption-id"
> >
6 Attributes 7 Attributes
</div> </div>
</div> </div>
<button <button
@ -1466,15 +1596,24 @@ exports[`Storyshots Attributes / Attributes selected 1`] = `
Value Value
</label> </label>
<div <div
class="MuiInputBase-root-id MuiOutlinedInput-root-id MuiInputBase-fullWidth-id MuiInputBase-formControl-id" class="MuiInputBase-root-id MuiOutlinedInput-root-id MuiInputBase-fullWidth-id MuiInputBase-formControl-id MuiInputBase-adornedEnd-id MuiOutlinedInput-adornedEnd-id"
> >
<input <input
aria-invalid="false" aria-invalid="false"
class="MuiInputBase-input-id MuiOutlinedInput-input-id" class="MuiInputBase-input-id MuiOutlinedInput-input-id MuiInputBase-inputAdornedEnd-id MuiOutlinedInput-inputAdornedEnd-id"
name="attribute:Numeric Attribute" name="attribute:Numeric Attribute"
type="number" type="number"
value="12cm" value="12"
/> />
<div
class="MuiInputAdornment-root-id MuiInputAdornment-positionEnd-id"
>
<div
class="MuiTypography-root-id MuiTypography-body1-id MuiTypography-colorTextSecondary-id"
>
cm
</div>
</div>
<fieldset <fieldset
aria-hidden="true" aria-hidden="true"
class="PrivateNotchedOutline-root-id MuiOutlinedInput-notchedOutline-id" class="PrivateNotchedOutline-root-id MuiOutlinedInput-notchedOutline-id"
@ -1491,6 +1630,67 @@ exports[`Storyshots Attributes / Attributes selected 1`] = `
</div> </div>
</div> </div>
</div> </div>
<hr
class="Hr-root-id"
/>
<div
class="BasicAttributeRow-attributeSection-id Grid-root-id Grid-uniform-id"
>
<div
class="BasicAttributeRow-attributeSectionLabel-id"
data-test="attribute-label"
>
<div
class="MuiTypography-root-id MuiTypography-body1-id"
>
Boolean Attribute
</div>
</div>
<div
data-test="attribute-value"
>
<div
class="AttributeRow-pullRight-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id AttributeRow-pullRight-id PrivateSwitchBase-checked-id MuiCheckbox-checked-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
checked=""
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="attribute:Boolean Attribute"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="currentColor"
height="14"
width="14"
x="5"
y="5"
/>
<path
clip-rule="evenodd"
d="M 16.7527 9.33783 L 10.86618 15.7595 L 8 12.32006 L 8.76822 11.67988 L 10.90204 14.24046 L 16.0155 8.66211 L 16.7527 9.33783 Z"
fill="white"
fill-rule="evenodd"
/>
</svg>
</span>
</span>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -88,6 +88,7 @@ export enum AttributeErrorCode {
} }
export enum AttributeInputTypeEnum { export enum AttributeInputTypeEnum {
BOOLEAN = "BOOLEAN",
DROPDOWN = "DROPDOWN", DROPDOWN = "DROPDOWN",
FILE = "FILE", FILE = "FILE",
MULTISELECT = "MULTISELECT", MULTISELECT = "MULTISELECT",
@ -1127,6 +1128,7 @@ export interface AttributeInput {
slug: string; slug: string;
values?: (string | null)[] | null; values?: (string | null)[] | null;
valuesRange?: IntRangeInput | null; valuesRange?: IntRangeInput | null;
boolean?: boolean | null;
} }
export interface AttributeSortingInput { export interface AttributeSortingInput {
@ -1162,6 +1164,7 @@ export interface AttributeValueInput {
contentType?: string | null; contentType?: string | null;
references?: string[] | null; references?: string[] | null;
richText?: any | null; richText?: any | null;
boolean?: boolean | null;
} }
export interface AttributeValueTranslationInput { export interface AttributeValueTranslationInput {

View file

@ -6,7 +6,7 @@ async function handleFormSubmit<T>(
setChanged: (changed: boolean) => void setChanged: (changed: boolean) => void
): Promise<boolean> { ): Promise<boolean> {
const errors = await onSubmit(data); const errors = await onSubmit(data);
const ok = errors.length === 0; const ok = errors?.length === 0;
if (ok) { if (ok) {
setChanged(false); setChanged(false);