Skip to content

Commit

Permalink
Merge pull request #1151 from griffithlab/tables-fix
Browse files Browse the repository at this point in the history
hotfix for a couple of browse table issues
  • Loading branch information
acoffman authored Nov 4, 2024
2 parents 838e3ef + 478f83c commit c1a6161
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class CvcPhenotypesTableComponent implements OnInit {

// entity relay connection
this.connection$ = this.result$.pipe(
pluck('data', 'phenotypes'),
pluck('data', 'browsePhenotypes'),
filter(isNonNulled)
) as Observable<BrowsePhenotypeConnection>

Expand Down Expand Up @@ -195,7 +195,10 @@ export class CvcPhenotypesTableComponent implements OnInit {
this.cdr.detectChanges()
}

trackByIndex(_: number, data: Maybe<PhenotypeBrowseTableRowFieldsFragment>): Maybe<number> {
trackByIndex(
_: number,
data: Maybe<PhenotypeBrowseTableRowFieldsFragment>
): Maybe<number> {
return data?.id
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class CvcTherapiesTableComponent implements OnInit {
) // skip 1st true/false sequence

this.connection$ = this.result$.pipe(
pluck('data', 'therapies'),
pluck('data', 'browseTherapies'),
filter(isNonNulled)
) as Observable<BrowseTherapyConnection>

Expand Down
16 changes: 14 additions & 2 deletions client/src/app/graphql/graphql.type-policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ export const CvcTypePolicies: StrictTypedTypePolicies = {
'status',
'submitterId',
]),
browseDiseases: relayStylePagination(['name', 'doid', 'geneNames', 'id']),
browseTherapies: relayStylePagination([
'name',
'ncitId',
'therapyAlias',
'sortBy',
]),
events: relayStylePagination([
'subject',
'organizationId',
Expand Down Expand Up @@ -141,8 +146,15 @@ export const CvcTypePolicies: StrictTypedTypePolicies = {
'resolvingUserId',
'state',
]),
phenotypes: relayStylePagination(['hpoId', 'name', 'id']),
browsePhenotypes: relayStylePagination(['hpoId', 'name', 'sortBy']),
variantTypes: relayStylePagination(['soid', 'name', 'id']),
browseDiseases: relayStylePagination([
'name',
'doid',
'diseaseAlias',
'featureName',
'sortBy',
]),
therapies: relayStylePagination(['ncitId', 'name', 'id']),
clinicalTrials: relayStylePagination(['nctId', 'name', 'id']),
notifications: relayStylePagination([
Expand Down

0 comments on commit c1a6161

Please sign in to comment.