File tree 3 files changed +27
-1
lines changed
tensorboard/webapp/runs/effects 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ tf_ng_module(
14
14
"//tensorboard/webapp:app_state" ,
15
15
"//tensorboard/webapp:selectors" ,
16
16
"//tensorboard/webapp/app_routing" ,
17
+ "//tensorboard/webapp/app_routing:types" ,
17
18
"//tensorboard/webapp/app_routing/actions" ,
18
19
"//tensorboard/webapp/core/actions" ,
19
20
"//tensorboard/webapp/runs:types" ,
@@ -40,6 +41,7 @@ tf_ts_library(
40
41
"//tensorboard/webapp/angular:expect_angular_core_testing" ,
41
42
"//tensorboard/webapp/angular:expect_ngrx_store_testing" ,
42
43
"//tensorboard/webapp/app_routing:testing" ,
44
+ "//tensorboard/webapp/app_routing:types" ,
43
45
"//tensorboard/webapp/core/actions" ,
44
46
"//tensorboard/webapp/runs/actions" ,
45
47
"//tensorboard/webapp/runs/data_source" ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {
28
28
} from 'rxjs/operators' ;
29
29
import { areSameRouteKindAndExperiments } from '../../app_routing' ;
30
30
import { navigated } from '../../app_routing/actions' ;
31
+ import { RouteKind } from '../../app_routing/types' ;
31
32
import { State } from '../../app_state' ;
32
33
import * as coreActions from '../../core/actions' ;
33
34
import {
@@ -159,7 +160,11 @@ export class RunsEffects {
159
160
this . experimentsWithStaleRunsOnRouteChange$ ,
160
161
this . experimentsWithStaleRunsOnReload$
161
162
) . pipe (
162
- mergeMap ( ( { experimentIds, experimentIdsToBeFetched} ) => {
163
+ withLatestFrom ( this . store . select ( getActiveRoute ) ) ,
164
+ filter (
165
+ ( [ , route ] ) => route !== null && route . routeKind !== RouteKind . CARD
166
+ ) ,
167
+ mergeMap ( ( [ { experimentIds, experimentIdsToBeFetched} ] ) => {
163
168
return this . fetchAllRunsList ( experimentIds , experimentIdsToBeFetched ) ;
164
169
} )
165
170
) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
23
23
buildNavigatedAction ,
24
24
buildRoute ,
25
25
} from '../../app_routing/testing' ;
26
+ import { RouteKind } from '../../app_routing/types' ;
26
27
import { State } from '../../app_state' ;
27
28
import * as coreActions from '../../core/actions' ;
28
29
import {
@@ -472,6 +473,24 @@ describe('runs_effects', () => {
472
473
} ) ;
473
474
} ) ;
474
475
476
+ [
477
+ { specAction : buildNavigatedAction , specName : 'navigation' } ,
478
+ { specAction : coreActions . manualReload , specName : 'manual reload' } ,
479
+ { specAction : coreActions . reload , specName : 'auto reload' } ,
480
+ ] . forEach ( ( { specAction, specName} ) => {
481
+ it ( `does not fetch runs on card route when action is ${ specName } ` , ( ) => {
482
+ store . overrideSelector ( getActiveRoute , {
483
+ routeKind : RouteKind . CARD ,
484
+ params : { } ,
485
+ } ) ;
486
+ store . refreshState ( ) ;
487
+
488
+ action . next ( specAction ( ) ) ;
489
+
490
+ expect ( actualActions ) . toEqual ( [ ] ) ;
491
+ } ) ;
492
+ } ) ;
493
+
475
494
describe ( 'on navigation' , ( ) => {
476
495
it ( 'fetches for runs if not loaded before' , ( ) => {
477
496
const createFooRuns = ( ) => [
You can’t perform that action at this time.
0 commit comments