-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(protocol-designer): unite delete labware and handleFormChang…
…e logic (#2680) There was some unecessary duplication of concerns between handling unsaved form changes and handling deletion of labware in all saved forms. This addition creates a function that can be used by both cases, to unite the logic into one source of truth. Closes #2657
- Loading branch information
Showing
3 changed files
with
53 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
// @flow | ||
import type {StepFieldName} from '../fieldLevel' | ||
|
||
// Update Form input (onChange on inputs) | ||
export type ChangeFormPayload = { | ||
// TODO Ian 2018-05-04 use StepType + FormData type to properly type this payload. | ||
// Accessor strings and values depend on StepType | ||
stepType?: string, | ||
update: { | ||
[accessor: string]: ?mixed, // string | boolean | Array<string> | null, | ||
[StepFieldName]: ?mixed, // string | boolean | Array<string> | null, | ||
}, | ||
} | ||
|
||
export type ChangeSavedFormPayload = { | ||
stepId?: string, | ||
update: { | ||
[accessor: string]: ?mixed, // string | boolean | Array<string> | null, | ||
[StepFieldName]: ?mixed, // string | boolean | Array<string> | null, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters