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: validate group name #4197

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

Dominik-Kuzila
Copy link

Added a validator to addGroup action so that a new group name cannot be an empty string.
#2367

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 2.38%. Comparing base (6932f28) to head (eb4ea50).
Report is 213 commits behind head on main.

Files with missing lines Patch % Lines
src/store/groups.js 0.00% 1 Missing and 1 partial ⚠️
src/components/AppNavigation/RootNavigation.vue 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #4197       +/-   ##
============================================
- Coverage     65.90%   2.38%   -63.52%     
============================================
  Files            24      92       +68     
  Lines           786    4649     +3863     
  Branches          0    1162     +1162     
============================================
- Hits            518     111      -407     
- Misses          268    4418     +4150     
- Partials          0     120      +120     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SebastianKrupinski SebastianKrupinski changed the title Enhanc/validate group name fix: validate group name Oct 27, 2024
@SebastianKrupinski
Copy link
Contributor

SebastianKrupinski commented Oct 27, 2024

Hi @Dominik-Kuzila

Thank you for the pull request. I see no reason not to accept this. Just need a couple things fixed first,

A) can you please address the linting error. https://github.com/nextcloud/contacts/actions/runs/11543509232/job/32128715557?pr=4197

B) can you please squash all your commits in to a single commit.

C) please sign your git commit with git commit -sm 'fix: validate group name'

@Dominik-Kuzila Dominik-Kuzila force-pushed the enhanc/validate-group-name branch from 9d1d335 to c49b1ac Compare October 27, 2024 22:07
@Dominik-Kuzila
Copy link
Author

Hi, thank you for responding. Please let me know if I fixed it correctly or if there's anything else I should fix.

Copy link
Contributor

@hamza221 hamza221 left a comment

Choose a reason for hiding this comment

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

Looks good, can you please add a .catch here

this.$store.dispatch('addGroup', groupName)

@SebastianKrupinski
Copy link
Contributor

@Dominik-Kuzila Thank you for addressing items, Please also add the try/catch for the line that @hamza221 specified, and maybe pop up an error for the user.

showError(t('contacts', 'The message'))

showError() shows the error, t() is for translation.

@Dominik-Kuzila Dominik-Kuzila force-pushed the enhanc/validate-group-name branch from c49b1ac to 88593b0 Compare October 28, 2024 22:21
Signed-off-by: Dominik Kuzila <[email protected]>
@Dominik-Kuzila Dominik-Kuzila force-pushed the enhanc/validate-group-name branch from 88593b0 to eb4ea50 Compare October 29, 2024 12:37
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski left a comment

Choose a reason for hiding this comment

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

Tested. Work good.

@hamza221 hamza221 merged commit cbf8d94 into nextcloud:main Oct 31, 2024
31 of 33 checks passed
Copy link

welcome bot commented Oct 31, 2024

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/contacts/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

@hamza221
Copy link
Contributor

/backport to stable6.1

@hamza221
Copy link
Contributor

/backport to stable6.0

Copy link

backportbot bot commented Oct 31, 2024

The backport to stable6.0 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable6.0
git pull origin stable6.0

# Create the new backport branch
git checkout -b backport/4197/stable6.0

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick eb4ea50c

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/4197/stable6.0

Error: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Successfully merging this pull request may close these issues.

3 participants