-
Notifications
You must be signed in to change notification settings - Fork 2
Item 10437: Aliquot Field Inheritance #872
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
Conversation
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.
Main changes needed are to sort out the comments that the linter wreaked havoc on.
onChange: jest.fn(), | ||
lockType: DOMAIN_FIELD_NOT_LOCKED, | ||
isExistingField: true, | ||
value: 'ParentOnly', |
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.
Might want to use the constants for these values.
</Row> | ||
<Row> | ||
<Col xs={12}> | ||
<div className="dataset_data_row_uniqueness_container"> |
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.
Classname seems odd here. Should it be renamed to be more obviously applicable here?
sectionTitle: 'Derivation Data Scope', | ||
label_all: 'Editable for parent and child data independently', | ||
label_child: 'Editable for child data only', | ||
label_parent: 'Editable for parent data only (default)', |
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.
The use of underscores in these names instead of camelCasing seems odd to me.
@@ -211,5 +211,7 @@ export const DEFAULT_DOMAIN_FORM_DISPLAY_OPTIONS = { | |||
}; | |||
|
|||
export const DERIVATION_DATA_SCOPE_CHILD_ONLY = 'ChildOnly'; | |||
export const DERIVATION_DATA_SCOPE_PARENT_ONLY = 'ParentOnly'; | |||
export const DERIVATION_DATA_SCOPE_ALL = 'All'; |
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.
Probably makes typing more difficult, but an enum could make things more concise.
<b>Editable for samples only:</b> Field is only editable for samples but not for aliquots. Aliquot will | ||
inherit the field value from its parent sample. |
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.
<b>Editable for samples only:</b> Field is only editable for samples but not for aliquots. Aliquot will | |
inherit the field value from its parent sample. | |
<b>Editable for samples only:</b> Field is editable for samples but not for aliquots. An aliquot will | |
inherit the field value from its parent sample. |
// used for extracting or querying for the parents of this type | ||
ancestorColumnName: string; | ||
appUrlPrefixParts?: string[]; | ||
// A list of fields that are backed by ExprColumn and the ExprColumn's sql contain sub select clauses |
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.
The comments are all messed up here. Can we convince the linter to no rearrange things here?
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.
eslint does not handling moving comments well and it's a known issue:
import-js/eslint-plugin-import#1723
import-js/eslint-plugin-import#1450
Instead of adding eslint-disable-line
to all lines, I went ahead with moving all inline comments to a block comment above the interface. See commit: b4af75b
Let me know if anyone has better ideas. @labkey-nicka @cnathe @labkey-alan
aliquotFields = []; | ||
const metricUnit = sampleTypeDomain.get('options').get('metricUnit'); | ||
|
||
sampleTypeDomain.domainDesign.fields.forEach(field => { | ||
if (field.derivationDataScope === 'ChildOnly') { | ||
aliquotFields.push(field.name.toLowerCase()); | ||
} else if (field.derivationDataScope === 'All') { |
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.
Use constants?
sampleLineageKeys: string[]; | ||
sampleLineage: Record<string, any>; // mapping from sample rowId to sample record containing lineage | ||
sampleLineage: Record<string, any>; | ||
sampleLineageKeys: string[]; // mapping from sample rowId to sample record containing lineage |
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.
Comment is misplaced here too.
// parent only | ||
independentFields: string[]; | ||
// aliquot-specific | ||
metaFields: string[]; // aliquot & parent rename to sharedFields |
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.
Also comment issues here.
schemaName?: string; | ||
shared?: boolean; | ||
thumbnail?: string; // This is actually a URL, do we enforce that? | ||
type?: DataViewInfoType; | ||
viewName?: string; | ||
|
||
appUrl?: AppURL; // This is a client side only attribute. Used to navigate within a Single Page App. | ||
// This comes directly from the API response and is a link to LK Server |
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.
Comment placement needs a little love.
# Conflicts: # packages/components/package.json # packages/components/releaseNotes/components.md
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.
Sadly, still a few displaced comments
export const DERIVATION_DATA_SCOPE_CHILD_ONLY = 'ChildOnly'; | ||
const DERIVATION_DATA_SCOPE_CHILD_ONLY = 'ChildOnly'; | ||
const DERIVATION_DATA_SCOPE_PARENT_ONLY = 'ParentOnly'; | ||
const DERIVATION_DATA_SCOPE_ALL = 'All'; |
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.
Seems like you don't need the constants if captured in the enum, but no big deal.
fields?: List<DomainField>; | ||
indices?: List<DomainIndex>; | ||
domainException?: DomainException; | ||
newDesignFields?: List<DomainField>; // set of fields to initialize a manually created design | ||
// set of fields to initialize a manually created design |
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.
This belongs to the newDesignFields
field
rowIndexes: List<number>; | ||
newRowIndexes?: List<number>; // for drag and drop | ||
severity?: string; // for drag and drop |
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.
This comment belongs to newRowIndexes
beforeFinish?: (model: SampleTypeModel) => void; | ||
initModel: DomainDetails; | ||
// DomainDesigner props |
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.
Previously, these props were organized into groups, but the linter has undone that, so the comments should probably go away (or else we revert the linting).
aliquotNamePatternProps?: AliquotNamePatternProps; | ||
useSeparateDataClassesAliasMenu?: boolean; | ||
|
||
// This sets the top of the sticky header, default is 0 |
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.
Belongs to the containerTop
field
schemaName?: string; | ||
shared?: boolean; | ||
thumbnail?: string; // This is actually a URL, do we enforce that? | ||
type?: DataViewInfoType; | ||
viewName?: string; | ||
|
||
appUrl?: AppURL; // This is a client side only attribute. Used to navigate within a Single Page App. | ||
// This is a client side only attribute. Used to navigate within a Single Page App. |
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.
This belongs to appUrl
thanks. updated |
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.
One more displaced comment, but otherwise good to go.
schemaName?: string; | ||
shared?: boolean; | ||
// This comes directly from the API response and is a link to LK Server |
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.
Belongs to runUrl
# Conflicts: # packages/components/package.json # packages/components/releaseNotes/components.md # packages/components/src/internal/components/editable/EditableGrid.tsx # packages/components/src/internal/components/entities/EntityInsertPanel.tsx # packages/components/src/internal/components/samples/SamplesBulkUpdateForm.tsx
# Conflicts: # packages/components/package.json # packages/components/releaseNotes/components.md # packages/components/src/internal/components/editable/EditableGrid.tsx # packages/components/src/internal/components/entities/EntityInsertPanel.tsx # packages/components/src/internal/components/samples/SamplesBulkUpdateForm.tsx
# Conflicts: # packages/components/package.json # packages/components/releaseNotes/components.md
# Conflicts: # packages/components/package.json # packages/components/releaseNotes/components.md
# Conflicts: # packages/components/package.json # packages/components/releaseNotes/components.md
Rationale
We are re-enabling "Aliquot Specific" fields for sample types. Additionally, support for "Samples & Aliquots" fields that allows independent editing of property fields for parent and child samples is added. Prior to the feature, only "Parent Only" sample properties are supported to force aliquots to always inherit properties from its parent sample.
Related Pull Requests
Changes