All files / modules/85-cv/pages/slos CVSLOsListingPage.types.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3

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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90                                                                          13x 13x 13x                                                                                                    
/*
 * Copyright 2022 Harness Inc. All rights reserved.
 * Use of this source code is governed by the PolyForm Shield 1.0.0 license
 * that can be found in the licenses directory at the root of this repository, also available at
 * https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt.
 */
 
import type { SelectOption } from '@wings-software/uicore'
import type { MonitoredServiceDTO, RiskCount, SLODashboardWidget, SLOErrorBudgetResetDTO } from 'services/cv'
import type { SLOActionTypes } from './CVSLOsListingPage.constants'
 
export interface CVSLOsListingPageProps {
  monitoredService?: Pick<MonitoredServiceDTO, 'name' | 'identifier'>
}
 
// SLOCardHeader
 
export interface SLOCardHeaderProps {
  serviceLevelObjective: SLODashboardWidget
  onDelete: (identifier: string, name: string) => void
  onResetErrorBudget: (sloIdentifier: string, formDate: SLOErrorBudgetResetDTO) => void
  monitoredServiceIdentifier?: string
}
 
// SLOCardContent
 
export interface SLOCardContentProps {
  isCardView?: boolean
  serviceLevelObjective: SLODashboardWidget
  sliderTimeRange?: { startTime: number; endTime: number }
  setSliderTimeRange?: (timeRange?: SLOCardContentProps['sliderTimeRange']) => void
}
 
export interface SLOTargetChartWithChangeTimelineProps extends SLOCardContentProps {
  type: SLOCardToggleViews
}
 
export enum SLOCardToggleViews {
  SLO = 'SLO',
  ERROR_BUDGET = 'ERROR_BUDGET'
}
 
export interface GetSLOAndErrorBudgetGraphOptions {
  minXLimit: number
  maxXLimit: number
  type: SLOCardToggleViews
  serviceLevelObjective: SLODashboardWidget
  startTime: number
  endTime: number
  isCardView?: boolean
}
 
export type RiskTypes = 'HEALTHY' | 'OBSERVE' | 'NEED_ATTENTION' | 'UNHEALTHY' | 'EXHAUSTED'
 
export interface SLODashboardRiskCount {
  displayName?: string
  count?: number
  identifier?: RiskTypes
}
 
export interface SLORiskFilter extends RiskCount {
  displayColor: string
}
 
export type SLITypes = 'Availability' | 'Latency' | 'All'
export type SLITypesParams = 'Availability' | 'Latency'
export type TargetTypes = 'Rolling' | 'Calender' | 'All'
export type TargetTypesParams = 'Rolling' | 'Calender'
 
export interface SLOFilterState {
  userJourney: SelectOption
  monitoredService: SelectOption
  sliTypes: SelectOption
  targetTypes: SelectOption
  sloRiskFilter: SLORiskFilter | null
}
 
export interface SLOFilterAction {
  type: SLOActionTypes
  payload?: SLOActionPayload
}
 
export interface SLOActionPayload {
  userJourney?: SelectOption
  monitoredService?: SelectOption
  sliTypes?: SelectOption
  targetTypes?: SelectOption
  sloRiskFilter?: SLORiskFilter | null
}