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(kselect): add item-creation-validator prop [KHCP-13862] #2485

Merged
merged 8 commits into from
Oct 31, 2024

Conversation

portikM
Copy link
Member

@portikM portikM commented Oct 28, 2024

Summary

Addresses: https://konghq.atlassian.net/browse/KHCP-13862

Adds itemCreationValidator prop for validating user input when enableItemCreation is true

@portikM portikM self-assigned this Oct 28, 2024
@portikM portikM requested review from adamdehaven, jillztom, Justineo and a team as code owners October 28, 2024 18:51
Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for kongponents-sandbox ready!

Name Link
🔨 Latest commit 109783d
🔍 Latest deploy log https://app.netlify.com/sites/kongponents-sandbox/deploys/6723eac91e4edc000896ee1a
😎 Deploy Preview https://deploy-preview-2485--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 Oct 28, 2024

Deploy Preview for kongponents ready!

Name Link
🔨 Latest commit 109783d
🔍 Latest deploy log https://app.netlify.com/sites/kongponents/deploys/6723eac98e2ec20008f0726c
😎 Deploy Preview https://deploy-preview-2485--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.

@portikM portikM enabled auto-merge (squash) October 28, 2024 18:56
mihai-peteu
mihai-peteu previously approved these changes Oct 31, 2024
@@ -372,6 +372,67 @@ When used in conjunction with `enableFiltering` set to `true`, KSelect will sugg
<KSelect enable-item-creation enable-filtering placeholder="Try searching for 'service d'" :items="selectItems" />
```

### itemCreationValidator

Prop for passing a function for input validation when item creation is enabled. The function takes query input string as a single parameter and must return a `boolean` value. When a function passed through `itemCreationValidator` returns `false`, the _Add new value_ button will be disabled.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Prop for passing a function for input validation when item creation is enabled. The function takes query input string as a single parameter and must return a `boolean` value. When a function passed through `itemCreationValidator` returns `false`, the _Add new value_ button will be disabled.
Prop for passing a function for input validation when item creation is enabled.
The function takes the query input string as a single parameter and must return a `boolean` value.
When the function passed through `itemCreationValidator` returns `false`, the "Add new value" button will be disabled.

src/components/KSelect/KSelect.vue Outdated Show resolved Hide resolved
@portikM portikM merged commit bf31855 into main Oct 31, 2024
11 checks passed
@portikM portikM deleted the fix/khcp-13862-kselect-item-creation-validator branch October 31, 2024 20:43
kongponents-bot pushed a commit that referenced this pull request Oct 31, 2024
## [9.14.6](v9.14.5...v9.14.6) (2024-10-31)

### Bug Fixes

* **kselect:** add item-creation-validator prop [KHCP-13862] ([#2485](#2485)) ([bf31855](bf31855))
@kongponents-bot
Copy link
Collaborator

🎉 This PR is included in version 9.14.6 🎉

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.

4 participants