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
b8c46c3d
Commit
b8c46c3d
authored
Jul 12, 2018
by
samdbeckham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverts the previous change in favour of using `Vue.set()` instead
parent
0650cc4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
30 deletions
+34
-30
ee/app/assets/javascripts/vue_shared/security_reports/components/modal.vue
...ascripts/vue_shared/security_reports/components/modal.vue
+11
-12
ee/app/assets/javascripts/vue_shared/security_reports/store/mutations.js
...avascripts/vue_shared/security_reports/store/mutations.js
+23
-18
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/modal.vue
View file @
b8c46c3d
...
...
@@ -32,7 +32,15 @@
this
.
modal
.
vulnerability
.
dismissalFeedback
.
author
);
},
/**
* The slot for the footer should be rendered if any of the conditions is true.
*/
shouldRenderFooterSection
()
{
return
(
!
this
.
modal
.
isResolved
&&
(
this
.
canCreateFeedbackPermission
||
this
.
canCreateIssuePermission
)
);
},
},
methods
:
{
...
mapActions
([
'
dismissIssue
'
,
'
revertDismissIssue
'
,
'
createNewIssue
'
]),
...
...
@@ -58,15 +66,6 @@
hasLinks
(
field
,
key
)
{
return
key
===
'
links
'
&&
this
.
hasValue
(
field
);
},
/**
* The slot for the footer should be rendered if any of the conditions is true.
*/
shouldRenderFooterSection
()
{
return
(
!
this
.
modal
.
isResolved
&&
(
this
.
canCreateFeedbackPermission
||
this
.
canCreateIssuePermission
)
);
},
},
};
</
script
>
...
...
@@ -74,7 +73,7 @@
<modal
id=
"modal-mrwidget-security-issue"
:header-title-text=
"modal.title"
:class=
"
{ 'modal-hide-footer': !shouldRenderFooterSection
()
}"
:class=
"
{ 'modal-hide-footer': !shouldRenderFooterSection }"
class="modal-security-report-dast"
>
<slot>
...
...
@@ -213,7 +212,7 @@
</div>
</slot>
<div
slot=
"footer"
>
<
template
v-if=
"shouldRenderFooterSection
()
"
>
<
template
v-if=
"shouldRenderFooterSection"
>
<button
type=
"button"
class=
"btn btn-default"
...
...
ee/app/assets/javascripts/vue_shared/security_reports/store/mutations.js
View file @
b8c46c3d
/* eslint-disable no-param-reassign */
import
*
as
types
from
'
./mutation_types
'
;
import
Vue
from
"
vue
"
;
import
{
parseSastIssues
,
parseDependencyScanningIssues
,
...
...
@@ -258,34 +259,38 @@ export default {
[
types
.
SET_ISSUE_MODAL_DATA
](
state
,
payload
)
{
const
{
issue
,
status
}
=
payload
;
state
.
modal
.
title
=
issue
.
title
;
state
.
modal
.
data
.
description
.
value
=
issue
.
description
;
state
.
modal
.
data
.
file
.
value
=
issue
.
location
&&
issue
.
location
.
file
;
state
.
modal
.
data
.
file
.
url
=
issue
.
urlPath
;
state
.
modal
.
data
.
className
.
value
=
issue
.
location
&&
issue
.
location
.
class
;
state
.
modal
.
data
.
methodName
.
value
=
issue
.
location
&&
issue
.
location
.
method
;
state
.
modal
.
data
.
namespace
.
value
=
issue
.
namespace
;
Vue
.
set
(
state
.
modal
,
"
title
"
,
issue
.
title
);
Vue
.
set
(
state
.
modal
.
data
.
description
,
"
value
"
,
issue
.
description
);
Vue
.
set
(
state
.
modal
.
data
.
file
,
"
value
"
,
issue
.
location
&&
issue
.
location
.
file
);
Vue
.
set
(
state
.
modal
.
data
.
file
,
"
url
"
,
issue
.
urlPath
);
Vue
.
set
(
state
.
modal
.
data
.
className
,
"
value
"
,
issue
.
location
&&
issue
.
location
.
class
);
Vue
.
set
(
state
.
modal
.
data
.
methodName
,
"
value
"
,
issue
.
location
&&
issue
.
location
.
method
);
Vue
.
set
(
state
.
modal
.
data
.
namespace
,
"
value
"
,
issue
.
namespace
);
if
(
issue
.
identifiers
&&
issue
.
identifiers
.
length
>
0
)
{
state
.
modal
.
data
.
identifiers
.
value
=
issue
.
identifiers
;
Vue
.
set
(
state
.
modal
.
data
.
identifiers
,
"
value
"
,
issue
.
identifiers
)
;
}
else
{
// Force a null value for identifiers to avoid showing an empty array
state
.
modal
.
data
.
identifiers
.
value
=
null
;
Vue
.
set
(
state
.
modal
.
data
.
identifiers
,
"
value
"
,
null
)
;
}
state
.
modal
.
data
.
severity
.
value
=
issue
.
severity
;
state
.
modal
.
data
.
confidence
.
value
=
issue
.
confidence
;
state
.
modal
.
data
.
solution
.
value
=
issue
.
solution
;
Vue
.
set
(
state
.
modal
.
data
.
severity
,
"
value
"
,
issue
.
severity
);
Vue
.
set
(
state
.
modal
.
data
.
confidence
,
"
value
"
,
issue
.
confidence
);
Vue
.
set
(
state
.
modal
.
data
.
solution
,
"
value
"
,
issue
.
solution
);
if
(
issue
.
links
&&
issue
.
links
.
length
>
0
)
{
state
.
modal
.
data
.
links
.
value
=
issue
.
links
;
Vue
.
set
(
state
.
modal
.
data
.
links
,
"
value
"
,
issue
.
links
)
;
}
else
{
// Force a null value for links to avoid showing an empty array
state
.
modal
.
data
.
links
.
value
=
null
;
Vue
.
set
(
state
.
modal
.
data
.
links
,
"
value
"
,
null
)
;
}
state
.
modal
.
data
.
instances
.
value
=
issue
.
instances
;
state
.
modal
.
vulnerability
=
issue
;
state
.
modal
.
isResolved
=
status
===
'
success
'
;
Vue
.
set
(
state
.
modal
.
data
.
instances
,
"
value
"
,
issue
.
instances
);
Vue
.
set
(
state
.
modal
,
"
vulnerability
"
,
issue
);
Vue
.
set
(
state
.
modal
,
'
isResolved
'
,
status
===
'
success
'
);
// clear previous state
state
.
modal
.
error
=
null
;
Vue
.
set
(
state
.
modal
,
"
error
"
,
null
)
;
},
[
types
.
REQUEST_DISMISS_ISSUE
](
state
)
{
...
...
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