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
973fac66
Commit
973fac66
authored
Nov 11, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor HTTP Request/Response into methods
* Refactor common computed prop logic into methods
parent
94b08103
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
33 deletions
+24
-33
ee/app/assets/javascripts/vulnerabilities/components/details.vue
...assets/javascripts/vulnerabilities/components/details.vue
+19
-28
ee/app/assets/javascripts/vulnerabilities/constants.js
ee/app/assets/javascripts/vulnerabilities/constants.js
+2
-2
locale/gitlab.pot
locale/gitlab.pot
+3
-3
No files found.
ee/app/assets/javascripts/vulnerabilities/components/details.vue
View file @
973fac66
...
...
@@ -66,38 +66,13 @@ export default {
)?.
response
;
},
getConstructedRequest
()
{
const
{
body
,
method
,
url
,
headers
=
[]
}
=
this
.
vulnerability
.
request
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
method
&&
url
&&
headerLines
?
[
`
${
method
}
${
url
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
)
:
''
;
return
this
.
constructRequest
(
this
.
vulnerability
.
request
);
},
getConstructedResponse
()
{
const
{
body
,
status_code
:
statusCode
,
reason_phrase
:
reasonPhrase
,
headers
=
[],
}
=
this
.
vulnerability
.
response
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
statusCode
&&
reasonPhrase
&&
headerLines
?
[
`
${
statusCode
}
${
reasonPhrase
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
)
:
''
;
return
this
.
constructResponse
(
this
.
vulnerability
.
response
);
},
getConstructedRecordedResponse
()
{
const
{
body
,
status_code
:
statusCode
,
reason_phrase
:
reasonPhrase
,
headers
=
[],
}
=
this
.
recordedMessage
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
statusCode
&&
reasonPhrase
&&
headerLines
?
[
`
${
statusCode
}
${
reasonPhrase
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
)
:
''
;
return
this
.
constructResponse
(
this
.
recordedMessage
);
},
requestData
()
{
if
(
!
this
.
vulnerability
.
request
)
{
...
...
@@ -167,6 +142,22 @@ export default {
?
headers
.
map
(({
name
,
value
})
=>
`
${
name
}
:
${
value
}
`
).
join
(
'
\n
'
)
:
''
;
},
constructResponse
(
response
)
{
const
{
body
,
status_code
:
statusCode
,
reason_phrase
:
reasonPhrase
,
headers
=
[]
}
=
response
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
statusCode
&&
reasonPhrase
&&
headerLines
?
[
`
${
statusCode
}
${
reasonPhrase
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
)
:
''
;
},
constructRequest
(
request
)
{
const
{
body
,
method
,
url
,
headers
=
[]
}
=
request
;
const
headerLines
=
this
.
getHeadersAsCodeBlockLines
(
headers
);
return
method
&&
url
&&
headerLines
?
[
`
${
method
}
${
url
}
\n`
,
headerLines
,
'
\n\n
'
,
body
].
join
(
''
)
:
''
;
},
},
};
</
script
>
...
...
ee/app/assets/javascripts/vulnerabilities/constants.js
View file @
973fac66
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
export
const
VULNERABILITY_STATE_OBJECTS
=
{
detected
:
{
...
...
@@ -67,5 +67,5 @@ export const REGEXES = {
};
export
const
SUPPORTING_MESSAGE_TYPES
=
{
RECORDED
:
__
(
'
Recorded
'
),
RECORDED
:
s__
(
'
VulnerabilityManagement|
Recorded
'
),
};
locale/gitlab.pot
View file @
973fac66
...
...
@@ -21945,9 +21945,6 @@ msgstr ""
msgid "Reconfigure"
msgstr ""
msgid "Recorded"
msgstr ""
msgid "Recover hidden stage"
msgstr ""
...
...
@@ -29649,6 +29646,9 @@ msgstr ""
msgid "VulnerabilityManagement|Needs triage"
msgstr ""
msgid "VulnerabilityManagement|Recorded"
msgstr ""
msgid "VulnerabilityManagement|Something went wrong while trying to delete the comment. Please try again later."
msgstr ""
...
...
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