Send ajax request for label update only if they are changed
What does this MR do?
At the moment we send requests to update the labels on issue even if nothing has been changed. This fixes that and only sends requests when something has actually been changed.
The code gets the initial selected values based on the inputs & then compares that to the selected values when submitting. If they are equal, then no request is sent.
What are the relevant issue numbers?
Closes #19472 (closed)
Merge request reports
Activity
Reassigned to @jschatz1
@iamphill needs tests.
Reassigned to @iamphill
Added 1185 commits:
-
6060ec6c...ef2edcc1 - 1183 commits from branch
master
- 1a4196ce - Send ajax request for label update only if they are changed
- a5430e21 - Added tests
-
6060ec6c...ef2edcc1 - 1183 commits from branch
Reassigned to @jschatz1
Milestone changed to %8.11
- Edited by Jacob Schatz
Reassigned to @iamphill
Reassigned to @iamphill
@jschatz1 I can't reproduce that error. & the code in this MR does not touch the user dropdown code at all - so it can't be this that caused it. Also, i'm pretty sure that dropdown has tests linked to it.
Added 790 commits:
-
a5430e21...e63729d9 - 789 commits from branch
master
- a2e37627 - Merge branch 'master' into label-update-check-new
-
a5430e21...e63729d9 - 789 commits from branch
Added 1 commit:
- cea572eb - Fixed tests
Milestone changed to %8.12
Reassigned to @jschatz1
Added 1659 commits:
-
cea572eb...2778dec1 - 1658 commits from branch
master
- 923ea885 - Merge branch 'master' into label-update-check-new
-
cea572eb...2778dec1 - 1658 commits from branch
Reassigned to @iamphill
Added 463 commits:
-
923ea885...ad599eb6 - 461 commits from branch
master
- 2765f9e7 - Merge branch 'master' into label-update-check-new
- 81b4d652 - Fixed tooltip tests failing
-
923ea885...ad599eb6 - 461 commits from branch
Reassigned to @jschatz1
24 24 $sidebarLabelTooltip = $block.find('.js-sidebar-labels-tooltip'); 25 25 $value = $block.find('.value'); 26 26 $loading = $block.find('.block-loading').fadeOut(); 27 initialSelected = $dropdown.closest('.selectbox') - Resolved by Phil Hughes
Added 1 commit:
- bc810976 - Changed underscore style
Added 1 commit:
- dc85566c - Changed underscore style
Added 282 commits:
-
dc85566c...2b3a1da6 - 280 commits from branch
master
- 549530f7 - Changed underscore style
- 6bf6a7d6 - Merge branch 'master' into label-update-check-new
-
dc85566c...2b3a1da6 - 280 commits from branch
Conflicts. @iamphill
Reassigned to @iamphill
Added 536 commits:
-
6bf6a7d6...49405ac7 - 535 commits from branch
master
- 1edd8881 - Merge branch 'master' into label-update-check-new
-
6bf6a7d6...49405ac7 - 535 commits from branch
Reassigned to @jschatz1
@iamphill conflicts again. Sorry buddy.
@mikegreiling can you fix the conflicts here since @iamphill is out?
Reassigned to @mikegreiling
Added 263 commits:
-
1edd8881...3820ca58 - 262 commits from branch
master
- 177be4c0 - Merge branch 'master' into label-update-check-new
-
1edd8881...3820ca58 - 262 commits from branch
Mentioned in commit d34d4f7f
Added 1 commit:
- d34d4f7f - Send ajax request for label update only if they are changed (#19472 (closed) !5071 (merged))
Mentioned in commit b13213e6
Added 1 commit:
- b13213e6 - Send ajax request for label update only if they are changed (#19472 (closed) !5071 (merged))
I've squashed everything into one commit, and tested it out locally. Should be good to go
I would, however, add that I think this issue should also be tackled in the backend. Whether we prevent the superfluous ajax call on the frontend or not, the fact that the backend triggers notifications and web hooks when nothing has changed is a problem that should be fixed.
Reassigned to @jschatz1
Mentioned in issue #22697 (moved)
Mentioned in commit 4d4506ad
Mentioned in issue #22556 (closed)
Mentioned in commit 71472bde
mentioned in issue gitlab#6406