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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f1fc6bc
Item 10437: Aliquot Field Inheritance
XingY Jun 20, 2022
1dedec0
lint
XingY Jun 20, 2022
923e389
ui fixes
XingY Jun 21, 2022
89f971d
fix sample creation with all fields
XingY Jun 21, 2022
e1d29b7
fix editable export for insert cases
XingY Jun 21, 2022
2461e84
Merge branch 'develop' into fb_aliquotOptions
XingY Jun 22, 2022
778efea
jest
XingY Jun 22, 2022
4697fe7
lint
XingY Jun 22, 2022
c319248
fix jest
XingY Jun 22, 2022
3b53833
lint
XingY Jun 22, 2022
ea01153
fix release note
XingY Jun 22, 2022
ca68acf
v2.189.0-fb-aliquotOptions.1
XingY Jun 22, 2022
5c32b70
Merge branch 'develop' into fb_aliquotOptions
XingY Jun 23, 2022
7524d21
code review changes
XingY Jun 23, 2022
17780fe
v2.189.0-fb-aliquotOptions.2
XingY Jun 23, 2022
8af65d9
code review changes
XingY Jun 23, 2022
4505e8f
lint
XingY Jun 23, 2022
696f8c3
lint
XingY Jun 23, 2022
b4af75b
extract comments
XingY Jun 23, 2022
c7d883e
v2.189.0-fb-aliquotOptions.4
XingY Jun 23, 2022
0a7fdf0
don't show options for barcode fields
XingY Jun 23, 2022
6ffb8b1
lint
XingY Jun 23, 2022
e1052a4
v2.189.0-fb-aliquotOptions.5
XingY Jun 23, 2022
ed28988
code review changes
XingY Jun 23, 2022
e237466
fix comment
XingY Jun 24, 2022
91ef27c
update snapshot
XingY Jun 24, 2022
e13aa40
Merge branch 'develop' into fb_aliquotOptions
XingY Jun 29, 2022
b0e7e4c
v2.192.0-fb-aliquotOptions.1
XingY Jun 29, 2022
a655f06
set explicit default value for aliquot options
XingY Jun 30, 2022
19dddc6
Merge branch 'develop' into fb_aliquotOptions
XingY Jun 30, 2022
e6e4b2a
v2.193.0-fb-aliquotOptions.1
XingY Jun 30, 2022
5c54353
Merge branch 'develop' into fb_aliquotOptions
XingY Jul 3, 2022
0ca2eba
v2.193.0-fb-aliquotOptions.2
XingY Jul 3, 2022
3024097
Fix editable grid update with no aliquot selection
XingY Jul 5, 2022
34860f4
Merge branch 'develop' into fb_aliquotOptions
XingY Jul 5, 2022
f31de98
v2.195.0-fb-aliquotOptions.1
XingY Jul 5, 2022
fe201a3
fix independent field
XingY Jul 6, 2022
3540ed0
v2.195.0-fb-aliquotOptions.2
XingY Jul 6, 2022
e8b9eaf
fix aliquot reset
XingY Jul 6, 2022
6c4d5fe
v2.195.0-fb-aliquotOptions.3
XingY Jul 6, 2022
4abd527
Merge branch 'develop' into fb_aliquotOptions
XingY Jul 7, 2022
c9f6a5f
v2.196.0-fb-aliquotOptions.2
XingY Jul 7, 2022
f98e84d
update snapshot
XingY Jul 7, 2022
9684e05
update release note
XingY Jul 7, 2022
f51590c
v2.196.0
XingY Jul 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
XingY committed Jun 20, 2022
commit 1dedec02208ffab15eb5e5737ece29dceda1a051
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import React, {FC, memo, useCallback, useEffect, useMemo, useState} from 'react';
import { Col, Radio, Row} from 'react-bootstrap';
import React, { FC, memo, useCallback, useEffect, useMemo, useState } from 'react';
import { Col, Radio, Row } from 'react-bootstrap';

import { Alert } from '../base/Alert';

import { createFormInputId } from './actions';
import { isFieldFullyLocked } from './propertiesUtil';
import {
DERIVATION_DATA_SCOPE_ALL,
DERIVATION_DATA_SCOPE_CHILD_ONLY,
DERIVATION_DATA_SCOPE_PARENT_ONLY,
DOMAIN_FIELD_DERIVATION_DATA_SCOPE
DOMAIN_FIELD_DERIVATION_DATA_SCOPE,
} from './constants';
import { IDerivationDataScope, ITypeDependentProps } from './models';
import { SectionHeading } from './SectionHeading';
import {Alert} from "../base/Alert";

interface Props extends ITypeDependentProps {
value?: string;
config?: IDerivationDataScope;
isExistingField?: boolean;
value?: string;
}

export const DerivationDataScopeFieldOptions: FC<Props> = memo(props => {

const { domainIndex, index, onChange, config, lockType, value, label, isExistingField } = props;

const [isExistingParentOnly, setIsExistingParentOnly] = useState<boolean>(false);
Expand All @@ -42,16 +42,16 @@ export const DerivationDataScopeFieldOptions: FC<Props> = memo(props => {
return isFieldFullyLocked(lockType);
}, [lockType]);

const onRadioChange = useCallback((event) => {
if (isExistingParentOnly && event.target.value === DERIVATION_DATA_SCOPE_ALL)
setHasScopeChange(true);
else
setHasScopeChange(false);
onChange(inputId, event.target.value);
}, [inputId, onChange, isExistingParentOnly]);
const onRadioChange = useCallback(
event => {
if (isExistingParentOnly && event.target.value === DERIVATION_DATA_SCOPE_ALL) setHasScopeChange(true);
else setHasScopeChange(false);
onChange(inputId, event.target.value);
},
[inputId, onChange, isExistingParentOnly]
);

if (!config.show)
return null;
if (!config.show) return null;

return (
<div>
Expand Down Expand Up @@ -97,11 +97,11 @@ export const DerivationDataScopeFieldOptions: FC<Props> = memo(props => {
</div>
</Col>
</Row>
{hasScopeChange && config.scopeChangeWarning &&
{hasScopeChange && config.scopeChangeWarning && (
<Row>
<Alert bsStyle="warning">{config.scopeChangeWarning}</Alert>
</Row>
}
)}
</div>
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export interface IBannerMessage {
}

export interface ITypeDependentProps {
index: number;
domainIndex: number;
index: number;
label: string;
onChange: (fieldId: string, value: any, index?: number, expand?: boolean) => any;
lockType: string;
onChange: (fieldId: string, value: any, index?: number, expand?: boolean) => any;
}

export interface FieldDetails {
Expand All @@ -112,35 +112,36 @@ export interface FieldDetails {
}

export interface DomainPropertiesGridColumn {
index: string;
caption: string;
index: string;
sortable: boolean;
}

export const SAMPLE_TYPE_OPTION_VALUE = `${SAMPLE_TYPE.rangeURI}|all`;

interface IDomainDesign {
name: string;
container: string;
description?: string;
domainURI: string;
domainId: number;
allowFileLinkProperties: boolean;
allowAttachmentProperties: boolean;
allowFileLinkProperties: boolean;
allowFlagProperties: boolean;
allowTextChoiceProperties: boolean;
allowTimepointProperties: boolean;
showDefaultValueSettings: boolean;
container: string;
defaultDefaultValueType: string;
defaultValueOptions: List<string>;
description?: string;
domainException?: DomainException;
domainId: number;
domainKindName?: string;
domainURI: string;
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

instructions?: string;
domainKindName?: string;
schemaName?: string;
name: string;
newDesignFields?: List<DomainField>;
queryName?: string;
schemaName?: string;
showDefaultValueSettings: boolean;
}

export class DomainDesign
Expand Down Expand Up @@ -490,20 +491,20 @@ export class DomainIndex
}

export enum FieldErrors {
NONE = '',
MISSING_SCHEMA_QUERY = 'Missing required lookup target schema or table property.',
MISSING_DATA_TYPE = 'Please provide a data type for each field.',
MISSING_FIELD_NAME = 'Please provide a name for each field.',
MISSING_ONTOLOGY_PROPERTIES = 'Missing required ontology source or label field property.',
MISSING_SCHEMA_QUERY = 'Missing required lookup target schema or table property.',
NONE = '',
}

export interface IConditionalFormat {
formatFilter: string;
backgroundColor?: string;
bold: boolean;
formatFilter: string;
italic: boolean;
strikethrough: boolean;
textColor?: string;
backgroundColor?: string;
}

export class ConditionalFormat
Expand Down Expand Up @@ -589,16 +590,16 @@ export class PropertyValidatorProperties
const EXPECTED_VALIDATOR_TYPES = ['Range', 'RegEx', 'TextChoice', 'Lookup'];

export interface IPropertyValidator {
type: string;
name: string;
properties: PropertyValidatorProperties;
extraProperties: PropertyValidatorProperties;
errorMessage?: string;
description?: string;
errorMessage?: string;
expression?: string;
extraProperties: PropertyValidatorProperties;
name: string;
new: boolean;
shouldShowWarning: boolean;
properties: PropertyValidatorProperties;
rowId?: number;
expression?: string;
shouldShowWarning: boolean;
type: string;
}

export class PropertyValidator
Expand Down Expand Up @@ -699,22 +700,22 @@ export const DEFAULT_TEXT_CHOICE_VALIDATOR = new PropertyValidator({
interface ILookupConfig {
lookupContainer?: string;
lookupQuery?: string;
lookupSchema?: string;
lookupQueryValue?: string;
lookupSchema?: string;
lookupType?: PropDescType;
}

export interface IDomainField {
PHI?: string;
URL?: string;
conceptImportColumn?: string;
conceptLabelColumn?: string;
conceptSubtree?: string;
conceptURI?: string;
conditionalFormats: List<ConditionalFormat>;
defaultScale?: string;
defaultValueType?: string;
defaultValue?: string;
dataType: PropDescType;
defaultDisplayValue?: string;
description?: string;
dimension?: boolean;
excludeFromShifting?: boolean;
format?: string;
defaultScale?: string;
hidden?: boolean;
importAliases?: string;
label?: string;
Expand All @@ -725,37 +726,37 @@ export interface IDomainField {
measure?: boolean;
mvEnabled?: boolean;
name: string;
PHI?: string;
excludeFromShifting?: boolean;
primaryKey?: boolean;
propertyId?: number;
propertyURI: string;
propertyValidators: List<PropertyValidator>;
rangeValidators: List<PropertyValidator>;
rangeURI: string;
regexValidators: List<PropertyValidator>;
lookupQueryValue: string;
dimension?: boolean;
lookupType: PropDescType;
textChoiceValidator?: PropertyValidator;
required?: boolean;
updatedField: boolean;
recommendedVariable?: boolean;
scale?: number;
scannable?: boolean;
URL?: string;
description?: string;
shownInDetailsView?: boolean;
shownInInsertView?: boolean;
shownInUpdateView?: boolean;
visible: boolean;
dataType: PropDescType;
lookupQueryValue: string;
lookupType: PropDescType;
rangeURI: string;
rangeValidators: List<PropertyValidator>;
regexValidators: List<PropertyValidator>;
original: Partial<IDomainField>;
updatedField: boolean;
required?: boolean;
isPrimaryKey: boolean;
lockType: string;
disablePhiLevel?: boolean;
lockExistingField?: boolean;
sourceOntology?: string;
conceptSubtree?: string;
conceptLabelColumn?: string;
conceptImportColumn?: string;
defaultValue?: string;
defaultValueType?: string;
format?: string;
principalConceptCode?: string;
}

Expand Down Expand Up @@ -1612,10 +1613,10 @@ export class QueryInfoLite

// modeled after the JSON object received during server side error (except the severity).
interface IDomainException {
errors?: List<DomainFieldError>;
exception: string;
success: boolean;
severity: string;
errors?: List<DomainFieldError>;
success: boolean;
}

// DomainException is used for both server side and client side errors.
Expand Down Expand Up @@ -1770,12 +1771,12 @@ export class DomainException
}

interface IDomainFieldError {
message: string;
fieldName: string;
message: string;
newRowIndexes?: List<number>;
propertyId?: number;
severity?: string;
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

}

export class DomainFieldError
Expand Down Expand Up @@ -1837,43 +1838,43 @@ export interface IAppDomainHeader {
domain: DomainDesign;
domainIndex: number;
modelDomains?: List<DomainDesign>;
onChange?: (changes: List<IFieldChange>, index: number, expand: boolean) => void;
onAddField?: (fieldConfig: Partial<IDomainField>) => void;
onChange?: (changes: List<IFieldChange>, index: number, expand: boolean) => void;
onDomainChange?: (index: number, updatedDomain: DomainDesign) => void;
}

export type DomainPanelStatus = 'INPROGRESS' | 'TODO' | 'COMPLETE' | 'NONE';

export interface IDomainFormDisplayOptions {
hideRequired?: boolean;
hideValidators?: boolean;
isDragDisabled?: boolean;
hideTextOptions?: boolean;
phiLevelDisabled?: boolean;
hideAddFieldsButton?: boolean;
disableMvEnabled?: boolean;
hideImportData?: boolean;
derivationDataScopeConfig?: IDerivationDataScope;
disableMvEnabled?: boolean;
domainKindDisplayName?: string;
retainReservedFields?: boolean;
hideAddFieldsButton?: boolean;
hideConditionalFormatting?: boolean;
hideFilePropertyType?: boolean;
hideStudyPropertyTypes?: boolean;
hideImportData?: boolean;
hideImportExport?: boolean;
hideConditionalFormatting?: boolean;
hideInferFromFile?: boolean;
hideRequired?: boolean;
hideStudyPropertyTypes?: boolean;
hideTextOptions?: boolean;
hideValidators?: boolean;
isDragDisabled?: boolean;
phiLevelDisabled?: boolean;
retainReservedFields?: boolean;
showScannableOption?: boolean;
textChoiceLockedForDomain?: boolean;
textChoiceLockedSqlFragment?: string;
}

export interface IDerivationDataScope {
show?: boolean;
sectionTitle?: string;
helpLinkNode?: ReactNode;
label_all?: string;
label_child?: string;
label_parent?: string;
helpLinkNode?: ReactNode;
scopeChangeWarning?: string;
sectionTitle?: string;
show?: boolean;
}

/**
Expand Down Expand Up @@ -1918,8 +1919,8 @@ export class DomainDetails extends Record({
}

export interface DomainFieldIndexChange {
originalIndex: number;
newIndex: number;
originalIndex: number;
}

export interface BulkDeleteConfirmInfo {
Expand All @@ -1928,7 +1929,7 @@ export interface BulkDeleteConfirmInfo {
}

export interface NameExpressionsValidationResults {
warnings: string[];
errors: string[];
previews: string[];
warnings: string[];
}
Loading