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
384c4741
Commit
384c4741
authored
Mar 09, 2021
by
Fernando Arias
Committed by
Savas Vedova
Mar 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update column width
* Adjust response styles Tweak alignment for solution text
parent
a8d09910
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
36 deletions
+52
-36
ee/app/assets/javascripts/vue_shared/security_reports/components/solution_card_vuex.vue
...shared/security_reports/components/solution_card_vuex.vue
+29
-25
ee/app/assets/javascripts/vue_shared/security_reports/components/vulnerability_detail.vue
...ared/security_reports/components/vulnerability_detail.vue
+2
-2
ee/changelogs/unreleased/281721-adjust-vuln-modal-column-width.yml
...logs/unreleased/281721-adjust-vuln-modal-column-width.yml
+5
-0
ee/spec/frontend/vue_shared/security_reports/components/__snapshots__/vulnerability_detail_spec.js.snap
...omponents/__snapshots__/vulnerability_detail_spec.js.snap
+2
-2
ee/spec/frontend/vue_shared/security_reports/components/solution_card_vuex_spec.js
...ed/security_reports/components/solution_card_vuex_spec.js
+14
-7
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/solution_card_vuex.vue
View file @
384c4741
<
script
>
<
script
>
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlCard
}
from
'
@gitlab/ui
'
;
export
default
{
export
default
{
name
:
'
SolutionCard
'
,
name
:
'
SolutionCard
'
,
components
:
{
GlIcon
},
components
:
{
GlIcon
,
GlCard
},
props
:
{
props
:
{
solution
:
{
solution
:
{
type
:
String
,
type
:
String
,
...
@@ -42,29 +42,33 @@ export default {
...
@@ -42,29 +42,33 @@ export default {
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"card my-4"
>
<gl-card
<div
v-if=
"solutionText"
class=
"card-body d-flex align-items-center"
>
class=
"gl-my-6"
<div
:body-class=
"
{ 'gl-p-0': !solutionText }"
class=
"col-auto d-flex align-items-center pl-0"
:footer-class="{ 'gl-border-0': !solutionText }"
:class=
"
{ 'col-md-2': !isStandaloneVulnerability }"
>
>
<template
v-if=
"solutionText"
#default
>
<div
class=
"circle-icon-container pr-3"
aria-hidden=
"true"
><gl-icon
name=
"bulb"
/></div>
<div
class=
"gl-display-flex gl-align-items-center"
>
<strong
class=
"text-right flex-grow-1"
>
{{
s__
(
'
ciReport|Solution
'
)
}}
:
</strong>
<div
</div>
class=
"col-auto gl-display-flex gl-align-items-center gl-justify-content-end gl-pl-0"
<span
class=
"flex-shrink-1 pl-0"
:class=
"
{ 'col-md-10': !isStandaloneVulnerability }">
{{
:class=
"
{ 'col-md-2': !isStandaloneVulnerability }"
solutionText
>
}}
</span>
<gl-icon
class=
"gl-mr-5"
name=
"bulb"
/>
</div>
<strong>
{{
s__
(
'
ciReport|Solution
'
)
}}
:
</strong>
<template
v-if=
"showCreateMergeRequestMsg"
>
</div>
<div
class=
"card-footer"
:class=
"
{ 'border-0': !solutionText }">
<span
class=
"flex-shrink-1 gl-pl-0"
:class=
"
{ 'col-md-10': !isStandaloneVulnerability }">
{{
<em
class=
"text-secondary"
>
solutionText
{{
}}
</span>
s__
(
'
ciReport|Create a merge request to implement this solution, or download and apply the patch manually.
'
,
)
}}
</em>
</div>
</div>
</
template
>
</
template
>
</div>
<
template
v-if=
"showCreateMergeRequestMsg"
#footer
>
<em
class=
"gl-text-gray-500"
data-testid=
"merge-request-solution"
>
{{
s__
(
'
ciReport|Create a merge request to implement this solution, or download and apply the patch manually.
'
,
)
}}
</em>
</
template
>
</gl-card>
</template>
</template>
ee/app/assets/javascripts/vue_shared/security_reports/components/vulnerability_detail.vue
View file @
384c4741
...
@@ -12,8 +12,8 @@ export default {
...
@@ -12,8 +12,8 @@ export default {
<
template
functional
>
<
template
functional
>
<div
class=
"d-sm-flex my-sm-2 my-4"
>
<div
class=
"d-sm-flex my-sm-2 my-4"
>
<label
class=
"col-sm-
4 text-sm-right font-weight-bold
pl-0"
>
{{
props
.
label
}}
:
</label>
<label
class=
"col-sm-
2 text-sm-right gl-font-weight-bold gl-
pl-0"
>
{{
props
.
label
}}
:
</label>
<div
class=
"col-sm-
8 pl-0 text-secondary
"
>
<div
class=
"col-sm-
10 gl-pl-0 gl-text-gray-500
"
>
<slot></slot>
<slot></slot>
</div>
</div>
</div>
</div>
...
...
ee/changelogs/unreleased/281721-adjust-vuln-modal-column-width.yml
0 → 100644
View file @
384c4741
---
title
:
Fix alignment issues in vulnerability modals
merge_request
:
55716
author
:
type
:
fixed
ee/spec/frontend/vue_shared/security_reports/components/__snapshots__/vulnerability_detail_spec.js.snap
View file @
384c4741
...
@@ -5,13 +5,13 @@ exports[`VulnerabilityDetail component renders the label prop and default slot 1
...
@@ -5,13 +5,13 @@ exports[`VulnerabilityDetail component renders the label prop and default slot 1
class="d-sm-flex my-sm-2 my-4"
class="d-sm-flex my-sm-2 my-4"
>
>
<label
<label
class="col-sm-
4 text-sm-right font-weight-bold
pl-0"
class="col-sm-
2 text-sm-right gl-font-weight-bold gl-
pl-0"
>
>
foo:
foo:
</label>
</label>
<div
<div
class="col-sm-
8 pl-0 text-secondary
"
class="col-sm-
10 gl-pl-0 gl-text-gray-500
"
>
>
<p>
<p>
bar
bar
...
...
ee/spec/frontend/vue_shared/security_reports/components/solution_card_vuex_spec.js
View file @
384c4741
import
{
GlCard
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
component
from
'
ee/vue_shared/security_reports/components/solution_card_vuex.vue
'
;
import
component
from
'
ee/vue_shared/security_reports/components/solution_card_vuex.vue
'
;
...
@@ -19,13 +20,15 @@ describe('Solution Card', () => {
...
@@ -19,13 +20,15 @@ describe('Solution Card', () => {
it
(
'
takes the value of solution
'
,
()
=>
{
it
(
'
takes the value of solution
'
,
()
=>
{
const
propsData
=
{
solution
};
const
propsData
=
{
solution
};
wrapper
=
shallowMount
(
Component
,
{
propsData
});
wrapper
=
shallowMount
(
Component
,
{
propsData
});
expect
(
wrapper
.
find
(
'
.card-body
'
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
solution
}
`
);
expect
(
wrapper
.
findComponent
(
GlCard
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
solution
}
`
,
);
});
});
it
(
'
takes the summary from a remediation
'
,
()
=>
{
it
(
'
takes the summary from a remediation
'
,
()
=>
{
const
propsData
=
{
remediation
};
const
propsData
=
{
remediation
};
wrapper
=
shallowMount
(
Component
,
{
propsData
});
wrapper
=
shallowMount
(
Component
,
{
propsData
});
expect
(
wrapper
.
find
(
'
.card-body
'
).
text
()).
toMatchInterpolatedText
(
expect
(
wrapper
.
find
Component
(
GlCard
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
remediation
.
summary
}
`
,
`Solution:
${
remediation
.
summary
}
`
,
);
);
});
});
...
@@ -33,7 +36,9 @@ describe('Solution Card', () => {
...
@@ -33,7 +36,9 @@ describe('Solution Card', () => {
it
(
'
takes the value of solution, if both are defined
'
,
()
=>
{
it
(
'
takes the value of solution, if both are defined
'
,
()
=>
{
const
propsData
=
{
remediation
,
solution
};
const
propsData
=
{
remediation
,
solution
};
wrapper
=
shallowMount
(
Component
,
{
propsData
});
wrapper
=
shallowMount
(
Component
,
{
propsData
});
expect
(
wrapper
.
find
(
'
.card-body
'
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
solution
}
`
);
expect
(
wrapper
.
findComponent
(
GlCard
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
solution
}
`
,
);
});
});
});
});
});
});
...
@@ -46,7 +51,9 @@ describe('Solution Card', () => {
...
@@ -46,7 +51,9 @@ describe('Solution Card', () => {
});
});
it
(
'
renders the solution text and label
'
,
()
=>
{
it
(
'
renders the solution text and label
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.card-body
'
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
solution
}
`
);
expect
(
wrapper
.
findComponent
(
GlCard
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
solution
}
`
,
);
});
});
it
(
'
does not render the card footer
'
,
()
=>
{
it
(
'
does not render the card footer
'
,
()
=>
{
...
@@ -65,7 +72,7 @@ describe('Solution Card', () => {
...
@@ -65,7 +72,7 @@ describe('Solution Card', () => {
});
});
it
(
'
renders the solution text and label
'
,
()
=>
{
it
(
'
renders the solution text and label
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.card-body
'
).
text
()).
toMatchInterpolatedText
(
expect
(
wrapper
.
find
Component
(
GlCard
).
text
()).
toMatchInterpolatedText
(
`Solution:
${
remediation
.
summary
}
`
,
`Solution:
${
remediation
.
summary
}
`
,
);
);
});
});
...
@@ -84,7 +91,7 @@ describe('Solution Card', () => {
...
@@ -84,7 +91,7 @@ describe('Solution Card', () => {
});
});
it
(
'
renders the create a merge request to implement this solution message
'
,
()
=>
{
it
(
'
renders the create a merge request to implement this solution message
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.card-footer
'
).
text
()).
toMatch
(
expect
(
wrapper
.
find
(
'
[data-testid="merge-request-solution"]
'
).
text
()).
toMatch
(
s__
(
s__
(
'
ciReport|Create a merge request to implement this solution, or download and apply the patch manually.
'
,
'
ciReport|Create a merge request to implement this solution, or download and apply the patch manually.
'
,
),
),
...
@@ -94,7 +101,7 @@ describe('Solution Card', () => {
...
@@ -94,7 +101,7 @@ describe('Solution Card', () => {
describe
(
'
without download patch
'
,
()
=>
{
describe
(
'
without download patch
'
,
()
=>
{
it
(
'
does not render the card footer
'
,
()
=>
{
it
(
'
does not render the card footer
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.card-footer
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
'
[data-testid="merge-request-solution"]
'
).
exists
()).
toBe
(
false
);
});
});
});
});
});
});
...
...
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