GitLab FOSS merge requestshttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests2017-10-06T05:20:19Zhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14486Adjust display settings for MR widget source branch removal components2017-10-06T05:20:19Zusername-removed-408230Adjust display settings for MR widget source branch removal components## What does this MR do?
1. In the MR Widget, when user can't remove source branch, we hide the checkbox
1. In the MR Create/Edit View, when user can't remove source branch, we hide the checkbox
1. In the MR Widget, when the user ca...## What does this MR do?
1. In the MR Widget, when user can't remove source branch, we hide the checkbox
1. In the MR Create/Edit View, when user can't remove source branch, we hide the checkbox
1. In the MR Widget, when the user can't remove the source branch **and** the source branch will be removed, show a message in the MR Widget that says "Removes source branch".
1. Update existing specs and add new ones for the "Removes source branch" status message
1. Adds some logic to the spec helper method `mountComponent` to support passing plain Vue config objects
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
## Screenshots (if relevant)
## Does this MR meet the acceptance criteria?
- [ ] [Changelog entry](https://docs.gitlab.com/ee/development/changelog.html) added, if necessary
- [ ] [Documentation created/updated](https://docs.gitlab.com/ee/development/doc_styleguide.html)
- [ ] 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](https://docs.gitlab.com/ee/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #3326410.1https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13884Resolve "Customize branch name when using create branch in an issue"2017-11-29T12:45:12Zusername-removed-86853blackst0ne.ru@gmail.comResolve "Customize branch name when using create branch in an issue"## What does this MR do?
This MR adds an ability to type a custom branch name in the `Create merge request` dropdown placed in an issue.
## TODO
* [ ] Add backend specs
* [ ] Add frontend specs
## Are there points in the code th...## What does this MR do?
This MR adds an ability to type a custom branch name in the `Create merge request` dropdown placed in an issue.
## TODO
* [ ] Add backend specs
* [ ] Add frontend specs
## Are there points in the code the reviewer needs to double check?
![create_mr_button](/uploads/8f5e06e455a85500973334797c563ede/create_mr_button.gif)
## Why was this MR needed?
It improves UX of branch management.
## Screenshots (if relevant)
To be added.
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] 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](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #2114310.1username-removed-86853blackst0ne.ru@gmail.comusername-removed-86853blackst0ne.ru@gmail.comhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11110Resolve "/unlabel quick action - limit autocomplete to applied labels"2018-08-01T11:19:55Zusername-removed-86853blackst0ne.ru@gmail.comResolve "/unlabel quick action - limit autocomplete to applied labels"## What does this MR do?
The MR adds filtering of labels available on `~`, `/label ~`, `/unlabel ~`, and `/relabel ~` commands.
## What does this MR not do?
The MR does **not** support real-time synchronization.
`gfm_au...## What does this MR do?
The MR adds filtering of labels available on `~`, `/label ~`, `/unlabel ~`, and `/relabel ~` commands.
## What does this MR not do?
The MR does **not** support real-time synchronization.
`gfm_auto_complete.js` loads labels only once (by current design).
So synchronizing data is out of this MR's scope.
## Expected behavior
1. `/label ` should show only labels that are
* available for current project
* **not** set to current issuable yet
2. `/lab[TAB] ` should behave exactly as above.
3. `/unlabel ` should show only labels that are
* available for current project
* **already set** to current issuable
4. `/unlab[TAB] ` should behave exactly as above.
5. `/relabel` should show only labels that are available for current project.
6. `/relab[TAB] ` should behave exactly as above.
7. `~` should show only labels that are available for current project regardless which ones are set.
## Details
**Backend**
1. `autocomplete_sources_controller.rb#labels` now respects parameters `type` and `type_id` (like in `#commands` action).
2. If parameters are presented, `AutocompleteService.labels` mixes available labels with current set labels of passed issuable.
3. Frontend receives such an response:
```json
..., {"title":"backend","color":"#FFECDB","set":true}, ...
```
**Frontend**
`gfm_auto_complete.js#setupLabels` now has both modified `matcher` (to parse slash commands) and `filter` (to filter only needed labels).
## Are there points in the code the reviewer needs to double check?
1. Feature specs work correctly only for `~` command, but fail on `command + ~` construction like `/label ~`. Modification of `switch` (adding an unneeded extra variable) in `filter` of `gfm_auto_complete.js#setupLabels` fixes the specs, but it looks strange to me.
2. Frontend code is not maximal DRYed. I'm not sure if part of `matcher` code should be moved to a standalone function.
## Why was this MR needed?
It makes UX better and improves user's workflow.
## Screenshots
**When no labels set yet**
| Command | Description | Screenshot |
| -------- | -------- | -------- |
| **~** | List of all available labels | ![Screenshot_20170526_112841](/uploads/4ec9315770fd83c39cae0ca70685d780/Screenshot_20170526_112841.png) |
| **/label ~** | List of all available labels to be set | ![image](/uploads/c5c41c1e00857d5521f713c88b9c9aff/image.png) |
| **/relabel ~** | List of all unset labels to be set | ![image](/uploads/41c02a58d185f00a23bda2b4de4b1794/image.png) |
| **/unlabel ~** | List of all set labels to be unset | ![image](/uploads/d33d7161f8d473d4964a2b2af866fe66/image.png) |
**When labels `frontend` and `backend` are already set**
| Command | Description | Screenshot |
| -------- | -------- | -------- |
| **~** | List of all available labels | ![image](/uploads/1a0fadc1106c107ebf560da6a5fbe593/image.png) |
| **/label ~** | List of all available labels to be set | ![image](/uploads/f691b216835a184e7f689c3ab8929ca7/image.png) |
| **/relabel ~** | List of all unset labels to be set | ![image](/uploads/973add35507aa8425bd72ce7d3e1593e/image.png) |
| **/unlabel ~** | List of all set labels to be unset | ![image](/uploads/a1a24faf1a803b0f1e8d31bbf94b590c/image.png) |
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #22680 and #27319kushalpandyakushalpandya