Resolve "When the branch name is a divider or separator, the project home page cannot display the branch name correctly."
Closed
requested to merge 65473-when-the-branch-name-is-a-divider-or-separator-the-project-home-page-cannot-display-the-branch-name-correctly into master
2 unresolved threads
Compare changes
Files
2- Thomas Randolph authored
Basic Intent: Allow all branch names without accidentally creating layout or backstage DOM. e.g. a branch named `separator` should never create a separator `li` element. Ideally, there should never be a string that could cause this kind of conflict. Implementation: All of the `GitLabDropdown.renderData` and `GitLabDropdown.renderItem` are extracted to a standalone module. To render a divider or separator, consumers must now pass in an object like `{ "type": "divider" }` or `{ "type": "separator" }` Notable choices: - All of the functions have a cyclomatic complexity of 3 or less - See: https://en.wikipedia.org/wiki/Cyclomatic_complexity - Note the "Correlation to number of defects" section - While software complexity may not have a directly causal relationship with defects, less complex software is generally easier to reason about, and **may** reduce defects. I personally try to maintain complexity of no higher than 3.
app/assets/javascripts/gl_dropdown/render.js
0 → 100644
+ 228
− 0