Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,17 @@
<cvc-empty-value cvcEmptyCategory="unspecified"></cvc-empty-value>
}
</nz-descriptions-item>

<nz-descriptions-item nzTitle="Therapies">
@if (activity().sourceSuggestion.therapies.length > 0) {
@for (therapy of activity().sourceSuggestion.therapies; track therapy.id) {
<cvc-therapy-tag
[therapy]="therapy"
[truncateLongName]="true"></cvc-therapy-tag>
}
} @else {
<cvc-empty-value cvcEmptyCategory="unspecified"></cvc-empty-value>
}
</nz-descriptions-item>
</nz-descriptions>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ import { SuggestSourceActivityDetailFragment } from '@app/generated/civic.apollo
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions'
import { NzTagModule } from 'ng-zorro-antd/tag'
import { CvcEmptyValueModule } from '@app/forms/components/empty-value/empty-value.module'
import { CvcTherapyTagModule } from '@app/components/therapies/cvc-therapy-tag/cvc-therapy-tag.module'

@Component({
selector: 'cvc-suggest-source-activity-details',
imports: [NzDescriptionsModule, NzTagModule, CvcEmptyValueModule],
imports: [
NzDescriptionsModule,
NzTagModule,
CvcEmptyValueModule,
CvcTherapyTagModule,
],
templateUrl: './suggest-source-activity.component.html',
styleUrl: './suggest-source-activity.component.less',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ fragment SuggestSourceActivityDetail on SuggestSourceActivity {
link
deprecated
}
therapies {
id
name
link
deprecated
}
}
...ActivityFeedItemBase
...ActivityFeedItemEvents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
[nzSortFn]="true">
Disease
</th>
<th nzWidth="220px">Therapies</th>
<th
nzWidth="90px"
[nzColumnKey]="sortColumns.CreatedAt"
Expand Down Expand Up @@ -186,6 +187,14 @@
filterChange$.next()
"></cvc-clearable-input-filter>
</th>
<th>
<cvc-clearable-input-filter
[(inputModel)]="therapyNameInput"
placeholderText="Therapy"
(inputModelChange)="
filterChange$.next()
"></cvc-clearable-input-filter>
</th>
<th></th>
<th nzRight></th>
</tr>
Expand Down Expand Up @@ -296,6 +305,15 @@
[disease]="suggestion.disease"
[truncateLongName]="true"></cvc-disease-tag>
</td>
<td>
<ng-container *ngIf="suggestion.therapies.length > 0">
<ng-container *ngFor="let therapy of suggestion.therapies">
<cvc-therapy-tag
[therapy]="therapy"
[truncateLongName]="true"></cvc-therapy-tag>
</ng-container>
</ng-container>
</td>
<td nzAlign="right">
{{ suggestion.createdAt | date }}
</td>
Expand All @@ -311,6 +329,7 @@
molecularProfileId: suggestion.molecularProfile?.id,
sourceId: suggestion.source?.id,
diseaseId: suggestion.disease?.id,
therapyIds: getTherapyIdsQueryParam(suggestion),
}"
[disabled]="suggestion.status != status.New"
nz-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface SourceSuggestionTableFilters {
citationInput?: Maybe<string>
commentInput?: Maybe<string>
diseaseNameInput?: Maybe<string>
therapyNameInput?: Maybe<string>
molecularProfileNameInput?: Maybe<string>
sourceIdInput?: Maybe<number>
sourceTypeInput?: Maybe<SourceSource>
Expand Down Expand Up @@ -104,6 +105,7 @@ export class CvcSourceSuggestionsTableComponent implements OnInit {
sourceIdInput: Maybe<number>
molecularProfileNameInput: Maybe<string>
diseaseNameInput: Maybe<string>
therapyNameInput: Maybe<string>
commentInput: Maybe<string>
submitterInput: Maybe<string>
citationInput: Maybe<string>
Expand Down Expand Up @@ -239,6 +241,7 @@ export class CvcSourceSuggestionsTableComponent implements OnInit {
sourceId: this.sourceIdInput ? +this.sourceIdInput : undefined,
molecularProfileName: this.molecularProfileNameInput,
diseaseName: this.diseaseNameInput,
therapyName: this.therapyNameInput,
comment: this.commentInput,
submitter: this.submitterInput,
citation: this.citationInput,
Expand All @@ -262,6 +265,12 @@ export class CvcSourceSuggestionsTableComponent implements OnInit {
this.showManageForm = false
}

getTherapyIdsQueryParam(
suggestion: Maybe<BrowseSourceSuggestionRowFieldsFragment>
): string {
return JSON.stringify(suggestion?.therapies.map((t) => t.id) || [])
}

// virtual scroll helpers
trackByIndex(_: number, data: Maybe<BrowseSourceSuggestionRowFieldsFragment>): Maybe<number> {
return data?.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CvcNoMoreRowsModule } from '@app/components/shared/no-more-rows/no-more
import { CvcTableCountsModule } from '@app/components/shared/table-counts/table-counts.module'
import { CvcTableDownloaderComponent } from '@app/components/shared/table-downloader/table-downloader.component'
import { CvcSourceTagModule } from '@app/components/sources/source-tag/source-tag.module'
import { CvcTherapyTagModule } from '@app/components/therapies/cvc-therapy-tag/cvc-therapy-tag.module'
import { CvcUserTagModule } from '@app/components/users/user-tag/user-tag.module'
import { CvcPipesModule } from '@app/core/pipes/pipes.module'
import { CvcAutoHeightCardModule } from '@app/directives/auto-height-card/auto-height-card.module'
Expand Down Expand Up @@ -58,6 +59,7 @@ import { NzSpaceCompactComponent } from 'ng-zorro-antd/space'
CvcFormErrorsAlertModule,
CvcPipesModule,
CvcSourceTagModule,
CvcTherapyTagModule,
CvcUpdateSourceSuggestionFormModule,
CvcUserTagModule,
CvcMolecularProfileTagModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ query BrowseSourceSuggestions(
$sourceId: Int
$molecularProfileName: String
$diseaseName: String
$therapyName: String
$comment: String
$submitter: String
$citation: String
Expand All @@ -26,6 +27,7 @@ query BrowseSourceSuggestions(
sourceId: $sourceId
molecularProfileName: $molecularProfileName
diseaseName: $diseaseName
therapyName: $therapyName
comment: $comment
submitter: $submitter
citation: $citation
Expand Down Expand Up @@ -64,6 +66,12 @@ fragment BrowseSourceSuggestionRowFields on SourceSuggestion {
link
deprecated
}
therapies {
id
name
link
deprecated
}
source {
link
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ const formFieldConfig: FormlyFieldConfig[] = [
type: 'disease-select',
props: {},
},
{
key: 'therapyIds',
type: 'therapy-multi-select',
props: {
required: false,
requireType: false,
description:
'Select one or more Therapies for this Source Suggestion, if applicable.',
},
},
{
key: 'sourceId',
type: 'source-select',
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/forms/models/source-fields.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export type SourceFields = {
molecularProfileId?: number
sourceId?: number
diseaseId?: number
}
therapyIds?: number[]
}
3 changes: 2 additions & 1 deletion client/src/app/forms/utilities/source-to-model-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export function sourceFormModelToInput(model: SourceModel): Maybe<SuggestSourceI
sourceId: fields.sourceId!,
molecularProfileId: fields.molecularProfileId,
diseaseId: fields.diseaseId,
therapyIds: fields.therapyIds || [],
organizationId: model.organizationId,
comment: model.comment!
}
}
}
3 changes: 2 additions & 1 deletion client/src/app/generated/civic.apollo-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ export type SourceStubFieldPolicy = {
id?: FieldPolicy<any> | FieldReadFunction<any>,
sourceType?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SourceSuggestionKeySpecifier = ('createdAt' | 'creationActivity' | 'disease' | 'events' | 'id' | 'initialComment' | 'lastStatusUpdateActivity' | 'link' | 'molecularProfile' | 'name' | 'reason' | 'source' | 'status' | 'user' | SourceSuggestionKeySpecifier)[];
export type SourceSuggestionKeySpecifier = ('createdAt' | 'creationActivity' | 'disease' | 'events' | 'id' | 'initialComment' | 'lastStatusUpdateActivity' | 'link' | 'molecularProfile' | 'name' | 'reason' | 'source' | 'status' | 'therapies' | 'user' | SourceSuggestionKeySpecifier)[];
export type SourceSuggestionFieldPolicy = {
createdAt?: FieldPolicy<any> | FieldReadFunction<any>,
creationActivity?: FieldPolicy<any> | FieldReadFunction<any>,
Expand All @@ -2510,6 +2510,7 @@ export type SourceSuggestionFieldPolicy = {
reason?: FieldPolicy<any> | FieldReadFunction<any>,
source?: FieldPolicy<any> | FieldReadFunction<any>,
status?: FieldPolicy<any> | FieldReadFunction<any>,
therapies?: FieldPolicy<any> | FieldReadFunction<any>,
user?: FieldPolicy<any> | FieldReadFunction<any>
};
export type SourceSuggestionConnectionKeySpecifier = ('edges' | 'filteredCount' | 'lastUpdated' | 'nodes' | 'pageCount' | 'pageInfo' | 'totalCount' | SourceSuggestionConnectionKeySpecifier)[];
Expand Down
34 changes: 26 additions & 8 deletions client/src/app/generated/civic.apollo.ts

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions client/src/app/generated/client.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -51214,6 +51214,18 @@
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "therapyName",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
Expand Down Expand Up @@ -60073,6 +60085,30 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "therapies",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"name": null,
"kind": "LIST",
"ofType": {
"name": null,
"kind": "NON_NULL",
"ofType": {
"name": "Therapy",
"kind": "OBJECT",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "user",
"description": null,
Expand Down Expand Up @@ -63951,6 +63987,30 @@
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "therapyIds",
"description": "List of IDs of CIViC Therapy entries for this Source Suggestion. An empty list indicates none.",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"name": null,
"kind": "LIST",
"ofType": {
"name": null,
"kind": "NON_NULL",
"ofType": {
"name": "Int",
"kind": "SCALAR",
"ofType": null
}
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
Expand Down
7 changes: 7 additions & 0 deletions client/src/app/generated/server.model.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10849,6 +10849,7 @@ type Query {
status: SourceSuggestionStatus
submitter: String
submitterId: Int
therapyName: String
): SourceSuggestionConnection!

"""
Expand Down Expand Up @@ -12780,6 +12781,7 @@ type SourceSuggestion implements EventOriginObject & EventSubject {
reason: String
source: Source
status: SourceSuggestionStatus!
therapies: [Therapy!]!
user: User
}

Expand Down Expand Up @@ -13879,6 +13881,11 @@ input SuggestSourceInput {
Internal CIViC ID for the source to suggest. Use the AddRemoteCitation mutation to populate this if needed.
"""
sourceId: Int!

"""
List of IDs of CIViC Therapy entries for this Source Suggestion. An empty list indicates none.
"""
therapyIds: [Int!]!
}

"""
Expand Down
Loading
Loading