Skip to content

Commit

Permalink
Merge pull request #623 from griffithlab/oncogenic-release
Browse files Browse the repository at this point in the history
Add Support for Oncogenic Assertions and updated Oncogenic/Predisposing data model.
  • Loading branch information
susannasiebert authored Sep 13, 2022
2 parents 4e616f0 + 289d8e3 commit 1d3ea49
Show file tree
Hide file tree
Showing 225 changed files with 12,110 additions and 14,000 deletions.
51 changes: 51 additions & 0 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "cvc",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "cvc",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
10 changes: 5 additions & 5 deletions client/.graphqlrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ extensions:
config:
apolloClientVersion: 3
nonOptionalTypename: true
futureProofUnions: true
futureProofEnums: true
futureProofUnions: false
futureProofEnums: false
maybeValue: T | undefined
./src/app/generated/server.possible-types.ts:
./src/app/generated/civic.possible-types.ts:
plugins:
- fragment-matcher
config:
apolloClientVersion: 2
./src/app/generated/server.field-policies.ts:
apolloClientVersion: 3
./src/app/generated/civic.apollo-helpers.ts:
plugins:
- typescript-apollo-client-helpers
config:
Expand Down
12 changes: 11 additions & 1 deletion client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "yarn"
"packageManager": "yarn",
"defaultCollection": "@angular-eslint/schematics"
},
"newProjectRoot": "lib",
"projects": {
Expand Down Expand Up @@ -138,6 +139,15 @@
"devServerTarget": "main:serve:production"
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
Expand Down
82 changes: 46 additions & 36 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build": "ng build --build-optimizer",
"build:stats": "ng build --stats-json",
"analyze": "webpack-bundle-analyzer ../server/public/stats.json",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
Expand All @@ -14,68 +16,77 @@
"generate-apollo:start": "graphql-codegen --watch"
},
"private": true,
"resolutions": {
"error-stack-parser": "2.0.6"
},
"dependencies": {
"@angular/animations": "~13.1.3",
"@angular/common": "~13.1.3",
"@angular/compiler": "~13.1.3",
"@angular/core": "~13.1.3",
"@angular/forms": "~13.1.3",
"@angular/platform-browser": "~13.1.3",
"@angular/platform-browser-dynamic": "~13.1.3",
"@angular/router": "~13.1.3",
"@angular/animations": "~13.3.11",
"@angular/common": "~13.3.11",
"@angular/compiler": "~13.3.11",
"@angular/core": "~13.3.11",
"@angular/forms": "~13.3.11",
"@angular/platform-browser": "~13.3.11",
"@angular/platform-browser-dynamic": "~13.3.11",
"@angular/router": "~13.3.11",
"@apollo/client": "^3.5.8",
"@ngneat/until-destroy": "^9.1.2",
"@ngrx/component": "^12.5.1",
"@ngx-formly/core": "^5.10.32",
"@ngx-formly/ng-zorro-antd": "^0.0",
"apollo-angular": "^2.1.0",
"ng-zorro-antd": "^13.0.1",
"apollo-angular": "^3.0.1",
"ng-zorro-antd": "^13.3.2",
"ngx-cookie-service": "^13.1.2",
"ngx-logger": "^5.0.7",
"ngx-timeago": "^2.0.0",
"rxjs": "~6.6.6",
"rxjs": "^6.5.3",
"rxjs-debug": "^1.3.0",
"rxjs-etc": "^10.6.2",
"rxjs-spy": "^7.5.3",
"ts-enum-util": "^4.0.2",
"tslib": "^2.3.1",
"xstate": "^4.30.3",
"xstate-angular": "^0.0.2",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.1.4",
"@angular-eslint/eslint-plugin": "^1.0.0",
"@angular-eslint/eslint-plugin-template": "^1.0.0",
"@angular-eslint/template-parser": "^1.0.0",
"@angular/cli": "^13.1.4",
"@angular/compiler-cli": "13.1.3",
"@angular-devkit/build-angular": "~13.3.8",
"@angular-eslint/builder": "13.2.1",
"@angular-eslint/eslint-plugin": "13.2.1",
"@angular-eslint/eslint-plugin-template": "13.2.1",
"@angular-eslint/schematics": "13.2.1",
"@angular-eslint/template-parser": "13.2.1",
"@angular/cli": "^13.3.8",
"@angular/compiler-cli": "13.3.11",
"@angular/language-server": "^13.1.1",
"@graphql-codegen/add": "^2.0.2",
"@graphql-codegen/cli": "1.20.0",
"@graphql-codegen/fragment-matcher": "^2.0.1",
"@graphql-codegen/introspection": "^1.18.1",
"@graphql-codegen/typescript": "1.20.0",
"@graphql-codegen/typescript-apollo-angular": "2.2.1",
"@graphql-codegen/typescript-apollo-client-helpers": "^1.1.3",
"@graphql-codegen/typescript-operations": "^1.17.13",
"@graphql-eslint/eslint-plugin": "^0.7.1",
"@graphql-inspector/cli": "^2.3.0",
"@graphql-codegen/add": "3.1.1",
"@graphql-codegen/cli": "2.6.2",
"@graphql-codegen/fragment-matcher": "3.2.1",
"@graphql-codegen/introspection": "2.1.1",
"@graphql-codegen/typescript": "2.4.10",
"@graphql-codegen/typescript-apollo-angular": "3.4.9",
"@graphql-codegen/typescript-apollo-client-helpers": "2.1.17",
"@graphql-codegen/typescript-operations": "2.3.7",
"@graphql-eslint/eslint-plugin": "3.10.3",
"@graphql-inspector/cli": "3.1.2",
"@ngx-formly/schematics": "^5.10.30",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@typescript-eslint/eslint-plugin": "5.17.0",
"@typescript-eslint/eslint-plugin-tslint": "^4.13.0",
"@typescript-eslint/parser": "^4.13.0",
"@typescript-eslint/parser": "5.17.0",
"casual": "^1.6.2",
"codelyzer": "^6.0.0",
"eslint": "^7.20.0",
"eslint": "^8.12.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^31.0.3",
"eslint-plugin-prefer-arrow": "^1.2.2",
"express": "^4.17.2",
"express-graphql": "^0.12.0",
"graphql": "^15.4.0",
"graphql": "16.4.0",
"graphql-cli": "^4.1.0",
"graphql-config": "^3.2.0",
"graphql-mock": "^1.3.0",
"graphql-schema-linter": "^2.0.1",
"graphql-config": "4.3.0",
"graphql-mock": "2.0.0",
"graphql-schema-linter": "3.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.16",
Expand All @@ -87,7 +98,6 @@
"patch-package": "^6.4.7",
"prettier": "^2.5.1",
"protractor": "~7.0.0",
"rxjs-spy": "^7.5.3",
"svg-to-ts": "^6.0.0",
"svgo": "^2.3.0",
"ts-node": "~8.3.0",
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare let gtag: Function;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
styleUrls: ['./app.component.less'],
})

export class AppComponent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, Input, OnInit } from "@angular/core";
import { AssertionBrowseTableRowFieldsFragment } from "@app/generated/civic.apollo";
import { AssertionBrowseFieldsFragment } from "@app/generated/civic.apollo";

@Component({
selector: 'cvc-assertion-card',
templateUrl: './assertion-card.component.html',
styleUrls: ['./assertion-card.component.less']
})
export class CvcAssertionCardComponent implements OnInit {
@Input() assertion!: AssertionBrowseTableRowFieldsFragment;
@Input() assertion!: AssertionBrowseFieldsFragment;

ngOnInit(){
if(this.assertion == undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{{ assertion.variantOrigin | evidenceEnumDisplay }}
</nz-descriptions-item>

<nz-descriptions-item *ngIf="assertion.assertionType == 'PREDISPOSING' else ampLevel" nzTitle="ACMG Codes" nzSpan="2">
<nz-descriptions-item *ngIf="assertionRules.requiresAcmgCodes(assertion.assertionType)" nzTitle="ACMG Codes" nzSpan="2">
<ng-container *ngIf="assertion.acmgCodes.length > 0; else noAcmg">
<nz-tag nz-tooltip [nzTooltipTitle]="code.description" *ngFor="let code of assertion.acmgCodes">{{ code.code }}</nz-tag>
</ng-container>
Expand All @@ -55,11 +55,18 @@
</ng-template>
</nz-descriptions-item>

<ng-template #ampLevel>
<nz-descriptions-item nzTitle="AMP/ASCO/CAP Category">
{{ assertion.ampLevel | formatAmp: 'compact' | ifEmpty: '--' }}
</nz-descriptions-item>
</ng-template>
<nz-descriptions-item *ngIf="assertionRules.requiresClingenCodes(assertion.assertionType)" nzTitle="ClinGen/CGC/VICC Codes" nzSpan="2">
<ng-container *ngIf="assertion.clingenCodes.length > 0; else noClingen">
<nz-tag nz-tooltip [nzTooltipTitle]="code.description" *ngFor="let code of assertion.clingenCodes">{{ code.code }}</nz-tag>
</ng-container>
<ng-template #noClingen>
--
</ng-template>
</nz-descriptions-item>

<nz-descriptions-item *ngIf="assertionRules.requiresAmpLevel(assertion.assertionType)" nzTitle="AMP/ASCO/CAP Category">
{{ assertion.ampLevel | formatAmp: 'compact' | ifEmpty: '--' }}
</nz-descriptions-item>

<nz-descriptions-item nzTitle="Regulatory Approval">
<i nz-icon *ngIf="assertion.regulatoryApproval" nzType="check-circle" nzTheme="twotone" nzTwotoneColor="#52c41a"></i>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Component, Input, OnInit } from "@angular/core";
import { AssertionPopoverFragment, AssertionPopoverGQL, Maybe } from "@app/generated/civic.apollo";
import { map } from 'rxjs/operators'
import { filter, map } from 'rxjs/operators'
import { Observable } from 'rxjs';
import { isNonNulled } from "rxjs-etc";
import { AssertionState } from "@app/forms/config/states/assertion.state";

@Component({
selector: 'cvc-assertion-popover',
Expand All @@ -13,6 +15,8 @@ export class CvcAssertionPopoverComponent implements OnInit {

assertion$?: Observable<Maybe<AssertionPopoverFragment>>

assertionRules = new AssertionState()

constructor(private gql: AssertionPopoverGQL) { }

ngOnInit() {
Expand All @@ -21,6 +25,8 @@ export class CvcAssertionPopoverComponent implements OnInit {
}
this.assertion$ = this.gql.watch({ assertionId: this.assertionId })
.valueChanges
.pipe(map(({ data }) => data.assertion))
.pipe(map(r => r.data),
filter(isNonNulled),
map(({ assertion }) => assertion));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ fragment assertionPopover on Assertion {
code
description
}
clingenCodes {
code
description
}
nccnGuideline {
id
name
Expand Down
Loading

0 comments on commit 1d3ea49

Please sign in to comment.