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

Bug 1893924 - Tabular reports return blank tables #2241

Merged
merged 1 commit into from
May 3, 2024

Conversation

dklawren
Copy link
Collaborator

@dklawren dklawren commented May 2, 2024

Second try at fixing this the correct way.

What was happening is when a single table of the report was being rendered, report.cgi was setting the table name to " " which the JS changes didn't like. So I now set the table name to "single" and look for that instead of " ". This fixes one issue occurring. On the same note there was also an issue with table identifiers have spaces in the names which I had to remove otherwise the tables were misrendered.

Another issue was that linkify and linkifyTotal formatters were not getting the column name value properly and only the row name and count. By passing in $column element (a ) to the formatters I am able to access the column and name and remove the undefined values showing up in the links to buglist.cgi.

And lastly, a third issue was when displaying multiple tables on a single report. The tables had data appearing in the wrong places when the JS was rendering them since each table was not distinct and was using the same "report_table" identifier. Changing to "report_table_[% tbl_id FILTER html %]" made each one distinct and all were rendered properly.

@dklawren dklawren requested review from kyoshino and cgsheeh and removed request for kyoshino May 2, 2024 22:36

// encodeURIComponent() doesn't escape single quotes.
return encodeURIComponent(str).replace(/'/g, escape);
};

window.addEventListener('DOMContentLoaded', () => {
const linkify = ({ value, data }) => {
const linkify = ({ $column, value, data }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think this can just be column without the $, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nit: I think this can just be column without the $, right?

You are correct. Technically $column and column are no different to Javascript but in style of JS used in Bugzlla, variables with $ are used to denote a DOM element so I used it to be consistent.

@dklawren dklawren merged commit 1f0f80e into mozilla-bteam:master May 3, 2024
17 checks passed
@dklawren dklawren deleted the 1893924 branch May 3, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants