-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#1439] Add htmx to cases #621
Conversation
e8a7f5a
to
324ff43
Compare
b1f6b03
to
e3565c4
Compare
b0aea11
to
a27c45d
Compare
Codecov Report
@@ Coverage Diff @@
## develop #621 +/- ##
===========================================
- Coverage 96.45% 96.23% -0.23%
===========================================
Files 618 627 +9
Lines 21857 22282 +425
===========================================
+ Hits 21083 21443 +360
- Misses 774 839 +65
... and 16 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@jiromaykin FYI if you want to freeze the spinner and review it properly you can add a breakpoint to the cases (cms/cases/views/cases.py -> |
|
||
def handle_no_permission(self): | ||
if self.request.user.is_authenticated: | ||
return TemplateResponse(self.request, "pages/cases/403.html") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Htmx stuff looks pretty good.
One thing that bothers me is the javascript components don't chain from the node that is found by the selector, but use global selectors to grab the various sub-elements and attach event handlers.
This is not accurate and could give memory leaks because if the selector matches the new html fragment the component could still find and (duplicated) attach to elements outside of the fragment. Eg: multiple instantiations of the component code could connect to the same elements.
Thanks! I am excited to test this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's just me, but when the list view has loaded (any list open/closed/Lopende) - I still see the spinner at the bottom after data has loaded (spinner should disappear here after loading is done),
When this happens it seems like javascript is becoming unresponsive because I cannot open the desktopmenu navigation anymore from this page.

Additionally: the main-navigation still works if I log in as a DigiD user - but it still has the spinner still visible after data has loaded. |
@jiromaykin have you reloaded-rebuilt js in your local machine?It seems weird because I don't seem to have a problem. |
Sorry @vaszig - I thought the Watch function did a clean rebuild. It's working correctly after one build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see a lot of global selectors (eg: ID's, getElementById(x)
or querySelector("#x")
in the components.
As everything works I'll approve to land this larger PR and added Taiga issue 1544 (and earlier 1511) to clean this up.
const documentUpload = this.fileUploadInput.closest('#form_upload') | ||
|
||
fileUploadInput.addEventListener('change', function (e) { | ||
const files = e.target.files | ||
const sizeInfo = documentUpload.querySelector('#upload_size') | ||
const nameInfo = documentUpload.querySelector('#upload_name') | ||
const validationInfo = documentUpload.querySelector('#upload_error') | ||
const closeButton = documentUpload.querySelector('#close_upload') | ||
const submit_upload = documentUpload.querySelector('#submit_upload') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed this with Vasilios and put it in ticket 1544
No description provided.