Skip to content

Commit 5cc2461

Browse files
committed
content added for global only & pipeline
1 parent 3248a8e commit 5cc2461

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/cdPipeline/PullImageDigestToggle.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react'
33
import Tippy from '@tippyjs/react'
44
import { ReactComponent as DockerWithImage } from '../../assets/icons/ic-docker-with-image.svg'
55
import { PullImageDigestToggleType } from './types'
6-
import { DIGEST_DISABLE_TOGGLE_MESSAGE_FOR_PIPELINE, DIGEST_DISABLE_TOGGLE_MESSAGE_GLOBAL } from '../../config'
6+
import { DIGEST_DISABLE_TOGGLE_MESSAGE_FOR_PIPELINE, DIGEST_DISABLE_TOGGLE_MESSAGE_GLOBAL_ONLY } from '../../config'
77

88
function PullImageDigestToggle({ formData, setFormData }: PullImageDigestToggleType): JSX.Element {
99
const handleImageDigestToggle = (): void => {
@@ -14,10 +14,10 @@ function PullImageDigestToggle({ formData, setFormData }: PullImageDigestToggleT
1414

1515
const getContentText = () => {
1616
let text = ''
17-
if (formData.isDigestEnforcedForEnv) {
18-
text = DIGEST_DISABLE_TOGGLE_MESSAGE_GLOBAL
19-
} else if (formData.isDigestEnforcedForPipeline) {
17+
if (formData.isDigestEnforcedForPipeline && formData.isDigestEnforcedForEnv) {
2018
text = DIGEST_DISABLE_TOGGLE_MESSAGE_FOR_PIPELINE
19+
} else if (formData.isDigestEnforcedForEnv) {
20+
text = DIGEST_DISABLE_TOGGLE_MESSAGE_GLOBAL_ONLY
2121
}
2222
return text
2323
}

src/config/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,6 @@ export const CVE_ID_NOT_FOUND = "CVE ID not found"
812812
export const CONFIGURE_LINK_NO_NAME = "Please provide name for the tool you want to link"
813813
export const NO_HOST_URL = "Please enter host url"
814814
export const WEBHOOK_NO_API_TOKEN_ERROR = "API Token is required to execute webhook"
815-
export const DIGEST_DISABLE_TOGGLE_MESSAGE_GLOBAL= "Pull image digest policy is enforced in Global Configurations. Go to Global Configurations to change."
815+
export const DIGEST_DISABLE_TOGGLE_MESSAGE_GLOBAL_ONLY= "Enforced from Global Configurations. Go to Global Configurations to change."
816816
export const DIGEST_DISABLE_TOGGLE_MESSAGE_FOR_PIPELINE= "Enforced from Global Configurations. To change, first disable it in Global Configurations, then come back here."
817817

0 commit comments

Comments
 (0)