Commit 29e4ec70 authored by Tom Quirk's avatar Tom Quirk Committed by David O'Regan

Use GlAvatar in environments dashboard

Changelog: changed
parent b453775c
<script> <script>
import { GlTooltipDirective, GlLink, GlBadge, GlIcon } from '@gitlab/ui'; import { GlTooltipDirective, GlLink, GlBadge, GlIcon, GlAvatarLink, GlAvatar } from '@gitlab/ui';
import { escape, isEmpty } from 'lodash'; import { escape, isEmpty } from 'lodash';
import Alerts from 'ee/vue_shared/dashboards/components/alerts.vue'; import Alerts from 'ee/vue_shared/dashboards/components/alerts.vue';
import ProjectPipeline from 'ee/vue_shared/dashboards/components/project_pipeline.vue'; import ProjectPipeline from 'ee/vue_shared/dashboards/components/project_pipeline.vue';
...@@ -7,14 +7,12 @@ import TimeAgo from 'ee/vue_shared/dashboards/components/time_ago.vue'; ...@@ -7,14 +7,12 @@ import TimeAgo from 'ee/vue_shared/dashboards/components/time_ago.vue';
import { STATUS_FAILED } from 'ee/vue_shared/dashboards/constants'; import { STATUS_FAILED } from 'ee/vue_shared/dashboards/constants';
import { s__, __, sprintf } from '~/locale'; import { s__, __, sprintf } from '~/locale';
import Commit from '~/vue_shared/components/commit.vue'; import Commit from '~/vue_shared/components/commit.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
import EnvironmentHeader from './environment_header.vue'; import EnvironmentHeader from './environment_header.vue';
export default { export default {
components: { components: {
EnvironmentHeader, EnvironmentHeader,
UserAvatarLink,
GlLink, GlLink,
GlBadge, GlBadge,
Commit, Commit,
...@@ -22,6 +20,8 @@ export default { ...@@ -22,6 +20,8 @@ export default {
ProjectPipeline, ProjectPipeline,
TimeAgo, TimeAgo,
GlIcon, GlIcon,
GlAvatarLink,
GlAvatar,
}, },
directives: { directives: {
'gl-tooltip': GlTooltipDirective, 'gl-tooltip': GlTooltipDirective,
...@@ -127,13 +127,14 @@ export default { ...@@ -127,13 +127,14 @@ export default {
<div :class="cardClasses" class="dashboard-card-body card-body"> <div :class="cardClasses" class="dashboard-card-body card-body">
<div v-if="lastDeployment" class="row"> <div v-if="lastDeployment" class="row">
<div class="col-1 align-self-center px-3"> <div class="col-1 align-self-center px-3">
<user-avatar-link <gl-avatar-link v-if="user" :href="user.path">
v-if="user" <gl-avatar
:link-href="user.path" :src="user.avatar_url"
:img-src="user.avatar_url" :entity-name="user.username"
:tooltip-text="user.name" :title="user.name"
:img-size="32" :size="32"
/> />
</gl-avatar-link>
</div> </div>
<div class="col-10 col-sm-7 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">
......
...@@ -18,16 +18,19 @@ exports[`Environment matchs the snapshot 1`] = ` ...@@ -18,16 +18,19 @@ exports[`Environment matchs the snapshot 1`] = `
<div <div
class="col-1 align-self-center px-3" class="col-1 align-self-center px-3"
> >
<user-avatar-link-stub <gl-avatar-link-stub
imgalt="" href="/root"
imgcssclasses="" >
imgsize="32" <gl-avatar-stub
imgsrc="https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon" alt="avatar"
linkhref="/root" entityid="0"
tooltipplacement="top" entityname="root"
tooltiptext="Administrator" shape="circle"
username="" size="32"
/> src="https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon"
title="Administrator"
/>
</gl-avatar-link-stub>
</div> </div>
<div <div
......
...@@ -32,6 +32,7 @@ describe('Environment', () => { ...@@ -32,6 +32,7 @@ describe('Environment', () => {
expect(wrapper.findComponent(EnvironmentHeader).props('environment')).toBe(environment); expect(wrapper.findComponent(EnvironmentHeader).props('environment')).toBe(environment);
}); });
}); });
describe('alerts', () => { describe('alerts', () => {
let alert; let alert;
...@@ -45,6 +46,7 @@ describe('Environment', () => { ...@@ -45,6 +46,7 @@ describe('Environment', () => {
expect(alert.props('lastAlert')).toBe(environment.last_alert); expect(alert.props('lastAlert')).toBe(environment.last_alert);
}); });
}); });
describe('commit', () => { describe('commit', () => {
let commit; let commit;
......
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