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
23a272fb
Commit
23a272fb
authored
Jun 03, 2020
by
Emily Ring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor mr_widget_terraform_plan to use GitLab UI
Uses GlLink and removed a tag Only uses GlIcon
parent
bf241b1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_terraform_plan.vue
...ge_request_widget/components/mr_widget_terraform_plan.vue
+5
-12
spec/frontend/vue_mr_widget/components/mr_widget_terraform_plan_spec.js
...vue_mr_widget/components/mr_widget_terraform_plan_spec.js
+3
-3
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_terraform_plan.vue
View file @
23a272fb
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
GlIcon
,
GlLoadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlL
ink
,
GlL
oadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
CiIcon
from
'
../../vue_shared/components/ci_icon.vue
'
;
import
flash
from
'
~/flash
'
;
import
Poll
from
'
~/lib/utils/poll
'
;
export
default
{
name
:
'
MRWidgetTerraformPlan
'
,
components
:
{
CiIcon
,
GlIcon
,
GlLink
,
GlLoadingIcon
,
GlSprintf
,
},
...
...
@@ -36,12 +35,6 @@ export default {
deleteNum
()
{
return
Number
(
this
.
plan
.
delete
);
},
iconStatusObj
()
{
return
{
group
:
'
warning
'
,
icon
:
'
status_warning
'
,
};
},
logUrl
()
{
return
this
.
plan
.
job_path
;
},
...
...
@@ -90,7 +83,7 @@ export default {
<section
class=
"mr-widget-section"
>
<div
class=
"mr-widget-body media d-flex flex-row"
>
<span
class=
"append-right-default align-self-start align-self-lg-center"
>
<
ci-icon
:status=
"iconStatusObj
"
:size=
"24"
/>
<
gl-icon
name=
"status_warning
"
:size=
"24"
/>
</span>
<div
class=
"d-flex flex-fill flex-column flex-md-row"
>
...
...
@@ -125,7 +118,7 @@ export default {
</div>
<div
class=
"terraform-mr-plan-actions"
>
<
a
<
gl-link
v-if=
"logUrl"
:href=
"logUrl"
target=
"_blank"
...
...
@@ -137,7 +130,7 @@ export default {
>
{{ __('View full log') }}
<gl-icon
name=
"external-link"
/>
</
a
>
</
gl-link
>
</div>
</div>
</div>
...
...
spec/frontend/vue_mr_widget/components/mr_widget_terraform_plan_spec.js
View file @
23a272fb
import
{
GlLoadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlL
ink
,
GlL
oadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
...
...
@@ -80,7 +80,7 @@ describe('MrWidgetTerraformPlan', () => {
});
it
(
'
renders button when url is found
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
a
'
).
text
()).
toContain
(
'
View full log
'
);
expect
(
wrapper
.
find
(
GlLink
).
exists
()).
toBe
(
true
);
});
it
(
'
does not make additional requests after poll is successful
'
,
()
=>
{
...
...
@@ -101,7 +101,7 @@ describe('MrWidgetTerraformPlan', () => {
);
expect
(
wrapper
.
find
(
'
.js-terraform-report-link
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
text
()).
not
.
toContain
(
'
View full log
'
);
expect
(
wrapper
.
find
(
GlLink
).
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