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

Hoc loading error states #1589

Merged
merged 62 commits into from
May 14, 2019
Merged

Hoc loading error states #1589

merged 62 commits into from
May 14, 2019

Conversation

chris-hinds
Copy link
Contributor

@chris-hinds chris-hinds commented Apr 12, 2019

Resolves #1248

Overall change:

This PR branches from @sareh original MVP loading state, with the intention of making the Loading and error states more re-useable when adding different page types.

This is done by using HOC (Higher Order Components) to provide a loading and an error state. This enables to reduce of a lot of complexity in the article container and in the future homepage container, removing the need for these to know about error and loading states.

It also introduces a PageWrapper that is used to load the necessary page furniture which should be fairly similar if not the same across articles and homepages.

I would want to refactor this some more at a later date by producing a Layout that then wraps each page type container, again reducing the required logic in both the article and the homepage containers.

Code changes:


  • I have assigned myself to this PR and the corresponding issues
  • Tests added for new features
  • Test engineer approval
  • I have followed the merging checklist and this is ready to merge.

Copy link
Contributor

@dr3 dr3 left a comment

Choose a reason for hiding this comment

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

Loveee this, so clean and simple and modular 😍

Also this PR is draft, so soz for the review but its so close to being great 🙈

src/app/containers/PageHandlers/withData.jsx Show resolved Hide resolved
src/app/containers/PageHandlers/withData.jsx Outdated Show resolved Hide resolved
src/app/containers/Article/index.jsx Show resolved Hide resolved
jamesdonoh
jamesdonoh previously approved these changes Apr 29, 2019
Copy link
Contributor

@jamesdonoh jamesdonoh left a comment

Choose a reason for hiding this comment

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

The tests as they stand provide enough coverage against breakage, let's raise a separate issue to improve them further if needed - this work is a blocker for others and we need to finish it up. Thanks @hindsc52 for taking this on and everyone for their reviews.

dr3
dr3 previously approved these changes Apr 29, 2019
Copy link
Contributor

@dr3 dr3 left a comment

Choose a reason for hiding this comment

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

lgtm

@dr3 dr3 mentioned this pull request Apr 29, 2019
1 task
@jamesdonoh
Copy link
Contributor

Blocked by #1661

@chris-hinds chris-hinds dismissed stale reviews from dr3, jamesdonoh, and rossgaskell via 5f64100 May 13, 2019 07:22
@chris-hinds
Copy link
Contributor Author

chris-hinds commented May 13, 2019

Please note the current CC issues are for tests so can be ignored.

Copy link
Contributor

@rossgaskell rossgaskell left a comment

Choose a reason for hiding this comment

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

image
^^ It definitely is this time 😂

@jamesbrumpton
Copy link
Contributor

LGTM. Happy for this to be merged.

@jamesdonoh jamesdonoh merged commit ecc4a62 into latest May 14, 2019
@jamesdonoh jamesdonoh deleted the hoc-loading-error-states branch May 14, 2019 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create loading page
9 participants