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(app): Consolidate /motor calls into common API #2301

Merged
merged 2 commits into from
Sep 19, 2018

Conversation

Kadee80
Copy link
Contributor

@Kadee80 Kadee80 commented Sep 17, 2018

overview

Small refactor PR in to make future API work around connectivity state easier with regards to #2100.

Since motors/disengage calls get pipettes before disengage it does not implement buildRequestMaker.

Motor disengage request/response is now stored in api state. Previously there was an empty motors reducer that is now removed.

changelog

  • refactor(app): Consolidate /motor calls into common API

review requests

Please test change pipette and make sure pipette motors disengage works as expected.

@Kadee80 Kadee80 self-assigned this Sep 17, 2018
@Kadee80 Kadee80 requested a review from mcous September 17, 2018 23:12
@@ -6,7 +6,7 @@ import {calibrationReducer, type CalibrationAction} from './calibration'
import type {HealthAction} from './health'
import type {PipettesAction} from './pipettes'
import type {ModulesAction} from './modules'
import {motorsReducer, type MotorsAction} from './motors'
import {type MotorsAction} from './motors'
Copy link
Contributor

Choose a reason for hiding this comment

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

Style nitpick, but can we move type outside the braces to match the other ones?

| MotorsRequestAction
| MotorsSuccessAction
| MotorsFailureAction
| ApiAction<'disengage', null, DisengageResponse>
Copy link
Contributor

Choose a reason for hiding this comment

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

This path should be motors/disengage and the request type should be DisengageRequest, not null

error: ApiRequestError,
|},
|}
type MotorsCall = ApiCall<DisengageRequest, DisengageResponse>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would call this DisengageCall, not MotorsCall

| ApiAction<'disengage', null, DisengageResponse>

export type MotorsState = {
motors?: MotorsCall,
Copy link
Contributor

Choose a reason for hiding this comment

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

Path should be motors/disengage, not motors

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #2301 into edge will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2301      +/-   ##
==========================================
- Coverage   29.92%   29.89%   -0.04%     
==========================================
  Files         500      500              
  Lines        8049     8045       -4     
==========================================
- Hits         2409     2405       -4     
  Misses       5640     5640
Impacted Files Coverage Δ
app/src/http-api-client/index.js 100% <ø> (ø) ⬆️
app/src/http-api-client/motors.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4ace8...c17bbff. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #2301 into edge will increase coverage by 0.44%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2301      +/-   ##
==========================================
+ Coverage   29.92%   30.37%   +0.44%     
==========================================
  Files         500      502       +2     
  Lines        8049     8326     +277     
==========================================
+ Hits         2409     2529     +120     
- Misses       5640     5797     +157
Impacted Files Coverage Δ
app/src/http-api-client/index.js 100% <ø> (ø) ⬆️
app/src/http-api-client/motors.js 100% <100%> (ø) ⬆️
app/src/shell/index.js 78.78% <0%> (-3.83%) ⬇️
...tocol-designer/src/file-data/selectors/commands.js 19.26% <0%> (-2.28%) ⬇️
...steplist/formLevel/stepFormToArgs/mixFormToArgs.js 2.22% <0%> (-0.72%) ⬇️
...-designer/src/steplist/actions/handleFormChange.js 1.51% <0%> (-0.28%) ⬇️
app/src/components/RunLog/CommandList.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/index.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/AppUpdateModal.js 0% <0%> (ø) ⬆️
...signer/src/components/WellSelectionInstructions.js 0% <0%> (ø) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4ace8...c17bbff. Read the comment docs.

4 similar comments
@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #2301 into edge will increase coverage by 0.44%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2301      +/-   ##
==========================================
+ Coverage   29.92%   30.37%   +0.44%     
==========================================
  Files         500      502       +2     
  Lines        8049     8326     +277     
==========================================
+ Hits         2409     2529     +120     
- Misses       5640     5797     +157
Impacted Files Coverage Δ
app/src/http-api-client/index.js 100% <ø> (ø) ⬆️
app/src/http-api-client/motors.js 100% <100%> (ø) ⬆️
app/src/shell/index.js 78.78% <0%> (-3.83%) ⬇️
...tocol-designer/src/file-data/selectors/commands.js 19.26% <0%> (-2.28%) ⬇️
...steplist/formLevel/stepFormToArgs/mixFormToArgs.js 2.22% <0%> (-0.72%) ⬇️
...-designer/src/steplist/actions/handleFormChange.js 1.51% <0%> (-0.28%) ⬇️
app/src/components/RunLog/CommandList.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/index.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/AppUpdateModal.js 0% <0%> (ø) ⬆️
...signer/src/components/WellSelectionInstructions.js 0% <0%> (ø) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4ace8...c17bbff. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #2301 into edge will increase coverage by 0.44%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2301      +/-   ##
==========================================
+ Coverage   29.92%   30.37%   +0.44%     
==========================================
  Files         500      502       +2     
  Lines        8049     8326     +277     
==========================================
+ Hits         2409     2529     +120     
- Misses       5640     5797     +157
Impacted Files Coverage Δ
app/src/http-api-client/index.js 100% <ø> (ø) ⬆️
app/src/http-api-client/motors.js 100% <100%> (ø) ⬆️
app/src/shell/index.js 78.78% <0%> (-3.83%) ⬇️
...tocol-designer/src/file-data/selectors/commands.js 19.26% <0%> (-2.28%) ⬇️
...steplist/formLevel/stepFormToArgs/mixFormToArgs.js 2.22% <0%> (-0.72%) ⬇️
...-designer/src/steplist/actions/handleFormChange.js 1.51% <0%> (-0.28%) ⬇️
app/src/components/RunLog/CommandList.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/index.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/AppUpdateModal.js 0% <0%> (ø) ⬆️
...signer/src/components/WellSelectionInstructions.js 0% <0%> (ø) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4ace8...c17bbff. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #2301 into edge will increase coverage by 0.44%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2301      +/-   ##
==========================================
+ Coverage   29.92%   30.37%   +0.44%     
==========================================
  Files         500      502       +2     
  Lines        8049     8326     +277     
==========================================
+ Hits         2409     2529     +120     
- Misses       5640     5797     +157
Impacted Files Coverage Δ
app/src/http-api-client/index.js 100% <ø> (ø) ⬆️
app/src/http-api-client/motors.js 100% <100%> (ø) ⬆️
app/src/shell/index.js 78.78% <0%> (-3.83%) ⬇️
...tocol-designer/src/file-data/selectors/commands.js 19.26% <0%> (-2.28%) ⬇️
...steplist/formLevel/stepFormToArgs/mixFormToArgs.js 2.22% <0%> (-0.72%) ⬇️
...-designer/src/steplist/actions/handleFormChange.js 1.51% <0%> (-0.28%) ⬇️
app/src/components/RunLog/CommandList.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/index.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/AppUpdateModal.js 0% <0%> (ø) ⬆️
...signer/src/components/WellSelectionInstructions.js 0% <0%> (ø) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4ace8...c17bbff. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 18, 2018

Codecov Report

Merging #2301 into edge will increase coverage by 0.44%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge    #2301      +/-   ##
==========================================
+ Coverage   29.92%   30.37%   +0.44%     
==========================================
  Files         500      502       +2     
  Lines        8049     8326     +277     
==========================================
+ Hits         2409     2529     +120     
- Misses       5640     5797     +157
Impacted Files Coverage Δ
app/src/http-api-client/index.js 100% <ø> (ø) ⬆️
app/src/http-api-client/motors.js 100% <100%> (ø) ⬆️
app/src/shell/index.js 78.78% <0%> (-3.83%) ⬇️
...tocol-designer/src/file-data/selectors/commands.js 19.26% <0%> (-2.28%) ⬇️
...steplist/formLevel/stepFormToArgs/mixFormToArgs.js 2.22% <0%> (-0.72%) ⬇️
...-designer/src/steplist/actions/handleFormChange.js 1.51% <0%> (-0.28%) ⬇️
app/src/components/RunLog/CommandList.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/index.js 0% <0%> (ø) ⬆️
app/src/components/AppSettings/AppUpdateModal.js 0% <0%> (ø) ⬆️
...signer/src/components/WellSelectionInstructions.js 0% <0%> (ø) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4ace8...c17bbff. Read the comment docs.

Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

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

🦄

@Kadee80 Kadee80 merged commit d9d42e0 into edge Sep 19, 2018
@Kadee80 Kadee80 deleted the app_refactor-motor-state branch September 19, 2018 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project refactor small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants