Commit dacb6338 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '35010-make-identicon-shared' into 'master'

Make Identicon for avatars a shared component

Closes #35010

See merge request !13919
parents 3fd0cd7d 8d024db6
<script> <script>
import identicon from '../../vue_shared/components/identicon.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import groupIdenticon from './group_identicon.vue';
export default { export default {
components: { components: {
groupIdenticon, identicon,
}, },
props: { props: {
group: { group: {
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,7 @@ export default {
class="avatar s40" class="avatar s40"
:src="group.avatarUrl" :src="group.avatarUrl"
/> />
<group-identicon <identicon
v-else v-else
:entity-id=group.id :entity-id=group.id
:entity-name="group.name" :entity-name="group.name"
......
import Vue from 'vue'; import Vue from 'vue';
import groupIdenticonComponent from '~/groups/components/group_identicon.vue'; import identiconComponent from '~/vue_shared/components/identicon.vue';
import GroupsStore from '~/groups/stores/groups_store';
import { group1 } from './mock_data';
const createComponent = () => { const createComponent = () => {
const Component = Vue.extend(groupIdenticonComponent); const Component = Vue.extend(identiconComponent);
const store = new GroupsStore();
const group = store.decorateGroup(group1);
return new Component({ return new Component({
propsData: { propsData: {
entityId: group.id, entityId: 1,
entityName: group.name, entityName: 'entity-name',
}, },
}).$mount(); }).$mount();
}; };
describe('GroupIdenticonComponent', () => { describe('IdenticonComponent', () => {
let vm; let vm;
beforeEach(() => { beforeEach(() => {
......
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