Refactor weight select
What does this MR do?
Remove dead code in WeightSelect that is not used in any current execution paths. Considering this code is tightly coupled with glDropdown and there is lack of documentation for that, the chance of these unused execution paths being used again is slim to none. As a result, I am recommending that we remove this dead code. Below is an analysis of how it was determined to be dead code.
WeightSelect
is invoked in our codebase
Here are the different ways graph TD;
A["boards/components/weight_select.vue:L53"] --> WeightSelect.js;
B["pages/projects/issues/form.js:L17"] --> WeightSelect.js;
WeightSelect
Here are the different pages that invoke graph TD;
projects:issues:edit --> WeightSelect.js;
projects:issues:new --> WeightSelect.js;
projects:boards:index --> WeightSelect.js;
WeightSelect
's glDropdown as seen on line 40
Here is how the execution paths work in the clicked event handler of graph LR;
style A stroke:#e74c3c,stroke-width:4px;
style C stroke:#e74c3c,stroke-width:4px;
weightSelect.clicked -. triggers this path in projects:boards:index .-> options.handleClick;
weightSelect.clicked -. not triggered in any scenarios .-> A["$(dropdown).is('.js-filter-submit')"];
weightSelect.clicked -. triggers this path in projects:issues:new and projects:issues:edit .-> B["$dropdown.is('.js-issuable-form-weight')"]
weightSelect.clicked -. not triggered in any scenarios .-> C[else];
Note: Red border indicates dead code
Are there points in the code the reviewer needs to double check?
Shouldn't be
Why was this MR needed?
~"technical debt"
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Edited by Clement Ho