-
Notifications
You must be signed in to change notification settings - Fork 215
Support liquid fields for issue and evidence tables #1480
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
base: develop
Are you sure you want to change the base?
Conversation
| else | ||
| [evidence.fields.fetch(column, ''), markup(evidence.fields.fetch(column, ''))] | ||
| liquid_content = evidence.fields.fetch(column, '') | ||
| preview_path = preview_project_issue_evidence_path(current_project, @issue, evidence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd set this in the controller like we do with @form_preview_path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the index action only handles the collection, the controller cannot access a specific evidence instance variable to set the preview_path. Therefore, we must either add logic to iterate over all evidence records in the controller index action, or use the Evidence.new approach to generate a reusable path template for JS to update the path with the correct ID.
In this specific context, neither of those two options is worth the added complexity or performance drop. The simplest and most efficient solution is to keep the path generation in the view partial's loop, where the evidence is availiable.
Summary
Currently, even though Liquid works as expected in Word filters and other contexts, it cannot be displayed properly in the Issues/Evidence tables.
Leverage the existing liquid-async and preview flow to render liquid content for issues and evidence field tables.
Check List