Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Fix views crashing when description or content fields are null #997

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

bmigirl
Copy link

@bmigirl bmigirl commented Feb 23, 2021

I want to merge this change because it fixes pages / product details crashing when content or description fields are null

Screenshots

Pull Request Checklist

  1. All visible strings are translated with proper context.
  2. All data-formatting is locale-aware (dates, numbers, and so on).
  3. The changes are tested.
  4. The code is documented (docstrings, project documentation).
  5. Changes are mentioned in the changelog.

Test Environment Config

API_URI=https://master.staging.saleor.cloud/graphql/

@github-actions github-actions bot temporarily deployed to quick-fix-nullable-content-description-fields February 23, 2021 10:56 Inactive
@github-actions github-actions bot temporarily deployed to storybook quick-fix-nullable-content-description-fields February 23, 2021 10:56 Inactive
@@ -13,8 +13,8 @@ import { TypedArticleQuery } from "./query";

import "./scss/index.scss";

const canDisplay = page =>
maybe(() => !!page && !!page.title && !!page.content);
const canDisplay = page => maybe(() => !!page && !!page.title);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe? 👮

Suggested change
const canDisplay = page => maybe(() => !!page && !!page.title);
const canDisplay = page => !!page?.title;

!!product.# &&
!!product.variants
);
maybe(() => !!product.name && !!product.# && !!product.variants);
Copy link
Contributor

Choose a reason for hiding this comment

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

👮

Copy link
Contributor

Choose a reason for hiding this comment

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

☝️

Copy link
Member

Choose a reason for hiding this comment

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

👀

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

@maarcingebala maarcingebala left a comment

Choose a reason for hiding this comment

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

Tested locally, it works 👍

@maarcingebala maarcingebala merged commit 5b0428e into master Feb 23, 2021
@maarcingebala maarcingebala deleted the quick-fix-nullable-content-description-fields branch February 23, 2021 12:56
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants