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

Refactor: STEP 2 mapStateToProps HOC to hook useSelector to get state (Developer) #1325

Closed
nphivu414 opened this issue May 25, 2020 · 1 comment · Fixed by #1798
Closed
Assignees
Labels
feature New feature or request front-end Relates to front end issues marketplace Relates to the Marketplace

Comments

@nphivu414
Copy link
Contributor

Background context or User story:

  • Some places we're getting the data from the state like the example below
    image
  • For the new version of react we can use hooks to get data via selector like image below
    image

Specification or Acceptance Criteria:.

  • Replace the way to get data from components from mapStateToProps to use useSelector hooks
  • How to test.
  1. Mock a global Redux store placing in core/__mocks__/store.ts
  2. Use the mock store in core/__mocks__/store.ts for mock store like this
    image
  • Where should we place the selector?.
    We'll input selector to /src/selector/ folder and we'll have 3 files developer.ts, client.ts and admin.ts. We'll put the selector which use for a developer to developer file ...
  • How to name selector?.
    We'll name it as select<> in the redux state tree.

Suggested solution:

  • Move the way to get data from state directly to use and get data via selector
  • Mock global state to core/__mocks__/store.ts
@nphivu414 nphivu414 added feature New feature or request marketplace Relates to the Marketplace front-end Relates to front end issues labels May 25, 2020
@nphivu414 nphivu414 added this to the Marketplace v2.0 milestone May 25, 2020
@nphivu414 nphivu414 self-assigned this May 25, 2020
nphivu414 added a commit that referenced this issue May 25, 2020
…1329)

* feat: #1325 Refactor developer help page using new react-redux hooks
nphivu414 added a commit that referenced this issue May 27, 2020
nphivu414 added a commit that referenced this issue May 28, 2020
nphivu414 added a commit that referenced this issue May 28, 2020
nphivu414 added a commit that referenced this issue May 28, 2020
nphivu414 pushed a commit that referenced this issue Jun 19, 2020
@duong-se duong-se linked a pull request Jun 19, 2020 that will close this issue
14 tasks
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
nphivu414 pushed a commit that referenced this issue Jun 23, 2020
* refactor: #1325 Refactor installations using react-redux hooks
nphivu414 pushed a commit that referenced this issue Jun 24, 2020
…ux hooks (#1823)

* refactor: #1325 Refactor app revision modal using react-redux hooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request front-end Relates to front end issues marketplace Relates to the Marketplace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants