diff --git a/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html b/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html
index 2e018ae9b..050a468ca 100644
--- a/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html
+++ b/client/src/app/components/events/event-timeline-item/event-timeline-item.component.html
@@ -12,7 +12,7 @@
*ngIf="tagDisplay != 'hideUser'">
- {{ event.action | eventVerbiage : 'feed' }}
+ {{ event.action | eventVerbiage: 'feed' }}
@@ -76,7 +76,10 @@
*ngSwitchCase="'EvidenceItem'"
[evidence]="subject">
+
): string {
if (!value) return ''
+ if (value.endsWith('Variant')) {
+ return 'civic-variant'
+ }
return `civic-${value.replace(/_/g, '').toLowerCase()}`
}
}
diff --git a/client/src/app/core/utilities/get-entity-color.ts b/client/src/app/core/utilities/get-entity-color.ts
index 4f83ffae5..4e6ae1218 100644
--- a/client/src/app/core/utilities/get-entity-color.ts
+++ b/client/src/app/core/utilities/get-entity-color.ts
@@ -14,6 +14,8 @@ export const EntityColors = new Map([
['Source', '#f9ba45'],
['Therapy', '#ac3996'],
['Variant', '#74d34c'],
+ ['GeneVariant', '#74d34c'],
+ ['FactorVariant', '#74d34c'],
['VariantGroup', '#74d34c'],
['VariantType', '#74d34c'],
diff --git a/client/src/app/forms/types/feature-select/feature-select.type.html b/client/src/app/forms/types/feature-select/feature-select.type.html
index 5e9caaa09..ef8a65f20 100644
--- a/client/src/app/forms/types/feature-select/feature-select.type.html
+++ b/client/src/app/forms/types/feature-select/feature-select.type.html
@@ -5,7 +5,7 @@
+ (ngModelChange)="this.onFeatureType$.next($event)">
diff --git a/client/src/app/forms/types/feature-select/feature-select.type.ts b/client/src/app/forms/types/feature-select/feature-select.type.ts
index a47644d71..cfd137d72 100644
--- a/client/src/app/forms/types/feature-select/feature-select.type.ts
+++ b/client/src/app/forms/types/feature-select/feature-select.type.ts
@@ -32,7 +32,8 @@ import { FormlyFieldProps } from '@ngx-formly/ng-zorro-antd/form-field'
import { NzSelectOptionInterface } from 'ng-zorro-antd/select'
import mixin from 'ts-mixin-extended'
import { FeatureIdWithCreationStatus } from './feature-quick-add/feature-quick-add.form'
-import { BehaviorSubject } from 'rxjs'
+import { BehaviorSubject, Subscription } from 'rxjs'
+import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'
export type CvcFeatureSelectFieldOption = Partial<
FieldTypeConfig>
@@ -67,6 +68,7 @@ const FeatureSelectMixin = mixin(
>()
)
+@UntilDestroy()
@Component({
selector: 'cvc-feature-select',
templateUrl: './feature-select.type.html',
@@ -94,7 +96,7 @@ export class CvcFeatureSelectField
optionTemplates?: QueryList>
selectedFeatureType?: FeatureInstanceTypes = this.props.featureType
- onFeatureType$?: BehaviorSubject> =
+ onFeatureType$: BehaviorSubject> =
new BehaviorSubject>(undefined)
constructor(
@@ -107,6 +109,12 @@ export class CvcFeatureSelectField
ngAfterViewInit(): void {
this.selectedFeatureType = this.props.featureType
+ if (this.props.featureTypeCallback) {
+ this.onFeatureType$
+ .pipe(untilDestroyed(this))
+ .subscribe((ft) => this.props.featureTypeCallback(ft))
+ this.onFeatureType$.next(this.selectedFeatureType)
+ }
this.configureBaseField() // mixin fn
this.configureEntitySelectField({
// mixin fn
diff --git a/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts b/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts
index 61caeb843..6c6cde0ec 100644
--- a/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts
+++ b/client/src/app/forms/types/molecular-profile-select/mp-finder/mp-finder.component.ts
@@ -7,7 +7,11 @@ import {
import { UntypedFormGroup } from '@angular/forms'
import { EntityFieldSubjectMap } from '@app/forms/states/base.state'
import { CvcFormRowWrapperProps } from '@app/forms/wrappers/form-row/form-row.wrapper'
-import { MolecularProfile, Variant } from '@app/generated/civic.apollo'
+import {
+ CreateableFeatureTypes,
+ MolecularProfile,
+ Variant,
+} from '@app/generated/civic.apollo'
import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core'
import { Apollo, gql } from 'apollo-angular'
import { Maybe } from 'graphql/jsutils/Maybe'
@@ -15,6 +19,7 @@ import { NzFormLayoutType } from 'ng-zorro-antd/form'
import { BehaviorSubject } from 'rxjs'
import { tag } from 'rxjs-spy/operators'
import { CvcVariantSelectFieldOption } from '../../variant-select/variant-select.type'
+import { EnumToTitlePipe } from '@app/core/pipes/enum-to-title-pipe'
type MpFinderModel = {
featureId?: number
@@ -40,6 +45,7 @@ export class MpFinderComponent {
model: MpFinderModel
form: UntypedFormGroup
config: FormlyFieldConfig[]
+ featureType?: CreateableFeatureTypes
finderState: MpFinderState = {
formLayout: 'horizontal',
@@ -76,6 +82,9 @@ export class MpFinderComponent {
showExtra: false,
showErrorTip: false,
required: true,
+ featureTypeCallback: (ft: CreateableFeatureTypes) => {
+ this.featureType = ft
+ },
},
},
{
@@ -110,10 +119,11 @@ export class MpFinderComponent {
getSelectedVariant(variantId: Maybe): Maybe {
if (!variantId) return
+ const feature = new EnumToTitlePipe().transform(this.featureType)
const fragment = {
- id: `Variant:${variantId}`,
+ id: `${feature}Variant:${variantId}`,
fragment: gql`
- fragment VariantSelectQuery on Variant {
+ fragment VariantSelectQuery on ${feature}Variant {
id
name
link
diff --git a/client/src/app/forms/types/variant-select/variant-select.query.gql b/client/src/app/forms/types/variant-select/variant-select.query.gql
index 26271c7c0..acb4cfe10 100644
--- a/client/src/app/forms/types/variant-select/variant-select.query.gql
+++ b/client/src/app/forms/types/variant-select/variant-select.query.gql
@@ -14,7 +14,15 @@ query VariantSelectTypeahead($name: String!, $featureId: Int) {
query VariantSelectTag($variantId: Int!) {
variant(id: $variantId) {
- ...VariantSelectTypeaheadFields
+ ... on Variant {
+ ...VariantSelectTypeaheadFields
+ }
+ ... on GeneVariant {
+ ...VariantSelectTypeaheadFields
+ }
+ ... on FactorVariant {
+ ...VariantSelectTypeaheadFields
+ }
}
}
diff --git a/client/src/app/generated/civic.apollo-helpers.ts b/client/src/app/generated/civic.apollo-helpers.ts
index 457a3aa10..6394bf40e 100644
--- a/client/src/app/generated/civic.apollo-helpers.ts
+++ b/client/src/app/generated/civic.apollo-helpers.ts
@@ -2125,6 +2125,19 @@ export type VariantAliasKeySpecifier = ('name' | VariantAliasKeySpecifier)[];
export type VariantAliasFieldPolicy = {
name?: FieldPolicy | FieldReadFunction
};
+export type VariantConnectionKeySpecifier = ('edges' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | VariantConnectionKeySpecifier)[];
+export type VariantConnectionFieldPolicy = {
+ edges?: FieldPolicy | FieldReadFunction,
+ nodes?: FieldPolicy | FieldReadFunction,
+ pageCount?: FieldPolicy | FieldReadFunction,
+ pageInfo?: FieldPolicy | FieldReadFunction,
+ totalCount?: FieldPolicy | FieldReadFunction
+};
+export type VariantEdgeKeySpecifier = ('cursor' | 'node' | VariantEdgeKeySpecifier)[];
+export type VariantEdgeFieldPolicy = {
+ cursor?: FieldPolicy | FieldReadFunction,
+ node?: FieldPolicy | FieldReadFunction
+};
export type VariantGroupKeySpecifier = ('comments' | 'description' | 'events' | 'flagged' | 'flags' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'name' | 'revisions' | 'sources' | 'variants' | VariantGroupKeySpecifier)[];
export type VariantGroupFieldPolicy = {
comments?: FieldPolicy | FieldReadFunction,
@@ -3038,6 +3051,14 @@ export type StrictTypedTypePolicies = {
keyFields?: false | VariantAliasKeySpecifier | (() => undefined | VariantAliasKeySpecifier),
fields?: VariantAliasFieldPolicy,
},
+ VariantConnection?: Omit & {
+ keyFields?: false | VariantConnectionKeySpecifier | (() => undefined | VariantConnectionKeySpecifier),
+ fields?: VariantConnectionFieldPolicy,
+ },
+ VariantEdge?: Omit & {
+ keyFields?: false | VariantEdgeKeySpecifier | (() => undefined | VariantEdgeKeySpecifier),
+ fields?: VariantEdgeFieldPolicy,
+ },
VariantGroup?: Omit & {
keyFields?: false | VariantGroupKeySpecifier | (() => undefined | VariantGroupKeySpecifier),
fields?: VariantGroupFieldPolicy,
diff --git a/client/src/app/generated/civic.apollo.ts b/client/src/app/generated/civic.apollo.ts
index 3554e1a5d..7d776a240 100644
--- a/client/src/app/generated/civic.apollo.ts
+++ b/client/src/app/generated/civic.apollo.ts
@@ -1952,7 +1952,7 @@ export type Factor = Commentable & EventOriginObject & EventSubject & Flaggable
revisions: RevisionConnection;
sources: Array