Skip to content

Commit

Permalink
Remove cna dicrete long type
Browse files Browse the repository at this point in the history
Resolve feedback of @alisman
  • Loading branch information
Bas Leenknegt committed Nov 21, 2022
1 parent 6e2a943 commit 2c35d41
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ function createCnaNamespaceColumns(
const namespaceColumns = Object.values(
namespaceColumnRecords
) as CNATableColumn[];
namespaceColumns.forEach(c => (c.visible = false));
_.forEach(namespaceColumns, c => {
c.visible = false;
});
return namespaceColumns;
}
24 changes: 13 additions & 11 deletions src/shared/components/mutationTable/MutationTableUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Mutation } from 'cbioportal-ts-api-client';
import { getServerConfig } from 'config/config';
import { NamespaceColumnConfig } from 'shared/components/namespaceColumns/NamespaceColumnConfig';
import { createNamespaceColumns } from 'shared/components/namespaceColumns/namespaceColumnsUtils';
import _ from 'lodash';

export function createMutationNamespaceColumns(
namespaceColumnConfig: NamespaceColumnConfig | undefined
Expand All @@ -16,16 +17,17 @@ export function createMutationNamespaceColumns(
MutationTableColumn
> = createNamespaceColumns<Mutation>(namespaceColumnConfig);

for (const key in columns) {
const column = columns[key];
column.filter = (
d: Mutation[],
filterString: string,
filterStringUpper: string
) => defaultFilter(d, key, filterStringUpper);
column.visible = !!getServerConfig()
.skin_mutation_table_namespace_column_show_by_default;
column.order = 400;
}
_.forEach(
(column: MutationTableColumn, key: ExtendedMutationTableColumnType) => {
column.filter = (
d: Mutation[],
filterString: string,
filterStringUpper: string
) => defaultFilter(d, key, filterStringUpper);
column.visible = !!getServerConfig()
.skin_mutation_table_namespace_column_show_by_default;
column.order = 400;
}
);
return columns;
}
6 changes: 0 additions & 6 deletions src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const AlterationTypeConstants = {

export const DataTypeConstants = {
DISCRETE: 'DISCRETE',
DISCRETE_LONG: 'DISCRETE_LONG',
CONTINUOUS: 'CONTINUOUS',
ZSCORE: 'Z-SCORE',
MAF: 'MAF',
Expand All @@ -128,8 +127,3 @@ export const DataTypeConstants = {
BINARY: 'BINARY',
CATEGORICAL: 'CATEGORICAL',
};

export const CnaDataTypes = [
DataTypeConstants.DISCRETE,
DataTypeConstants.DISCRETE_LONG,
];
4 changes: 2 additions & 2 deletions src/shared/lib/StoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { IGisticData } from 'shared/model/Gistic';
import { IMutSigData } from 'shared/model/MutSig';
import {
CLINICAL_ATTRIBUTE_ID_ENUM,
CnaDataTypes,
DataTypeConstants,
GENOME_NEXUS_ARG_FIELD_ENUM,
} from 'shared/constants';
import {
Expand Down Expand Up @@ -1029,7 +1029,7 @@ export function findDiscreteMolecularProfile(
}

return molecularProfilesInStudy.result.find((p: MolecularProfile) => {
return CnaDataTypes.includes(p.datatype);
return p.datatype === DataTypeConstants.DISCRETE;
});
}

Expand Down

0 comments on commit 2c35d41

Please sign in to comment.