-
Notifications
You must be signed in to change notification settings - Fork 1
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
disable and hide csv import button when request in flight #142
Conversation
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.
good idea and good change
The performance tweaks in this PR are spot-on. For generation times, measured the change to enable |
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.
Sorry! I didn't send the code review... I left in pending state
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 didn't see this review was pending. Apologies for the slow turnaround.
I'm really excited for this change - we had somebody on the group this week who uploaded a CSV twice.
- I just did a quick test and I think the buttons in the rows aren't working - try clicking "upload", "trash can", or "refresh" on any row in the table and nothing happens.
- During CSV upload could we maybe disable the cancel button too? It's clickable but I'm not sure if it does anything.
Seeing this error in console
TypeError: Cannot read properties of null (reading 'firstChild')
at He (htmx.min.js:1:11222)
at De (htmx.min.js:1:12038)
at Fe (htmx.min.js:1:12842)
at x (htmx.min.js:1:42365)
at Tr (htmx.min.js:1:44027)
at b.onload (htmx.min.js:1:39225)
Code looks good!
oh i missed that, i think it's a combination of how swaps are done on the table and bigskysoftware/htmx#2247. I've updated the libraries and added support for individual row updates.
|
@kennsippell I've made some changes to the events api and the updates should appear "faster" now. This should fix #63 as well |
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.
Excellent change!
Remember to update package version before merge.
} | ||
|
||
private eventedPlaceStateChange = (subject: Place | Place[], state: PlaceUploadState) => { | ||
if (!Array.isArray(subject)) { | ||
subject = [subject]; | ||
} | ||
|
||
if (subject.length > 1) { |
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.
would love your thoughts on how to make this work with the warning system... with the warning system, when you edit CHP A you can cause changes to CHP B. I suppose I will now have to monitor all changes on all rows and separately trigger each refresh?
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.
when you edit CHP A you can cause changes to CHP B. I suppose I will now have to monitor all changes on all rows and separately trigger each refresh
Triggering individual events is the most optimal. Refreshing the table is basically just refreshing the page at this point
@@ -64,8 +63,7 @@ | |||
|
|||
<td> | |||
{% if place.creationDetails.password %} | |||
{% capture explanation %}Username: {{ place.creationDetails.username }} | |||
Password: {{ place.creationDetails.password }}{% endcapture %} | |||
{% capture explanation %}Username: {{ place.creationDetails.username }} Password: {{ place.creationDetails.password }}{% endcapture %} |
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 like having it on multiple lines for when you copy/paste
is there a reason to change and put it on one line? do you like it better?
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.
Anything after the new line will be ignored when pushing the html via sse https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format
hierarchy: Config.getHierarchyWithReplacement(place.type, 'desc'), | ||
userRoleProperty: Config.getUserRoleConfig(place.type), | ||
}, | ||
place: place, |
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.
place: place, | |
place, |
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've got a problem when submitting invalid csv files. No error is displayed.
Fixes #136
Fixes #63