File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
tensorboard/webapp/runs/effects Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ tf_ng_module(
1414 "//tensorboard/webapp:app_state" ,
1515 "//tensorboard/webapp:selectors" ,
1616 "//tensorboard/webapp/app_routing" ,
17+ "//tensorboard/webapp/app_routing:types" ,
1718 "//tensorboard/webapp/app_routing/actions" ,
1819 "//tensorboard/webapp/core/actions" ,
1920 "//tensorboard/webapp/runs:types" ,
@@ -40,6 +41,7 @@ tf_ts_library(
4041 "//tensorboard/webapp/angular:expect_angular_core_testing" ,
4142 "//tensorboard/webapp/angular:expect_ngrx_store_testing" ,
4243 "//tensorboard/webapp/app_routing:testing" ,
44+ "//tensorboard/webapp/app_routing:types" ,
4345 "//tensorboard/webapp/core/actions" ,
4446 "//tensorboard/webapp/runs/actions" ,
4547 "//tensorboard/webapp/runs/data_source" ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {
2828} from 'rxjs/operators' ;
2929import { areSameRouteKindAndExperiments } from '../../app_routing' ;
3030import { navigated } from '../../app_routing/actions' ;
31+ import { RouteKind } from '../../app_routing/types' ;
3132import { State } from '../../app_state' ;
3233import * as coreActions from '../../core/actions' ;
3334import {
@@ -159,7 +160,11 @@ export class RunsEffects {
159160 this . experimentsWithStaleRunsOnRouteChange$ ,
160161 this . experimentsWithStaleRunsOnReload$
161162 ) . 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} ] ) => {
163168 return this . fetchAllRunsList ( experimentIds , experimentIdsToBeFetched ) ;
164169 } )
165170 ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
2323 buildNavigatedAction ,
2424 buildRoute ,
2525} from '../../app_routing/testing' ;
26+ import { RouteKind } from '../../app_routing/types' ;
2627import { State } from '../../app_state' ;
2728import * as coreActions from '../../core/actions' ;
2829import {
@@ -472,6 +473,24 @@ describe('runs_effects', () => {
472473 } ) ;
473474 } ) ;
474475
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+
475494 describe ( 'on navigation' , ( ) => {
476495 it ( 'fetches for runs if not loaded before' , ( ) => {
477496 const createFooRuns = ( ) => [
You can’t perform that action at this time.
0 commit comments