Skip to content

Commit 0b0f139

Browse files
committed
chore: generate api token optional check
1 parent 0622fbf commit 0b0f139

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/ciPipeline/Webhook/WebhookDetailsModal.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ import './webhookDetails.scss'
5050
import { getUserRole, createOrUpdateUser } from '@Pages/GlobalConfigurations/Authorization/authorization.service'
5151
import { MODES, SERVER_MODE, WEBHOOK_NO_API_TOKEN_ERROR } from '../../../config'
5252
import { createGeneratedAPIToken } from '@Pages/GlobalConfigurations/Authorization/APITokens/service'
53-
import { CURL_PREFIX, GENERATE_TOKEN_WITH_REQUIRED_PERMISSIONS, PLAYGROUND_TAB_LIST, REQUEST_BODY_TAB_LIST, RESPONSE_TAB_LIST } from './webhook.utils'
53+
import {
54+
CURL_PREFIX,
55+
GENERATE_TOKEN_WITH_REQUIRED_PERMISSIONS,
56+
PLAYGROUND_TAB_LIST,
57+
REQUEST_BODY_TAB_LIST,
58+
RESPONSE_TAB_LIST,
59+
} from './webhook.utils'
5460
import { SchemaType, TabDetailsType, WebhookDetailsType, WebhookDetailType } from './types'
5561
import { executeWebhookAPI, getExternalCIConfig } from './webhook.service'
5662
import { GENERATE_TOKEN_NAME_VALIDATION } from '../../../config/constantMessaging'
@@ -353,7 +359,9 @@ export const WebhookDetailsModal = ({ close, isTemplateView }: WebhookDetailType
353359
}
354360

355361
const handleCopyToClipboard = async ({ e, token }: { e: React.MouseEvent; token: string }) => {
356-
stopPropagation(e)
362+
if (e) {
363+
stopPropagation(e)
364+
}
357365
setCopyToClipboardPromise(copyToClipboard(token))
358366
}
359367

0 commit comments

Comments
 (0)