Fix merged table rendering in Python env #3739
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the context of this PR?
Fixes: ONSDESYS-653
This PR fixes some bugs in the table macro related to some logic in that macro that doesnt work correctly in a python/jinja2 environment.
The first change is to the way the
ons-table--has-rowspanis added to the<table>element. In jinja2 any variable set inside a for loop are only accessible in that for loop so the changes to thehasRowSpanvar were inaccessible from outside of the loop so it was always false when it came to adding the class. This had to be refactored to add the class inside the loop instead of setting the var. This fixed the spacing and border issues.The second change fixes the way keys are accessed and set within object in a jinja2 env. Without the quotes around
thsthis was being set as undefined and therefore in the loop{% for th in headerCols.ths %}this key was inaccessible so the titles were never being set.How to review this PR
example-table-merge-cellsexampleload-design-system-templatesstep from the run command in the make fileChecklist
This needs to be completed by the person raising the PR.