Commit 916b6d98 authored by Clement Ho's avatar Clement Ho

Merge branch 'environments-dashboard-ux-tweaks' into 'master'

Environments dashboard ux tweaks

See merge request gitlab-org/gitlab!18280
parents 2c97a540 52485e97
---
title: Minor UX improvements to Environments Dashboard page
merge_request: 18280
author:
type: changed
...@@ -56,6 +56,7 @@ export default { ...@@ -56,6 +56,7 @@ export default {
'dashboard-card-body-warning': !this.hasPipelineFailed && this.hasPipelineErrors, 'dashboard-card-body-warning': !this.hasPipelineFailed && this.hasPipelineErrors,
'dashboard-card-body-failed': this.hasPipelineFailed, 'dashboard-card-body-failed': this.hasPipelineFailed,
'bg-secondary': !this.hasPipelineFailed && !this.hasPipelineErrors, 'bg-secondary': !this.hasPipelineFailed && !this.hasPipelineErrors,
'd-flex flex-column justify-content-center align-items-center': !this.deployable,
}; };
}, },
user() { user() {
...@@ -87,6 +88,15 @@ export default { ...@@ -87,6 +88,15 @@ export default {
} }
: {}; : {};
}, },
commitAuthor() {
return (
this.commit.author || {
avatar_url: this.commit.author_gravatar_url,
path: `mailto:${_.escape(this.commit.author_email)}`,
username: this.commit.author_name,
}
);
},
finishedTime() { finishedTime() {
return this.deployable.updated_at; return this.deployable.updated_at;
}, },
...@@ -127,7 +137,7 @@ export default { ...@@ -127,7 +137,7 @@ export default {
/> />
</div> </div>
<div class="col-10 col-sm-6 pr-0 pl-5 align-self-center align-middle ci-table"> <div class="col-10 col-sm-7 pr-0 pl-5 align-self-center align-middle ci-table">
<div class="branch-commit"> <div class="branch-commit">
<icon name="work" /> <icon name="work" />
<gl-link v-gl-tooltip="jobTooltip" :href="deployable.build_path" class="str-truncated"> <gl-link v-gl-tooltip="jobTooltip" :href="deployable.build_path" class="str-truncated">
...@@ -135,23 +145,29 @@ export default { ...@@ -135,23 +145,29 @@ export default {
</gl-link> </gl-link>
</div> </div>
<commit <commit
:tag="commitRef.tag" :tag="lastDeployment.tag"
:commit-ref="commitRef" :commit-ref="commitRef"
:short-sha="commit.short_id" :short-sha="commit.short_id"
:commit-url="commit.commit_url" :commit-url="commit.commit_url"
:title="commit.title" :title="commit.title"
:author="commit.author" :author="commitAuthor"
:show-branch="true" :show-branch="true"
/> />
</div> </div>
<div class="col-sm-5 pl-0 text-right align-self-center d-none d-sm-block"> <div
class="col-sm-4 mt-0 pl-5 pl-sm-0 offset-1 offset-sm-0 text-sm-right align-self-center col-12 d-sm-block"
>
<time-ago <time-ago
v-if="shouldShowTimeAgo" v-if="shouldShowTimeAgo"
:time="finishedTime" :time="finishedTime"
:tooltip-text="$options.tooltips.timeAgo" :tooltip-text="$options.tooltips.timeAgo"
/> />
<alerts :count="environment.alert_count" :last-alert="environment.last_alert" /> <alerts
v-if="environment.alert_count > 0"
:count="environment.alert_count"
:last-alert="environment.last_alert"
/>
</div> </div>
<div v-if="lastPipeline" class="col-12"> <div v-if="lastPipeline" class="col-12">
...@@ -164,7 +180,7 @@ export default { ...@@ -164,7 +180,7 @@ export default {
</div> </div>
<div v-else class="h-100 d-flex justify-content-center align-items-center"> <div v-else class="h-100 d-flex justify-content-center align-items-center">
<div class="text-plain text-metric text-center bold w-75"> <div class="text-plain text-metric text-center bold">
{{ $options.noDeploymentMessage }} {{ $options.noDeploymentMessage }}
</div> </div>
</div> </div>
......
...@@ -31,7 +31,7 @@ exports[`Environment matchs the snapshot 1`] = ` ...@@ -31,7 +31,7 @@ exports[`Environment matchs the snapshot 1`] = `
</div> </div>
<div <div
class="col-10 col-sm-6 pr-0 pl-5 align-self-center align-middle ci-table" class="col-10 col-sm-7 pr-0 pl-5 align-self-center align-middle ci-table"
> >
<div <div
class="branch-commit" class="branch-commit"
...@@ -54,6 +54,7 @@ exports[`Environment matchs the snapshot 1`] = ` ...@@ -54,6 +54,7 @@ exports[`Environment matchs the snapshot 1`] = `
</div> </div>
<commit-stub <commit-stub
author="[object Object]"
commitref="[object Object]" commitref="[object Object]"
commiturl="https://22878.qa-tunnel.gitlab.info/root/minimal-ruby-app/commit/63492726c2264a0277141d6a6573c3d22ecd7de3" commiturl="https://22878.qa-tunnel.gitlab.info/root/minimal-ruby-app/commit/63492726c2264a0277141d6a6573c3d22ecd7de3"
shortsha="63492726" shortsha="63492726"
...@@ -64,7 +65,7 @@ exports[`Environment matchs the snapshot 1`] = ` ...@@ -64,7 +65,7 @@ exports[`Environment matchs the snapshot 1`] = `
</div> </div>
<div <div
class="col-sm-5 pl-0 text-right align-self-center d-none d-sm-block" class="col-sm-4 mt-0 pl-5 pl-sm-0 offset-1 offset-sm-0 text-sm-right align-self-center col-12 d-sm-block"
> >
<timeago-stub <timeago-stub
time="2019-02-20T16:15:40.122Z" time="2019-02-20T16:15:40.122Z"
......
...@@ -73,7 +73,11 @@ describe('Environment', () => { ...@@ -73,7 +73,11 @@ describe('Environment', () => {
}); });
it('binds author', () => { it('binds author', () => {
expect(commit.props('author')).toBe(environment.last_deployment.commit.author); expect(commit.props('author')).toEqual({
avatar_url: environment.last_deployment.commit.author_gravatar_url,
path: `mailto:${environment.last_deployment.commit.author_email}`,
username: environment.last_deployment.commit.author_name,
});
}); });
it('binds tag', () => { it('binds tag', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment