-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature Request: Refer to the current fava filters (time, account, filter) in link field #24
Comments
hi @ileodo, yes that's possible, take a look at the example dashboard: fava-dashboards/example/dashboards.yaml Line 592 in 4d6340b
You can access the account and filter in the same way. |
thanks @andreasgerstmayr, it would be great to just support a special variable name in the link filed which will be replaced with the time instead of manually do it in js. |
I'd like to keep the extension as simple as possible, and don't plan to support this for now. |
@ileodo: Related to this, just wanted to share this snippet of code that makes the above request pretty easy to implement within the new # dashboards.yml
utils:
inline: |
const linkReplacer = () => {
const windowUrl = new URL(window.location.href);
window.document.querySelectorAll('h2 a').forEach(function (el) {
const linkUrl = new URL(el.href);
linkUrl.searchParams.set('time', windowUrl.searchParams.get('time'));
linkUrl.searchParams.set('conversion', windowUrl.searchParams.get('conversion'));
el.href = linkUrl;
});
}
linkReplacer(); This JS snippet runs after each page load, loops through all the dashboard's panel headlines, and updates their |
@mattmattmatt thanks for the snippet! I've added a generic way to copy Fava's filter parameters to all links in #41. |
as per above, is that possible to refer to the fava's current filters, including time, account and filter?
Thanks
The text was updated successfully, but these errors were encountered: