Commit faa4ce17 authored by Gary Holtz's avatar Gary Holtz

Modifying documentation to show "/draft" as primary

It looks like `/draft` will be the official term going forward, so
I made that the official label and `/wip` the alias.
parent f732a956
......@@ -143,7 +143,7 @@ export default {
<div class="media-body">
<div class="gl-ml-3 float-left">
<span class="gl-font-weight-bold">
{{ __('This merge request is still a work in progress.') }}
{{ __('This merge request is still a draft.') }}
</span>
<span class="gl-display-block text-muted">{{
__("Draft merge requests can't be merged.")
......
......@@ -27,7 +27,7 @@ There are several ways to flag a merge request as a Draft:
description will have the same effect.
- **Deprecated** Add `[WIP]` or `WIP:` to the start of the merge request's title.
**WIP** still works but was deprecated in favor of **Draft**. It will be removed in the next major version (GitLab 14.0).
- Add the `/wip` [quick action](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics)
- Add the `/draft` (or `/wip`) [quick action](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics)
in a comment in the merge request. This is a toggle, and can be repeated
to change the status back. Note that any other text in the comment will be discarded.
- Add `draft:`, `Draft:`, `fixup!`, or `Fixup!` to the beginning of a commit message targeting the
......@@ -43,7 +43,7 @@ Similar to above, when a Merge Request is ready to be merged, you can remove the
- Remove `[Draft]`, `Draft:` or `(Draft)` from the start of the merge request's title. Clicking on
**Remove the Draft: prefix from the title**, under the title box, when editing the merge
request's description, will have the same effect.
- Add the `/wip` [quick action](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics)
- Add the `/draft` (or `/wip`) [quick action](../quick_actions.md#quick-actions-for-issues-merge-requests-and-epics)
in a comment in the merge request. This is a toggle, and can be repeated
to change the status back. Note that any other text in the comment will be discarded.
- Click on the **Resolve Draft status** button near the bottom of the merge request description,
......
......@@ -40,6 +40,7 @@ The following quick actions are applicable to descriptions, discussions and thre
| `/copy_metadata <#issue>` | ✓ | ✓ | | Copy labels and milestone from another issue in the project. |
| `/create_merge_request <branch name>` | ✓ | | | Create a new merge request starting from the current issue. |
| `/done` | ✓ | ✓ | ✓ | Mark to do as done. |
| `/draft` | | ✓ | | Toggle the Work In Progress status. |
| `/due <date>` | ✓ | | | Set due date. Examples of valid `<date>` include `in 2 days`, `this Friday` and `December 31st`. |
| `/duplicate <#issue>` | ✓ | | | Close this issue and mark as a duplicate of another issue. **(CORE)** Also, mark both as related. **(STARTER)** |
| `/epic <epic>` | ✓ | | | Add to epic `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. **(PREMIUM)** |
......
......@@ -56,21 +56,21 @@ module Gitlab
@updates[:merge] = params[:merge_request_diff_head_sha]
end
desc 'Toggle the Work In Progress status'
desc 'Toggle the Draft status'
explanation do
noun = quick_action_target.to_ability_name.humanize(capitalize: false)
if quick_action_target.work_in_progress?
_("Unmarks this %{noun} as Work In Progress.")
_("Unmarks this %{noun} as Draft.")
else
_("Marks this %{noun} as Work In Progress.")
_("Marks this %{noun} as Draft.")
end % { noun: noun }
end
execution_message do
noun = quick_action_target.to_ability_name.humanize(capitalize: false)
if quick_action_target.work_in_progress?
_("Unmarked this %{noun} as Work In Progress.")
_("Unmarked this %{noun} as Draft.")
else
_("Marked this %{noun} as Work In Progress.")
_("Marked this %{noun} as Draft.")
end % { noun: noun }
end
......@@ -80,7 +80,7 @@ module Gitlab
# Allow it to mark as WIP on MR creation page _or_ through MR notes.
(quick_action_target.new_record? || current_user.can?(:"update_#{quick_action_target.to_ability_name}", quick_action_target))
end
command :wip, :draft do
command :draft, :wip do
@updates[:wip_event] = quick_action_target.work_in_progress? ? 'unwip' : 'wip'
end
......
......@@ -16221,7 +16221,7 @@ msgstr ""
msgid "Marked For Deletion At - %{deletion_time}"
msgstr ""
msgid "Marked this %{noun} as Work In Progress."
msgid "Marked this %{noun} as Draft."
msgstr ""
msgid "Marked this issue as a duplicate of %{duplicate_param}."
......@@ -16233,7 +16233,7 @@ msgstr ""
msgid "Marked to do as done."
msgstr ""
msgid "Marks this %{noun} as Work In Progress."
msgid "Marks this %{noun} as Draft."
msgstr ""
msgid "Marks this issue as a duplicate of %{duplicate_reference}."
......@@ -27412,7 +27412,7 @@ msgstr ""
msgid "This merge request is locked."
msgstr ""
msgid "This merge request is still a work in progress."
msgid "This merge request is still a draft."
msgstr ""
msgid "This merge request was merged. To apply this suggestion, edit this file directly."
......@@ -28589,10 +28589,10 @@ msgstr ""
msgid "Unlocks the discussion."
msgstr ""
msgid "Unmarked this %{noun} as Work In Progress."
msgid "Unmarked this %{noun} as Draft."
msgstr ""
msgid "Unmarks this %{noun} as Work In Progress."
msgid "Unmarks this %{noun} as Draft."
msgstr ""
msgid "Unreachable"
......
......@@ -33,7 +33,7 @@ RSpec.describe 'Merge request > User resolves Work in Progress', :js do
it 'retains merge request data after clicking Resolve WIP status' do
expect(page.find('.ci-widget-content')).to have_content("Pipeline ##{pipeline.id}")
expect(page).to have_content "This merge request is still a work in progress."
expect(page).to have_content "This merge request is still a draft."
page.within('.mr-state-widget') do
click_button('Mark as ready')
......@@ -45,7 +45,7 @@ RSpec.describe 'Merge request > User resolves Work in Progress', :js do
# merge request widget refreshes, which masks missing elements
# that should already be present.
expect(page.find('.ci-widget-content', wait: 0)).to have_content("Pipeline ##{pipeline.id}")
expect(page).not_to have_content('This merge request is still a work in progress.')
expect(page).not_to have_content('This merge request is still a draft.')
end
end
end
......@@ -84,7 +84,7 @@ describe('Wip', () => {
it('should have correct elements', () => {
expect(el.classList.contains('mr-widget-body')).toBeTruthy();
expect(el.innerText).toContain('This merge request is still a work in progress.');
expect(el.innerText).toContain('This merge request is still a draft.');
expect(el.querySelector('button').getAttribute('disabled')).toBeTruthy();
expect(el.querySelector('button').innerText).toContain('Merge');
expect(el.querySelector('.js-remove-wip').innerText.replace(/\s\s+/g, ' ')).toContain(
......
......@@ -312,8 +312,8 @@ RSpec.describe QuickActions::InterpretService do
end
end
shared_examples 'wip command' do
it 'returns wip_event: "wip" if content contains /wip' do
shared_examples 'draft command' do
it 'returns wip_event: "wip" if content contains /draft' do
_, updates, _ = service.execute(content, issuable)
expect(updates).to eq(wip_event: 'wip')
......@@ -322,12 +322,12 @@ RSpec.describe QuickActions::InterpretService do
it 'returns the wip message' do
_, _, message = service.execute(content, issuable)
expect(message).to eq("Marked this #{issuable.to_ability_name.humanize(capitalize: false)} as Work In Progress.")
expect(message).to eq("Marked this #{issuable.to_ability_name.humanize(capitalize: false)} as Draft.")
end
end
shared_examples 'unwip command' do
it 'returns wip_event: "unwip" if content contains /wip' do
shared_examples 'undraft command' do
it 'returns wip_event: "unwip" if content contains /draft' do
issuable.update!(title: issuable.wip_title)
_, updates, _ = service.execute(content, issuable)
......@@ -338,7 +338,7 @@ RSpec.describe QuickActions::InterpretService do
issuable.update!(title: issuable.wip_title)
_, _, message = service.execute(content, issuable)
expect(message).to eq("Unmarked this #{issuable.to_ability_name.humanize(capitalize: false)} as Work In Progress.")
expect(message).to eq("Unmarked this #{issuable.to_ability_name.humanize(capitalize: false)} as Draft.")
end
end
......@@ -1026,22 +1026,22 @@ RSpec.describe QuickActions::InterpretService do
let(:issuable) { issue }
end
it_behaves_like 'wip command' do
it_behaves_like 'draft command' do
let(:content) { '/wip' }
let(:issuable) { merge_request }
end
it_behaves_like 'unwip command' do
it_behaves_like 'undraft command' do
let(:content) { '/wip' }
let(:issuable) { merge_request }
end
it_behaves_like 'wip command' do
it_behaves_like 'draft command' do
let(:content) { '/draft' }
let(:issuable) { merge_request }
end
it_behaves_like 'unwip command' do
it_behaves_like 'undraft command' do
let(:content) { '/draft' }
let(:issuable) { merge_request }
end
......@@ -1906,13 +1906,13 @@ RSpec.describe QuickActions::InterpretService do
end
end
describe 'wip command' do
let(:content) { '/wip' }
describe 'draft command' do
let(:content) { '/draft' }
it 'includes the new status' do
_, explanations = service.explain(content, merge_request)
expect(explanations).to eq(['Marks this merge request as Work In Progress.'])
expect(explanations).to eq(['Marks this merge request as Draft.'])
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment