Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Dec 1, 2023
2 parents 4fda087 + 6a76ffc commit c2d981e
Show file tree
Hide file tree
Showing 138 changed files with 3,033 additions and 2,106 deletions.
6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@apollo/client": "^3.7.17",
"@ngneat/until-destroy": "^9.1.2",
"@ngrx/component": "^16.1.0",
"@ngx-formly/core": "^6.1.8",
"@ngx-formly/ng-zorro-antd": "^6.1.8",
"@ngx-formly/core": "^6.2.2",
"@ngx-formly/ng-zorro-antd": "^6.2.2",
"apollo-angular": "^5.0.0",
"ng-zorro-antd": "^16.1.0",
"ngx-cookie-service": "^16.0.0",
Expand Down Expand Up @@ -79,4 +79,4 @@
"error-stack-parser": "2.0.6"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ export class CvcViewerButtonComponent implements OnInit {
)
}
this.addVariantModalVisible$ = new BehaviorSubject<boolean>(false)
this.addVariantModalVisible$
.pipe(tag('addVariantModalVisible$'))
.subscribe()
}

ngOnInit(): void {
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/core/utilities/get-entity-color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ export const EntityColors = new Map<string, string>([
['Event', '#1db8a9'],
['EvidenceItem', '#2a63b6'],
['Gene', '#07aff0'],
['Therapy', '#ac3996'],
['MolecularProfile', '#33b358'],
['NccnGuideline', '#49566D'],
['Phenotype', '#1db8a9'],
['Source', '#f9ba45'],
['Therapy', '#ac3996'],
['Variant', '#74d34c'],
['VariantGroup', '#74d34c'],
['VariantType', '#74d34c'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<cvc-comment-input-form [(comment)]="comment"></cvc-comment-input-form>
<nz-spin
nzTip="Submitting"
[nzSpinning]="this.loading">
[nzSpinning]="this.mutationLoading$ | ngrxPush">
<nz-form-item>
<nz-form-control>
<ng-container *ngrxLet="viewer$ as viewer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
EvidenceCountsForMolecularProfileGQL,
Organization,
} from '@app/generated/civic.apollo'
import { Observable, Subject } from 'rxjs'
import { BehaviorSubject, Observable, Subject } from 'rxjs'
import { NetworkErrorsService } from '@app/core/services/network-errors.service'
import { MutatorWithState } from '@app/core/utilities/mutation-state-wrapper'
import { ActivatedRoute } from '@angular/router'
Expand All @@ -42,15 +42,15 @@ export class ComplexMolecularProfileDeprecateForm implements OnDestroy, OnInit {

success: boolean = false
errorMessages: string[] = []
loading: boolean = false
mutationLoading$ = new BehaviorSubject(false)

viewer$: Observable<Viewer>

comment: string = ''
reason: Maybe<MolecularProfileDeprecationReasonMutationInput>
selectedOrg: Maybe<Organization>

hasEvidence$?: Observable<Boolean>
hasEvidence$?: Observable<boolean>
isLoading$?: Observable<boolean>

constructor(
Expand Down Expand Up @@ -98,6 +98,8 @@ export class ComplexMolecularProfileDeprecateForm implements OnDestroy, OnInit {
organizationId: this.selectedOrg?.id,
}

this.mutationLoading$.next(true)

let state = this.deprecateComplexMolecularProfileMutator.mutate(
this.deprecateComplexMolecularProfileGQL,
input,
Expand All @@ -115,20 +117,16 @@ export class ComplexMolecularProfileDeprecateForm implements OnDestroy, OnInit {
if (res) {
this.success = true
this.comment = ''
this.mutationLoading$.next(false)
}
})

state.submitError$.pipe(takeUntil(this.destroy$)).subscribe((res) => {
if (res.length > 0) {
this.errorMessages = res
this.mutationLoading$.next(false)
}
})

state.isSubmitting$
.pipe(takeUntil(this.destroy$))
.subscribe((loading) => {
this.loading = loading
})
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
<nz-tag
[nzMode]="'closeable'"
(nzOnClose)="cvcOnClose.next($event)">
<span *ngIf="entity && entity.tooltip; else noTooltip"
nz-tooltip [nzTooltipTitle]="entity.tooltip">
<ng-template [ngTemplateOutlet]="tagContent"> </ng-template>
<span
*ngIf="entity && entity.tooltip; else noTooltip"
nz-tooltip
[nzTooltipTitle]="entity.tooltip">
<ng-template [ngTemplateOutlet]="tagContent"> </ng-template>
</span>
</nz-tag>
</span>
Expand All @@ -39,9 +41,11 @@
<span
*ngIf="cvcContext === 'multi-select-item'"
class="multi-select-item">
<span *ngIf="entity && entity.tooltip; else noTooltip"
nz-tooltip [nzTooltipTitle]="entity.tooltip">
<ng-template [ngTemplateOutlet]="tagContent"> </ng-template>
<span
*ngIf="entity && entity.tooltip; else noTooltip"
nz-tooltip
[nzTooltipTitle]="entity.tooltip">
<ng-template [ngTemplateOutlet]="tagContent"> </ng-template>
</span>
</span>

Expand All @@ -55,7 +59,9 @@
</ng-template>

<ng-template #popoverContent>
<cvc-entity-tag-popover *ngIf="this.popoverInput" [entity]="this.popoverInput"></cvc-entity-tag-popover>
<cvc-entity-tag-popover
*ngIf="this.popoverInput"
[entity]="this.popoverInput"></cvc-entity-tag-popover>
</ng-template>

<!-- tag contents, just the tag icon and label, used by the context templates above-->
Expand All @@ -71,7 +77,7 @@
</a>
<ng-template #tagLabel>
<span
*ngIf="typename; else noIcon"
*ngIf="typename && cvcShowIcon; else noIcon"
nz-icon
[nzType]="typename | typenameToIcon"
nzTheme="twotone"
Expand All @@ -88,12 +94,9 @@
<ng-template [ngTemplateOutlet]="noIcon"></ng-template>
CACHE-MISS ({{ cvcCacheId }})
</ng-template>

<ng-template #noIcon>
<span
nz-icon
class="tag-icon"
nzType="question-circle"
nzTheme="outline"></span>
<span class="tag-no-icon"></span>
</ng-template>
</ng-template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ nz-tag {
padding: 3px 2px 3px 4px;
margin: -3px 0 -3px 0;
}
.tag-no-icon {
display: inline-block;
width: 4px;
}
.tag-label {
display: inline-block;
font-weight: normal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export type LinkableEntity = {
export const isLinkableEntity: TypeGuard<any, LinkableEntity> = (
entity: any
): entity is LinkableEntity =>
entity !== undefined && entity.__typename && entity.id && entity.name !== undefined
entity !== undefined &&
entity.__typename &&
entity.id &&
entity.name !== undefined

export type CvcTagLabelMax =
| '50px'
Expand Down Expand Up @@ -100,6 +103,7 @@ export class CvcEntityTagComponent implements OnChanges {
@Input() cvcHasTooltip: boolean = false
@Input() cvcFullWidth: boolean = false
@Input() cvcShowPopover: boolean = false
@Input() cvcShowIcon: boolean = true
@Input() cvcTruncateLabel?: CvcTagLabelMax

@Output() cvcTagCheckedChange: EventEmitter<boolean> =
Expand Down Expand Up @@ -143,7 +147,7 @@ export class CvcEntityTagComponent implements OnChanges {
}
// get linkable entity
let fragment = undefined
if(!this.cvcDisableLink) {
if (!this.cvcDisableLink) {
fragment = {
id: `${typename}:${id}`,
fragment: gql`
Expand All @@ -154,7 +158,7 @@ export class CvcEntityTagComponent implements OnChanges {
}
`,
}
} else if(this.cvcHasTooltip) {
} else if (this.cvcHasTooltip) {
fragment = {
id: `${typename}:${id}`,
fragment: gql`
Expand All @@ -165,8 +169,7 @@ export class CvcEntityTagComponent implements OnChanges {
}
`,
}
}
else{
} else {
fragment = {
id: `${typename}:${id}`,
fragment: gql`
Expand All @@ -176,8 +179,6 @@ export class CvcEntityTagComponent implements OnChanges {
}
`,
}


}
const entity = this.apollo.client.readFragment(fragment)
if (!isLinkableEntity(entity)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { CvcPipesModule } from '@app/core/pipes/pipes.module';
import { FormlyModule } from '@ngx-formly/core';
import { FormlyNzFormFieldModule } from '@ngx-formly/ng-zorro-antd/form-field';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzInputModule } from 'ng-zorro-antd/input';
Expand All @@ -18,7 +17,6 @@ import { CvcEnumSelectComponent } from './enum-select.component';
CommonModule,
ReactiveFormsModule,
FormlyModule.forChild(),
FormlyNzFormFieldModule,
NzIconModule,
NzFormModule,
NzSelectModule,
Expand Down

This file was deleted.

Loading

0 comments on commit c2d981e

Please sign in to comment.