From 037b4fe939696eebe6295a858470f2661d1e3878 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 27 Jan 2017 22:24:08 +0000 Subject: First iteration Create shared folder for vue common files Update paths Second iteration - refactor main component to be 100% reusable between the 3 tables --- .../javascripts/vue_common_component/commit.js.es6 | 163 --------------------- 1 file changed, 163 deletions(-) delete mode 100644 app/assets/javascripts/vue_common_component/commit.js.es6 (limited to 'app/assets/javascripts/vue_common_component/commit.js.es6') diff --git a/app/assets/javascripts/vue_common_component/commit.js.es6 b/app/assets/javascripts/vue_common_component/commit.js.es6 deleted file mode 100644 index 62a22e39a3b..00000000000 --- a/app/assets/javascripts/vue_common_component/commit.js.es6 +++ /dev/null @@ -1,163 +0,0 @@ -/*= require vue */ -/* global Vue */ -(() => { - window.gl = window.gl || {}; - - window.gl.CommitComponent = Vue.component('commit-component', { - - props: { - /** - * Indicates the existance of a tag. - * Used to render the correct icon, if true will render `fa-tag` icon, - * if false will render `fa-code-fork` icon. - */ - tag: { - type: Boolean, - required: false, - default: false, - }, - - /** - * If provided is used to render the branch name and url. - * Should contain the following properties: - * name - * ref_url - */ - commitRef: { - type: Object, - required: false, - default: () => ({}), - }, - - /** - * Used to link to the commit sha. - */ - commitUrl: { - type: String, - required: false, - default: '', - }, - - /** - * Used to show the commit short sha that links to the commit url. - */ - shortSha: { - type: String, - required: false, - default: '', - }, - - /** - * If provided shows the commit tile. - */ - title: { - type: String, - required: false, - default: '', - }, - - /** - * If provided renders information about the author of the commit. - * When provided should include: - * `avatar_url` to render the avatar icon - * `web_url` to link to user profile - * `username` to render alt and title tags - */ - author: { - type: Object, - required: false, - default: () => ({}), - }, - - commitIconSvg: { - type: String, - required: false, - }, - }, - - computed: { - /** - * Used to verify if all the properties needed to render the commit - * ref section were provided. - * - * TODO: Improve this! Use lodash _.has when we have it. - * - * @returns {Boolean} - */ - hasCommitRef() { - return this.commitRef && this.commitRef.name && this.commitRef.ref_url; - }, - - /** - * Used to verify if all the properties needed to render the commit - * author section were provided. - * - * TODO: Improve this! Use lodash _.has when we have it. - * - * @returns {Boolean} - */ - hasAuthor() { - return this.author && - this.author.avatar_url && - this.author.web_url && - this.author.username; - }, - - /** - * If information about the author is provided will return a string - * to be rendered as the alt attribute of the img tag. - * - * @returns {String} - */ - userImageAltDescription() { - return this.author && - this.author.username ? `${this.author.username}'s avatar` : null; - }, - }, - - template: ` -
- -
- - -
- - - {{commitRef.name}} - - -
- - - {{shortSha}} - - -

- - - - - - - {{title}} - - - - Cant find HEAD commit for this branch - -

-
- `, - }); -})(); -- cgit v1.2.1