Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numeric attributes #1065

Merged
merged 14 commits into from
Apr 29, 2021
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add multiline field plugins - #974 by @dominik-zeglen
- Handle limit reached error - #990 by @dominik-zeglen
- Display Cloud limits - #1004 by @dominik-zeglen
- Introducing numeric attributes - #1065 by @piotrgrundas
- Add shipping method description - #1058 by @jwm0
- Fix voucher and sales sorting errors - #1063 by @orzechdev
- Fix custom currency formatting - #1067 by @orzechdev
Expand Down
56 changes: 56 additions & 0 deletions locale/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,18 @@
"context": "dialog content",
"string": "Are you sure you want to delete {attributeName}?"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_acreFt": {
"context": "acre-ft unit",
"string": "acre-ft"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_acreInch": {
"context": "acre-inch unit",
"string": "acre-inch"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_area": {
"context": "area units type",
"string": "Area"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_attributeLabel": {
"context": "attribute's label",
"string": "Default Label"
Expand All @@ -881,6 +893,10 @@
"context": "attribute slug input field helper text",
"string": "This is used internally. Make sure you don’t use spaces"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_distance": {
"context": "distance units type",
"string": "Distance"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_dropdown": {
"context": "product attribute type",
"string": "Dropdown"
Expand All @@ -893,18 +909,34 @@
"context": "file attribute type",
"string": "File"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_imperial": {
"context": "imperial unit system",
"string": "Imperial"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_inputType": {
"context": "attribute's editor component",
"string": "Catalog Input type for Store Owner"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_metric": {
"context": "metric unit system",
"string": "Metric"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_multiselect": {
"context": "product attribute type",
"string": "Multiple Select"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_numeric": {
"context": "numeric attribute type",
"string": "Numeric"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_page": {
"context": "page attribute entity type",
"string": "Pages"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_pint": {
"context": "pint unit",
"string": "pint"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_product": {
"context": "product attribute entity type",
"string": "Products"
Expand All @@ -913,14 +945,38 @@
"context": "references attribute type",
"string": "References"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_selectUnit": {
"context": "check to require numeric attribute unit",
"string": "Select unit"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_text": {
"context": "text attribute type",
"string": "Text"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_unit": {
"context": "numeric attribute unit",
"string": "Unit"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_unitOf": {
"context": "numeric attribute units of",
"string": "Units of"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_unitSystem": {
"context": "numeric attribute unit system",
"string": "System"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_valueRequired": {
"context": "check to require attribute to have value",
"string": "Value Required"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_volume": {
"context": "volume units types",
"string": "Volume"
},
"src_dot_attributes_dot_components_dot_AttributeDetails_dot_weight": {
"context": "weight units type",
"string": "Weight"
},
"src_dot_attributes_dot_components_dot_AttributeListPage_dot_2417065806": {
"context": "tab name",
"string": "All Attributes"
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 75 additions & 2 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,15 @@ type AppUpdate {
app: App
}

enum AreaUnitsEnum {
SQ_CM
SQ_M
SQ_KM
SQ_FT
SQ_YD
SQ_INCH
}

type AssignNavigation {
menu: Menu
menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
Expand All @@ -399,6 +408,7 @@ type Attribute implements Node & ObjectWithMetadata {
name: String
slug: String
type: AttributeTypeEnum
unit: MeasurementUnitsEnum
values: [AttributeValue]
valueRequired: Boolean!
visibleInStorefront: Boolean!
Expand Down Expand Up @@ -438,6 +448,7 @@ input AttributeCreateInput {
name: String!
slug: String
type: AttributeTypeEnum!
unit: MeasurementUnitsEnum
values: [AttributeValueCreateInput]
valueRequired: Boolean
isVariantOnly: Boolean
Expand Down Expand Up @@ -493,13 +504,15 @@ input AttributeFilterInput {
input AttributeInput {
slug: String!
values: [String]
valuesRange: IntRangeInput
}

enum AttributeInputTypeEnum {
DROPDOWN
MULTISELECT
FILE
REFERENCE
NUMERIC
RICH_TEXT
}

Expand Down Expand Up @@ -559,6 +572,7 @@ type AttributeUpdate {
input AttributeUpdateInput {
name: String
slug: String
unit: MeasurementUnitsEnum
removeValues: [ID]
addValues: [AttributeValueCreateInput]
valueRequired: Boolean
Expand Down Expand Up @@ -1781,6 +1795,15 @@ enum DiscountValueTypeEnum {
PERCENTAGE
}

enum DistanceUnitsEnum {
CM
M
KM
FT
YD
INCH
}

type Domain {
host: String!
sslEnabled: Boolean!
Expand Down Expand Up @@ -2367,6 +2390,39 @@ type Margin {
stop: Int
}

enum MeasurementUnitsEnum {
CM
M
KM
FT
YD
INCH
SQ_CM
piotrgrundas marked this conversation as resolved.
Show resolved Hide resolved
SQ_M
SQ_KM
SQ_FT
SQ_YD
SQ_INCH
CUBIC_MILLIMETER
CUBIC_CENTIMETER
CUBIC_DECIMETER
CUBIC_METER
LITER
CUBIC_FOOT
CUBIC_INCH
CUBIC_YARD
QT
PINT
FL_OZ
ACRE_IN
ACRE_FT
G
LB
OZ
KG
TONNE
}

type Menu implements Node & ObjectWithMetadata {
id: ID!
name: String!
Expand Down Expand Up @@ -5637,6 +5693,22 @@ type VerifyToken {
errors: [AccountError!]!
}

enum VolumeUnitsEnum {
CUBIC_MILLIMETER
CUBIC_CENTIMETER
CUBIC_DECIMETER
CUBIC_METER
LITER
CUBIC_FOOT
CUBIC_INCH
CUBIC_YARD
QT
PINT
FL_OZ
ACRE_IN
ACRE_FT
}

type Voucher implements Node {
id: ID!
name: String
Expand Down Expand Up @@ -6043,10 +6115,11 @@ type Weight {
scalar WeightScalar

enum WeightUnitsEnum {
KG
G
LB
OZ
G
KG
TONNE
}

scalar _Any
Expand Down
Loading