Skip to content

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

Merged
merged 45 commits into from
Jul 8, 2022
Merged

Item 10437: Aliquot Field Inheritance #872

merged 45 commits into from
Jul 8, 2022

Conversation

XingY
Copy link
Contributor

@XingY XingY commented Jun 22, 2022

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

  • Enable aliquot field options on sample type designer
  • Support CRUD for 3 types of sample property fields

Copy link
Contributor

@labkey-susanh labkey-susanh left a 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',
Copy link
Contributor

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">
Copy link
Contributor

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)',
Copy link
Contributor

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';
Copy link
Contributor

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.

Comment on lines 64 to 65
<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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<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
Copy link
Contributor

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?

Copy link
Contributor Author

@XingY XingY Jun 23, 2022

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') {
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

@XingY XingY requested a review from labkey-susanh June 23, 2022 22:39
Copy link
Contributor

@labkey-susanh labkey-susanh left a 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';
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

This belongs to appUrl

@XingY XingY requested a review from labkey-susanh June 23, 2022 23:16
@XingY
Copy link
Contributor Author

XingY commented Jun 23, 2022

Sadly, still a few displaced comments

thanks. updated

Copy link
Contributor

@labkey-susanh labkey-susanh left a 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Belongs to runUrl

XingY added 16 commits June 24, 2022 06:55
# 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
XingY added 5 commits July 7, 2022 14:57
# Conflicts:
#	packages/components/package.json
#	packages/components/releaseNotes/components.md
@XingY XingY merged commit ff66aa5 into develop Jul 8, 2022
@XingY XingY deleted the fb_aliquotOptions branch July 8, 2022 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants