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

Make links relative in sortable table header Nunjucks macro #161

Open
wants to merge 1 commit into
base: feature/nunjucks-as-express-rendering-engine
Choose a base branch
from

Conversation

danlivings-dxw
Copy link
Contributor

@danlivings-dxw danlivings-dxw commented Apr 4, 2025

The sortableTableHeader macro will generate links that use query parameters to control the sorting of the dashboard. However, as the table header links are of the form
/?sortBy=<sort>&sortDirection=<direction>, they will only work correctly when used on the root path. To make them usable anywhere, just the query part of the URL can be used as the href, which will link to the current page with the updated query parameters.

@danlivings-dxw danlivings-dxw force-pushed the feature/nunjucks-as-express-rendering-engine branch from 3f782d4 to 9e1085b Compare April 4, 2025 10:58
The sortableTableHeader macro will generate links that use query
parameters to control the sorting of the dashboard. However, as the
table header links are of the form
/?sortBy=<sort>&sortDirection=<direction>, they will only work
correctly when used on the root path. To make them usable anywhere,
just the query part of the URL can be used as the href, which will
link to the current page with the updated query parameters.
@danlivings-dxw danlivings-dxw force-pushed the fix/use-relative-href-for-sortable-table-headers branch from 3a16e88 to 9605234 Compare April 4, 2025 10:59
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.

1 participant