From 3c668fa04fd7e0a1d925e9666eb727ed3e83d145 Mon Sep 17 00:00:00 2001 From: Bryce Johnson Date: Sat, 15 Apr 2017 19:38:07 -0400 Subject: Consolidate user avatar Vue logic --- .../boards/components/issue_card_inner.js | 27 ++++---- .../components/stage_code_component.js | 7 +- .../components/stage_issue_component.js | 8 ++- .../components/stage_plan_component.js | 9 ++- .../components/stage_production_component.js | 8 ++- .../components/stage_review_component.js | 8 ++- .../components/stage_staging_component.js | 7 +- .../diff_notes/components/diff_note_avatars.js | 28 +++++--- .../environments/components/environment_item.vue | 18 ++--- .../pipelines/components/pipeline_url.js | 22 +++--- .../javascripts/vue_shared/components/commit.js | 20 +++--- .../components/user_avatar/user_avatar_image.vue | 79 +++++++++++++++++++++ .../components/user_avatar/user_avatar_link.vue | 80 ++++++++++++++++++++++ .../user_avatar/user_avatar_size_mixin.js | 13 ++++ .../components/user_avatar/user_avatar_svg.vue | 42 ++++++++++++ 15 files changed, 310 insertions(+), 66 deletions(-) create mode 100644 app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue create mode 100644 app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_link.vue create mode 100644 app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_size_mixin.js create mode 100644 app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_svg.vue (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/boards/components/issue_card_inner.js b/app/assets/javascripts/boards/components/issue_card_inner.js index 710207db0c7..4699ef5a51c 100644 --- a/app/assets/javascripts/boards/components/issue_card_inner.js +++ b/app/assets/javascripts/boards/components/issue_card_inner.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import eventHub from '../eventhub'; const Store = gl.issueBoards.BoardsStore; @@ -38,6 +39,9 @@ gl.issueBoards.IssueCardInner = Vue.extend({ maxCounter: 99, }; }, + components: { + userAvatarLink, + }, computed: { numberOverLimit() { return this.issue.assignees.length - this.limitBeforeCounter; @@ -146,23 +150,16 @@ gl.issueBoards.IssueCardInner = Vue.extend({
- - - + class="js-no-trigger" + :link-href="assigneeUrl(assignee)" + :img-alt="avatarUrlTitle(assignee)" + :img-src="assignee.avatar" + :tooltip-text="assigneeUrlTitle(assignee)" + tooltip-placement="bottom" + />
@@ -19,7 +23,8 @@ global.cycleAnalytics.StageCodeComponent = Vue.extend({