Commit 1a7cc190 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Make linters happy

parent 283134a7
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"Turbolinks": false, "Turbolinks": false,
"window": false, "window": false,
"Vue": false, "Vue": false,
"Flash": false "Flash": false,
"Cookies": false
} }
} }
((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 = {})));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageCodeComponent = Vue.extend({ global.cycleAnalytics.StageCodeComponent = Vue.extend({
...@@ -40,5 +40,4 @@ ...@@ -40,5 +40,4 @@
</div> </div>
`, `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageIssueComponent = Vue.extend({ global.cycleAnalytics.StageIssueComponent = Vue.extend({
...@@ -42,5 +42,4 @@ ...@@ -42,5 +42,4 @@
</div> </div>
`, `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StagePlanComponent = Vue.extend({ global.cycleAnalytics.StagePlanComponent = Vue.extend({
...@@ -43,5 +43,4 @@ ...@@ -43,5 +43,4 @@
</div> </div>
`, `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageProductionComponent = Vue.extend({ global.cycleAnalytics.StageProductionComponent = Vue.extend({
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
</li> </li>
</ul> </ul>
</div> </div>
` `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageReviewComponent = Vue.extend({ global.cycleAnalytics.StageReviewComponent = Vue.extend({
...@@ -52,5 +52,4 @@ ...@@ -52,5 +52,4 @@
</div> </div>
`, `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageStagingComponent = Vue.extend({ global.cycleAnalytics.StageStagingComponent = Vue.extend({
...@@ -43,5 +43,4 @@ ...@@ -43,5 +43,4 @@
</div> </div>
`, `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
global.cycleAnalytics.StageTestComponent = Vue.extend({ global.cycleAnalytics.StageTestComponent = Vue.extend({
...@@ -50,5 +50,4 @@ ...@@ -50,5 +50,4 @@
</div> </div>
`, `,
}); });
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
<template v-if="time.days">{{ time.days }} <span>{{ time.days === 1 ? 'day' : 'days' }}</span></template> <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.hours">{{ time.hours }} <span>hr</span></template>
<template v-if="time.mins && !time.days">{{ time.mins }} <span>mins</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> </span>
`, `,
}); });
......
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
...@@ -16,26 +17,25 @@ ...@@ -16,26 +17,25 @@
contentType: 'application/json', contentType: 'application/json',
data: { data: {
cycle_analytics: { cycle_analytics: {
start_date: options.startDate start_date: options.startDate,
} },
} },
}); });
} }
fetchStageData(options) { fetchStageData(options) {
let { const {
stage, stage,
startDate, startDate,
} = options; } = options;
return $.get(`${this.requestPath}/events/${stage.title.toLowerCase()}.json`, { return $.get(`${this.requestPath}/events/${stage.title.toLowerCase()}.json`, {
cycle_analytics: { cycle_analytics: {
start_date: options.startDate start_date: startDate,
} },
}); });
} }
}; }
global.cycleAnalytics.CycleAnalyticsService = CycleAnalyticsService; global.cycleAnalytics.CycleAnalyticsService = CycleAnalyticsService;
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
/* eslint-disable no-param-reassign */
((global) => { ((global) => {
global.cycleAnalytics = global.cycleAnalytics || {}; global.cycleAnalytics = global.cycleAnalytics || {};
...@@ -7,13 +8,13 @@ ...@@ -7,13 +8,13 @@
stats: '', stats: '',
analytics: '', analytics: '',
events: [], events: [],
stages:[], stages: [],
}, },
setCycleAnalyticsData(data) { setCycleAnalyticsData(data) {
this.state = Object.assign(this.state, this.decorateData(data)); this.state = Object.assign(this.state, this.decorateData(data));
}, },
decorateData(data) { decorateData(data) {
let newData = {}; const newData = {};
newData.stages = data.stats || []; newData.stages = data.stats || [];
newData.summary = data.summary || []; newData.summary = data.summary || [];
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
this.state.hasError = state; this.state.hasError = state;
}, },
deactivateAllStages() { deactivateAllStages() {
this.state.stages.forEach(stage => { this.state.stages.forEach((stage) => {
stage.active = false; stage.active = false;
}); });
}, },
...@@ -50,7 +51,7 @@ ...@@ -50,7 +51,7 @@
this.state.events = this.decorateEvents(events); this.state.events = this.decorateEvents(events);
}, },
decorateEvents(events) { decorateEvents(events) {
let newEvents = events; const newEvents = events;
newEvents.forEach((item) => { newEvents.forEach((item) => {
item.totalTime = item.total_time; item.totalTime = item.total_time;
...@@ -75,5 +76,4 @@ ...@@ -75,5 +76,4 @@
return this.state.stages.find(stage => stage.active); return this.state.stages.find(stage => stage.active);
}, },
}; };
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
border-right-color: transparent; border-right-color: transparent;
border-top-color: $border-color; border-top-color: $border-color;
border-bottom-color: $border-color; border-bottom-color: $border-color;
box-shadow: inset 2px 0px 0px 0px $active-item-blue; box-shadow: inset 2px 0 0 0 $active-item-blue;
.stage-name { .stage-name {
font-weight: 600; font-weight: 600;
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
.stage-event-item { .stage-event-item {
list-style-type: none; list-style-type: none;
padding: 0 0 $gl-padding; padding: 0 0 $gl-padding;
margin: 0 $gl-padding $gl-padding $gl-padding; margin: 0 $gl-padding $gl-padding;
border-bottom: solid 1px $gray-darker; border-bottom: solid 1px $gray-darker;
@include clearfix; @include clearfix;
...@@ -288,7 +288,8 @@ ...@@ -288,7 +288,8 @@
margin-bottom: 0; margin-bottom: 0;
} }
.item-details, .item-time { .item-details,
.item-time {
float: left; float: left;
} }
...@@ -297,9 +298,11 @@ ...@@ -297,9 +298,11 @@
} }
.item-title { .item-title {
margin: 0 0 2px 0; margin: 0 0 2px;
&.issue-title, &.commit-title, &.merge-merquest-title { &.issue-title,
&.commit-title,
&.merge-merquest-title {
max-width: 100%; max-width: 100%;
display: block; display: block;
@include text-overflow(); @include text-overflow();
...@@ -325,10 +328,11 @@ ...@@ -325,10 +328,11 @@
} }
} }
.issue-date, .build-date { .issue-date,
.build-date {
color: $gl-text-color; color: $gl-text-color;
} }
.issue-link, .issue-link,
.commit-author-link, .commit-author-link,
.issue-author-link { .issue-author-link {
...@@ -346,7 +350,7 @@ ...@@ -346,7 +350,7 @@
svg { svg {
float: left; float: left;
} }
} }
} }
.merge-request-branch { .merge-request-branch {
...@@ -360,7 +364,7 @@ ...@@ -360,7 +364,7 @@
} }
} }
} }
// Custom Styles for stage items // Custom Styles for stage items
.item-build-component { .item-build-component {
...@@ -391,7 +395,7 @@ ...@@ -391,7 +395,7 @@
line-height: 1.3; line-height: 1.3;
vertical-align: top; vertical-align: top;
} }
.short-sha { .short-sha {
color: $gl-link-color; color: $gl-link-color;
line-height: 1.3; line-height: 1.3;
...@@ -433,13 +437,11 @@ ...@@ -433,13 +437,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
.overview-text {
}
.overview-image { .overview-image {
text-align: right; text-align: right;
} }
.overview-icon { .overview-icon {
svg { svg {
width: 365px; width: 365px;
......
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