Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
72a30d61
Commit
72a30d61
authored
Sep 15, 2017
by
Winnie Hellmann
Committed by
Phil Hughes
Sep 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display whether branch has been merged when deleting protected branch
parent
20295b3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
+20
-5
app/assets/javascripts/branches/branches_delete_modal.js
app/assets/javascripts/branches/branches_delete_modal.js
+6
-2
app/views/projects/branches/_branch.html.haml
app/views/projects/branches/_branch.html.haml
+2
-1
app/views/projects/branches/_delete_protected_modal.html.haml
...views/projects/branches/_delete_protected_modal.html.haml
+7
-2
changelogs/unreleased/winh-protected-branch-modal-merged.yml
changelogs/unreleased/winh-protected-branch-modal-merged.yml
+5
-0
No files found.
app/assets/javascripts/branches/branches_delete_modal.js
View file @
72a30d61
...
...
@@ -7,6 +7,7 @@ class DeleteModal {
this
.
$branchName
=
$
(
'
.js-branch-name
'
,
this
.
$modal
);
this
.
$confirmInput
=
$
(
'
.js-delete-branch-input
'
,
this
.
$modal
);
this
.
$deleteBtn
=
$
(
'
.js-delete-branch
'
,
this
.
$modal
);
this
.
$notMerged
=
$
(
'
.js-not-merged
'
,
this
.
$modal
);
this
.
bindEvents
();
}
...
...
@@ -16,8 +17,10 @@ class DeleteModal {
}
setModalData
(
e
)
{
this
.
branchName
=
e
.
currentTarget
.
dataset
.
branchName
||
''
;
this
.
deletePath
=
e
.
currentTarget
.
dataset
.
deletePath
||
''
;
const
branchData
=
e
.
currentTarget
.
dataset
;
this
.
branchName
=
branchData
.
branchName
||
''
;
this
.
deletePath
=
branchData
.
deletePath
||
''
;
this
.
isMerged
=
!!
branchData
.
isMerged
;
this
.
updateModal
();
}
...
...
@@ -30,6 +33,7 @@ class DeleteModal {
this
.
$confirmInput
.
val
(
''
);
this
.
$deleteBtn
.
attr
(
'
href
'
,
this
.
deletePath
);
this
.
$deleteBtn
.
attr
(
'
disabled
'
,
true
);
this
.
$notMerged
.
toggleClass
(
'
hidden
'
,
this
.
isMerged
);
}
}
...
...
app/views/projects/branches/_branch.html.haml
View file @
72a30d61
...
...
@@ -43,7 +43,8 @@
data:
{
toggle:
"modal"
,
target:
"#modal-delete-branch"
,
delete_path:
project_branch_path
(
@project
,
branch
.
name
),
branch_name:
branch
.
name
}
}
branch_name:
branch
.
name
,
is_merged:
(
"true"
if
@repository
.
merged_to_root_ref?
(
branch
.
name
))
}
}
=
icon
(
"trash-o"
)
-
else
%button
{
class:
"btn btn-remove remove-row js-ajax-loading-spinner has-tooltip disabled"
,
...
...
app/views/projects/branches/_delete_protected_modal.html.haml
View file @
72a30d61
...
...
@@ -6,13 +6,18 @@
%h3
.page-title
Delete protected branch
=
surround
"'"
,
"'?"
do
%span
.js-branch-name
>[branch name]
%span
.js-branch-name
.ref-name
>[branch name]
.modal-body
%p
You’re about to permanently delete the protected branch
=
succeed
'.'
do
%strong
.js-branch-name
[branch name]
%strong
.js-branch-name.ref-name
[branch name]
%p
.js-not-merged
-
default_branch
=
capture
do
%span
.ref-name
=
@repository
.
root_ref
=
s_
(
"Branches|This branch hasn’t been merged into %{default_branch}."
).
html_safe
%
{
default_branch:
default_branch
}
=
s_
(
"Branches|To avoid data loss, consider merging this branch before deleting it."
)
%p
Once you confirm and press
=
succeed
','
do
...
...
changelogs/unreleased/winh-protected-branch-modal-merged.yml
0 → 100644
View file @
72a30d61
---
title
:
Display whether branch has been merged when deleting protected branch
merge_request
:
14220
author
:
type
:
changed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment