Skip to content

Commit

Permalink
chore(ts): move const to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Sep 26, 2023
1 parent 45f6e9f commit 2dd1d0f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/Shared/Services/Settings.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import {
AutomatedAnalysisRecordingConfig,
FeatureLevel,
defaultAutomatedAnalysisRecordingConfig,
defaultChartControllerConfig,
ChartControllerConfig,
} from './service.types';
import { defaultChartControllerConfig } from './service.utils';

export class SettingsService {
private readonly _featureLevel$ = new BehaviorSubject<FeatureLevel>(
Expand Down
4 changes: 0 additions & 4 deletions src/app/Shared/Services/service.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ export interface ChartControllerConfig {
minRefresh: number;
}

export const defaultChartControllerConfig: ChartControllerConfig = {
minRefresh: 10,
};

// ======================================
// Login
// ======================================
Expand Down
6 changes: 5 additions & 1 deletion src/app/Shared/Services/service.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as React from 'react';
import { BehaviorSubject } from 'rxjs';
import { automatedAnalysisRecordingName, RecordingAttributes, Target } from './api.types';
import { MatchExpressionService } from './MatchExpression.service';
import { AutomatedAnalysisRecordingConfig } from './service.types';
import { AutomatedAnalysisRecordingConfig, ChartControllerConfig } from './service.types';

// ======================================
// Match Expression
Expand All @@ -30,6 +30,10 @@ export const MatchedTargetsServiceContext = React.createContext(new BehaviorSubj
// ======================================
// Setting
// ======================================
export const defaultChartControllerConfig: ChartControllerConfig = {
minRefresh: 10,
};

export const automatedAnalysisConfigToRecordingAttributes = (
config: AutomatedAnalysisRecordingConfig,
): RecordingAttributes => {
Expand Down
2 changes: 2 additions & 0 deletions src/test/Dashboard/Dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { store } from '@app/Shared/Redux/ReduxStore';
import { Target } from '@app/Shared/Services/api.types';
import { NotificationsContext, NotificationsInstance } from '@app/Shared/Services/Notifications.service';
import { FeatureLevel } from '@app/Shared/Services/service.types';
import { defaultChartControllerConfig } from '@app/Shared/Services/service.utils';
import { defaultServices, ServiceContext } from '@app/Shared/Services/Services';
import { defaultDatetimeFormat } from '@i18n/datetime';
import { createMemoryHistory } from 'history';
Expand Down Expand Up @@ -56,6 +57,7 @@ jest.spyOn(defaultServices.settings, 'featureLevel').mockReturnValue(of(FeatureL
jest.spyOn(defaultServices.settings, 'datetimeFormat').mockReturnValue(of(defaultDatetimeFormat));
jest.spyOn(defaultServices.settings, 'themeSetting').mockReturnValue(of(ThemeSetting.LIGHT));
jest.spyOn(defaultServices.settings, 'media').mockReturnValue(of());
jest.spyOn(defaultServices.settings, 'chartControllerConfig').mockReturnValue(defaultChartControllerConfig);

const history = createMemoryHistory({ initialEntries: ['/'] });

Expand Down

0 comments on commit 2dd1d0f

Please sign in to comment.