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
d9739651
Commit
d9739651
authored
Aug 16, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rspec failures
- Rework initRule logic to fix failing tests
parent
a289e20d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
ee/app/assets/javascripts/approvals/components/rule_form.vue
ee/app/assets/javascripts/approvals/components/rule_form.vue
+15
-15
ee/app/helpers/ee/projects_helper.rb
ee/app/helpers/ee/projects_helper.rb
+3
-3
No files found.
ee/app/assets/javascripts/approvals/components/rule_form.vue
View file @
d9739651
...
...
@@ -54,7 +54,7 @@ export default {
};
// TODO: Remove feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/235114
if
(
this
.
glFeatures
.
approvalSuggestions
)
{
return
{
...
defaults
,
name
:
this
.
defaultRuleName
||
''
};
return
{
...
defaults
,
name
:
this
.
defaultRuleName
||
defaults
.
name
};
}
return
defaults
;
...
...
@@ -145,7 +145,7 @@ export default {
);
},
isPersisted
()
{
return
this
.
rule
&&
this
.
r
ule
.
id
;
return
this
.
initRule
&&
this
.
initR
ule
.
id
;
},
isNameVisible
()
{
return
!
this
.
settings
.
lockedApprovalsRuleName
;
...
...
@@ -164,7 +164,7 @@ export default {
},
submissionData
()
{
return
{
id
:
this
.
rule
&&
this
.
r
ule
.
id
,
id
:
this
.
initRule
&&
this
.
initR
ule
.
id
,
name
:
this
.
settings
.
lockedApprovalsRuleName
||
this
.
name
||
DEFAULT_NAME
,
approvalsRequired
:
this
.
approvalsRequired
,
users
:
this
.
userIds
,
...
...
@@ -247,7 +247,7 @@ export default {
* Also delete the rule if necessary.
*/
submitEmptySingleRule
()
{
const
id
=
this
.
rule
&&
this
.
r
ule
.
id
;
const
id
=
this
.
initRule
&&
this
.
initR
ule
.
id
;
return
Promise
.
all
([
this
.
submitFallback
(),
id
?
this
.
deleteRule
(
id
)
:
Promise
.
resolve
()]);
},
...
...
@@ -257,27 +257,27 @@ export default {
return
this
.
isValid
;
},
getInitialData
()
{
if
(
!
this
.
rul
e
)
{
if
(
!
this
.
initRule
||
this
.
defaultRuleNam
e
)
{
return
{};
}
if
(
this
.
r
ule
.
isFallback
)
{
if
(
this
.
initR
ule
.
isFallback
)
{
return
{
approvalsRequired
:
this
.
r
ule
.
approvalsRequired
,
isFallback
:
this
.
r
ule
.
isFallback
,
approvalsRequired
:
this
.
initR
ule
.
approvalsRequired
,
isFallback
:
this
.
initR
ule
.
isFallback
,
};
}
const
{
containsHiddenGroups
=
false
,
removeHiddenGroups
=
false
}
=
this
.
r
ule
;
const
{
containsHiddenGroups
=
false
,
removeHiddenGroups
=
false
}
=
this
.
initR
ule
;
const
users
=
this
.
r
ule
.
users
.
map
(
x
=>
({
...
x
,
type
:
TYPE_USER
}));
const
groups
=
this
.
r
ule
.
groups
.
map
(
x
=>
({
...
x
,
type
:
TYPE_GROUP
}));
const
branches
=
this
.
r
ule
.
protectedBranches
?.
map
(
x
=>
x
.
id
)
||
[];
const
users
=
this
.
initR
ule
.
users
.
map
(
x
=>
({
...
x
,
type
:
TYPE_USER
}));
const
groups
=
this
.
initR
ule
.
groups
.
map
(
x
=>
({
...
x
,
type
:
TYPE_GROUP
}));
const
branches
=
this
.
initR
ule
.
protectedBranches
?.
map
(
x
=>
x
.
id
)
||
[];
return
{
name
:
this
.
r
ule
.
name
||
''
,
approvalsRequired
:
this
.
r
ule
.
approvalsRequired
||
0
,
minApprovalsRequired
:
this
.
r
ule
.
minApprovalsRequired
||
0
,
name
:
this
.
initR
ule
.
name
||
''
,
approvalsRequired
:
this
.
initR
ule
.
approvalsRequired
||
0
,
minApprovalsRequired
:
this
.
initR
ule
.
minApprovalsRequired
||
0
,
containsHiddenGroups
,
approvers
:
groups
.
concat
(
users
)
...
...
ee/app/helpers/ee/projects_helper.rb
View file @
d9739651
...
...
@@ -105,12 +105,12 @@ module EE
'security_approvals_help_page_path'
:
help_page_path
(
'user/application_security/index.md'
,
anchor:
'security-approvals-in-merge-requests-ultimate'
),
'security_configuration_path'
:
project_security_configuration_path
(
project
),
'vulnerability_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-security-approvals-within-a-project'
),
'license_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-license-approvals-within-a-project'
)}
}
'license_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-license-approvals-within-a-project'
)
}
}
end
def
can_modify_approvers
(
project
=
@project
)
def
can_modify_approvers
(
project
=
@project
)
can?
(
current_user
,
:modify_approvers_rules
,
project
)
end
end
def
permanent_delete_message
(
project
)
message
=
_
(
'This action will %{strongOpen}permanently delete%{strongClose} %{codeOpen}%{project}%{codeClose} %{strongOpen}immediately%{strongClose}, including its repositories and all content: issues, merge requests, etc.'
)
...
...
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