Skip to content

feat: Integration of API token flag && Data test id in API Token#2828

Merged
shivani170 merged 9 commits intodevelopfrom
chore-data-test-is
Jul 16, 2025
Merged

feat: Integration of API token flag && Data test id in API Token#2828
shivani170 merged 9 commits intodevelopfrom
chore-data-test-is

Conversation

@shivani170
Copy link
Contributor

@shivani170 shivani170 commented Jul 15, 2025

Description

  • API Token show/hide on the basis either token value coming from BE or not

Fixes https://github.com/devtron-labs/sprint-tasks/issues/2477

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@github-actions github-actions bot added the PR:Ready-to-Review PR:Ready-to-Review label Jul 15, 2025
@shivani170 shivani170 changed the title chore: Data test id in API Token feat: Data test id in API Token Jul 15, 2025
vivek-devtron
vivek-devtron previously approved these changes Jul 15, 2025
@shivani170 shivani170 changed the title feat: Data test id in API Token feat: Integration of API token floag && Data test id in API Token Jul 15, 2025
@shivani170 shivani170 changed the title feat: Integration of API token floag && Data test id in API Token feat: Integration of API token flag && Data test id in API Token Jul 15, 2025
@AbhishekA1509 AbhishekA1509 requested a review from Copilot July 15, 2025 11:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getWebhookTokenListOptions helper and token tabs in webhook.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 hideApiToken flag

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 getWebhookTokenListOptions helper 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[] => {

AbhishekA1509
AbhishekA1509 previously approved these changes Jul 15, 2025
vivek-devtron
vivek-devtron previously approved these changes Jul 16, 2025
@sonarqubecloud
Copy link

@shivani170 shivani170 merged commit 8649a46 into develop Jul 16, 2025
10 checks passed
@shivani170 shivani170 deleted the chore-data-test-is branch July 16, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:Ready-to-Review PR:Ready-to-Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants