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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | 22x 22x 22x 22x 22x 22x 22x 1x 1x 1x 1x 1x 1x 1x 1x | /* * Copyright 2021 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 React from 'react' import { get, isEmpty } from 'lodash-es' import { Container, Icon, Text, Layout } from '@wings-software/uicore' import { Color } from '@harness/design-system' import { useStrings } from 'framework/strings' import BarrierStageTooltip from '../BarrierStageTooltip/BarrierStageTooltip' export interface CDInfoProps { data?: any barrier?: { barrierInfoLoading?: boolean barrierData?: any } } export default function CDInfo(props: CDInfoProps): React.ReactElement { const { getString } = useStrings() const { data, barrier } = props const artifacts = get(data, 'data.moduleInfo.cd.serviceInfo.artifacts.sidecars', []).map( (artifact: any) => artifact.imagePath ?? artifact.version ) const primaryArtifactPath = get(data, 'data.moduleInfo.cd.serviceInfo.artifacts.primary', {}) Iif (!isEmpty(primaryArtifactPath)) { artifacts.push(primaryArtifactPath.imagePath ?? primaryArtifactPath.version) } const serviceName = get(data, 'data.moduleInfo.cd.serviceInfo.displayName', null) const environment = get(data, 'data.moduleInfo.cd.infraExecutionSummary.name', null) return ( <Container> {barrier?.barrierData?.data && data.status === 'Running' && ( <BarrierStageTooltip loading={!!barrier.barrierInfoLoading} stageName={data.name} data={barrier.barrierData?.data} /> )} {(serviceName || artifacts.length > 0 || environment) && ( <Container border={{ top: true, width: 1, color: Color.GREY_100 }} padding={{ top: 'small' }}> {serviceName && ( <Layout.Horizontal padding={{ right: 'medium', bottom: 'small', left: 'small' }}> <Container flex={{ justifyContent: 'center', alignItems: 'start' }} width={32}> <Icon name="services" color={Color.GREY_600} size={24} /> </Container> <Layout.Vertical spacing={'xsmall'} padding={{ top: 'xsmall', bottom: 'xsmall' }}> <Text font={{ size: 'small', weight: 'semi-bold' }} color={Color.BLACK}> {getString('serviceOrServices')} </Text> <Text font={{ size: 'xsmall' }} color={Color.GREY_700} data-testid="hovercard-service"> {serviceName} </Text> </Layout.Vertical> </Layout.Horizontal> )} {artifacts.length > 0 && ( <Layout.Horizontal padding={{ right: 'medium', bottom: 'small', left: 'small' }}> <Container flex={{ justifyContent: 'center', alignItems: 'start' }} width={32}> <Icon name="services" color={Color.GREY_600} size={24} /> </Container> <Layout.Vertical spacing={'xsmall'} padding={{ top: 'xsmall', bottom: 'xsmall' }}> <Text font={{ size: 'small', weight: 'semi-bold' }} color={Color.BLACK}> {getString('artifactOrArtifacts')} </Text> <Layout.Vertical spacing={'xsmall'} data-testid="hovercard-artifact"> {artifacts.map((imagePath: string, index: number) => ( <Text key={`${imagePath}+${index}`} font={{ size: 'xsmall' }} color={Color.GREY_700} data-testid="hovercard-environment" > {imagePath} </Text> ))} </Layout.Vertical> </Layout.Vertical> </Layout.Horizontal> )} {environment && ( <Layout.Horizontal padding={{ right: 'medium', bottom: 'small', left: 'small' }}> <Container flex={{ justifyContent: 'center', alignItems: 'start' }} width={32}> <Icon name="services" color={Color.GREY_600} size={24} /> </Container> <Layout.Vertical spacing={'xsmall'} padding={{ top: 'xsmall', bottom: 'xsmall' }}> <Text font={{ size: 'small', weight: 'semi-bold' }} color={Color.BLACK}> {getString('environmentOrEnvironments')} </Text> <Text font={{ size: 'xsmall' }} color={Color.GREY_700} data-testid="hovercard-environment"> {environment} </Text> </Layout.Vertical> </Layout.Horizontal> )} </Container> )} </Container> ) } |