Skip to content

Commit

Permalink
Merge branch 'features' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Mar 26, 2024
2 parents 8a46ed7 + 66fec60 commit 3dc67d0
Show file tree
Hide file tree
Showing 121 changed files with 11,105 additions and 4,530 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: 'ubuntu-latest'
strategy:
matrix:
ruby: ['3.2', '3.3']
ruby: ['3.3']
services:
postgres:
image: postgres:13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ query ActivityFeed(
$last: Int
$before: String
$after: String
$userId: Int
$userId: [Int!]
#$organizationId: Int
#$eventType: EventAction
#$mode: EventFeedMode
Expand Down Expand Up @@ -115,7 +115,7 @@ fragment activityFeedNode on ActivityInterface {
... on Revision {
revisionSetId
}
... on Variant {
... on VariantInterface {
deprecated
feature {
id
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/components/events/event-feed/event-feed.gql
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fragment eventFeedNode on Event {
... on Revision {
revisionSetId
}
... on Variant {
... on VariantInterface {
deprecated
feature {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fragment flagPopover on Flag {
id
link
name
...on Variant {
...on VariantInterface {
deprecated
feature {
id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
@if(variant.__typename == "FactorVariant") {
<nz-card
[nzTitle]="cardTitle"
nzType="inner"
nzSize="small">
<ng-template #cardTitle>
<i
nz-icon
nzType="civic-variant"
nzTheme="twotone"
[nzTwotoneColor]="'Variant' | entityColor"></i>
{{ variant.name }}
</ng-template>
<nz-row [nzGutter]="[8, 16]">
<nz-col [nzSpan]="24">
<nz-row [nzGutter]="[8, 8]">
<!-- gene attributes block -->
<nz-col nzSpan="24">
<nz-descriptions
nzLayout="horizontal"
nzSize="small"
[nzColumn]="4"
nzBordered="true">
<nz-descriptions-item
[nzSpan]="4"
nzTitle="Factor Variant">
<cvc-feature-variant-tag
[variant]="variant"></cvc-feature-variant-tag>
</nz-descriptions-item>
<!-- aliases -->
<nz-descriptions-item
[nzSpan]="2"
nzTitle="Aliases">
<ng-container
*ngIf="variant.variantAliases.length > 0; else noAliases">
<cvc-tag-list>
<nz-tag *ngFor="let alias of variant.variantAliases">{{
alias
}}</nz-tag>
</cvc-tag-list>
</ng-container>
<ng-template #noAliases>
<span
nz-typography
nzType="secondary"
>None specified</span
>
</ng-template>
</nz-descriptions-item>

<!-- variant type(s) -->
<nz-descriptions-item
[nzSpan]="2"
[nzTitle]="
variant.variantTypes.length > 1
? 'Variant Types'
: 'Variant Type'
">
<ng-container
*ngIf="variant.variantTypes.length > 0; else noTypes">
<cvc-tag-list>
<cvc-variant-type-tag
[variantType]="type"
*ngFor="let type of variant.variantTypes">
</cvc-variant-type-tag>
</cvc-tag-list>
</ng-container>
<ng-template #noTypes>
<span
nz-typography
nzType="secondary"
>None specified</span
>
</ng-template>
</nz-descriptions-item>

<nz-descriptions-item
[nzSpan]="4"
*ngIf="this.displayMps.length > 0"
nzTitle="Other Molecular Profiles">
<cvc-tag-list>
<ng-container *ngFor="let mp of this.displayMps">
<cvc-molecular-profile-tag
[molecularProfile]="mp"
[truncateLongName]="true"></cvc-molecular-profile-tag>
</ng-container>
<ng-container
*ngIf="
variant.molecularProfiles.totalCount >
this.displayMps.length + 1
">
<a routerLink="/variants/{{ variant.id }}/summary">
+ view
{{
variant.molecularProfiles.totalCount -
this.displayMps.length
}}
more
</a>
</ng-container>
</cvc-tag-list>
</nz-descriptions-item>
</nz-descriptions>
</nz-col>
</nz-row>
</nz-col>
</nz-row>
</nz-card>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { Component, Input, OnInit } from '@angular/core'
import { VariantMolecularProfileCardFieldsFragment } from '@app/generated/civic.apollo'
import { LinkableMolecularProfile } from '../molecular-profile-tag/molecular-profile-tag.component'

import { CommonModule } from '@angular/common'
import { CvcVariantTagModule } from '@app/components/variants/variant-tag/variant-tag.module'
import { NzTagModule } from 'ng-zorro-antd/tag'
import { NzIconModule } from 'ng-zorro-antd/icon'
import { NzGridModule } from 'ng-zorro-antd/grid'
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions'
import { NzTypographyModule } from 'ng-zorro-antd/typography'
import { CvcEmptyRevisableModule } from '@app/components/shared/empty-revisable/empty-revisable.module'
import { CvcTagListModule } from '@app/components/shared/tag-list/tag-list.module'
import { CvcVariantTypeTagModule } from '@app/components/variant-types/variant-type-tag/variant-type-tag.module'
import { CvcLinkTagModule } from '@app/components/shared/link-tag/link-tag.module'
import { NzCardModule } from 'ng-zorro-antd/card'
import { CvcPipesModule } from '@app/core/pipes/pipes.module'
import { CvcMolecularProfileTagModule } from '../molecular-profile-tag/molecular-profile-tag.module'
import { RouterModule } from '@angular/router'
import { NzCollapseModule } from 'ng-zorro-antd/collapse'
import { CvcCoordinatesCardModule } from '@app/components/variants/coordinates-card/coordinates-card.module'
import { NzSpaceModule } from 'ng-zorro-antd/space'
import { CvcFeatureTagModule } from '@app/components/features/feature-tag/feature-tag.module'
import { CvcFeatureVariantTagModule } from '@app/components/shared/feature-variant-tag/feature-variant-tag.module'

@Component({
selector: 'cvc-mp-factor-variant-card',
templateUrl: './molecular-profile-factor-variant-card.component.html',
styleUrls: ['./molecular-profile-factor-variant-card.component.less'],
standalone: true,
imports: [
CommonModule,
RouterModule,
NzTagModule,
NzIconModule,
NzGridModule,
NzDescriptionsModule,
NzTypographyModule,
NzCardModule,
NzCollapseModule,
NzSpaceModule,
CvcPipesModule,
CvcVariantTagModule,
CvcFeatureTagModule,
CvcEmptyRevisableModule,
CvcTagListModule,
CvcVariantTypeTagModule,
CvcLinkTagModule,
CvcTagListModule,
CvcMolecularProfileTagModule,
CvcCoordinatesCardModule,
CvcFeatureVariantTagModule,
],
})
export class CvcMolecularProfileFactorVariantCardComponent implements OnInit {
@Input() variant!: VariantMolecularProfileCardFieldsFragment
@Input() currentMolecularProfileId!: number

displayMps: LinkableMolecularProfile[] = []

ngOnInit() {
if (this.variant === undefined) {
throw new Error('Must pass a Variant into the MP Variant Card Component')
}

if (this.currentMolecularProfileId === undefined) {
throw new Error('Must pass a MP ID into the MP Variant Card Component')
}

if (this.variant.__typename !== 'FactorVariant') {
throw new Error('This card is for FactorVariant variant types only.')
}

this.displayMps = this.variant.molecularProfiles.nodes.filter(
(mp) => mp.id != this.currentMolecularProfileId
)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@if(variant.__typename == "GeneVariant") {
<nz-card
[nzTitle]="cardTitle"
nzType="inner"
Expand All @@ -22,7 +23,7 @@
nzBordered="true">
<nz-descriptions-item
[nzSpan]="4"
nzTitle="Variant">
nzTitle="Gene Variant">
<cvc-feature-variant-tag
[variant]="variant"></cvc-feature-variant-tag>
</nz-descriptions-item>
Expand Down Expand Up @@ -201,3 +202,4 @@
</nz-col>
</nz-row>
</nz-card>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.card-title {
font-size: 120%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { VariantMolecularProfileCardFieldsFragment } from '@app/generated/civic.
import { LinkableMolecularProfile } from '../molecular-profile-tag/molecular-profile-tag.component'

@Component({
selector: 'cvc-mp-variant-card',
templateUrl: './molecular-profile-variant-card.component.html',
styleUrls: ['./molecular-profile-variant-card.component.less'],
selector: 'cvc-mp-gene-variant-card',
templateUrl: './molecular-profile-gene-variant-card.component.html',
styleUrls: ['./molecular-profile-gene-variant-card.component.less'],
})
export class CvcMolecularProfileVariantCardComponent implements OnInit {
export class CvcMolecularProfileGeneVariantCardComponent implements OnInit {
@Input() variant!: VariantMolecularProfileCardFieldsFragment
@Input() currentMolecularProfileId!: number

Expand All @@ -22,6 +22,10 @@ export class CvcMolecularProfileVariantCardComponent implements OnInit {
throw new Error('Must pass a MP ID into the MP Variant Card Component')
}

if (this.variant.__typename !== 'GeneVariant') {
throw new Error('This card is for GeneVariant variant types only.')
}

this.displayMps = this.variant.molecularProfiles.nodes.filter(
(mp) => mp.id != this.currentMolecularProfileId
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CommonModule } from '@angular/common'
import { CvcVariantTagModule } from '@app/components/variants/variant-tag/variant-tag.module'
import { NzTagModule } from 'ng-zorro-antd/tag'
import { NzIconModule } from 'ng-zorro-antd/icon'
import { CvcMolecularProfileVariantCardComponent } from './molecular-profile-variant-card.component'
import { NzGridModule } from 'ng-zorro-antd/grid'
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions'
import { NzTypographyModule } from 'ng-zorro-antd/typography'
Expand All @@ -20,9 +19,10 @@ import { CvcCoordinatesCardModule } from '@app/components/variants/coordinates-c
import { NzSpaceModule } from 'ng-zorro-antd/space'
import { CvcFeatureTagModule } from '@app/components/features/feature-tag/feature-tag.module'
import { CvcFeatureVariantTagModule } from '@app/components/shared/feature-variant-tag/feature-variant-tag.module'
import { CvcMolecularProfileGeneVariantCardComponent } from './molecular-profile-gene-variant-card.component'

@NgModule({
declarations: [CvcMolecularProfileVariantCardComponent],
declarations: [CvcMolecularProfileGeneVariantCardComponent],
imports: [
CommonModule,
RouterModule,
Expand All @@ -44,8 +44,8 @@ import { CvcFeatureVariantTagModule } from '@app/components/shared/feature-varia
CvcTagListModule,
CvcMolecularProfileTagModule,
CvcCoordinatesCardModule,
CvcFeatureVariantTagModule
CvcFeatureVariantTagModule,
],
exports: [CvcMolecularProfileVariantCardComponent],
exports: [CvcMolecularProfileGeneVariantCardComponent],
})
export class CvcMolecularProfileVariantCardModule {}
export class CvcMolecularProfileGeneVariantCardModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fragment revisionPopover on Revision {
id
link
name
... on Variant {
... on VariantInterface {
deprecated
feature {
id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<ng-container *ngIf="this.cvcVariantId && (variant$ | ngrxPush) as variant">
@if(variant.__typename == "GeneVariant") {
<ng-container
*ngTemplateOutlet="coordinateCard; context: { $implicit: variant }">
</ng-container>
}
</ng-container>
<ng-container *ngIf="this.cvcCoordinates">
<ng-container
Expand Down Expand Up @@ -86,8 +88,13 @@
<nz-descriptions-item
nzTitle="Transcript"
nzColumn="5">
<cvc-link-tag *ngIf="coords.representativeTranscript" tooltip="View on Ensembl"
[href]="'http://www.ensembl.org/Homo_sapiens/transview?transcript=' + coords.representativeTranscript">
<cvc-link-tag
*ngIf="coords.representativeTranscript"
tooltip="View on Ensembl"
[href]="
'http://www.ensembl.org/Homo_sapiens/transview?transcript=' +
coords.representativeTranscript
">
{{ coords.representativeTranscript }}
</cvc-link-tag>
<ng-container *ngIf="!coords.representativeTranscript">
Expand Down Expand Up @@ -131,8 +138,13 @@
<nz-descriptions-item
nzTitle="Transcript"
nzColumn="5">
<cvc-link-tag *ngIf="coords.representativeTranscript" tooltip="View on Ensembl"
[href]="'http://www.ensembl.org/Homo_sapiens/transview?transcript=' + coords.representativeTranscript">
<cvc-link-tag
*ngIf="coords.representativeTranscript"
tooltip="View on Ensembl"
[href]="
'http://www.ensembl.org/Homo_sapiens/transview?transcript=' +
coords.representativeTranscript
">
{{ coords.representativeTranscript }}
</cvc-link-tag>
<ng-container *ngIf="!coords.representativeTranscript">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
CoordinatesCardQuery,
CoordinatesCardQueryVariables,
Maybe,
Variant,
} from '@app/generated/civic.apollo'
import { QueryRef } from 'apollo-angular'
import { Observable } from 'rxjs'
Expand Down
Loading

0 comments on commit 3dc67d0

Please sign in to comment.