Closed rouilj closed 5 months ago
This works but needs to be tested with testing framework
@BharathKanama am I correct that you have a test for this in your selenium suite?
Bharath you have marked this as ready for review, but I don't see a fallback test case in test_classhelper.py. Maybe it's not pushed to github or not pushed to main?
It is now pushed into main.
Add a method to prevent initialization of the web component. This allows testing of the fallback support if js is turned off, fails to load, gets filtered etc.
Also if the user can't use the REST interface (it's a separate permission than using the web interface), the web-component should not be enabled since it will break.
So this ticket checks these failing conditions. I think it's as simple as not running:
at the end of the js file.
Perhaps a small function or an if check wrapping the define call that looks at the URL and if a specific fragment (e.g. #classhelper-wc-toggle) is present, skip loading the component? This should be quick to check with:
document.URL.endsWith('#classhelper-wc-toggle')
or similar check. For now, no need to make it persistent (via cookie or something).