Skip to content
Snippets Groups Projects

Send ajax request for label update only if they are changed

Merged Phil Hughes requested to merge label-update-check-new into master
1 unresolved thread

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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')
  • Jacob Schatz
  • Phil Hughes Added 1 commit:

    Added 1 commit:

  • Phil Hughes Added 1 commit:

    Added 1 commit:

  • Phil Hughes Added 282 commits:

    Added 282 commits:

  • Conflicts. @iamphill

  • Reassigned to @iamphill

  • Phil Hughes Added 536 commits:

    Added 536 commits:

  • Reassigned to @jschatz1

  • Jacob Schatz Added ~149423 label

    Added ~149423 label

  • Jacob Schatz Removed ~149423 label

    Removed ~149423 label

  • Jacob Schatz Added ~149423 label

    Added ~149423 label

  • Testing the labels. Worked.

  • @iamphill conflicts again. Sorry buddy.

  • @mikegreiling can you fix the conflicts here since @iamphill is out?

  • Added 263 commits:

  • Phil Hughes Mentioned in commit d34d4f7f

    Mentioned in commit d34d4f7f

  • Added 1 commit:

  • Phil Hughes Mentioned in commit b13213e6

    Mentioned in commit b13213e6

  • Added 1 commit:

  • I've squashed everything into one commit, and tested it out locally. Should be good to go :ok_hand:

    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.

  • Mentioned in issue #22697 (moved)

  • Jacob Schatz Status changed to merged

    Status changed to merged

  • Jacob Schatz Mentioned in commit 4d4506ad

    Mentioned in commit 4d4506ad

  • Mentioned in issue #22556 (closed)

  • Picked into 8-12-stable, will go into 8.12.2.

  • Rubén Dávila Removed ~149423 label

    Removed ~149423 label

  • Jacob Schatz Mentioned in commit 71472bde

    Mentioned in commit 71472bde

  • mentioned in issue gitlab#6406

  • Please register or sign in to reply
    Loading