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

Implement site settings #3071

Merged
merged 26 commits into from Oct 12, 2018
Merged

Implement site settings #3071

merged 26 commits into from Oct 12, 2018

Conversation

dominik-zeglen
Copy link
Contributor

@dominik-zeglen dominik-zeglen commented Oct 8, 2018

Resolves #2589
Resolves #3090
Resolves #3089

@codecov
Copy link

codecov bot commented Oct 9, 2018

Codecov Report

Merging #3071 into master will not change coverage.
The diff coverage is 83.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3071   +/-   ##
=======================================
  Coverage   89.84%   89.84%           
=======================================
  Files         208      208           
  Lines       11189    11189           
  Branches     1106     1106           
=======================================
  Hits        10053    10053           
  Misses        802      802           
  Partials      334      334
Impacted Files Coverage Δ
saleor/graphql/core/mutations.py 92.74% <100%> (ø) ⬆️
saleor/graphql/shop/mutations.py 86.44% <81.81%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0f7764...258362e. Read the comment docs.

<SingleSelectField
choices={Object.keys(translatedAuthorizationKeyTypes()).map(
key => ({
label: translatedAuthorizationKeyTypes()[key],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will evaluate translatedAuthorizationKeyTypes in each iteration of the map loop.

"&:last-child": {
paddingRight: 0
},
width: 48 + theme.spacing.unit / 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please name your magic numbers or, even better, extract them from the theme where available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And magic number here is 48?

};
const handleSiteSettingsSuccess = (data: ShopSettingsUpdate) => {
if (
!maybe(() => data.shopDomainUpdate.errors.length) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using maybe in a conditional can lead to unexpected results.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only 3 possibilities here:

  • errors === null => false
  • errors.length === 0 => false
  • errors.length > 0 => true

So it's not like there are N possible results and we can't list them.

<Card>
<CardTitle
title={i18n.t("General Information", {
context: "card title"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better context: "store configuration". Physical placement (if important) could be part of a translator comment (not possible until we switch to a different translation API).

fullWidth
name="name"
label={i18n.t("Store Name", {
context: "field label"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This context is not needed.

helperText={
errors.name ||
i18n.t("Store Name is shown on taskbar in web browser", {
context: "help text"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This context is not needed.

})}
helperText={
errors.name ||
i18n.t("Store Name is shown on taskbar in web browser", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that mean? Isn't the taskbar the thing at the bottom of Windows?

error={!!errors.name}
fullWidth
name="name"
label={i18n.t("Store Name", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Store name" is not a great label as it can be read as "save the name" (including by translators), something more friendly like "Name of your store" or "Your brand name" could work better.

})}
helperText={
errors.domain ||
i18n.t("Domain is your store URL", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we give the field a better label? Currently it reads like this:

Whatchamacallit: [_______________]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like "URL of your online store"?

key={maybe(() => key.name)}
>
<TableCell>
{maybe(() => key.name) ? keyTypes[key.name] : <Skeleton />}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use maybe in conditionals.

<div className={classes.root}>
<Typography variant="title">
{i18n.t("Site Settings", {
context: "section name"
Copy link
Member

@patrys patrys Oct 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This context can be dropped.

@maarcingebala maarcingebala merged commit cbc72d3 into master Oct 12, 2018
@maarcingebala maarcingebala deleted the tsx/implement-site-settings branch October 12, 2018 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants