Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix commented issues

Krzysztof Bialoglowicz9e17c4210f2e
diff --git a/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx b/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx
index 03ef19e74a..837b97ddfb 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx
@@ -145,7 +145,7 @@ const CollectionCreatePage: React.StatelessComponent<
<VisibilityCard
data={data}
errors={formErrors}
- loading={disabled}
+ disabled={disabled}
onChange={change}
/>
</CardContent>
diff --git a/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx b/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx
index a34ca57885..9a95f10608 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx
@@ -120,7 +120,7 @@ const CollectionDetailsPage: React.StatelessComponent<
<VisibilityCard
data={data}
errors={formErrors}
- loading={disabled}
+ disabled={disabled}
onChange={change}
>
<ControlledSwitch
diff --git a/saleor/static/dashboard-next/components/VisibilityCard/VisibilityCard.tsx b/saleor/static/dashboard-next/components/VisibilityCard/VisibilityCard.tsx
index b28e88b4a8..6fa57f9d79 100644
--- a/saleor/static/dashboard-next/components/VisibilityCard/VisibilityCard.tsx
+++ b/saleor/static/dashboard-next/components/VisibilityCard/VisibilityCard.tsx
@@ -31,25 +31,25 @@ const styles = (theme: Theme) =>
});
interface VisibilityCardProps extends WithStyles<typeof styles> {
- children?: React.ReactNode;
+ children?: React.ReactNode | React.ReactNodeArray;
data: {
isPublished: boolean;
publicationDate: string;
};
errors: { [key: string]: string };
- loading?: boolean;
+ disabled?: boolean;
onChange(event: any);
}
export const VisibilityCard = withStyles(styles, {
- name: "PVisibilityCard"
+ name: "VisibilityCard"
})(
({
children,
classes,
data: { isPublished, publicationDate },
errors,
- loading,
+ disabled,
onChange
}: VisibilityCardProps) => {
return (
@@ -70,22 +70,24 @@ export const VisibilityCard = withStyles(styles, {
secondLabel={
publicationDate
? isPublished
- ? i18n.t("since ") + publicationDate
+ ? i18n.t("since {{ date }}", { date: publicationDate })
: Date.parse(publicationDate) > Date.now()
- ? i18n.t("will be visible on ") + publicationDate
+ ? i18n.t("will be visible on {{ date }}", {
+ date: publicationDate
+ })
: null
: null
}
checked={isPublished}
onChange={onChange}
- disabled={loading}
+ disabled={disabled}
/>
</div>
{!isPublished && (
<>
<TextField
error={!!errors.publicationDate}
- disabled={loading}
+ disabled={disabled}
label={i18n.t("Publish on")}
name="publicationDate"
type="date"
diff --git a/saleor/static/dashboard-next/pages/components/PageDetailsPage/PageDetailsPage.tsx b/saleor/static/dashboard-next/pages/components/PageDetailsPage/PageDetailsPage.tsx
index b0946ca04d..c2d4dca4a1 100644
--- a/saleor/static/dashboard-next/pages/components/PageDetailsPage/PageDetailsPage.tsx
+++ b/saleor/static/dashboard-next/pages/components/PageDetailsPage/PageDetailsPage.tsx
@@ -114,7 +114,7 @@ const PageDetailsPage: React.StatelessComponent<PageDetailsPageProps> = ({
<CardSpacer />
<VisibilityCard
data={data}
- loading={disabled}
+ disabled={disabled}
errors={formErrors}
onChange={change}
/>
diff --git a/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx b/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx
index c035b22cde..492c623528 100644
--- a/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductCreatePage/ProductCreatePage.tsx
@@ -208,7 +208,7 @@ export const ProductCreatePage: React.StatelessComponent<
<VisibilityCard
data={data}
errors={errors}
- loading={disabled}
+ disabled={disabled}
onChange={change}
/>
</div>
diff --git a/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx b/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx
index 630a210a4e..ad323b7b3d 100644
--- a/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx
@@ -292,7 +292,7 @@ export const ProductUpdate: React.StatelessComponent<ProductUpdateProps> = ({
<VisibilityCard
data={data}
errors={errors}
- loading={disabled}
+ disabled={disabled}
onChange={change}
/>
</div>