Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kcodeblock): updated copy button data-test-id [KHCP-14752] #2577

Conversation

afrzhussain
Copy link
Contributor

JIRA ticket : https://konghq.atlassian.net/browse/KHCP-14752
Added Unique Id for copy button data-test-id

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for kongponents-sandbox ready!

Name Link
🔨 Latest commit 27d527f
🔍 Latest deploy log https://app.netlify.com/sites/kongponents-sandbox/deploys/678e7322cfa95c00083be2d6
😎 Deploy Preview https://deploy-preview-2577--kongponents-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for kongponents ready!

Name Link
🔨 Latest commit 27d527f
🔍 Latest deploy log https://app.netlify.com/sites/kongponents/deploys/678e73228267560008f9729d
😎 Deploy Preview https://deploy-preview-2577--kongponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -156,7 +156,7 @@
:aria-label="`Copy (${ALT_SHORTCUT_LABEL}+C)`"
class="code-block-copy-button"
:copy-tooltip="`Copy (${ALT_SHORTCUT_LABEL}+C)`"
data-testid="code-block-copy-button"
:data-testid="`code-block-copy-button${id ? '-' + id : '' }`"
Copy link
Member

Choose a reason for hiding this comment

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

if id is a required prop, how would it be empty...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

empty strings are still accepted right ?
example : id=""

Copy link
Collaborator

@kaiarrowood kaiarrowood Jan 17, 2025

Choose a reason for hiding this comment

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

'' is considered falsey for prop { type: String, required: true }

EDIT: maybe that's not true 🤔 , but either way you don't gain much from this except not appending a dash if the string is empty. Seems like unnecessary logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i'll just remove the logic

@afrzhussain afrzhussain requested a review from portikM January 17, 2025 16:20
Copy link
Member

@portikM portikM left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@afrzhussain afrzhussain merged commit 63bd9da into main Jan 20, 2025
10 checks passed
@afrzhussain afrzhussain deleted the KHCP-14752-k-code-block-use-id-prop-in-copy-buttons-data-testid branch January 20, 2025 18:27
kongponents-bot pushed a commit that referenced this pull request Jan 20, 2025
## [9.17.2](v9.17.1...v9.17.2) (2025-01-20)

### Bug Fixes

* **kcodeblock:** updated copy button data-test-id [KHCP-14752] ([#2577](#2577)) ([63bd9da](63bd9da))
@kongponents-bot
Copy link
Collaborator

🎉 This PR is included in version 9.17.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants