feat: Integration of API token flag && Data test id in API Token#2828
Merged
shivani170 merged 9 commits intodevelopfrom Jul 16, 2025
Merged
feat: Integration of API token flag && Data test id in API Token#2828shivani170 merged 9 commits intodevelopfrom
shivani170 merged 9 commits intodevelopfrom
Conversation
vivek-devtron
previously approved these changes
Jul 15, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for selecting or auto-generating API tokens in the Webhook details UI and propagates a new hideApiToken flag throughout the API token workflows.
- Introduce
getWebhookTokenListOptionshelper and token tabs inwebhook.utils.ts - Extend services, types, and modals to fetch and display API tokens (including
hideApiToken) - Update API token components and types to pass and respect the
hideApiTokenflag
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/ciPipeline/Webhook/webhook.utils.ts | Added token tab list and mapping helper |
| src/components/ciPipeline/Webhook/webhook.service.ts | New API call to fetch Webhook-specific tokens |
| src/components/ciPipeline/Webhook/types.ts | Defined new option types and response for API tokens |
| src/components/ciPipeline/Webhook/WebhookDetailsModal.tsx | Integrated token selection UI and logic |
| src/Pages/GlobalConfigurations/Authorization/types.ts | Extended permission payload to include hideApiToken |
| src/Pages/GlobalConfigurations/Authorization/APITokens/apiToken.utils.ts | Added getApiTokenHeader and unused helper parameters |
| src/Pages/GlobalConfigurations/Authorization/APITokens/apiToken.type.ts | Made token optional and added hideApiToken |
| src/Pages/GlobalConfigurations/Authorization/APITokens/RegenerateModal.tsx | Propagate hideApiToken to regenerate modal |
| src/Pages/GlobalConfigurations/Authorization/APITokens/GenerateModal.tsx | Use getApiTokenHeader and default props for hideApiToken |
| src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx | Display existing token with clipboard button |
| src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx | Pass hideApiToken when creating tokens |
| src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx | Include token in search filter and initialize hideApiToken |
Comments suppressed due to low confidence (1)
src/components/ciPipeline/Webhook/webhook.utils.ts:50
- [nitpick] The new
getWebhookTokenListOptionshelper lacks unit tests to verify correct mapping of token properties to select options. Consider adding tests for edge cases (e.g., empty lists, special characters).
export const getWebhookTokenListOptions = (tokenList: TokenListType[]): TokenListOptionsType[] => {
src/Pages/GlobalConfigurations/Authorization/APITokens/apiToken.utils.ts
Show resolved
Hide resolved
src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx
Outdated
Show resolved
Hide resolved
AbhishekA1509
requested changes
Jul 15, 2025
src/Pages/GlobalConfigurations/Authorization/APITokens/RegenerateModal.tsx
Outdated
Show resolved
Hide resolved
src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx
Show resolved
Hide resolved
AbhishekA1509
previously approved these changes
Jul 15, 2025
src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx
Outdated
Show resolved
Hide resolved
src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx
Outdated
Show resolved
Hide resolved
src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx
Outdated
Show resolved
Hide resolved
vivek-devtron
previously approved these changes
Jul 16, 2025
|
vivek-devtron
approved these changes
Jul 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes https://github.com/devtron-labs/sprint-tasks/issues/2477
Type of change
Checklist: