Skip to content

Commit

Permalink
Fix lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
arcra committed Oct 16, 2024
1 parent 683c43b commit c5a1f50
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export class DebuggerContainer implements OnInit, OnDestroy {
this.runsIds$ = this.store.pipe(
select(
createSelector(getDebuggerRunListing, (runs): string[] =>
Object.keys(runs),
),
),
Object.keys(runs)
)
)
);
this.activeRunId$ = this.store.pipe(select(getActiveRunId));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export class AlertsContainer {
count: alertsBreakdown[alertType],
};
});
}),
),
})
)
);
this.focusType$ = this.store.pipe(select(getAlertsFocusType));
}
Expand Down
38 changes: 19 additions & 19 deletions tensorboard/webapp/core/effects/core_effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,70 +130,70 @@ export class CoreEffects {
return this.webappDataSource.fetchEnvironment().pipe(
tap((environment) => {
this.store.dispatch(environmentLoaded({environment}));
}),
})
);
}

constructor(
private actions$: Actions,
private store: Store<State>,
private webappDataSource: TBServerDataSource,
private webappDataSource: TBServerDataSource
) {
this.onDashboardLoad$ = merge(
this.actions$.pipe(
ofType(coreLoaded, navigated),
withLatestFrom(this.store.select(getActiveRoute)),
distinctUntilChanged(([, beforeRoute], [, afterRoute]) => {
return areSameRouteKindAndExperiments(beforeRoute, afterRoute);
}),
})
),
this.actions$.pipe(ofType(reload, manualReload)),
this.actions$.pipe(ofType(reload, manualReload))
).pipe(
withLatestFrom(this.store.select(getRouteKind)),
filter(([, routeKind]) => DASHBOARD_ROUTE_KIND.has(routeKind)),
throttleTime(DATA_LOAD_CONDITIONAL_THROTTLE_IN_MS, undefined, {
leading: true,
}),
})
);
this.fetchWebAppData$ = createEffect(
() => {
const pluginsListingReload$ = this.onDashboardLoad$.pipe(
withLatestFrom(
this.store.select(getPluginsListLoaded),
this.store.select(getEnabledExperimentalPlugins),
this.store.select(getEnabledExperimentalPlugins)
),
filter(([, {state}]) => state !== DataLoadState.LOADING),
tap(() => this.store.dispatch(pluginsListingRequested())),
mergeMap(([, , enabledExperimentalPlugins]) => {
return zip(
this.webappDataSource.fetchPluginsListing(
enabledExperimentalPlugins,
enabledExperimentalPlugins
),
// TODO(tensorboard-team): consider brekaing the environments out of
// the pluginsListingLoaded; currently, plugins listing load state
// is connected to the environments which is not ideal. Have its own
// load state.
this.fetchEnvironment(),
this.fetchEnvironment()
).pipe(
map(([plugins]) => {
this.store.dispatch(pluginsListingLoaded({plugins}));
}),
catchError((e) => {
if (e instanceof TBServerError) {
this.store.dispatch(
pluginsListingFailed({failureCode: e.failureCode}),
pluginsListingFailed({failureCode: e.failureCode})
);
} else {
this.store.dispatch(
pluginsListingFailed({
failureCode: PluginsListFailureCode.UNKNOWN,
}),
})
);
}
return EMPTY;
}),
})
);
}),
})
);

const runsReload$ = this.onDashboardLoad$.pipe(
Expand Down Expand Up @@ -260,12 +260,12 @@ export class CoreEffects {
throttleTime(ALIAS_CHANGE_RUNS_RELOAD_THROTTLE_IN_MS, undefined, {
leading: true,
trailing: true,
}),
})
);
}),
withLatestFrom(
this.store.select(getRouteKind),
this.store.select(getPolymerRunsLoadState),
this.store.select(getPolymerRunsLoadState)
),
filter(([, routeKind, loadState]) => {
// While the same check was applied earlier, `delay` + `throttleTime`
Expand All @@ -289,18 +289,18 @@ export class CoreEffects {
catchError(() => {
this.store.dispatch(polymerRunsFetchFailed());
return EMPTY;
}),
})
);

return merge(pluginsListingReload$, runsReload$);
},
{dispatch: false},
{dispatch: false}
);
this.dispatchChangePlugin$ = createEffect(
() => {
return merge(
this.onDashboardLoad$,
this.actions$.pipe(ofType(pluginsListingLoaded)),
this.actions$.pipe(ofType(pluginsListingLoaded))
).pipe(
withLatestFrom(this.store.select(getActivePlugin)),
map(([, activePlugin]) => activePlugin),
Expand All @@ -309,10 +309,10 @@ export class CoreEffects {
take(1),
tap((plugin) => {
this.store.dispatch(changePlugin({plugin: plugin!}));
}),
})
);
},
{dispatch: false},
{dispatch: false}
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class FeatureFlagDialogContainer {
this.showFlagsFilter$ = this.store.select(getOverriddenFeatureFlags).pipe(
map((overriddenFeatureFlags) => {
return overriddenFeatureFlags.showFlags?.toLowerCase();
}),
})
);
this.hasFlagsSentToServer$ = this.store
.select(getFeatureFlagsMetadata)
Expand All @@ -65,13 +65,13 @@ export class FeatureFlagDialogContainer {
return (metadata as AdvancedFeatureFlagMetadata<FeatureFlagType>)
.sendToServerWhenOverridden;
});
}),
})
);
this.featureFlags$ = this.store.select(getOverriddenFeatureFlags).pipe(
withLatestFrom(
this.store.select(getDefaultFeatureFlags),
this.store.select(getFeatureFlagsMetadata),
this.showFlagsFilter$,
this.showFlagsFilter$
),
map(
([
Expand All @@ -90,7 +90,7 @@ export class FeatureFlagDialogContainer {
.map(([flagName, defaultValue]) => {
const status = getFlagStatus(
flagName as keyof FeatureFlags,
overriddenFeatureFlags,
overriddenFeatureFlags
);
const metadata = flagMetadata[flagName as keyof FeatureFlags];
return {
Expand All @@ -102,8 +102,8 @@ export class FeatureFlagDialogContainer {
).sendToServerWhenOverridden,
} as FeatureFlagStatus<keyof FeatureFlags>;
});
},
),
}
)
);
}

Expand All @@ -120,12 +120,12 @@ export class FeatureFlagDialogContainer {
break;
case FeatureFlagOverrideStatus.ENABLED:
this.store.dispatch(
featureFlagOverrideChanged({flags: {[flag]: true}}),
featureFlagOverrideChanged({flags: {[flag]: true}})
);
break;
case FeatureFlagOverrideStatus.DISABLED:
this.store.dispatch(
featureFlagOverrideChanged({flags: {[flag]: false}}),
featureFlagOverrideChanged({flags: {[flag]: false}})
);
break;
default:
Expand All @@ -140,7 +140,7 @@ export class FeatureFlagDialogContainer {

function getFlagStatus(
flagName: keyof FeatureFlags,
overriddenFeatureFlags: Partial<FeatureFlags>,
overriddenFeatureFlags: Partial<FeatureFlags>
): FeatureFlagOverrideStatus {
if (overriddenFeatureFlags[flagName] === undefined) {
return FeatureFlagOverrideStatus.DEFAULT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ export class ScalarCardLineChartContainer
default:
const neverType = xAxisType as never;
throw new Error(
`Invalid xAxisType for line chart. ${neverType}`,
`Invalid xAxisType for line chart. ${neverType}`
);
}
}),
})
);
this.ngUnsubscribe = new Subject<void>();
}
Expand Down Expand Up @@ -165,13 +165,13 @@ export class ScalarCardLineChartContainer
ngOnInit() {
this.userViewBox$ = this.store.select(
getMetricsCardUserViewBox,
this.cardId,
this.cardId
);

this.loadState$ = this.store.select(getCardLoadState, this.cardId);

this.rangeEnabled$ = this.store.select(
getMetricsCardRangeSelectionEnabled(this.cardId),
getMetricsCardRangeSelectionEnabled(this.cardId)
);
}

Expand All @@ -181,13 +181,13 @@ export class ScalarCardLineChartContainer
}

onTimeSelectionChanged(
newTimeSelectionWithAffordance: TimeSelectionWithAffordance,
newTimeSelectionWithAffordance: TimeSelectionWithAffordance
) {
this.store.dispatch(
timeSelectionChanged({
...newTimeSelectionWithAffordance,
cardId: this.cardId,
}),
})
);
}

Expand All @@ -200,7 +200,7 @@ export class ScalarCardLineChartContainer
cardViewBoxChanged({
userViewBox: lineChartViewBox,
cardId: this.cardId,
}),
})
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ export class CardGridContainer implements OnChanges, OnDestroy {
]).pipe(
map(([items, pageSize]) => {
return Math.ceil(items.length / pageSize);
}),
})
);
this.isGroupExpanded$ = this.groupName$.pipe(
switchMap((groupName) => {
return groupName !== null
? this.store.select(getMetricsTagGroupExpansionState, groupName)
: of(true);
}),
})
);
this.showPaginationControls$ = this.numPages$.pipe(
map((numPages) => numPages > 1),
map((numPages) => numPages > 1)
);
this.normalizedPageIndex$ = combineLatest([
this.pageIndex$,
Expand All @@ -116,7 +116,7 @@ export class CardGridContainer implements OnChanges, OnDestroy {
map(([pageIndex, numPages]) => {
return Math.min(Math.max(pageIndex, 0), numPages - 1);
}),
shareReplay(1),
shareReplay(1)
);
this.pagedItems$ = combineLatest([
this.items$,
Expand All @@ -128,7 +128,7 @@ export class CardGridContainer implements OnChanges, OnDestroy {
const startIndex = pageSize * pageIndex;
const endIndex = pageSize * pageIndex + (expanded ? pageSize : 0);
return items.slice(startIndex, endIndex);
}),
})
);
this.cardMinWidth$ = this.store.select(getMetricsCardMinWidth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class MetricsFilterInputContainer {
} catch (err) {
return false;
}
}),
})
);
this.completions$ = this.store.select(getNonEmptyCardIdsWithMetadata).pipe(
combineLatestWith(this.store.select(getMetricsFilteredPluginTypes)),
Expand All @@ -74,12 +74,12 @@ export class MetricsFilterInputContainer {
} catch (e) {
return [tags, null];
}
},
}
),
filter(([, tagFilterRegex]) => tagFilterRegex !== null),
map(([tags, tagFilterRegex]) => {
return tags.filter((tag: string) => tagFilterRegex!.test(tag));
}),
})
);
}

Expand Down
Loading

0 comments on commit c5a1f50

Please sign in to comment.