Skip to content

Conversation

Zhao-Andy
Copy link
Contributor

@Zhao-Andy Zhao-Andy commented Oct 23, 2018

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix

Description

  • /settings/integrations is now loaded in asynchronously via Preact/Webpack
  • There's some weird behavior if you spam the select/remove buttons since I added optimistic rendering. See gif below

Related Tickets & Documents

Resolves #830 and resolves #822

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

dev-integrations-demo

Added to documentation?

  • no documentation needed

padding: 3px 0px;
margin-top:-5px;
float: right;
&:hover, &:focus {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer this over the previous version since it makes selecting/removing a lot more obvious than the opacity change on a white background.

if (erroredOut) {
return (
<div className="github-repos github-repos-errored">
An error occurred. Please check your browser console and email
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This adds error handling to the page, in case the asynchronous route times out or some other error occurs.

constructor(props) {
super(props);
const { selected } = this.props;
this.state = { selected };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally had this.state = this.props.selected but the linter threw an error saying I needed to use destructuring assignment. I see that it's useful but it seems more verbose to me (literally two lines versus one). Also, I had to do change it everywhere else where I was using this.props.something, so personally think we should change that rule.

resources :follows, only: [:create]
resources :github_repos, only: [:index] do
collection do
post "/update_or_create", to: "github_repos#update_or_create"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using one route for updating and creating since we have in the Github Repo model/table github_repo.rb a find_or_create method.

@Zhao-Andy
Copy link
Contributor Author

I added some basic tests for the components. @benhalpern @maestromac want to take a look?

@Zhao-Andy Zhao-Andy changed the title [WIP] Use Preact for asynchronous rendering for /settings/integrations Use Preact for asynchronous rendering for /settings/integrations Oct 26, 2018
Copy link
Contributor

@benhalpern benhalpern left a comment

Choose a reason for hiding this comment

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

This is so well done.

@pr-triage pr-triage bot added the PR: reviewed-approved bot applied label for PR's where reviewer approves changes label Oct 31, 2018
@benhalpern benhalpern merged commit ebd4b50 into forem:master Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: reviewed-approved bot applied label for PR's where reviewer approves changes
Projects
None yet
3 participants