summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/cycle_analytics/components
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/cycle_analytics/components')
-rw-r--r--app/assets/javascripts/cycle_analytics/components/banner.vue18
-rw-r--r--app/assets/javascripts/cycle_analytics/components/limit_warning_component.vue21
-rw-r--r--app/assets/javascripts/cycle_analytics/components/stage_code_component.vue42
-rw-r--r--app/assets/javascripts/cycle_analytics/components/stage_component.vue39
-rw-r--r--app/assets/javascripts/cycle_analytics/components/stage_plan_component.vue35
-rw-r--r--app/assets/javascripts/cycle_analytics/components/stage_review_component.vue53
-rw-r--r--app/assets/javascripts/cycle_analytics/components/stage_staging_component.vue62
-rw-r--r--app/assets/javascripts/cycle_analytics/components/stage_test_component.vue66
-rw-r--r--app/assets/javascripts/cycle_analytics/components/total_time_component.vue30
9 files changed, 277 insertions, 89 deletions
diff --git a/app/assets/javascripts/cycle_analytics/components/banner.vue b/app/assets/javascripts/cycle_analytics/components/banner.vue
index 732697c134e..3204b8dd8e7 100644
--- a/app/assets/javascripts/cycle_analytics/components/banner.vue
+++ b/app/assets/javascripts/cycle_analytics/components/banner.vue
@@ -26,28 +26,34 @@
class="js-ca-dismiss-button dismiss-button"
type="button"
:aria-label="__('Dismiss Cycle Analytics introduction box')"
- @click="dismissOverviewDialog">
+ @click="dismissOverviewDialog"
+ >
<i
class="fa fa-times"
aria-hidden="true">
</i>
</button>
- <div class="svg-container" v-html="iconCycleAnalyticsSplash">
+ <div
+ class="svg-container"
+ v-html="iconCycleAnalyticsSplash"
+ >
</div>
<div class="inner-content">
<h4>
- {{__('Introducing Cycle Analytics')}}
+ {{ __('Introducing Cycle Analytics') }}
</h4>
<p>
- {{ __('Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.') }}
+ {{ __(`Cycle Analytics gives an overview
+of how much time it takes to go from idea to production in your project.`) }}
</p>
<p>
<a
:href="documentationLink"
target="_blank"
rel="nofollow"
- class="btn">
- {{__('Read more')}}
+ class="btn"
+ >
+ {{ __('Read more') }}
</a>
</p>
</div>
diff --git a/app/assets/javascripts/cycle_analytics/components/limit_warning_component.vue b/app/assets/javascripts/cycle_analytics/components/limit_warning_component.vue
index 6e94ba929b2..32ae0cc1476 100644
--- a/app/assets/javascripts/cycle_analytics/components/limit_warning_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/limit_warning_component.vue
@@ -2,25 +2,34 @@
import tooltip from '../../vue_shared/directives/tooltip';
export default {
+ directives: {
+ tooltip,
+ },
props: {
count: {
type: Number,
required: true,
},
},
- directives: {
- tooltip,
- },
};
</script>
<template>
- <span v-if="count === 50" class="events-info pull-right">
+ <span
+ v-if="count === 50"
+ class="events-info pull-right"
+ >
<i
class="fa fa-warning"
v-tooltip
aria-hidden="true"
- :title="n__('Limited to showing %d event at most', 'Limited to showing %d events at most', 50)"
- data-placement="top"></i>
+ :title="n__(
+ 'Limited to showing %d event at most',
+ 'Limited to showing %d events at most',
+ 50
+ )"
+ data-placement="top"
+ >
+ </i>
{{ n__('Showing %d event', 'Showing %d events', 50) }}
</span>
</template>
diff --git a/app/assets/javascripts/cycle_analytics/components/stage_code_component.vue b/app/assets/javascripts/cycle_analytics/components/stage_code_component.vue
index 45930145b0a..a71dcf78103 100644
--- a/app/assets/javascripts/cycle_analytics/components/stage_code_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/stage_code_component.vue
@@ -4,15 +4,21 @@
import totalTime from './total_time_component.vue';
export default {
- props: {
- items: Array,
- stage: Object,
- },
components: {
userAvatarImage,
limitWarning,
totalTime,
},
+ props: {
+ items: {
+ type: Array,
+ default: () => [],
+ },
+ stage: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
};
</script>
<template>
@@ -22,28 +28,44 @@
<limit-warning :count="items.length" />
</div>
<ul class="stage-event-list">
- <li v-for="mergeRequest in items" class="stage-event-item">
+ <li
+ v-for="(mergeRequest, i) in items"
+ :key="i"
+ class="stage-event-item"
+ >
<div class="item-details">
<!-- FIXME: Pass an alt attribute here for accessibility -->
- <user-avatar-image :img-src="mergeRequest.author.avatarUrl"/>
+ <user-avatar-image :img-src="mergeRequest.author.avatarUrl" />
<h5 class="item-title merge-merquest-title">
<a :href="mergeRequest.url">
{{ mergeRequest.title }}
</a>
</h5>
- <a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a>
+ <a
+ :href="mergeRequest.url"
+ class="issue-link">
+ !{{ mergeRequest.iid }}
+ </a>
&middot;
<span>
{{ s__('OpenedNDaysAgo|Opened') }}
- <a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a>
+ <a
+ :href="mergeRequest.url"
+ class="issue-date">
+ {{ mergeRequest.createdAt }}
+ </a>
</span>
<span>
{{ s__('ByAuthor|by') }}
- <a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a>
+ <a
+ :href="mergeRequest.author.webUrl"
+ class="issue-author-link">
+ {{ mergeRequest.author.name }}
+ </a>
</span>
</div>
<div class="item-time">
- <total-time :time="mergeRequest.totalTime"></total-time>
+ <total-time :time="mergeRequest.totalTime" />
</div>
</li>
</ul>
diff --git a/app/assets/javascripts/cycle_analytics/components/stage_component.vue b/app/assets/javascripts/cycle_analytics/components/stage_component.vue
index 8c98bd249a1..907638d798a 100644
--- a/app/assets/javascripts/cycle_analytics/components/stage_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/stage_component.vue
@@ -4,15 +4,21 @@
import totalTime from './total_time_component.vue';
export default {
- props: {
- items: Array,
- stage: Object,
- },
components: {
userAvatarImage,
limitWarning,
totalTime,
},
+ props: {
+ items: {
+ type: Array,
+ default: () => [],
+ },
+ stage: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
};
</script>
<template>
@@ -25,30 +31,43 @@
<li
v-for="(issue, i) in items"
:key="i"
- class="stage-event-item">
+ class="stage-event-item"
+ >
<div class="item-details">
<!-- FIXME: Pass an alt attribute here for accessibility -->
<user-avatar-image :img-src="issue.author.avatarUrl"/>
<h5 class="item-title issue-title">
- <a class="issue-title" :href="issue.url">
+ <a
+ class="issue-title"
+ :href="issue.url"
+ >
{{ issue.title }}
</a>
</h5>
- <a :href="issue.url" class="issue-link">#{{ issue.iid }}</a>
+ <a
+ :href="issue.url"
+ class="issue-link"
+ >#{{ issue.iid }}</a>
&middot;
<span>
{{ s__('OpenedNDaysAgo|Opened') }}
- <a :href="issue.url" class="issue-date">{{ issue.createdAt }}</a>
+ <a
+ :href="issue.url"
+ class="issue-date"
+ >{{ issue.createdAt }}</a>
</span>
<span>
{{ s__('ByAuthor|by') }}
- <a :href="issue.author.webUrl" class="issue-author-link">
+ <a
+ :href="issue.author.webUrl"
+ class="issue-author-link"
+ >
{{ issue.author.name }}
</a>
</span>
</div>
<div class="item-time">
- <total-time :time="issue.totalTime"/>
+ <total-time :time="issue.totalTime" />
</div>
</li>
</ul>
diff --git a/app/assets/javascripts/cycle_analytics/components/stage_plan_component.vue b/app/assets/javascripts/cycle_analytics/components/stage_plan_component.vue
index 75d2f1fd70c..cee294b4ac2 100644
--- a/app/assets/javascripts/cycle_analytics/components/stage_plan_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/stage_plan_component.vue
@@ -5,15 +5,21 @@
import totalTime from './total_time_component.vue';
export default {
- props: {
- items: Array,
- stage: Object,
- },
components: {
userAvatarImage,
totalTime,
limitWarning,
},
+ props: {
+ items: {
+ type: Array,
+ default: () => [],
+ },
+ stage: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
computed: {
iconCommit() {
return iconCommit;
@@ -31,10 +37,11 @@
<li
v-for="(commit, i) in items"
:key="i"
- class="stage-event-item">
+ class="stage-event-item"
+ >
<div class="item-details item-conmmit-component">
<!-- FIXME: Pass an alt attribute here for accessibility -->
- <user-avatar-image :img-src="commit.author.avatarUrl"/>
+ <user-avatar-image :img-src="commit.author.avatarUrl" />
<h5 class="item-title commit-title">
<a :href="commit.commitUrl">
{{ commit.title }}
@@ -42,10 +49,20 @@
</h5>
<span>
{{ s__('FirstPushedBy|First') }}
- <span class="commit-icon" v-html="iconCommit"></span>
- <a :href="commit.commitUrl" class="commit-hash-link commit-sha">{{ commit.shortSha }}</a>
+ <span
+ class="commit-icon"
+ v-html="iconCommit"
+ >
+ </span>
+ <a
+ :href="commit.commitUrl"
+ class="commit-hash-link commit-sha"
+ >{{ commit.shortSha }}</a>
{{ s__('FirstPushedBy|pushed by') }}
- <a :href="commit.author.webUrl" class="commit-author-link">
+ <a
+ :href="commit.author.webUrl"
+ class="commit-author-link"
+ >
{{ commit.author.name }}
</a>
</span>
diff --git a/app/assets/javascripts/cycle_analytics/components/stage_review_component.vue b/app/assets/javascripts/cycle_analytics/components/stage_review_component.vue
index cbce9205e75..39b699a6395 100644
--- a/app/assets/javascripts/cycle_analytics/components/stage_review_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/stage_review_component.vue
@@ -5,16 +5,22 @@
import icon from '../../vue_shared/components/icon.vue';
export default {
- props: {
- items: Array,
- stage: Object,
- },
components: {
userAvatarImage,
totalTime,
limitWarning,
icon,
},
+ props: {
+ items: {
+ type: Array,
+ default: () => [],
+ },
+ stage: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
};
</script>
<template>
@@ -27,7 +33,8 @@
<li
v-for="(mergeRequest, i) in items"
:key="i"
- class="stage-event-item">
+ class="stage-event-item"
+ >
<div class="item-details">
<!-- FIXME: Pass an alt attribute here for accessibility -->
<user-avatar-image :img-src="mergeRequest.author.avatarUrl"/>
@@ -36,34 +43,52 @@
{{ mergeRequest.title }}
</a>
</h5>
- <a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a>
+ <a
+ :href="mergeRequest.url"
+ class="issue-link"
+ >!{{ mergeRequest.iid }}</a>
&middot;
<span>
{{ s__('OpenedNDaysAgo|Opened') }}
- <a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a>
+ <a
+ :href="mergeRequest.url"
+ class="issue-date"
+ >{{ mergeRequest.createdAt }}</a>
</span>
<span>
{{ s__('ByAuthor|by') }}
- <a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a>
+ <a
+ :href="mergeRequest.author.webUrl"
+ class="issue-author-link"
+ >{{ mergeRequest.author.name }}</a>
</span>
<template v-if="mergeRequest.state === 'closed'">
<span class="merge-request-state">
- <i class="fa fa-ban"></i>
+ <i
+ class="fa fa-ban"
+ aria-hidden="true"
+ >
+ </i>
{{ mergeRequest.state.toUpperCase() }}
</span>
</template>
<template v-else>
- <span class="merge-request-branch" v-if="mergeRequest.branch">
+ <span
+ class="merge-request-branch"
+ v-if="mergeRequest.branch"
+ >
<icon
name="fork"
- :size="16">
- </icon>
- <a :href="mergeRequest.branch.url">{{ mergeRequest.branch.name }}</a>
+ :size="16"
+ />
+ <a :href="mergeRequest.branch.url">
+ {{ mergeRequest.branch.name }}
+ </a>
</span>
</template>
</div>
<div class="item-time">
- <total-time :time="mergeRequest.totalTime"/>
+ <total-time :time="mergeRequest.totalTime" />
</div>
</li>
</ul>
diff --git a/app/assets/javascripts/cycle_analytics/components/stage_staging_component.vue b/app/assets/javascripts/cycle_analytics/components/stage_staging_component.vue
index 508a411e599..92f2a95a66a 100644
--- a/app/assets/javascripts/cycle_analytics/components/stage_staging_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/stage_staging_component.vue
@@ -6,16 +6,22 @@
import icon from '../../vue_shared/components/icon.vue';
export default {
- props: {
- items: Array,
- stage: Object,
- },
components: {
userAvatarImage,
totalTime,
limitWarning,
icon,
},
+ props: {
+ items: {
+ type: Array,
+ default: () => [],
+ },
+ stage: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
computed: {
iconBranch() {
return iconBranch;
@@ -33,30 +39,58 @@
<li
v-for="(build, i) in items"
class="stage-event-item item-build-component"
- :key="i">
+ :key="i"
+ >
<div class="item-details">
<!-- FIXME: Pass an alt attribute here for accessibility -->
<user-avatar-image :img-src="build.author.avatarUrl"/>
<h5 class="item-title">
- <a :href="build.url" class="pipeline-id">#{{ build.id }}</a>
+ <a
+ :href="build.url"
+ class="pipeline-id"
+ >
+ #{{ build.id }}
+ </a>
<icon
name="fork"
- :size="16">
- </icon>
- <a :href="build.branch.url" class="ref-name">{{ build.branch.name }}</a>
- <span class="icon-branch" v-html="iconBranch"></span>
- <a :href="build.commitUrl" class="commit-sha">{{ build.shortSha }}</a>
+ :size="16"
+ />
+ <a
+ :href="build.branch.url"
+ class="ref-name"
+ >
+ {{ build.branch.name }}
+ </a>
+ <span
+ class="icon-branch"
+ v-html="iconBranch"
+ >
+ </span>
+ <a
+ :href="build.commitUrl"
+ class="commit-sha"
+ >
+ {{ build.shortSha }}
+ </a>
</h5>
<span>
- <a :href="build.url" class="build-date">{{ build.date }}</a>
+ <a
+ :href="build.url"
+ class="build-date"
+ >
+ {{ build.date }}
+ </a>
{{ s__('ByAuthor|by') }}
- <a :href="build.author.webUrl" class="issue-author-link">
+ <a
+ :href="build.author.webUrl"
+ class="issue-author-link"
+ >
{{ build.author.name }}
</a>
</span>
</div>
<div class="item-time">
- <total-time :time="build.totalTime"/>
+ <total-time :time="build.totalTime" />
</div>
</li>
</ul>
diff --git a/app/assets/javascripts/cycle_analytics/components/stage_test_component.vue b/app/assets/javascripts/cycle_analytics/components/stage_test_component.vue
index 88fa6b073ca..b84bb6ed792 100644
--- a/app/assets/javascripts/cycle_analytics/components/stage_test_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/stage_test_component.vue
@@ -6,15 +6,21 @@
import icon from '../../vue_shared/components/icon.vue';
export default {
- props: {
- items: Array,
- stage: Object,
- },
components: {
totalTime,
limitWarning,
icon,
},
+ props: {
+ items: {
+ type: Array,
+ default: () => [],
+ },
+ stage: {
+ type: Object,
+ default: () => ({}),
+ },
+ },
computed: {
iconBuildStatus() {
return iconBuildStatus;
@@ -35,29 +41,59 @@
<li
v-for="(build, i) in items"
:key="i"
- class="stage-event-item item-build-component">
+ class="stage-event-item item-build-component"
+ >
<div class="item-details">
<h5 class="item-title">
- <span class="icon-build-status" v-html="iconBuildStatus"></span>
- <a :href="build.url" class="item-build-name">{{ build.name }}</a>
+ <span
+ class="icon-build-status"
+ v-html="iconBuildStatus"
+ >
+ </span>
+ <a
+ :href="build.url"
+ class="item-build-name"
+ >
+ {{ build.name }}
+ </a>
&middot;
- <a :href="build.url" class="pipeline-id">#{{ build.id }}</a>
+ <a
+ :href="build.url"
+ class="pipeline-id"
+ >
+ #{{ build.id }}
+ </a>
<icon
name="fork"
- :size="16">
- </icon>
- <a :href="build.branch.url" class="ref-name">{{ build.branch.name }}</a>
- <span class="icon-branch" v-html="iconBranch"></span>
- <a :href="build.commitUrl" class="commit-sha">{{ build.shortSha }}</a>
+ :size="16"
+ />
+ <a
+ :href="build.branch.url"
+ class="ref-name"
+ >
+ {{ build.branch.name }}
+ </a>
+ <span
+ class="icon-branch"
+ v-html="iconBranch"
+ >
+ </span>
+ <a
+ :href="build.commitUrl"
+ class="commit-sha">
+ {{ build.shortSha }}
+ </a>
</h5>
<span>
- <a :href="build.url" class="issue-date">
+ <a
+ :href="build.url"
+ class="issue-date">
{{ build.date }}
</a>
</span>
</div>
<div class="item-time">
- <total-time :time="build.totalTime"/>
+ <total-time :time="build.totalTime" />
</div>
</li>
</ul>
diff --git a/app/assets/javascripts/cycle_analytics/components/total_time_component.vue b/app/assets/javascripts/cycle_analytics/components/total_time_component.vue
index 62efd4f9c28..7758bf0cb3f 100644
--- a/app/assets/javascripts/cycle_analytics/components/total_time_component.vue
+++ b/app/assets/javascripts/cycle_analytics/components/total_time_component.vue
@@ -17,13 +17,33 @@
<template>
<span class="total-time">
<template v-if="hasData">
- <template v-if="time.days">{{ time.days }} <span>{{ n__('day', 'days', time.days) }}</span></template>
- <template v-if="time.hours">{{ time.hours }} <span>{{ n__('Time|hr', 'Time|hrs', time.hours) }}</span></template>
- <template v-if="time.mins && !time.days">{{ time.mins }} <span>{{ n__('Time|min', 'Time|mins', time.mins) }}</span></template>
- <template v-if="time.seconds && hasData === 1 || time.seconds === 0">{{ time.seconds }} <span>{{ s__('Time|s') }}</span></template>
+ <template v-if="time.days">
+ {{ time.days }}
+ <span>
+ {{ n__('day', 'days', time.days) }}
+ </span>
+ </template>
+ <template v-if="time.hours">
+ {{ time.hours }}
+ <span>
+ {{ n__('Time|hr', 'Time|hrs', time.hours) }}
+ </span>
+ </template>
+ <template v-if="time.mins && !time.days">
+ {{ time.mins }}
+ <span>
+ {{ n__('Time|min', 'Time|mins', time.mins) }}
+ </span>
+ </template>
+ <template v-if="time.seconds && hasData === 1 || time.seconds === 0">
+ {{ time.seconds }}
+ <span>
+ {{ s__('Time|s') }}
+ </span>
+ </template>
</template>
<template v-else>
--
</template>
- </span>
+ </span>
</template>