Commit 3ed80785 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '25569-changing-wording-to-delete-when-referring-to-removing-a-branch' into 'master'

Resolve "Changing wording to "Delete" when referring to removing a branch"

Closes #25569

See merge request gitlab-org/gitlab-ce!23966
parents da251c64 c607b358
......@@ -7,7 +7,7 @@ export default {
tooltip,
},
created() {
this.removesBranchText = __('<strong>Removes</strong> source branch');
this.removesBranchText = __('<strong>Deletes</strong> source branch');
this.tooltipTitle = __('A user with write access to the source branch selected this option');
},
};
......
......@@ -106,11 +106,11 @@ export default {
<a :href="mr.targetBranchPath" class="label-branch"> {{ mr.targetBranch }} </a>
</p>
<p v-if="mr.shouldRemoveSourceBranch">
{{ s__('mrWidget|The source branch will be removed') }}
{{ s__('mrWidget|The source branch will be deleted') }}
</p>
<p v-else class="d-flex align-items-start">
<span class="append-right-10">
{{ s__('mrWidget|The source branch will not be removed') }}
{{ s__('mrWidget|The source branch will not be deleted') }}
</span>
<a
v-if="canRemoveSourceBranch"
......@@ -121,7 +121,7 @@ export default {
@click.prevent="removeSourceBranch"
>
<i v-if="isRemovingSourceBranch" class="fa fa-spinner fa-spin" aria-hidden="true"> </i>
{{ s__('mrWidget|Remove source branch') }}
{{ s__('mrWidget|Delete source branch') }}
</a>
</p>
</section>
......
......@@ -84,7 +84,7 @@ export default {
.removeSourceBranch()
.then(res => res.data)
.then(data => {
if (data.message === 'Branch was removed') {
if (data.message === 'Branch was deleted') {
eventHub.$emit('MRWidgetUpdateRequested', () => {
this.isMakingRequest = false;
});
......@@ -174,22 +174,22 @@ export default {
</template>
</p>
<p v-if="mr.sourceBranchRemoved">
{{ s__('mrWidget|The source branch has been removed') }}
{{ s__('mrWidget|The source branch has been deleted') }}
</p>
<p v-if="shouldShowRemoveSourceBranch" class="space-children">
<span>{{ s__('mrWidget|You can remove source branch now') }}</span>
<span>{{ s__('mrWidget|You can delete the source branch now') }}</span>
<button
:disabled="isMakingRequest"
type="button"
class="btn btn-sm btn-default js-remove-branch-button"
@click="removeSourceBranch"
>
{{ s__('mrWidget|Remove Source Branch') }}
{{ s__('mrWidget|Delete source branch') }}
</button>
</p>
<p v-if="shouldShowSourceBranchRemoving">
<gl-loading-icon :inline="true" />
<span> {{ s__('mrWidget|The source branch is being removed') }} </span>
<span> {{ s__('mrWidget|The source branch is being deleted') }} </span>
</p>
</section>
</div>
......
......@@ -223,7 +223,7 @@ export default {
}
})
.catch(() => {
new Flash('Something went wrong while removing the source branch. Please try again.'); // eslint-disable-line
new Flash('Something went wrong while deleting the source branch. Please try again.'); // eslint-disable-line
});
},
},
......@@ -297,7 +297,7 @@ export default {
class="js-remove-source-branch-checkbox"
type="checkbox"
/>
Remove source branch
Delete source branch
</label>
<!-- Placeholder for EE extension of this component -->
......
......@@ -14,7 +14,7 @@ class DeleteBranchService < BaseService
end
if repository.rm_branch(current_user, branch_name)
success('Branch was removed')
success('Branch was deleted')
else
error('Failed to remove branch')
end
......
......@@ -15,7 +15,7 @@
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
= time_ago_with_tooltip(commit.committed_date)
- else
(branch was removed from repository)
(branch was deleted from repository)
= yield
......
......@@ -10,7 +10,7 @@
= hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil
= check_box_tag 'merge_request[force_remove_source_branch]', '1', issuable.force_remove_source_branch?, class: 'form-check-input'
= label_tag 'merge_request[force_remove_source_branch]', class: 'form-check-label' do
Remove source branch when merge request is accepted.
Delete source branch when merge request is accepted.
.form-group.row
.col-sm-10.offset-sm-2
......
---
title: Use delete instead of remove when referring to `git branch -D`
merge_request: !23966
author:
type: changed
......@@ -179,7 +179,7 @@ module API
optional :assignee_id, type: Integer, desc: 'The ID of a user to assign the merge request'
optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign the merge request'
optional :labels, type: String, desc: 'Comma-separated list of label names'
optional :remove_source_branch, type: Boolean, desc: 'Remove source branch when merging'
optional :remove_source_branch, type: Boolean, desc: 'Delete source branch when merging'
optional :allow_collaboration, type: Boolean, desc: 'Allow commits from members who can merge to the target branch'
optional :allow_maintainer_to_push, type: Boolean, as: :allow_collaboration, desc: '[deprecated] See allow_collaboration'
optional :squash, type: Grape::API::Boolean, desc: 'When true, the commits will be squashed into a single commit on merge'
......
......@@ -291,7 +291,7 @@ msgstr ""
msgid "<strong>%{group_name}</strong> group members"
msgstr ""
msgid "<strong>Removes</strong> source branch"
msgid "<strong>Deletes</strong> source branch"
msgstr ""
msgid "A 'Runner' is a process which runs a job. You can set up as many Runners as you need."
......@@ -8334,6 +8334,9 @@ msgstr ""
msgid "mrWidget|Create an issue to resolve them later"
msgstr ""
msgid "mrWidget|Delete source branch"
msgstr ""
msgid "mrWidget|Deployment statistics are not available currently"
msgstr ""
......@@ -8394,12 +8397,6 @@ msgstr ""
msgid "mrWidget|Refreshing now"
msgstr ""
msgid "mrWidget|Remove Source Branch"
msgstr ""
msgid "mrWidget|Remove source branch"
msgstr ""
msgid "mrWidget|Request to merge"
msgstr ""
......@@ -8433,19 +8430,19 @@ msgstr ""
msgid "mrWidget|The source branch HEAD has recently changed. Please reload the page and review the changes before merging"
msgstr ""
msgid "mrWidget|The source branch has been removed"
msgid "mrWidget|The source branch has been deleted"
msgstr ""
msgid "mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch"
msgstr ""
msgid "mrWidget|The source branch is being removed"
msgid "mrWidget|The source branch is being deleted"
msgstr ""
msgid "mrWidget|The source branch will be removed"
msgid "mrWidget|The source branch will be deleted"
msgstr ""
msgid "mrWidget|The source branch will not be removed"
msgid "mrWidget|The source branch will not be deleted"
msgstr ""
msgid "mrWidget|There are merge conflicts"
......@@ -8469,10 +8466,10 @@ msgstr ""
msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes."
msgstr ""
msgid "mrWidget|You can merge this merge request manually using the"
msgid "mrWidget|You can delete the source branch now"
msgstr ""
msgid "mrWidget|You can remove source branch now"
msgid "mrWidget|You can merge this merge request manually using the"
msgstr ""
msgid "mrWidget|branch does not exist."
......
......@@ -331,7 +331,7 @@ describe Projects::BranchesController do
let(:branch) { "feature" }
it 'returns JSON response with message' do
expect(json_response).to eql("message" => 'Branch was removed')
expect(json_response).to eql("message" => 'Branch was deleted')
end
it { expect(response).to have_gitlab_http_status(200) }
......@@ -341,7 +341,7 @@ describe Projects::BranchesController do
let(:branch) { "improve/awesome" }
it 'returns JSON response with message' do
expect(json_response).to eql('message' => 'Branch was removed')
expect(json_response).to eql('message' => 'Branch was deleted')
end
it { expect(response).to have_gitlab_http_status(200) }
......@@ -351,7 +351,7 @@ describe Projects::BranchesController do
let(:branch) { 'improve%2Fawesome' }
it 'returns JSON response with message' do
expect(json_response).to eql('message' => 'Branch was removed')
expect(json_response).to eql('message' => 'Branch was deleted')
end
it { expect(response).to have_gitlab_http_status(200) }
......
......@@ -25,7 +25,7 @@ describe 'User accepts a merge request', :js do
end
it 'accepts a merge request' do
check('Remove source branch')
check('Delete source branch')
click_button('Merge')
expect(page).to have_content('The changes were merged into')
......@@ -60,7 +60,7 @@ describe 'User accepts a merge request', :js do
end
it 'accepts a merge request' do
check('Remove source branch')
check('Delete source branch')
click_button('Merge')
expect(page).to have_content('The changes were merged into')
......
......@@ -33,7 +33,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
click_button "Merge when pipeline succeeds"
expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds"
expect(page).to have_content "The source branch will not be removed"
expect(page).to have_content "The source branch will not be deleted"
expect(page).to have_selector ".js-cancel-auto-merge"
visit project_merge_request_path(project, merge_request) # Needed to refresh the page
expect(page).to have_content /enabled an automatic merge when the pipeline for \h{8} succeeds/i
......@@ -94,7 +94,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
click_link 'Merge when pipeline succeeds'
expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds"
expect(page).to have_content "The source branch will not be removed"
expect(page).to have_content "The source branch will not be deleted"
expect(page).to have_link "Cancel automatic merge"
end
end
......@@ -127,10 +127,10 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
expect(page).to have_content "canceled the automatic merge"
end
it 'allows to remove source branch' do
click_link "Remove source branch"
it 'allows to delete source branch' do
click_link "Delete source branch"
expect(page).to have_content "The source branch will be removed"
expect(page).to have_content "The source branch will be deleted"
end
context 'when pipeline succeeds' do
......
......@@ -316,7 +316,7 @@ describe 'Merge request > User sees merge widget', :js do
it 'user cannot remove source branch' do
expect(page).not_to have_field('remove-source-branch-input')
expect(page).to have_content('Removes source branch')
expect(page).to have_content('Deletes source branch')
end
end
......
......@@ -38,7 +38,7 @@ describe 'User squashes a merge request', :js do
def accept_mr
expect(page).to have_button('Merge')
uncheck 'Remove source branch'
uncheck 'Delete source branch'
click_on 'Merge'
end
......
......@@ -97,7 +97,7 @@ describe 'Protected Branches', :js do
set_protected_branch_name('some-branch')
click_on "Protect"
within(".protected-branches-list") { expect(page).to have_content('branch was removed') }
within(".protected-branches-list") { expect(page).to have_content('branch was deleted') }
end
end
......
......@@ -121,14 +121,14 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
expect(vm.$el.innerText).toContain('to be merged automatically when the pipeline succeeds');
expect(vm.$el.innerText).toContain('The changes will be merged into');
expect(vm.$el.innerText).toContain(targetBranch);
expect(vm.$el.innerText).toContain('The source branch will not be removed');
expect(vm.$el.innerText).toContain('The source branch will not be deleted');
expect(vm.$el.querySelector('.js-cancel-auto-merge').innerText).toContain(
'Cancel automatic merge',
);
expect(vm.$el.querySelector('.js-cancel-auto-merge').getAttribute('disabled')).toBeFalsy();
expect(vm.$el.querySelector('.js-remove-source-branch').innerText).toContain(
'Remove source branch',
'Delete source branch',
);
expect(vm.$el.querySelector('.js-remove-source-branch').getAttribute('disabled')).toBeFalsy();
......@@ -143,19 +143,19 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
});
});
it('should show source branch will be removed text when it source branch set to remove', done => {
it('should show source branch will be deleted text when it source branch set to remove', done => {
vm.mr.shouldRemoveSourceBranch = true;
Vue.nextTick(() => {
const normalizedText = vm.$el.innerText.replace(/\s+/g, ' ');
expect(normalizedText).toContain('The source branch will be removed');
expect(normalizedText).not.toContain('The source branch will not be removed');
expect(normalizedText).toContain('The source branch will be deleted');
expect(normalizedText).not.toContain('The source branch will not be deleted');
done();
});
});
it('should not show remove source branch button when user not able to remove source branch', done => {
it('should not show delete source branch button when user not able to delete source branch', done => {
vm.mr.currentUserId = 4;
Vue.nextTick(() => {
......@@ -164,7 +164,7 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => {
});
});
it('should disable remove source branch button when the action is in progress', done => {
it('should disable delete source branch button when the action is in progress', done => {
vm.isRemovingSourceBranch = true;
Vue.nextTick(() => {
......
......@@ -128,7 +128,7 @@ describe('MRWidgetMerged', () => {
new Promise(resolve => {
resolve({
data: {
message: 'Branch was removed',
message: 'Branch was deleted',
},
});
}),
......@@ -157,8 +157,8 @@ describe('MRWidgetMerged', () => {
expect(vm.$el.textContent).toContain(targetBranch);
});
it('renders information about branch being removed', () => {
expect(vm.$el.textContent).toContain('The source branch has been removed');
it('renders information about branch being deleted', () => {
expect(vm.$el.textContent).toContain('The source branch has been deleted');
});
it('shows revert and cherry-pick buttons', () => {
......@@ -189,24 +189,24 @@ describe('MRWidgetMerged', () => {
expect(selectors.mergeCommitShaLink.href).toBe(vm.mr.mergeCommitPath);
});
it('should not show source branch removed text', done => {
it('should not show source branch deleted text', done => {
vm.mr.sourceBranchRemoved = false;
Vue.nextTick(() => {
expect(vm.$el.innerText).toContain('You can remove source branch now');
expect(vm.$el.innerText).not.toContain('The source branch has been removed');
expect(vm.$el.innerText).toContain('You can delete the source branch now');
expect(vm.$el.innerText).not.toContain('The source branch has been deleted');
done();
});
});
it('should show source branch removing text', done => {
it('should show source branch deleting text', done => {
vm.mr.isRemovingSourceBranch = true;
vm.mr.sourceBranchRemoved = false;
Vue.nextTick(() => {
expect(vm.$el.innerText).toContain('The source branch is being removed');
expect(vm.$el.innerText).not.toContain('You can remove source branch now');
expect(vm.$el.innerText).not.toContain('The source branch has been removed');
expect(vm.$el.innerText).toContain('The source branch is being deleted');
expect(vm.$el.innerText).not.toContain('You can delete the source branch now');
expect(vm.$el.innerText).not.toContain('The source branch has been deleted');
done();
});
});
......
......@@ -453,7 +453,7 @@ describe('mrWidgetOptions', () => {
vm.$nextTick(() => {
const tooltip = vm.$el.querySelector('.fa-question-circle');
expect(vm.$el.textContent).toContain('Removes source branch');
expect(vm.$el.textContent).toContain('Deletes source branch');
expect(tooltip.getAttribute('data-original-title')).toBe(
'A user with write access to the source branch selected this option',
);
......@@ -468,8 +468,8 @@ describe('mrWidgetOptions', () => {
vm.mr.state = 'merged';
vm.$nextTick(() => {
expect(vm.$el.textContent).toContain('The source branch has been removed');
expect(vm.$el.textContent).not.toContain('Removes source branch');
expect(vm.$el.textContent).toContain('The source branch has been deleted');
expect(vm.$el.textContent).not.toContain('Deletes source branch');
done();
});
......
......@@ -129,12 +129,12 @@ RSpec.shared_examples 'an editable merge request' do
expect(merge_request.merge_params['force_remove_source_branch']).to be_truthy
visit edit_project_merge_request_path(target_project, merge_request)
uncheck 'Remove source branch when merge request is accepted'
uncheck 'Delete source branch when merge request is accepted'
click_button 'Save changes'
expect(page).to have_unchecked_field 'remove-source-branch-input'
expect(page).to have_content 'Remove source branch'
expect(page).to have_content 'Delete source branch'
end
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