-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(protocol-designer,-shared-data): add liquid class scaffolding to PD #17126
Changes from 6 commits
608548a
e6b2407
a4e11a8
997baec
b583dd9
121c7dd
9dca002
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { getAllLiquidClassDefs } from '@opentrons/shared-data' | ||
|
||
const liquidClassDefs = getAllLiquidClassDefs() | ||
export const getLiquidClassDisplayName = ( | ||
liquidClass: string | null | ||
): string | null => { | ||
if (liquidClass == null) { | ||
return null | ||
} | ||
if (!(liquidClass in liquidClassDefs)) { | ||
console.warn(`Liquid class ${liquidClass} not found`) | ||
return null | ||
} | ||
return liquidClassDefs[liquidClass].displayName | ||
} |
Unchanged files with check annotations Beta
units?: string | ||
type?: string | ||
} | ||
interface PipetteQuirksField { | ||
Check warning on line 62 in api-client/src/pipettes/types.ts GitHub Actions / js checks
|
||
[quirkId: string]: boolean | ||
} | ||
interface QuirksField { | ||
quirks?: PipetteQuirksField | ||
} | ||
export type PipetteSettingsFieldsMap = QuirksField & { | ||
Check warning on line 69 in api-client/src/pipettes/types.ts GitHub Actions / js checks
|
||
[fieldId: string]: PipetteSettingsField | ||
} | ||
export interface IndividualPipetteSettings { | ||
fields: PipetteSettingsFieldsMap | ||
} | ||
type PipetteSettingsById = Partial<{ [id: string]: IndividualPipetteSettings }> | ||
Check warning on line 77 in api-client/src/pipettes/types.ts GitHub Actions / js checks
|
||
export type PipetteSettings = PipetteSettingsById | ||
export interface PipetteSettingsUpdateFieldsMap { | ||
Check warning on line 81 in api-client/src/pipettes/types.ts GitHub Actions / js checks
|
||
[fieldId: string]: PipetteSettingsUpdateField | ||
} | ||
} | null | ||
export interface UpdatePipetteSettingsData { | ||
fields: { [fieldId: string]: PipetteSettingsUpdateField } | ||
Check warning on line 90 in api-client/src/pipettes/types.ts GitHub Actions / js checks
|
||
} |
export interface ResourceLink { | ||
href: string | ||
meta?: Partial<{ [key: string]: string | null | undefined }> | ||
Check warning on line 14 in api-client/src/types.ts GitHub Actions / js checks
|
||
} | ||
export type ResourceLinks = Record< |
export const appRestart = (message: string): AppRestartAction => ({ | ||
type: APP_RESTART, | ||
payload: { | ||
message: message, | ||
Check warning on line 360 in app-shell-odd/src/actions.ts GitHub Actions / js checks
|
||
}, | ||
meta: { shell: true }, | ||
}) | ||
export const reloadUi = (message: string): ReloadUiAction => ({ | ||
type: RELOAD_UI, | ||
payload: { | ||
message: message, | ||
Check warning on line 368 in app-shell-odd/src/actions.ts GitHub Actions / js checks
|
||
}, | ||
meta: { shell: true }, | ||
}) | ||
export const sendLog = (message: string): SendLogAction => ({ | ||
type: SEND_LOG, | ||
payload: { | ||
message: message, | ||
Check warning on line 376 in app-shell-odd/src/actions.ts GitHub Actions / js checks
|
||
}, | ||
meta: { shell: true }, | ||
}) | ||
export const updateBrightness = (message: string): UpdateBrightnessAction => ({ | ||
type: UPDATE_BRIGHTNESS, | ||
payload: { | ||
message: message, | ||
Check warning on line 384 in app-shell-odd/src/actions.ts GitHub Actions / js checks
|
||
}, | ||
meta: { shell: true }, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, the other fields can be refactored as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this undefined here to avoid needing to add this to a migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are unnecessarily allowed to be undefined or null in some cases. The modal disallows saving without a liquid name, and displayColor is always a valid hex string. I think description can be set to null for easier use downstream as well. Thoughts on this interface for the selector
allIngredientGroupFields
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and since we're dealing with nullish initial values in
DefineLiquidsModal
, we can update that interface toThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see, that makes sense to me.
i think we would need
liquidClass
to be undefined inOrderedLiquids
at least because its included in the JSON protocols and if it is always null or a string, we'd need to make a migration for it. i'm all for adding this to the migration but not right now since there's no way to put it behind a FF. Do you mind adding a TODO or something above the type to remind us to migrate it later?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure! I will keep it as an optional property for now and we can remove the optionality and add a migration later