Skip to content
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

fixes the event icon's twotone background color #594

Merged
merged 7 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 11 additions & 22 deletions client/src/app/forms/assertion-revise/assertion-revise.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AcmgCode, AmpLevel, AssertionClinicalSignificance, AssertionDetailGQL,
import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
import { Subject } from 'rxjs';
import { AssertionState } from '../config/states/assertion.state';
import { FormDisease, FormDrug, FormEvidence, FormGene, FormPhenotype, FormVariant } from '../forms.interfaces';
import { FormDisease, FormDrug, FormEvidence, FormMolecularProfile, FormPhenotype } from '../forms.interfaces';
import * as fmt from '@app/forms/config/utilities/input-formatters';
import { takeUntil } from 'rxjs/operators';

Expand All @@ -15,8 +15,7 @@ interface FormModel {
id: number
description: string
summary: string
variant: FormVariant[]
gene: FormGene[]
molecularProfile: FormMolecularProfile,
variantOrigin: VariantOrigin
evidenceType: AssertionType
clinicalSignificance: AssertionClinicalSignificance
Expand Down Expand Up @@ -89,21 +88,15 @@ export class AssertionReviseForm implements OnDestroy, AfterViewInit {
},
fieldGroup: [
{
key: 'gene',
type: 'gene-array',
templateOptions: {
maxCount: 1,
required: true
}
},
{
key: 'variant',
type: 'variant-array',
key: 'molecularProfile',
type: 'molecular-profile-input',
templateOptions: {
label: 'Molecular Profile',
helpText: 'lorem ipsum',
required: true,
maxCount: 1,
allowCreate: false
}
nzSelectedIndex: 2,
allowCreate: false,
},
},
{
key: 'variantOrigin',
Expand Down Expand Up @@ -280,8 +273,7 @@ export class AssertionReviseForm implements OnDestroy, AfterViewInit {
fields: {
description: fmt.toNullableString(fields.description),
summary: fmt.toNullableString(fields.summary),
variantId: fields.variant[0].id!,
geneId: fields.gene[0].id!,
molecularProfileId: fields.molecularProfile.id,
variantOrigin: fields.variantOrigin,
assertionType: fields.evidenceType,
clinicalSignificance: fields.clinicalSignificance,
Expand Down Expand Up @@ -310,10 +302,7 @@ export class AssertionReviseForm implements OnDestroy, AfterViewInit {
id: fields.id,
description: fields.description,
summary: fields.summary,
//variant: [fields.variant],
//gene: [fields.gene],
gene: [],
variant: [],
molecularProfile: fields.molecularProfile,
variantOrigin: fields.variantOrigin,
evidenceType: fields.assertionType,
clinicalSignificance: fields.clinicalSignificance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { CvcEvidenceInputTypeModule } from '../config/types/evidence-input/evide
import { CvcEvidenceManagerWrapperModule } from '../config/wrappers/with-evidence-manager/with-evidence-manager.module';
import { CvcCancelButtonModule } from '../config/types/cancel-button/cancel-button.module';
import { CvcClingenCodeArrayTypeModule } from '../config/types/clingen-code-array/clingen-code-array.module';
import { CvcMolecularProfileInputTypeModule } from '../config/types/molecular-profile-input/molecular-profile-input.module';

@NgModule({
declarations: [
Expand Down Expand Up @@ -84,8 +85,7 @@ import { CvcClingenCodeArrayTypeModule } from '../config/types/clingen-code-arra
CvcDrugArrayTypeModule,
CvcPhenotypeArrayTypeModule,
CvcDrugInteractionSelectTypeModule,
CvcGeneArrayTypeModule,
CvcVariantArrayTypeModule,
CvcMolecularProfileInputTypeModule,
CvcSourceArrayTypeModule,
CvcAmpLevelInputTypeModule,
CvcAcmgCodeArrayTypeModule,
Expand Down
16 changes: 5 additions & 11 deletions client/src/app/forms/assertion-revise/assertion-revise.query.gql
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ fragment RevisableAssertionFields on Assertion {
id
summary
description
# variant {
# id
# name
# link
# singleVariantMolecularProfileId
# }
# gene {
# id
# name
# link
# }
molecularProfile {
id
name
link
}
variantOrigin
clinicalSignificance
disease {
Expand Down
28 changes: 9 additions & 19 deletions client/src/app/forms/assertion-submit/assertion-submit.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ import {
FormDisease,
FormDrug,
FormEvidence,
FormGene,
FormMolecularProfile,
FormPhenotype,
FormVariant
} from '../forms.interfaces';

interface FormModel {
fields: {
id: number
description: string
summary: string
variant: FormVariant[]
gene: FormGene[]
molecularProfile: FormMolecularProfile
variantOrigin: VariantOrigin
evidenceType: AssertionType
clinicalSignificance: AssertionClinicalSignificance
Expand Down Expand Up @@ -110,21 +108,14 @@ export class AssertionSubmitForm implements OnDestroy {
},
fieldGroup: [
{
key: 'gene',
type: 'gene-array',
templateOptions: {
maxCount: 1,
required: true
}
},
{
key: 'variant',
type: 'variant-array',
key: 'molecularProfile',
type: 'molecular-profile-input',
templateOptions: {
label: 'Molecular Profile',
helpText: 'lorem ipsum',
required: true,
maxCount: 1,
allowCreate: false
}
allowCreate: false,
},
},
{
key: 'variantOrigin',
Expand Down Expand Up @@ -295,8 +286,7 @@ export class AssertionSubmitForm implements OnDestroy {
fields: {
description: fmt.toNullableString(fields.description),
summary: fmt.toNullableString(fields.summary),
variantId: fields.variant[0].id!,
geneId: fields.gene[0].id!,
molecularProfileId: fields.molecularProfile.id,
variantOrigin: fields.variantOrigin,
assertionType: fields.evidenceType,
clinicalSignificance: fields.clinicalSignificance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import { CvcDiseaseArrayTypeModule } from '../config/types/disease-array/disease
import { CvcDrugArrayTypeModule } from '../config/types/drugs-array/drugs-array.module';
import { CvcPhenotypeArrayTypeModule } from '../config/types/phenotypes-array/phenotypes-array.module';
import { CvcDrugInteractionSelectTypeModule } from '../config/types/drug-interaction-select/drug-interaction-select.module';
import { CvcGeneArrayTypeModule } from '../config/types/gene-array/gene-array.module';
import { CvcVariantArrayTypeModule } from '../config/types/variant-array/variant-array.module';
import { CvcSourceArrayTypeModule } from '../config/types/source-array/source-array.module';
import { CvcAmpLevelInputTypeModule } from '../config/types/amp-level-input/amp-level-input.module';
import { CvcAcmgCodeArrayTypeModule } from '../config/types/acmg-code-array/acmg-code-array.module';
Expand All @@ -49,6 +47,7 @@ import { NzCardModule } from 'ng-zorro-antd/card';
import { NzSpaceModule } from 'ng-zorro-antd/space';
import { NzTypographyModule } from 'ng-zorro-antd/typography';
import { CvcClingenCodeArrayTypeModule } from '../config/types/clingen-code-array/clingen-code-array.module';
import { CvcMolecularProfileInputTypeModule } from '../config/types/molecular-profile-input/molecular-profile-input.module';

@NgModule({
declarations: [
Expand Down Expand Up @@ -78,6 +77,7 @@ import { CvcClingenCodeArrayTypeModule } from '../config/types/clingen-code-arra
CvcDiseaseInputTypeModule,
CvcTextareaBaseTypeModule,
CvcCommentTextareaTypeModule,
CvcMolecularProfileInputTypeModule,
CvcVariantOriginSelectTypeModule,
CvcEvidenceTypeSelectTypeModule,
CvcClinicalSignificanceSelectModule,
Expand All @@ -87,8 +87,6 @@ import { CvcClingenCodeArrayTypeModule } from '../config/types/clingen-code-arra
CvcDrugArrayTypeModule,
CvcPhenotypeArrayTypeModule,
CvcDrugInteractionSelectTypeModule,
CvcGeneArrayTypeModule,
CvcVariantArrayTypeModule,
CvcSourceArrayTypeModule,
CvcAmpLevelInputTypeModule,
CvcAcmgCodeArrayTypeModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@
</ng-container>
<ng-template #newMp>
<cvc-mp-tag-name [nameSegments]="mpName"></cvc-mp-tag-name>
<button nz-button
nzSize="small" (click)="submitNewMp()" style="float: right">
Create Molecular Profile
</button>
<ng-container *ngIf="this.allowCreate; else createNotAllowed">
<button nz-button
nzSize="small" (click)="submitNewMp()" style="float: right">
Create Molecular Profile
</button>
</ng-container>
<ng-template #createNotAllowed>
<span style="float: right">This Molecular Profile doesn't exist yet. Only existing Molecular Profiles can be used for Assertions. </span>
</ng-template>
</ng-template>
</ng-container>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ interface WithDisplayNameAndValue {
})
export class CvcComplexMolecularProfileInputForm implements OnDestroy, OnInit {
@Input() formConfig?: FormlyFieldConfig
@Input() allowCreate: boolean = true
@Output() onMolecularProfileSelected = new EventEmitter<number>();

private destroy$ = new Subject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
(nzSelectChange)="clear()"
[nzSelectedIndex]="this.field.templateOptions?.nzSelectedIndex == undefined ? 0 : this.field.templateOptions?.nzSelectedIndex">
<nz-tab nzTitle="Simple Molecular Profile">
<cvc-variant-submit-form (onVariantSelected)="onVariantSelected($event)"></cvc-variant-submit-form>
<cvc-variant-submit-form
(onVariantSelected)="onVariantSelected($event)"
[allowCreate]="this.field.templateOptions?.allowCreate"></cvc-variant-submit-form>
</nz-tab>
<nz-tab nzTitle="Complex Molecular Profile">
<cvc-complex-molecular-profile-input-form #complexMolecularProfileInputForm
(onMolecularProfileSelected)="onMpSelected($event)"
[formConfig]="field"></cvc-complex-molecular-profile-input-form>
[formConfig]="field"
[allowCreate]="this.field.templateOptions?.allowCreate"></cvc-complex-molecular-profile-input-form>
</nz-tab>
</nz-tabset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class EvidenceReviseForm implements OnInit, AfterViewInit, OnDestroy {
helpText: 'lorem ipsum',
required: true,
nzSelectedIndex: 2,
allowCreate: true
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class EvidenceSubmitForm implements AfterViewInit, OnDestroy {
label: 'Molecular Profile',
helpText: 'lorem ipsum',
required: true,
allowCreate: true,
},
},
{
Expand Down
34 changes: 7 additions & 27 deletions client/src/app/forms/variant-submit/variant-submit.form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { FormGroup } from '@angular/forms';
import {
AddVariantGQL,
Expand Down Expand Up @@ -33,14 +33,15 @@ export interface SelectedVariant {
templateUrl: './variant-submit.form.html',
styleUrls: ['./variant-submit.form.less'],
})
export class VariantSubmitForm implements OnDestroy {
export class VariantSubmitForm implements OnDestroy, OnInit {
@Output() onVariantSelected = new EventEmitter<SelectedVariant>();
@Input() allowCreate: boolean = true;

private destroy$ = new Subject();

formModel!: FormModel;
formGroup: FormGroup = new FormGroup({});
formFields: FormlyFieldConfig[];
formFields: FormlyFieldConfig[] = [];
formOptions: FormlyFormOptions = { formState: new EvidenceState() };

submitVariantMutator: MutatorWithState<AddVariantGQL, AddVariantMutation, AddVariantMutationVariables>
Expand All @@ -61,7 +62,9 @@ export class VariantSubmitForm implements OnDestroy {
) {

this.submitVariantMutator = new MutatorWithState(networkErrorService);
}

ngOnInit() {
this.formFields = [
{
key: 'fields',
Expand All @@ -87,33 +90,10 @@ export class VariantSubmitForm implements OnDestroy {
type: 'variant-array',
templateOptions: {
required: false,
canCreate: false,
maxCount: 1,
allowCreate: this.allowCreate,
}
},
/* {
key: 'variant',
type: 'cvc-textarea',
templateOptions: {
label: 'Variant Name',
helpText: 'The name of the variant to add',
placeholder: 'Enter variant name',
required: true,
autosize: {
minRows: 1,
maxRows: 1
}
},
validation: {
messages: {
required: 'Variant name is required to add a new variant.'
}
}
}, */
/* {
key: 'submit',
type: 'submit-button'
}, */
]
}
];
Expand Down
15 changes: 9 additions & 6 deletions client/src/app/generated/civic.apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ export type AssertionFields = {
fdaCompanionTest: NullableBooleanInput;
/** Does the Assertion have FDA regulatory approval. */
fdaRegulatoryApproval: NullableBooleanInput;
/** The ID of the Gene to which this Assertion belongs */
geneId: Scalars['Int'];
/** The ID of the Molecular Profile to which this Assertion belongs */
molecularProfileId: Scalars['Int'];
/** The internal CIViC ID of the NCCN guideline associated with this Assertion */
nccnGuidelineId: NullableIntInput;
/** The version of the NCCN Guideline specified */
Expand All @@ -373,8 +373,6 @@ export type AssertionFields = {
phenotypeIds: Array<Scalars['Int']>;
/** A brief single sentence statement summarizing the clinical significance of this Assertion. */
summary: NullableStringInput;
/** The ID of the Variant to which this Assertion belongs */
variantId: Scalars['Int'];
/** The Variant Origin for this Assertion. */
variantOrigin: VariantOrigin;
};
Expand Down Expand Up @@ -5570,9 +5568,9 @@ export type AssertionRevisableFieldsQueryVariables = Exact<{
}>;


export type AssertionRevisableFieldsQuery = { __typename: 'Query', assertion?: { __typename: 'Assertion', id: number, summary: string, description: string, variantOrigin: VariantOrigin, clinicalSignificance: AssertionClinicalSignificance, drugInteractionType?: DrugInteraction | undefined, assertionDirection: AssertionDirection, assertionType: AssertionType, ampLevel?: AmpLevel | undefined, nccnGuidelineVersion?: string | undefined, regulatoryApproval?: boolean | undefined, fdaCompanionTest?: boolean | undefined, disease?: { __typename: 'Disease', id: number, doid?: number | undefined, name: string, displayName: string, link: string } | undefined, drugs: Array<{ __typename: 'Drug', id: number, ncitId?: string | undefined, name: string, link: string }>, phenotypes: Array<{ __typename: 'Phenotype', id: number, hpoId: string, name: string }>, acmgCodes: Array<{ __typename: 'AcmgCode', id: number, code: string, description: string }>, clingenCodes: Array<{ __typename: 'ClingenCode', id: number, code: string, description: string }>, nccnGuideline?: { __typename: 'NccnGuideline', id: number, name: string } | undefined, evidenceItems: Array<{ __typename: 'EvidenceItem', id: number, name: string, link: string, status: EvidenceStatus }> } | undefined };
export type AssertionRevisableFieldsQuery = { __typename: 'Query', assertion?: { __typename: 'Assertion', id: number, summary: string, description: string, variantOrigin: VariantOrigin, clinicalSignificance: AssertionClinicalSignificance, drugInteractionType?: DrugInteraction | undefined, assertionDirection: AssertionDirection, assertionType: AssertionType, ampLevel?: AmpLevel | undefined, nccnGuidelineVersion?: string | undefined, regulatoryApproval?: boolean | undefined, fdaCompanionTest?: boolean | undefined, molecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string }, disease?: { __typename: 'Disease', id: number, doid?: number | undefined, name: string, displayName: string, link: string } | undefined, drugs: Array<{ __typename: 'Drug', id: number, ncitId?: string | undefined, name: string, link: string }>, phenotypes: Array<{ __typename: 'Phenotype', id: number, hpoId: string, name: string }>, acmgCodes: Array<{ __typename: 'AcmgCode', id: number, code: string, description: string }>, clingenCodes: Array<{ __typename: 'ClingenCode', id: number, code: string, description: string }>, nccnGuideline?: { __typename: 'NccnGuideline', id: number, name: string } | undefined, evidenceItems: Array<{ __typename: 'EvidenceItem', id: number, name: string, link: string, status: EvidenceStatus }> } | undefined };

export type RevisableAssertionFieldsFragment = { __typename: 'Assertion', id: number, summary: string, description: string, variantOrigin: VariantOrigin, clinicalSignificance: AssertionClinicalSignificance, drugInteractionType?: DrugInteraction | undefined, assertionDirection: AssertionDirection, assertionType: AssertionType, ampLevel?: AmpLevel | undefined, nccnGuidelineVersion?: string | undefined, regulatoryApproval?: boolean | undefined, fdaCompanionTest?: boolean | undefined, disease?: { __typename: 'Disease', id: number, doid?: number | undefined, name: string, displayName: string, link: string } | undefined, drugs: Array<{ __typename: 'Drug', id: number, ncitId?: string | undefined, name: string, link: string }>, phenotypes: Array<{ __typename: 'Phenotype', id: number, hpoId: string, name: string }>, acmgCodes: Array<{ __typename: 'AcmgCode', id: number, code: string, description: string }>, clingenCodes: Array<{ __typename: 'ClingenCode', id: number, code: string, description: string }>, nccnGuideline?: { __typename: 'NccnGuideline', id: number, name: string } | undefined, evidenceItems: Array<{ __typename: 'EvidenceItem', id: number, name: string, link: string, status: EvidenceStatus }> };
export type RevisableAssertionFieldsFragment = { __typename: 'Assertion', id: number, summary: string, description: string, variantOrigin: VariantOrigin, clinicalSignificance: AssertionClinicalSignificance, drugInteractionType?: DrugInteraction | undefined, assertionDirection: AssertionDirection, assertionType: AssertionType, ampLevel?: AmpLevel | undefined, nccnGuidelineVersion?: string | undefined, regulatoryApproval?: boolean | undefined, fdaCompanionTest?: boolean | undefined, molecularProfile: { __typename: 'MolecularProfile', id: number, name: string, link: string }, disease?: { __typename: 'Disease', id: number, doid?: number | undefined, name: string, displayName: string, link: string } | undefined, drugs: Array<{ __typename: 'Drug', id: number, ncitId?: string | undefined, name: string, link: string }>, phenotypes: Array<{ __typename: 'Phenotype', id: number, hpoId: string, name: string }>, acmgCodes: Array<{ __typename: 'AcmgCode', id: number, code: string, description: string }>, clingenCodes: Array<{ __typename: 'ClingenCode', id: number, code: string, description: string }>, nccnGuideline?: { __typename: 'NccnGuideline', id: number, name: string } | undefined, evidenceItems: Array<{ __typename: 'EvidenceItem', id: number, name: string, link: string, status: EvidenceStatus }> };

export type SuggestAssertionRevisionMutationVariables = Exact<{
input: SuggestAssertionRevisionInput;
Expand Down Expand Up @@ -7346,6 +7344,11 @@ export const RevisableAssertionFieldsFragmentDoc = gql`
id
summary
description
molecularProfile {
id
name
link
}
variantOrigin
clinicalSignificance
disease {
Expand Down
Loading