Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Feature/prtl 2351 convert flow to ts #2409

Merged
merged 2 commits into from
Nov 16, 2018
Merged
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 @@ -18,10 +18,10 @@ import OverflowTooltippedLabel from '@ncigdc/uikit/OverflowTooltippedLabel';

import { Container, BucketLink } from './';

import { TBucket } from './types';
import { IBucket } from './types';

type TProps = {
buckets: [TBucket],
buckets: [IBucket],
field: string,
filteredBuckets: Array<Object>,
style: Object,
Expand Down
6 changes: 0 additions & 6 deletions src/packages/@ncigdc/components/Aggregations/types.js

This file was deleted.

4 changes: 4 additions & 0 deletions src/packages/@ncigdc/components/Aggregations/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface IBucket {
doc_count: number;
key: string;
};
4 changes: 2 additions & 2 deletions src/packages/@ncigdc/components/PrimarySitesCount.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import React from 'react';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';

export type TProps = {
aggregations: {
primary_site: { buckets: [TBucket] },
primary_site: { buckets: [IBucket] },
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import React from 'react';
import _ from 'lodash';
import entityShortnameMapping from '@ncigdc/utils/entityShortnameMapping';
import { TSearchHit } from './types';
import { ISearchHit } from './types';
import { internalHighlight } from '@ncigdc/uikit/Highlight';

const styles = {
Expand Down Expand Up @@ -133,7 +133,7 @@ const ResultHighlights = ({
};

type TProps = {
results: TSearchHit[],
results: ISearchHit[],
query: string,
onSelectItem: Function,
onActivateItem: Function,
Expand Down
34 changes: 0 additions & 34 deletions src/packages/@ncigdc/components/QuickSearch/types.js

This file was deleted.

32 changes: 32 additions & 0 deletions src/packages/@ncigdc/components/QuickSearch/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export interface IShard {
failed: number;
successful: number;
total: number;
}

export type ISearchHitType =
| 'gene'
| 'case'
| 'ssm'
| 'occurrence'
| 'project'
| 'file'
| 'annotation'
| 'report';

export interface ISearchHit {
_id: string;
_score: number;
_type: ISearchHitType;
}

export interface ISearchResponse {
data: {
_shards: IShard;
hits: ISearchHit[];
total: number;
timed_out: boolean;
took: number;
};
warings: {};
}
18 changes: 9 additions & 9 deletions src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Relay from 'react-relay/classic';
import _ from 'lodash';
import { compose } from 'recompose';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';
import withRouter from '@ncigdc/utils/withRouter';
import { parseFilterParam } from '@ncigdc/utils/uri';
import { ColumnCenter, RowCenter, PieTitle, SelfFilteringPie } from './';
Expand All @@ -13,14 +13,14 @@ export type TProps = {
push: Function,
query: Object,
aggregations: {
demographic__ethnicity: { buckets: [TBucket] },
demographic__gender: { buckets: [TBucket] },
demographic__race: { buckets: [TBucket] },
diagnoses__vital_status: { buckets: [TBucket] },
disease_type: { buckets: [TBucket] },
primary_site: { buckets: [TBucket] },
project__program__name: { buckets: [TBucket] },
project__project_id: { buckets: [TBucket] },
demographic__ethnicity: { buckets: [IBucket] },
demographic__gender: { buckets: [IBucket] },
demographic__race: { buckets: [IBucket] },
diagnoses__vital_status: { buckets: [IBucket] },
disease_type: { buckets: [IBucket] },
primary_site: { buckets: [IBucket] },
project__program__name: { buckets: [IBucket] },
project__project_id: { buckets: [IBucket] },
},
};

Expand Down
12 changes: 6 additions & 6 deletions src/packages/@ncigdc/components/TabPieCharts/RepoFilesPies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _ from 'lodash';
import { compose, withState } from 'recompose';

import withSize from '@ncigdc/utils/withSize';
import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';
import withRouter from '@ncigdc/utils/withRouter';
import { parseFilterParam } from '@ncigdc/utils/uri';
import {
Expand All @@ -22,11 +22,11 @@ export type TProps = {
push: Function,
query: Object,
aggregations: {
data_category: { buckets: [TBucket] },
data_type: { buckets: [TBucket] },
experimental_strategy: { buckets: [TBucket] },
data_format: { buckets: [TBucket] },
access: { buckets: [TBucket] },
data_category: { buckets: [IBucket] },
data_type: { buckets: [IBucket] },
experimental_strategy: { buckets: [IBucket] },
data_format: { buckets: [IBucket] },
access: { buckets: [IBucket] },
},
setShowingMore: Function,
showingMore: boolean,
Expand Down
16 changes: 8 additions & 8 deletions src/packages/@ncigdc/containers/AnnotationAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import FacetHeader from '@ncigdc/components/Aggregations/FacetHeader';
import FacetWrapper from '@ncigdc/components/FacetWrapper';
import escapeForRelay from '@ncigdc/utils/escapeForRelay';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';

import { Row } from '@ncigdc/uikit/Flex';
import { withTheme } from '@ncigdc/theme';
Expand All @@ -19,13 +19,13 @@ export type TProps = {
annotationIdCollapsed: boolean,
setAnnotationIdCollapsed: Function,
aggregations: {
category: { buckets: [TBucket] },
classification: { buckets: [TBucket] },
entity_type: { buckets: [TBucket] },
project__primary_site: { buckets: [TBucket] },
project__program__name: { buckets: [TBucket] },
project__project_id: { buckets: [TBucket] },
status: { buckets: [TBucket] },
category: { buckets: [IBucket] },
classification: { buckets: [IBucket] },
entity_type: { buckets: [IBucket] },
project__primary_site: { buckets: [IBucket] },
project__program__name: { buckets: [IBucket] },
project__project_id: { buckets: [IBucket] },
status: { buckets: [IBucket] },
},
setAutocomplete: () => {},
suggestions: Array<Object>,
Expand Down
16 changes: 8 additions & 8 deletions src/packages/@ncigdc/containers/FileAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import withFacetSelection from '@ncigdc/utils/withFacetSelection';
import escapeForRelay from '@ncigdc/utils/escapeForRelay';
import tryParseJSON from '@ncigdc/utils/tryParseJSON';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';

import { withTheme } from '@ncigdc/theme';
import FileIcon from '@ncigdc/theme/icons/File';
Expand Down Expand Up @@ -104,13 +104,13 @@ export type TProps = {
facets: { facets: string },
parsedFacets: Object,
aggregations: {
access: { buckets: [TBucket] },
data_category: { buckets: [TBucket] },
data_format: { buckets: [TBucket] },
data_type: { buckets: [TBucket] },
experimental_strategy: { buckets: [TBucket] },
platform: { buckets: [TBucket] },
analysis__workflow_type: { buckets: [TBucket] },
access: { buckets: [IBucket] },
data_category: { buckets: [IBucket] },
data_format: { buckets: [IBucket] },
data_type: { buckets: [IBucket] },
experimental_strategy: { buckets: [IBucket] },
platform: { buckets: [IBucket] },
analysis__workflow_type: { buckets: [IBucket] },
},
theme: Object,
filters: Object,
Expand Down
14 changes: 7 additions & 7 deletions src/packages/@ncigdc/containers/ProjectAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import FacetHeader from '@ncigdc/components/Aggregations/FacetHeader';
import FacetWrapper from '@ncigdc/components/FacetWrapper';
import escapeForRelay from '@ncigdc/utils/escapeForRelay';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';

import { withTheme } from '@ncigdc/theme';
import { Row } from '@ncigdc/uikit/Flex';
Expand All @@ -18,13 +18,13 @@ import FolderIcon from '@ncigdc/theme/icons/Folder';
export type TProps = {
suggestions: Array<Object>,
aggregations: {
disease_type: { buckets: [TBucket] },
primary_site: { buckets: [TBucket] },
program__name: { buckets: [TBucket] },
project_id: { buckets: [TBucket] },
summary__data_categories__data_category: { buckets: [TBucket] },
disease_type: { buckets: [IBucket] },
primary_site: { buckets: [IBucket] },
program__name: { buckets: [IBucket] },
project_id: { buckets: [IBucket] },
summary__data_categories__data_category: { buckets: [IBucket] },
summary__experimental_strategies__experimental_strategy: {
buckets: [TBucket],
buckets: [IBucket],
},
},
setAutocomplete: Function,
Expand Down
18 changes: 9 additions & 9 deletions src/packages/@ncigdc/containers/explore/CaseAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import tryParseJSON from '@ncigdc/utils/tryParseJSON';
import FacetHeader from '@ncigdc/components/Aggregations/FacetHeader';
import { UploadCaseSet } from '@ncigdc/components/Modals/UploadSet';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';

export type TProps = {
caseIdCollapsed: boolean,
Expand All @@ -34,16 +34,16 @@ export type TProps = {
facets: { facets: string },
parsedFacets: Object,
aggregations: {
demographic__ethnicity: { buckets: [TBucket] },
demographic__gender: { buckets: [TBucket] },
demographic__race: { buckets: [TBucket] },
diagnoses__vital_status: { buckets: [TBucket] },
demographic__ethnicity: { buckets: [IBucket] },
demographic__gender: { buckets: [IBucket] },
demographic__race: { buckets: [IBucket] },
diagnoses__vital_status: { buckets: [IBucket] },
diagnoses__days_to_death: { max: number, min: number },
diagnoses__age_at_diagnosis: { max: number, min: number },
disease_type: { buckets: [TBucket] },
primary_site: { buckets: [TBucket] },
project__program__name: { buckets: [TBucket] },
project__project_id: { buckets: [TBucket] },
disease_type: { buckets: [IBucket] },
primary_site: { buckets: [IBucket] },
project__program__name: { buckets: [IBucket] },
project__project_id: { buckets: [IBucket] },
},
hits: {
edges: Array<{
Expand Down
10 changes: 5 additions & 5 deletions src/packages/@ncigdc/containers/explore/GeneAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import { compose, withState } from 'recompose';
import SuggestionFacet from '@ncigdc/components/Aggregations/SuggestionFacet';
import FacetWrapper from '@ncigdc/components/FacetWrapper';
import FacetHeader from '@ncigdc/components/Aggregations/FacetHeader';
import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';
import { UploadGeneSet } from '@ncigdc/components/Modals/UploadSet';
import UploadSetButton from '@ncigdc/components/UploadSetButton';
import { withTheme } from '@ncigdc/theme';
import escapeForRelay from '@ncigdc/utils/escapeForRelay';

export type TProps = {
aggregations: {
biotype: { buckets: [TBucket] },
is_cancer_gene_census: { buckets: [TBucket] },
case__cnv__cnv_change: { buckets: [TBucket] },
biotype: { buckets: [IBucket] },
is_cancer_gene_census: { buckets: [IBucket] },
case__cnv__cnv_change: { buckets: [IBucket] },
},
cnvAggregations: {
cnv_change: { buckets: [TBucket] },
cnv_change: { buckets: [IBucket] },
},
hits: {
edges: Array<{
Expand Down
8 changes: 4 additions & 4 deletions src/packages/@ncigdc/containers/explore/SSMAggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SuggestionFacet from '@ncigdc/components/Aggregations/SuggestionFacet';
import FacetWrapper from '@ncigdc/components/FacetWrapper';
import FacetHeader from '@ncigdc/components/Aggregations/FacetHeader';

import { TBucket } from '@ncigdc/components/Aggregations/types';
import { IBucket } from '@ncigdc/components/Aggregations/types';

import { withTheme } from '@ncigdc/theme';
import escapeForRelay from '@ncigdc/utils/escapeForRelay';
Expand Down Expand Up @@ -91,9 +91,9 @@ const presetFacets: Array<{

export type TProps = {
aggregations: {
consequence__transcript__annotation__vep_impact: { buckets: [TBucket] },
consequence__transcript__consequence_type: { buckets: [TBucket] },
mutation_type: { buckets: [TBucket] },
consequence__transcript__annotation__vep_impact: { buckets: [IBucket] },
consequence__transcript__consequence_type: { buckets: [IBucket] },
mutation_type: { buckets: [IBucket] },
},
hits: {
edges: Array<{
Expand Down
37 changes: 0 additions & 37 deletions src/packages/@ncigdc/containers/types.js

This file was deleted.

Loading