Superseeds: https://pagure.io/pagure/pull-request/4674
this could be just {}, no need to use JSON.stringify . Like in https://pagure.io/pagure/blob/master/f/pagure/themes/srcfpo/templates/repo_master_sidebar.html#_190-192
I like the feedback, on success close the modal, otherwise alert, enough to start :)
Indeed, I should have cleaned this
You like the current way or you would like more feedback on success?
2 new commits added
Move the bugzilla assignee update window to a modal
Add input fields to set/reset default bz assignees
I like the current way. We could add some job in progress indicator while the ajax call promise is running, but not so important
We could add some job in progress indicator while the ajax call promise is running, but not so important
The mouse cursor is changed when the ajax call is made ;-)
oh yeah, did not realize that. Should we disable the button while is running to avoid race conditions and misbehaving due to double clicks?
diff --git a/pagure/themes/srcfpo/templates/repo_master_sidebar.html b/pagure/themes/srcfpo/templates/repo_master_sidebar.html index 89f186f5..b9a3ec5d 100644 --- a/pagure/themes/srcfpo/templates/repo_master_sidebar.html +++ b/pagure/themes/srcfpo/templates/repo_master_sidebar.html @@ -280,6 +280,8 @@ $("#change_assignees").on('submit', function(){ $('html').css('cursor', 'progress'); + $('#reset_assignee').attr('disabled', true); + $('#reset_assignee').text('Updating...'); $.ajax({ url: "{{ url_for('distgit_ns.bzoverride_patch_endpoint', repo=repo.name, namespace=repo.namespace) }}", type: 'POST', @@ -294,12 +296,16 @@ $("#fedora_assignee_txt").text(res.fedora_assignee); $("#epel_assignee_txt").text(res.epel_assignee); $('#modal_assignee').modal('hide') + $('#reset_assignee').attr('disabled', false); + $('#reset_assignee').text('Update'); $('html').css('cursor', 'default'); return false; }, error: function(res) { alert("Unable to update the bugzilla assignee(s)"); $('html').css('cursor', 'default'); + $('#reset_assignee').attr('disabled', false); + $('#reset_assignee').text('Update'); return false; } })
This disables the button and changes the button's text to make more obvious that we are in-progress (dit not test it :P)
missing semicolon. js will probably work, but we should add it for coding style consistency
m, should we disable the reset to defaults button too while ajax is in progress?
I like the idea of disabling the buttons, :thumbsup:
Turns out this was needed, otherwise the endpoint fails to convert the data from JSON... :(
Seems nice now. You have my +1 since this is not tested by Jenkins at all
:thumbsup:
Thanks for the reviews! :)
Pull-Request has been merged by pingou
Superseeds: https://pagure.io/pagure/pull-request/4674