@@ -12,9 +12,9 @@ import Select from 'react-select';
12
12
import LoadingIndicator from 'app/components/loadingIndicator/LoadingIndicator' ;
13
13
import autobind from 'autobind-decorator' ;
14
14
import {
15
+ DEFAULT_GENE ,
15
16
DEFAULT_MARGIN_BOTTOM_LG ,
16
- TABLE_COLUMN_KEY ,
17
- THRESHOLD_ALTERATION_PAGE_TABLE_FIXED_HEIGHT
17
+ TABLE_COLUMN_KEY
18
18
} from 'app/config/constants' ;
19
19
import OncoKBTable , {
20
20
SearchColumn
@@ -31,10 +31,11 @@ import { RouterStore } from 'mobx-react-router';
31
31
import { getHighestLevelStrings } from '../genePage/GenePage' ;
32
32
import styles from './AlterationPage.module.scss' ;
33
33
import classnames from 'classnames' ;
34
- import SmallPageContainer from 'app/components/SmallPageContainer' ;
35
34
import InfoIcon from 'app/shared/icons/InfoIcon' ;
36
35
import DocumentTitle from 'react-document-title' ;
37
36
import { MutationEffectResp } from 'app/shared/api/generated/OncoKbPrivateAPI' ;
37
+ import { Else , If , Then } from 'react-if' ;
38
+ import { UnknownGeneAlert } from 'app/shared/alert/UnknownGeneAlert' ;
38
39
39
40
enum SummaryKey {
40
41
GENE_SUMMARY = 'geneSummary' ,
@@ -286,130 +287,150 @@ export default class GenePage extends React.Component<
286
287
render ( ) {
287
288
return (
288
289
< DocumentTitle title = { this . documentTitle } >
289
- < >
290
- < h2 className = { 'd-flex align-items-center' } >
291
- < GenePageLink
292
- hugoSymbol = { this . store . hugoSymbol }
293
- highlightContent = { false }
294
- />
295
- < span className = { 'ml-2' } > { ` ${ this . store . alterationQuery } ` } </ span >
296
- </ h2 >
297
- < AlterationInfo
298
- oncogenicity = { this . store . annotationResult . result . oncogenic }
299
- mutationEffect = { this . store . annotationResult . result . mutationEffect }
300
- isVus = { this . store . annotationResult . result . vus }
301
- highestSensitiveLevel = {
302
- this . store . annotationResult . result . highestSensitiveLevel
303
- }
304
- highestResistanceLevel = {
305
- this . store . annotationResult . result . highestResistanceLevel
306
- }
307
- />
308
- < Row >
309
- < Col >
310
- { this . alterationSummaries . map ( summary => {
311
- return (
312
- < div className = { DEFAULT_MARGIN_BOTTOM_LG } >
313
- { summary . content }
314
- </ div >
315
- ) ;
316
- } ) }
317
- </ Col >
318
- </ Row >
319
- < Row >
320
- < Col >
321
- < div className = "d-flex align-items-center" >
322
- < span
323
- className = { classnames (
324
- DEFAULT_MARGIN_BOTTOM_LG ,
325
- styles . headerTumorTypeSelection ,
326
- 'mr-2'
327
- ) }
328
- >
329
- < Select
330
- styles = { {
331
- control : ( base , state ) => ( {
332
- ...base ,
333
- height : '30px' ,
334
- 'min-height' : '30px'
335
- } ) ,
336
- dropdownIndicator : base => ( {
337
- ...base ,
338
- padding : 4
339
- } ) ,
340
- clearIndicator : base => ( {
341
- ...base ,
342
- padding : 4
343
- } ) ,
344
- valueContainer : base => ( {
345
- ...base ,
346
- padding : '0px 6px'
347
- } ) ,
348
- input : base => ( {
349
- ...base ,
350
- margin : 0 ,
351
- padding : 0
352
- } )
353
- } }
354
- value = { this . tumorTypeSelectValue }
355
- placeholder = "Select a tumor type"
356
- options = { this . store . allTumorTypesOptions . result }
357
- formatGroupLabel = { this . formatGroupLabel }
358
- isClearable = { true }
359
- onChange = { ( selectedOption : any ) =>
360
- this . updateTumorTypeQuery ( selectedOption )
361
- }
290
+ < If condition = { this . store . gene . isComplete } >
291
+ < Then >
292
+ { this . store . gene . isError ||
293
+ this . store . gene . result === DEFAULT_GENE ? (
294
+ < UnknownGeneAlert />
295
+ ) : (
296
+ < >
297
+ < h2 className = { 'd-flex align-items-center' } >
298
+ < GenePageLink
299
+ hugoSymbol = { this . store . hugoSymbol }
300
+ highlightContent = { false }
362
301
/>
363
- </ span >
364
- < InfoIcon
365
- overlay = "For tumor type specific information, please select a tumor type from the dropdown"
366
- placement = "top"
367
- style = { { fontSize : '0.6rem' } }
368
- />
369
- </ div >
370
- </ Col >
371
- </ Row >
372
- { this . store . tumorTypeQuery ? (
373
- < Row >
374
- < Col >
375
- { this . tumorTypeSummaries . map ( summary => {
376
- return (
377
- < div className = { DEFAULT_MARGIN_BOTTOM_LG } >
378
- { summary . content }
379
- </ div >
380
- ) ;
381
- } ) }
382
- </ Col >
383
- </ Row >
384
- ) : null }
385
- { this . store . therapeuticImplications . length > 0 ? (
386
- < Row >
387
- < Col >
388
- < OncoKBTable
389
- data = { this . store . therapeuticImplications }
390
- columns = { this . therapeuticTableColumns }
391
- pageSize = {
392
- this . store . therapeuticImplications . length === 0
393
- ? 1
394
- : this . store . therapeuticImplications . length
302
+ < span
303
+ className = { 'ml-2' }
304
+ > { ` ${ this . store . alterationQuery } ` } </ span >
305
+ </ h2 >
306
+ < AlterationInfo
307
+ oncogenicity = { this . store . annotationResult . result . oncogenic }
308
+ mutationEffect = {
309
+ this . store . annotationResult . result . mutationEffect
310
+ }
311
+ isVus = { this . store . annotationResult . result . vus }
312
+ highestSensitiveLevel = {
313
+ this . store . annotationResult . result . highestSensitiveLevel
314
+ }
315
+ highestResistanceLevel = {
316
+ this . store . annotationResult . result . highestResistanceLevel
395
317
}
396
- loading = { this . store . annotationResult . isPending }
397
- disableSearch = { true }
398
- defaultSorted = { [
399
- {
400
- id : TABLE_COLUMN_KEY . LEVEL ,
401
- desc : false
402
- } ,
403
- {
404
- id : TABLE_COLUMN_KEY . ALTERATION ,
405
- desc : false
406
- }
407
- ] }
408
318
/>
409
- </ Col >
410
- </ Row >
411
- ) : null }
412
- </ >
319
+ < Row >
320
+ < Col >
321
+ { this . alterationSummaries . map ( summary => {
322
+ return (
323
+ < div className = { DEFAULT_MARGIN_BOTTOM_LG } >
324
+ { summary . content }
325
+ </ div >
326
+ ) ;
327
+ } ) }
328
+ </ Col >
329
+ </ Row >
330
+ < Row >
331
+ < Col >
332
+ < div className = "d-flex align-items-center" >
333
+ < span
334
+ className = { classnames (
335
+ DEFAULT_MARGIN_BOTTOM_LG ,
336
+ styles . headerTumorTypeSelection ,
337
+ 'mr-2'
338
+ ) }
339
+ >
340
+ < Select
341
+ styles = { {
342
+ control : ( base , state ) => ( {
343
+ ...base ,
344
+ height : '30px' ,
345
+ 'min-height' : '30px'
346
+ } ) ,
347
+ dropdownIndicator : base => ( {
348
+ ...base ,
349
+ padding : 4
350
+ } ) ,
351
+ clearIndicator : base => ( {
352
+ ...base ,
353
+ padding : 4
354
+ } ) ,
355
+ valueContainer : base => ( {
356
+ ...base ,
357
+ padding : '0px 6px'
358
+ } ) ,
359
+ input : base => ( {
360
+ ...base ,
361
+ margin : 0 ,
362
+ padding : 0
363
+ } )
364
+ } }
365
+ value = { this . tumorTypeSelectValue }
366
+ placeholder = "Select a tumor type"
367
+ options = { this . store . allTumorTypesOptions . result }
368
+ formatGroupLabel = { this . formatGroupLabel }
369
+ isClearable = { true }
370
+ onChange = { ( selectedOption : any ) =>
371
+ this . updateTumorTypeQuery ( selectedOption )
372
+ }
373
+ />
374
+ </ span >
375
+ < InfoIcon
376
+ overlay = "For tumor type specific information, please select a tumor type from the dropdown"
377
+ placement = "top"
378
+ style = { { fontSize : '0.6rem' } }
379
+ />
380
+ </ div >
381
+ </ Col >
382
+ </ Row >
383
+ { this . store . tumorTypeQuery ? (
384
+ < Row >
385
+ < Col >
386
+ { this . tumorTypeSummaries . map ( summary => {
387
+ return (
388
+ < div className = { DEFAULT_MARGIN_BOTTOM_LG } >
389
+ { summary . content }
390
+ </ div >
391
+ ) ;
392
+ } ) }
393
+ </ Col >
394
+ </ Row >
395
+ ) : null }
396
+ { this . store . therapeuticImplications . length > 0 ? (
397
+ < Row >
398
+ < Col >
399
+ < OncoKBTable
400
+ data = { this . store . therapeuticImplications }
401
+ columns = { this . therapeuticTableColumns }
402
+ pageSize = {
403
+ this . store . therapeuticImplications . length === 0
404
+ ? 1
405
+ : this . store . therapeuticImplications . length
406
+ }
407
+ loading = { this . store . annotationResult . isPending }
408
+ disableSearch = { true }
409
+ defaultSorted = { [
410
+ {
411
+ id : TABLE_COLUMN_KEY . LEVEL ,
412
+ desc : false
413
+ } ,
414
+ {
415
+ id : TABLE_COLUMN_KEY . ALTERATION ,
416
+ desc : false
417
+ }
418
+ ] }
419
+ />
420
+ </ Col >
421
+ </ Row >
422
+ ) : null }
423
+ </ >
424
+ ) }
425
+ </ Then >
426
+ < Else >
427
+ < LoadingIndicator
428
+ size = { 'big' }
429
+ center = { true }
430
+ isLoading = { this . store . gene . isPending }
431
+ />
432
+ </ Else >
433
+ </ If >
413
434
</ DocumentTitle >
414
435
) ;
415
436
}
0 commit comments