All files / shared/config clientConfig.ts

100% Statements 1/1
100% Branches 10/10
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41                                618x                                                
import { Language } from "shared/types/models/programItem";
 
export interface ClientConfig {
  apiServerUrl: string;
  showTestValues: boolean;
  enableReduxTrace: boolean;
  loadedSettings: string;
  enableAxe: boolean;
  enableWhyDidYouRender: boolean;
  dataUpdateInterval: number;
  appBuildTime: string;
  showAnnouncement: boolean;
  activeLanguages: Language[];
  showAboutPageInProgress: boolean;
}
 
export const clientConfig: ClientConfig = {
  // Event settings
  showAboutPageInProgress: false,
  showAnnouncement: false,
  activeLanguages: [Language.FINNISH, Language.ENGLISH, Language.SWEDISH],
 
  // Dev
  enableReduxTrace: false,
  enableAxe: false,
  enableWhyDidYouRender: false,
 
  // Environment dependent
  loadedSettings: process.env.SETTINGS ?? "development",
  apiServerUrl: process.env.API_SERVER_URL ?? "http://localhost:5000",
  showTestValues: process.env.SHOW_TEST_VALUES === "true" || false,
  // eslint-disable-next-line unicorn/prefer-logical-operator-over-ternary
  dataUpdateInterval: Number(process.env.DATA_UPDATE_INTERVAL)
    ? Number(process.env.DATA_UPDATE_INTERVAL)
    : 60, // seconds
  // Build time baked in at build time, empty when built without one (local
  // dev). The bundle's own git SHA isn't baked in: nothing reads it, because
  // deploys are told apart by which build is newer rather than by identity
  appBuildTime: process.env.APP_BUILD_TIME ?? "",
};