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
350fec4b
Commit
350fec4b
authored
Sep 30, 2019
by
Jason Goodman
Committed by
Kushal Pandya
Sep 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle a deployment without a deployable in the Environment Dashboard
Display no deployment information
parent
7df9cd9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
ee/app/assets/javascripts/environments_dashboard/components/dashboard/environment.vue
...vironments_dashboard/components/dashboard/environment.vue
+3
-11
ee/spec/frontend/environments_dashboard/components/environment_spec.js
...end/environments_dashboard/components/environment_spec.js
+33
-0
No files found.
ee/app/assets/javascripts/environments_dashboard/components/dashboard/environment.vue
View file @
350fec4b
...
...
@@ -70,7 +70,7 @@ export default {
return
!
_
.
isEmpty
(
this
.
environment
.
last_deployment
)
?
this
.
environment
.
last_deployment
:
null
;
},
deployable
()
{
return
!
_
.
isEmpty
(
this
.
lastDeployment
.
deployable
)
?
this
.
lastDeployment
.
deployable
:
null
;
return
this
.
lastDeployment
?
this
.
lastDeployment
.
deployable
:
null
;
},
commit
()
{
return
!
_
.
isEmpty
(
this
.
lastDeployment
.
commit
)
?
this
.
lastDeployment
.
commit
:
{};
...
...
@@ -102,15 +102,7 @@ export default {
);
},
buildName
()
{
if
(
this
.
environment
&&
this
.
environment
.
last_deployment
&&
this
.
environment
.
last_deployment
.
deployable
)
{
const
{
deployable
}
=
this
.
environment
.
last_deployment
;
return
`
${
deployable
.
name
}
#
${
deployable
.
id
}
`
;
}
return
''
;
return
this
.
deployable
?
`
${
this
.
deployable
.
name
}
#
${
this
.
deployable
.
id
}
`
:
''
;
},
},
};
...
...
@@ -124,7 +116,7 @@ export default {
/>
<div
:class=
"cardClasses"
class=
"dashboard-card-body card-body"
>
<div
v-if=
"
lastDeployment
"
class=
"row"
>
<div
v-if=
"
deployable
"
class=
"row"
>
<div
class=
"col-1 align-self-center"
>
<user-avatar-link
v-if=
"user"
...
...
ee/spec/frontend/environments_dashboard/components/environment_spec.js
View file @
350fec4b
...
...
@@ -81,4 +81,37 @@ describe('Environment', () => {
});
});
});
it
(
'
renders an environment without a deployment
'
,
()
=>
{
propsData
=
{
environment
:
{
...
environment
,
last_deployment
:
null
,
},
};
wrapper
=
shallowMount
(
Component
,
{
localVue
,
propsData
,
});
expect
(
wrapper
.
text
()).
toContain
(
'
This environment has no deployments yet.
'
);
});
it
(
'
renders an environment with a deployment without a deployable
'
,
()
=>
{
propsData
=
{
environment
:
{
...
environment
,
last_deployment
:
{
...
environment
.
last_deployment
,
deployable
:
null
,
},
},
};
wrapper
=
shallowMount
(
Component
,
{
localVue
,
propsData
,
});
expect
(
wrapper
.
text
()).
toContain
(
'
This environment has no deployments yet.
'
);
});
});
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