Skip to content

feat(tags): implement TagNormalizer for keyword validation and update… - #1607

Merged
NishaSharma14 merged 3 commits into
developmentfrom
fix/tag-keyword-guard
Nov 3, 2026
Merged

NishaSharma14 merged 3 commits into
developmentfrom
fix/tag-keyword-guard

Conversation

@NishaSharma14

@NishaSharma14 NishaSharma14 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

… tag handling across drafts, projects, and studies to block user from entering non-ASCII characters.

Add a server-side guard that returns a validation error (422, key tags) instead of a 500:

  • New App\Support\Tags\TagNormalizer: splits on | and newlines, trims, drops empties, de-duplicates, and rejects any keyword containing non-ASCII characters.
  • Applied in UpdateProject, UpdateStudy and ProcessDraft.
  • The error message lists the offending keywords and the supported separators (comma, semicolon, pipe).
  • Keyword inputs now accept | as a separator and show an updated placeholder: "Type a keyword or keywords separated by comma (,), semicolon (;) or pipe (|) and press enter" (Publish.vue, Submission.vue, Upload.vue, Study/Partials/Details.vue, Project/Partials/Details.vue).
  • Feature tests in UpdateProjectTest cover a pipe-separated list and a non-ASCII keyword.

… tag handling across drafts, projects, and studies to block user from entering non-ASCII characters.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved separator handling, validation error display, and regression-coverage issues remain.

1 open issue
What changed in this PR

Adds centralized tag normalization and non-ASCII validation across draft, project, and study workflows.

Changes:

  • Introduces shared tag normalization and validation.
  • Applies it to draft, project, and study updates.
  • Updates keyword inputs for pipe-separated values.
  • Adds project-level regression tests.
File Summary
tests/​Feature/​Project/​UpdateProjectTest.php Tests project tag splitting and validation.
resources/​js/​Shared/​Submission.vue Adds pipe-separated tag input support.
resources/​js/​Pages/​Upload.vue Adds pipe-separated tag input support.
resources/​js/​Pages/​Study/​Partials/​Details.vue Updates study tag input; tags validation error rendering is needed.
resources/​js/​Pages/​Publish.vue Adds pipe-separated tag input support.
resources/​js/​Pages/​Project/​Partials/​Details.vue Updates project tag input; tags validation error rendering is needed.
app/​Support/​Tags/​TagNormalizer.php Adds shared normalization and validation; comma and semicolon separators need support.
app/​Actions/​Study/​UpdateStudy.php Applies normalization to study updates; add focused regression coverage.
app/​Actions/​Project/​UpdateProject.php Applies normalization to project updates.
app/​Actions/​Draft/​ProcessDraft.php Applies normalization to drafts; add focused regression coverage.

Review effort: Lite

Comment thread app/Support/Tags/TagNormalizer.php Resolved
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.67%. Comparing base (51dd721) to head (e7a85d4).
⚠️ Report is 1 commits behind head on development.

Files with missing lines Patch % Lines
app/Support/Tags/TagNormalizer.php 94.73% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             development    #1607      +/-   ##
=================================================
+ Coverage          83.66%   83.67%   +0.01%     
- Complexity          5700     5709       +9     
=================================================
  Files                361      362       +1     
  Lines              20230    20251      +21     
=================================================
+ Hits               16926    16946      +20     
- Misses              3304     3305       +1     
Flag Coverage Δ
unittests 83.67% <96.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NishaSharma14 NishaSharma14 self-assigned this Oct 21, 2026
@NishaSharma14
NishaSharma14 merged commit ce0d642 into development Nov 3, 2026
4 checks passed
@NishaSharma14
NishaSharma14 deleted the fix/tag-keyword-guard branch November 3, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 on project update when a keyword contains non-ASCII characters (production DB is SQL_ASCII)

2 participants