Skip to content

Commit

Permalink
Fix type issues after client update
Browse files Browse the repository at this point in the history
  • Loading branch information
alisman committed Jun 6, 2022
1 parent 188b007 commit 9f3a59a
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 34 deletions.
5 changes: 1 addition & 4 deletions end-to-end-test/remote/specs/core/results.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@ describe('Results Page', function() {
var url = `${CBIOPORTAL_URL}/results/mutations?tab_index=tab_visualize&cancer_study_list=ov_tcga_pub&cancer_study_id=ov_tcga_pub&genetic_profile_ids_PROFILE_MUTATION_EXTENDED=ov_tcga_pub_mutations&Z_SCORE_THRESHOLD=2.0&case_set_id=ov_tcga_pub_3way_complete&gene_list=TP53+PTEN&gene_set_choice=user-defined-list&Action=Submit`;
browser.url(url);
$('[data-test=view3DStructure]').waitForExist({
timeout: 10000,
});
$('[data-test=view3DStructure]').waitForEnabled({
timeout: 10000,
timeout: 20000,
});
$('[data-test=oncogenic-icon-image]').waitForDisplayed({
timeout: 10000,
Expand Down
6 changes: 2 additions & 4 deletions src/AppStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from 'cbioportal-frontend-commons';
import { getLoadConfig, getServerConfig } from './config/config';
import _ from 'lodash';
import internalClient from 'shared/api/cbioportalInternalClientInstance';
import client from 'shared/api/cbioportalClientInstance';
import { sendSentryMessage } from './shared/lib/tracking';

export type SiteError = {
Expand Down Expand Up @@ -96,9 +96,7 @@ export class AppStore {

readonly portalVersion = remoteData<string | undefined>({
invoke: async () => {
const portalVersionResult = await internalClient.getInfoUsingGET(
{}
);
const portalVersionResult = await client.getInfoUsingGET({});
if (portalVersionResult && portalVersionResult.portalVersion) {
let version = undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
ResourceData,
Sample,
SampleMolecularIdentifier,
StructuralVariantFilter,
GenericAssayData,
GenericAssayMeta,
GenericAssayDataMultipleStudyFilter,
Expand Down Expand Up @@ -200,6 +199,7 @@ import {
} from 'shared/lib/GenericAssayUtils/MutationalSignaturesUtils';
import { getServerConfig } from 'config/config';
import { getOncoKbIconStyle } from 'shared/lib/AnnotationColumnUtils';
import { StructuralVariantFilter } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

type PageMode = 'patient' | 'sample';
type ResourceId = string;
Expand Down Expand Up @@ -613,7 +613,7 @@ export class PatientViewPageStore {
.value();

if (mutationalSignatureContributionStableIds.length > 0) {
return client.fetchGenericAssayMetaDataUsingPOST({
return client.fetchGenericAssayMetaUsingPOST({
genericAssayMetaFilter: {
genericAssayStableIds: mutationalSignatureContributionStableIds,
} as GenericAssayMetaFilter,
Expand Down Expand Up @@ -1615,7 +1615,7 @@ export class PatientViewPageStore {
}),
} as StructuralVariantFilter;

return client.fetchStructuralVariantsUsingPOST({
return internalClient.fetchStructuralVariantsUsingPOST({
structuralVariantFilter,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { PatientViewPageStore } from '../clinicalInformation/PatientViewPageStor
import LazyMobXTable, {
Column,
} from 'shared/components/lazyMobXTable/LazyMobXTable';
import { StructuralVariant } from 'cbioportal-ts-api-client';
import TumorColumnFormatter from '../mutation/column/TumorColumnFormatter';
import HeaderIconMenu from '../mutation/HeaderIconMenu';
import GeneFilterMenu from '../mutation/GeneFilterMenu';
Expand All @@ -26,6 +25,7 @@ import {
DEFAULT_ONCOKB_CONTENT_WIDTH,
updateOncoKbIconStyle,
} from 'shared/lib/AnnotationColumnUtils';
import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

export interface IPatientViewStructuralVariantTableProps {
store: PatientViewPageStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
USE_DEFAULT_PUBLIC_INSTANCE_FOR_ONCOKB,
oncoKbAnnotationSortValue,
} from 'react-mutation-mapper';
import { CancerStudy, StructuralVariant } from 'cbioportal-ts-api-client';
import { CancerStudy } from 'cbioportal-ts-api-client';
import { IAnnotationColumnProps } from 'shared/components/mutationTable/column/AnnotationColumnFormatter';
import { CancerGene, IndicatorQueryResp } from 'oncokb-ts-api-client';
import {
Expand All @@ -19,6 +19,7 @@ import {
calculateOncoKbAvailableDataType,
} from 'cbioportal-utils';
import AnnotationHeader from 'shared/components/mutationTable/column/annotation/AnnotationHeader';
import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

export default class AnnotationColumnFormatter {
public static getData(
Expand Down
9 changes: 6 additions & 3 deletions src/pages/resultsView/ResultsViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ import {
SampleIdentifier,
SampleList,
SampleMolecularIdentifier,
} from 'cbioportal-ts-api-client';
import {
StructuralVariant,
StructuralVariantFilter,
} from 'cbioportal-ts-api-client';
} from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import client from 'shared/api/cbioportalClientInstance';
import {
CanonicalMutationType,
Expand Down Expand Up @@ -3286,7 +3289,7 @@ export class ResultsViewPageStore
sampleMolecularIdentifiers: filters,
} as StructuralVariantFilter;

return await client.fetchStructuralVariantsUsingPOST({
return await internalClient.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: data,
});
}
Expand Down Expand Up @@ -5899,7 +5902,7 @@ export class ResultsViewPageStore
if (_.isEmpty(filters)) {
return [];
} else {
return client.fetchStructuralVariantsUsingPOST({
return internalClient.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: {
entrezGeneIds: [q.entrezGeneId],
sampleMolecularIdentifiers: filters,
Expand Down
4 changes: 3 additions & 1 deletion src/pages/resultsView/ResultsViewPageStoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import {
PatientFilter,
PatientIdentifier,
ReferenceGenomeGene,
StructuralVariant,
Sample,
} from 'cbioportal-ts-api-client';

import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import { action, ObservableMap } from 'mobx';
import AccessorsForOqlFilter, {
getSimplifiedMutationType,
Expand Down
4 changes: 3 additions & 1 deletion src/pages/resultsView/plots/PlotsTabUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import {
Mutation,
NumericGeneMolecularData,
Sample,
StructuralVariant,
} from 'cbioportal-ts-api-client';

import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import {
capitalize,
remoteData,
Expand Down
9 changes: 7 additions & 2 deletions src/pages/studyView/StudyViewComparisonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import {
Sample,
SampleIdentifier,
SampleMolecularIdentifier,
} from 'cbioportal-ts-api-client';

import {
StructuralVariant,
StructuralVariantFilter,
} from 'cbioportal-ts-api-client';
} from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import { getGroupParameters } from 'pages/groupComparison/comparisonGroupManager/ComparisonGroupManagerUtils';
import { LoadingPhase } from 'pages/groupComparison/GroupComparisonLoading';
import comparisonClient from 'shared/api/comparisonGroupClientInstance';
Expand All @@ -21,6 +25,7 @@ import { ChartTypeEnum } from 'pages/studyView/StudyViewConfig';
import { getGeneFromUniqueKey } from './TableUtils';
import client from 'shared/api/cbioportalClientInstance';
import { REQUEST_ARG_ENUM } from 'shared/constants';
import internalClient from 'shared/api/cbioportalInternalClientInstance';

export function doesChartHaveComparisonGroupsLimit(chartMeta: ChartMeta) {
return chartMeta.uniqueKey !== SpecialChartsUniqueKeyEnum.CANCER_STUDIES;
Expand Down Expand Up @@ -145,7 +150,7 @@ export async function getSvData(
geneIds: hugoGeneSymbols,
});

return client.fetchStructuralVariantsUsingPOST({
return internalClient.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: {
entrezGeneIds: genes.map(g => g.entrezGeneId),
sampleMolecularIdentifiers,
Expand Down
4 changes: 3 additions & 1 deletion src/shared/components/oncoprint/TooltipUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import {
GenePanelData,
MolecularProfile,
Mutation,
StructuralVariant,
} from 'cbioportal-ts-api-client';

import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import client from 'shared/api/cbioportalClientInstance';
import {
ClinicalTrackSpec,
Expand Down
5 changes: 3 additions & 2 deletions src/shared/lib/GenericAssayUtils/GenericAssayCommonUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import client from 'shared/api/cbioportalClientInstance';
import internalClient from 'shared/api/cbioportalInternalClientInstance';
import {
GenericAssayMetaFilter,
GenericAssayMeta,
Expand Down Expand Up @@ -112,7 +113,7 @@ export function fetchGenericAssayMetaByProfileIds(
genericAssayProfileIds: string[]
) {
if (genericAssayProfileIds.length > 0) {
return client.fetchGenericAssayMetaDataUsingPOST({
return client.fetchGenericAssayMetaUsingPOST({
genericAssayMetaFilter: {
molecularProfileIds: genericAssayProfileIds,
// the Swagger-generated type expected by the client method below
Expand All @@ -126,7 +127,7 @@ export function fetchGenericAssayMetaByProfileIds(

export function fetchGenericAssayMetaByEntityIds(entityIds: string[]) {
if (entityIds.length > 0) {
return client.fetchGenericAssayMetaDataUsingPOST({
return client.fetchGenericAssayMetaUsingPOST({
genericAssayMetaFilter: {
genericAssayStableIds: entityIds,
// the Swagger-generated type expected by the client method below
Expand Down
2 changes: 1 addition & 1 deletion src/shared/lib/StoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
ReferenceGenomeGene,
Sample,
SampleFilter,
StructuralVariant,
} from 'cbioportal-ts-api-client';
import defaultClient from 'shared/api/cbioportalClientInstance';
import client from 'shared/api/cbioportalClientInstance';
Expand Down Expand Up @@ -109,6 +108,7 @@ import {
} from 'shared/lib/MutationUtils';
import { ObservableMap } from 'mobx';
import { chunkCalls } from 'cbioportal-utils';
import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

export const MolecularAlterationType_filenameSuffix: {
[K in MolecularProfile['molecularAlterationType']]?: string;
Expand Down
3 changes: 2 additions & 1 deletion src/shared/lib/oql/AccessorsForOqlFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import {
Mutation,
MolecularProfile,
NumericGeneMolecularData,
StructuralVariant,
} from 'cbioportal-ts-api-client';
import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import _ from 'lodash';
import {
AlterationTypeConstants,
Expand Down
7 changes: 3 additions & 4 deletions src/shared/lib/oql/annotateAlterationTypes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import AccessorsForOqlFilter from './AccessorsForOqlFilter';
import {
NumericGeneMolecularData,
StructuralVariant,
} from 'cbioportal-ts-api-client';
import { NumericGeneMolecularData } from 'cbioportal-ts-api-client';
import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import {
AlterationTypeConstants,
AnnotatedMutation,
Expand Down
9 changes: 4 additions & 5 deletions src/shared/lib/oql/oqlfilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ import {
ExtendedAlteration,
AnnotatedStructuralVariant,
} from '../../../pages/resultsView/ResultsViewPageStore';
import {
NumericGeneMolecularData,
Mutation,
StructuralVariant,
} from 'cbioportal-ts-api-client';
import { NumericGeneMolecularData, Mutation } from 'cbioportal-ts-api-client';

import { StructuralVariant } from 'cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal';

import { Alteration } from 'shared/lib/oql/oql-parser';
import AccessorsForOqlFilter, {
Datum,
Expand Down

0 comments on commit 9f3a59a

Please sign in to comment.