-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add slug field to category, product, collection & page details #720
Conversation
Add weight field and fix warehouse country selection
Fix weight based rate update
src/components/SeoForm/SeoForm.tsx
Outdated
: getPageErrorMessage(error as PageErrorFragment, intl); | ||
}; | ||
|
||
const handleSlugChange = event => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untyped function argument
src/components/SeoForm/SeoForm.tsx
Outdated
} | ||
}; | ||
|
||
const getError = fieldName => getFieldError(errors, fieldName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untyped function argument
@@ -56,6 +56,7 @@ const PageDetailsPage: React.FC<PageDetailsPageProps> = ({ | |||
}) => { | |||
const intl = useIntl(); | |||
const localizeDate = useDateLocalize(); | |||
const pageExists = page === null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pageExists
is true if page doesn't exist
"If empty, the preview shows what will be autogenerated." | ||
})} | ||
value={description ? description.slice(0, 299) : undefined} | ||
helperText={intl.formatMessage(seoFieldMessage)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If getError(SeoField.description) === true
, this input will be red but won't display any message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, removing until we get errors for those fields from backend
src/components/SeoForm/SeoForm.tsx
Outdated
loading?: boolean; | ||
helperText?: string; | ||
isCreating?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the better name would be allowEmptySlug
, it's more understandable from the component's perspective
@@ -56,6 +56,7 @@ const PageDetailsPage: React.FC<PageDetailsPageProps> = ({ | |||
}) => { | |||
const intl = useIntl(); | |||
const localizeDate = useDateLocalize(); | |||
const pageExists = page === null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const pageExists = page === null; | |
const pageNotExists = page === null; |
8330fc6
to
f956be3
Compare
SALEOR-1021
✨ After changes:
Pull Request Checklist
Test environment config
API_URI=https://master.staging.saleor.rocks/graphql/