diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-19 03:38:29 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-21 21:57:11 +0300 |
commit | 1a7cc190b734731f936c9aa067bf5ac2d46ef2c6 (patch) | |
tree | 22bd77d0ea5cb08141da425c711b41ede9505412 /app/assets/javascripts/cycle_analytics | |
parent | 283134a7def2ace2c3da5aa36db6bc29e46e8bed (diff) |
Make linters happy
Diffstat (limited to 'app/assets/javascripts/cycle_analytics')
11 files changed, 23 insertions, 78 deletions
diff --git a/app/assets/javascripts/cycle_analytics/components/item_commit_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/item_commit_component.js.es6 deleted file mode 100644 index e05995c406a..00000000000 --- a/app/assets/javascripts/cycle_analytics/components/item_commit_component.js.es6 +++ /dev/null @@ -1,49 +0,0 @@ -((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; - - /* - `commit` prop should have - - - Commit title - - Commit URL - - Commit Short SHA - - Commit author - - Commit author profile URL - - Commit author avatar URL - - Total time - */ - - global.cycleAnalytics.ItemCommitComponent = Vue.extend({ - props: { - commit: Object, - }, - template: ` - <div> - <div class="item-details item-conmmit-component"> - <img class="avatar" :src="commit.author.avatarUrl"> - <h5 class="item-title commit-title"> - <a :href="commit.commitUrl"> - {{ commit.title }} - </a> - </h5> - <span> - First - <span class="commit-icon"> - <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 40 40"> - <path fill="#8F8F8F" fill-rule="evenodd" d="M28.7769836,18 C27.8675252,13.9920226 24.2831748,11 20,11 C15.7168252,11 12.1324748,13.9920226 11.2230164,18 L4.0085302,18 C2.90195036,18 2,18.8954305 2,20 C2,21.1122704 2.8992496,22 4.0085302,22 L11.2230164,22 C12.1324748,26.0079774 15.7168252,29 20,29 C24.2831748,29 27.8675252,26.0079774 28.7769836,22 L35.9914698,22 C37.0980496,22 38,21.1045695 38,20 C38,18.8877296 37.1007504,18 35.9914698,18 L28.7769836,18 L28.7769836,18 Z M20,25 C22.7614237,25 25,22.7614237 25,20 C25,17.2385763 22.7614237,15 20,15 C17.2385763,15 15,17.2385763 15,20 C15,22.7614237 17.2385763,25 20,25 L20,25 Z"/> - </svg> - </span> - <a :href="commit.commitUrl" class="commit-hash-link monospace">{{ commit.shortSha }}</a> - pushed by - <a :href="commit.author.webUrl" class="commit-author-link"> - {{ commit.author.name }} - </a> - </span> - </div> - <div class="item-time"> - <total-time :time="commit.totalTime"></total-time> - </div> - <div> - `, - }); -}(window.gl || (window.gl = {}))); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_code_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_code_component.js.es6 index 4f83c61b45d..520cee7738b 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_code_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_code_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StageCodeComponent = Vue.extend({ @@ -40,5 +40,4 @@ </div> `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_issue_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_issue_component.js.es6 index fc3dd043a0b..09cd3dba6a5 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_issue_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_issue_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StageIssueComponent = Vue.extend({ @@ -42,5 +42,4 @@ </div> `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_plan_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_plan_component.js.es6 index d6fa1244ef8..78ca411d76d 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_plan_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_plan_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StagePlanComponent = Vue.extend({ @@ -43,5 +43,4 @@ </div> `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_production_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_production_component.js.es6 index 051271bc053..a6b6d817a82 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_production_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_production_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StageProductionComponent = Vue.extend({ @@ -40,7 +40,6 @@ </li> </ul> </div> - ` + `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_review_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_review_component.js.es6 index 78ff0bf069a..9e819c1d420 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_review_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_review_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StageReviewComponent = Vue.extend({ @@ -52,5 +52,4 @@ </div> `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_staging_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_staging_component.js.es6 index af0318ffc19..92e1f4cadfa 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_staging_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_staging_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StageStagingComponent = Vue.extend({ @@ -43,5 +43,4 @@ </div> `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/stage_test_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/stage_test_component.js.es6 index 4cbdfbeb5b7..c6237bdcd5e 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_test_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/stage_test_component.js.es6 @@ -1,5 +1,5 @@ +/* eslint-disable no-param-reassign */ ((global) => { - global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics.StageTestComponent = Vue.extend({ @@ -50,5 +50,4 @@ </div> `, }); - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/components/total_time_component.js.es6 b/app/assets/javascripts/cycle_analytics/components/total_time_component.js.es6 index 829ad4604ce..8403fbeaab5 100644 --- a/app/assets/javascripts/cycle_analytics/components/total_time_component.js.es6 +++ b/app/assets/javascripts/cycle_analytics/components/total_time_component.js.es6 @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ ((global) => { global.cycleAnalytics = global.cycleAnalytics || {}; @@ -10,7 +11,7 @@ <template v-if="time.days">{{ time.days }} <span>{{ time.days === 1 ? 'day' : 'days' }}</span></template> <template v-if="time.hours">{{ time.hours }} <span>hr</span></template> <template v-if="time.mins && !time.days">{{ time.mins }} <span>mins</span></template> - <template v-if="time.seconds && Object.keys(time).length === 1 || time.seconds === 0">{{ time.seconds }} <span>s</span></template> + <template v-if="time.seconds && Object.keys(time).length === 1 || time.seconds === 0">{{ time.seconds }} <span>s</span></template> </span> `, }); diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js.es6 b/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js.es6 index 06299bc8988..9f74b14c4b9 100644 --- a/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js.es6 +++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_service.js.es6 @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ ((global) => { global.cycleAnalytics = global.cycleAnalytics || {}; @@ -16,26 +17,25 @@ contentType: 'application/json', data: { cycle_analytics: { - start_date: options.startDate - } - } + start_date: options.startDate, + }, + }, }); } fetchStageData(options) { - let { + const { stage, startDate, } = options; return $.get(`${this.requestPath}/events/${stage.title.toLowerCase()}.json`, { cycle_analytics: { - start_date: options.startDate - } + start_date: startDate, + }, }); } - }; + } global.cycleAnalytics.CycleAnalyticsService = CycleAnalyticsService; - })(window.gl || (window.gl = {})); diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6 b/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6 index a6005306130..64c24f71b87 100644 --- a/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6 +++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6 @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ ((global) => { global.cycleAnalytics = global.cycleAnalytics || {}; @@ -7,13 +8,13 @@ stats: '', analytics: '', events: [], - stages:[], + stages: [], }, setCycleAnalyticsData(data) { this.state = Object.assign(this.state, this.decorateData(data)); }, decorateData(data) { - let newData = {}; + const newData = {}; newData.stages = data.stats || []; newData.summary = data.summary || []; @@ -38,7 +39,7 @@ this.state.hasError = state; }, deactivateAllStages() { - this.state.stages.forEach(stage => { + this.state.stages.forEach((stage) => { stage.active = false; }); }, @@ -50,7 +51,7 @@ this.state.events = this.decorateEvents(events); }, decorateEvents(events) { - let newEvents = events; + const newEvents = events; newEvents.forEach((item) => { item.totalTime = item.total_time; @@ -75,5 +76,4 @@ return this.state.stages.find(stage => stage.active); }, }; - })(window.gl || (window.gl = {})); |