Skip to content

fix(ui): replace tojson with single-quoted literals in Fetch Tools onclick#3179

Closed
crivetimihai wants to merge 1 commit intomainfrom
fix/fetch-tools-button-tojson-escaping
Closed

fix(ui): replace tojson with single-quoted literals in Fetch Tools onclick#3179
crivetimihai wants to merge 1 commit intomainfrom
fix/fetch-tools-button-tojson-escaping

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

Note: This PR was re-created from #3100 due to repository maintenance. Your code and branch are intact. @omorros please verify everything looks good.

🔗 Related Issue

Closes #3082


📝 Summary

The "Fetch Tools" button in gateways_partial.html was broken because |tojson outputs double-quoted JSON strings inside a
double-quoted onclick attribute, corrupting HTML parsing. Replaced with single-quoted JS literals to match the working
pattern used everywhere else in the templates.


🏷️ Type of Change

  • Bug fix

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 80% make coverage

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • Tests added/updated for changes
  • Documentation updated (if applicable)
  • No secrets or credentials committed

📓 Notes (optional)

Single line change in gateways_partial.html:41. The same button works correctly in admin.html (initial page load) which
already uses single quotes — this fix aligns the HTMX partial to match.

…k handler

Signed-off-by: Oriol Morros Vilaseca <OM368@student.aru.ac.uk>
@crivetimihai crivetimihai added this to the Release 1.0.0-GA milestone Feb 24, 2026
@crivetimihai crivetimihai added bug Something isn't working ui User Interface SHOULD P2: Important but not vital; high-value items that are not crucial for the immediate release labels Feb 24, 2026
@omorros
Copy link
Copy Markdown
Contributor

omorros commented Feb 24, 2026

Hi @crivetimihai thanks for reopening this! I've verified the code, everything looks good, intact and matching my original changes. Ready for review whenever you get the chance. Thanks!

Copy link
Copy Markdown
Collaborator

@marekdano marekdano left a comment

Choose a reason for hiding this comment

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

Approving, as it was already approved by me on #3100. The changes in this PR are the same.

LGTM 🚀

@crivetimihai crivetimihai added the merge-queue Rebased and ready to merge label Mar 3, 2026
@crivetimihai crivetimihai self-assigned this Mar 7, 2026
@crivetimihai crivetimihai added the release-fix Critical bugfix required for the release label Mar 7, 2026
@marekdano
Copy link
Copy Markdown
Collaborator

@omorros - can you please resolve conflicts?

@marekdano marekdano closed this Mar 11, 2026
@marekdano marekdano reopened this Mar 11, 2026
@omorros
Copy link
Copy Markdown
Contributor

omorros commented Mar 11, 2026

Hi @crivetimihai @marekdano I've rebased the fix onto the latest main and it's ready to go, but since the PR branch lives on the IBM repo I don't have push access to update it directly. Would it be okay if I open a new PR from my fork instead? Happy to link it to #3082 and reference this one. Let me know!

@marekdano
Copy link
Copy Markdown
Collaborator

marekdano commented Mar 11, 2026

Hi @crivetimihai @marekdano I've rebased the fix onto the latest main and it's ready to go, but since the PR branch lives on the IBM repo I don't have push access to update it directly. Would it be okay if I open a new PR from my fork instead? Happy to link it to #3082 and reference this one. Let me know!

@omorros - If creating a new PR helps to solve the issue, please create a new PR and reference this one there.

@marekdano
Copy link
Copy Markdown
Collaborator

Closing this PR. A new PR #3616 has been created to cover the fix

@marekdano marekdano closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working merge-queue Rebased and ready to merge release-fix Critical bugfix required for the release SHOULD P2: Important but not vital; high-value items that are not crucial for the immediate release ui User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][UI]: Fetch Tools button broken due to Jinja tojson quote escaping in gateways_partial.html

3 participants