summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-02-10 22:10:50 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-02-10 22:10:50 +0000
commit3a30767121e25f11fd40716e8e93a6307a9ac44b (patch)
treee50ab17d61edfff9d6be284d2ba0ee2f8ce06bf1 /app
parent86558d53ddcf008fff396d25c38c9462fb77f615 (diff)
parent58131ac93c2a7c784c8c4f9025ef250eac4e1fa1 (diff)
downloadgitlab-ce-3a30767121e25f11fd40716e8e93a6307a9ac44b.tar.gz
Merge branch 'master' into 27932-merge-request-pipelines-displays-json27932-merge-request-pipelines-displays-json
* master: Revert "Merge branch 'add-additional-checks-to-ca-data' into 'master' " Fix broken test to use trigger in order to not take tooltip overlaping in consideration Fix job to pipeline renaming Replace teaspoon references with Karma Add changelog Only show MR widget graph if there are stages Fix tooltip scss for anchors. Adds css for button's tooltips to have similar behavior. Removes padding from mini graph table cell to guarantee stages don't break line on hover moved hyperlink reference section at the end of the content adds changelog fixes frontend doc broken link
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es64
-rw-r--r--app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es647
-rw-r--r--app/assets/javascripts/cycle_analytics/default_event_objects.js.es698
-rw-r--r--app/assets/javascripts/lib/utils/text_utility.js10
-rw-r--r--app/assets/javascripts/wikis.js.es66
-rw-r--r--app/assets/stylesheets/pages/pipelines.scss14
-rw-r--r--app/serializers/analytics_stage_entity.rb1
-rw-r--r--app/views/projects/ci/pipelines/_pipeline.html.haml4
-rw-r--r--app/views/projects/cycle_analytics/show.html.haml2
-rw-r--r--app/views/projects/merge_requests/widget/_heading.html.haml5
-rw-r--r--app/views/projects/merge_requests/widget/_show.html.haml4
-rw-r--r--app/views/projects/merge_requests/widget/open/_build_failed.html.haml2
-rw-r--r--app/views/projects/triggers/_index.html.haml4
13 files changed, 49 insertions, 152 deletions
diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6 b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6
index f161eb23795..c41c57c1dcd 100644
--- a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6
+++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6
@@ -97,7 +97,7 @@ $(() => {
}
this.isLoadingStage = true;
- cycleAnalyticsStore.setStageEvents([], stage);
+ cycleAnalyticsStore.setStageEvents([]);
cycleAnalyticsStore.setActiveStage(stage);
cycleAnalyticsService
@@ -107,7 +107,7 @@ $(() => {
})
.done((response) => {
this.isEmptyStage = !response.events.length;
- cycleAnalyticsStore.setStageEvents(response.events, stage);
+ cycleAnalyticsStore.setStageEvents(response.events);
})
.error(() => {
this.isEmptyStage = true;
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 3efeb141008..be732971c7f 100644
--- a/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6
+++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6
@@ -1,8 +1,4 @@
/* eslint-disable no-param-reassign */
-
-require('../lib/utils/text_utility');
-const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
-
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
@@ -38,12 +34,11 @@ const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
});
newData.stages.forEach((item) => {
- const stageSlug = gl.text.dasherize(item.title.toLowerCase());
+ const stageName = item.title.toLowerCase();
item.active = false;
- item.isUserAllowed = data.permissions[stageSlug];
- item.emptyStageText = EMPTY_STAGE_TEXTS[stageSlug];
- item.component = `stage-${stageSlug}-component`;
- item.slug = stageSlug;
+ item.isUserAllowed = data.permissions[stageName];
+ item.emptyStageText = EMPTY_STAGE_TEXTS[stageName];
+ item.component = `stage-${stageName}-component`;
});
newData.analytics = data;
return newData;
@@ -63,33 +58,31 @@ const DEFAULT_EVENT_OBJECTS = require('./default_event_objects');
this.deactivateAllStages();
stage.active = true;
},
- setStageEvents(events, stage) {
- this.state.events = this.decorateEvents(events, stage);
+ setStageEvents(events) {
+ this.state.events = this.decorateEvents(events);
},
- decorateEvents(events, stage) {
+ decorateEvents(events) {
const newEvents = [];
events.forEach((item) => {
if (!item) return;
- const eventItem = Object.assign({}, DEFAULT_EVENT_OBJECTS[stage.slug], item);
-
- eventItem.totalTime = eventItem.total_time;
- eventItem.author.webUrl = eventItem.author.web_url;
- eventItem.author.avatarUrl = eventItem.author.avatar_url;
+ item.totalTime = item.total_time;
+ item.author.webUrl = item.author.web_url;
+ item.author.avatarUrl = item.author.avatar_url;
- if (eventItem.created_at) eventItem.createdAt = eventItem.created_at;
- if (eventItem.short_sha) eventItem.shortSha = eventItem.short_sha;
- if (eventItem.commit_url) eventItem.commitUrl = eventItem.commit_url;
+ if (item.created_at) item.createdAt = item.created_at;
+ if (item.short_sha) item.shortSha = item.short_sha;
+ if (item.commit_url) item.commitUrl = item.commit_url;
- delete eventItem.author.web_url;
- delete eventItem.author.avatar_url;
- delete eventItem.total_time;
- delete eventItem.created_at;
- delete eventItem.short_sha;
- delete eventItem.commit_url;
+ delete item.author.web_url;
+ delete item.author.avatar_url;
+ delete item.total_time;
+ delete item.created_at;
+ delete item.short_sha;
+ delete item.commit_url;
- newEvents.push(eventItem);
+ newEvents.push(item);
});
return newEvents;
diff --git a/app/assets/javascripts/cycle_analytics/default_event_objects.js.es6 b/app/assets/javascripts/cycle_analytics/default_event_objects.js.es6
deleted file mode 100644
index cfaf9835bf8..00000000000
--- a/app/assets/javascripts/cycle_analytics/default_event_objects.js.es6
+++ /dev/null
@@ -1,98 +0,0 @@
-module.exports = {
- issue: {
- created_at: '',
- url: '',
- iid: '',
- title: '',
- total_time: {},
- author: {
- avatar_url: '',
- id: '',
- name: '',
- web_url: '',
- },
- },
- plan: {
- title: '',
- commit_url: '',
- short_sha: '',
- total_time: {},
- author: {
- name: '',
- id: '',
- avatar_url: '',
- web_url: '',
- },
- },
- code: {
- title: '',
- iid: '',
- created_at: '',
- url: '',
- total_time: {},
- author: {
- name: '',
- id: '',
- avatar_url: '',
- web_url: '',
- },
- },
- test: {
- name: '',
- id: '',
- date: '',
- url: '',
- short_sha: '',
- commit_url: '',
- total_time: {},
- branch: {
- name: '',
- url: '',
- },
- },
- review: {
- title: '',
- iid: '',
- created_at: '',
- url: '',
- state: '',
- total_time: {},
- author: {
- name: '',
- id: '',
- avatar_url: '',
- web_url: '',
- },
- },
- staging: {
- id: '',
- short_sha: '',
- date: '',
- url: '',
- commit_url: '',
- total_time: {},
- author: {
- name: '',
- id: '',
- avatar_url: '',
- web_url: '',
- },
- branch: {
- name: '',
- url: '',
- },
- },
- production: {
- title: '',
- created_at: '',
- url: '',
- iid: '',
- total_time: {},
- author: {
- name: '',
- id: '',
- avatar_url: '',
- web_url: '',
- },
- },
-};
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js
index 326b7cb7f57..d9370db0cf2 100644
--- a/app/assets/javascripts/lib/utils/text_utility.js
+++ b/app/assets/javascripts/lib/utils/text_utility.js
@@ -1,7 +1,5 @@
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, max-len */
-require('vendor/latinise');
-
(function() {
(function(w) {
var base;
@@ -166,14 +164,8 @@ require('vendor/latinise');
gl.text.pluralize = function(str, count) {
return str + (count > 1 || count === 0 ? 's' : '');
};
- gl.text.truncate = function(string, maxLength) {
+ return gl.text.truncate = function(string, maxLength) {
return string.substr(0, (maxLength - 3)) + '...';
};
- gl.text.dasherize = function(str) {
- return str.replace(/[_\s]+/g, '-');
- };
- gl.text.slugify = function(str) {
- return str.trim().toLowerCase().latinise();
- };
})(window);
}).call(this);
diff --git a/app/assets/javascripts/wikis.js.es6 b/app/assets/javascripts/wikis.js.es6
index 75fd1394a03..ef99b2e92f0 100644
--- a/app/assets/javascripts/wikis.js.es6
+++ b/app/assets/javascripts/wikis.js.es6
@@ -1,10 +1,14 @@
/* eslint-disable no-param-reassign */
/* global Breakpoints */
+require('vendor/latinise');
require('./breakpoints');
require('vendor/jquery.nicescroll');
((global) => {
+ const dasherize = str => str.replace(/[_\s]+/g, '-');
+ const slugify = str => dasherize(str.trim().toLowerCase().latinise());
+
class Wikis {
constructor() {
this.bp = Breakpoints.get();
@@ -30,7 +34,7 @@ require('vendor/jquery.nicescroll');
if (!this.newWikiForm) return;
const slugInput = this.newWikiForm.querySelector('#new_wiki_path');
- const slug = gl.text.slugify(slugInput.value);
+ const slug = slugify(slugInput.value);
if (slug.length > 0) {
const wikisPath = slugInput.getAttribute('data-wikis-path');
diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss
index 974100bdff0..0c7019dc64f 100644
--- a/app/assets/stylesheets/pages/pipelines.scss
+++ b/app/assets/stylesheets/pages/pipelines.scss
@@ -94,6 +94,10 @@
padding: 10px 8px;
}
+ td.stage-cell {
+ padding: 10px 0;
+ }
+
.commit-link {
padding: 9px 8px 10px;
}
@@ -291,12 +295,14 @@
height: 22px;
margin: 3px 6px 3px 0;
- .tooltip {
- white-space: nowrap;
+ // Hack to show a button tooltip inline
+ button.has-tooltip + .tooltip {
+ min-width: 105px;
}
- .tooltip-inner {
- padding: 3px 4px;
+ // Bootstrap way of showing the content inline for anchors.
+ a.has-tooltip {
+ white-space: nowrap;
}
&:not(:last-child) {
diff --git a/app/serializers/analytics_stage_entity.rb b/app/serializers/analytics_stage_entity.rb
index 69bf693de8d..a559d0850c4 100644
--- a/app/serializers/analytics_stage_entity.rb
+++ b/app/serializers/analytics_stage_entity.rb
@@ -2,7 +2,6 @@ class AnalyticsStageEntity < Grape::Entity
include EntityDateHelper
expose :title
- expose :legend
expose :description
expose :median, as: :value do |stage|
diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml
index ac0fd87fd8d..f852f2e3fd7 100644
--- a/app/views/projects/ci/pipelines/_pipeline.html.haml
+++ b/app/views/projects/ci/pipelines/_pipeline.html.haml
@@ -15,7 +15,7 @@
- else
%span.api.monospace API
- if pipeline.latest?
- %span.label.label-success.has-tooltip{ title: 'Latest job for this branch' } latest
+ %span.label.label-success.has-tooltip{ title: 'Latest pipeline for this branch' } latest
- if pipeline.triggered?
%span.label.label-primary triggered
- if pipeline.yaml_errors.present?
@@ -61,7 +61,7 @@
.btn-group.inline
- if actions.any?
.btn-group
- %button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual job', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual job' }
+ %button.dropdown-toggle.btn.btn-default.has-tooltip.js-pipeline-dropdown-manual-actions{ type: 'button', title: 'Manual pipeline', data: { toggle: 'dropdown', placement: 'top' }, 'aria-label' => 'Manual pipeline' }
= custom_icon('icon_play')
= icon('caret-down', 'aria-hidden' => 'true')
%ul.dropdown-menu.dropdown-menu-align-right
diff --git a/app/views/projects/cycle_analytics/show.html.haml b/app/views/projects/cycle_analytics/show.html.haml
index ad904a8708e..5405ff16bea 100644
--- a/app/views/projects/cycle_analytics/show.html.haml
+++ b/app/views/projects/cycle_analytics/show.html.haml
@@ -44,7 +44,7 @@
Last 90 days
.stage-panel-container
.panel.panel-default.stage-panel
- .panel-heading
+ .panel-heading
%nav.col-headers
%ul
%li.stage-header
diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml
index bef76f16ca7..e3062f47788 100644
--- a/app/views/projects/merge_requests/widget/_heading.html.haml
+++ b/app/views/projects/merge_requests/widget/_heading.html.haml
@@ -9,8 +9,9 @@
Pipeline
= link_to "##{@pipeline.id}", namespace_project_pipeline_path(@pipeline.project.namespace, @pipeline.project, @pipeline.id), class: 'pipeline'
= ci_label_for_status(status)
- .mr-widget-pipeline-graph
- = render 'shared/mini_pipeline_graph', pipeline: @pipeline, klass: 'js-pipeline-inline-mr-widget-graph'
+ - if @pipeline.stages.any?
+ .mr-widget-pipeline-graph
+ = render 'shared/mini_pipeline_graph', pipeline: @pipeline, klass: 'js-pipeline-inline-mr-widget-graph'
%span
for
= succeed "." do
diff --git a/app/views/projects/merge_requests/widget/_show.html.haml b/app/views/projects/merge_requests/widget/_show.html.haml
index 4c063747857..0b0fb7854c2 100644
--- a/app/views/projects/merge_requests/widget/_show.html.haml
+++ b/app/views/projects/merge_requests/widget/_show.html.haml
@@ -17,11 +17,11 @@
ci_status: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.status : ''}",
ci_message: {
normal: "Pipeline {{status}} for \"{{title}}\"",
- preparing: "{{status}} job for \"{{title}}\""
+ preparing: "{{status}} pipeline for \"{{title}}\""
},
ci_enable: #{@project.ci_service ? "true" : "false"},
ci_title: {
- preparing: "{{status}} job",
+ preparing: "{{status}} pipeline",
normal: "Pipeline {{status}}"
},
ci_sha: "#{@merge_request.head_pipeline ? @merge_request.head_pipeline.short_sha : ''}",
diff --git a/app/views/projects/merge_requests/widget/open/_build_failed.html.haml b/app/views/projects/merge_requests/widget/open/_build_failed.html.haml
index a18c2ad768f..3979d5fa8ed 100644
--- a/app/views/projects/merge_requests/widget/open/_build_failed.html.haml
+++ b/app/views/projects/merge_requests/widget/open/_build_failed.html.haml
@@ -1,6 +1,6 @@
%h4
= icon('exclamation-triangle')
- The job for this merge request failed
+ The pipeline for this merge request failed
%p
Please retry the job or push a new commit to fix the failure.
diff --git a/app/views/projects/triggers/_index.html.haml b/app/views/projects/triggers/_index.html.haml
index 5cb1818ae54..33883facf9b 100644
--- a/app/views/projects/triggers/_index.html.haml
+++ b/app/views/projects/triggers/_index.html.haml
@@ -65,7 +65,7 @@
In the
%code .gitlab-ci.yml
of another project, include the following snippet.
- The project will be rebuilt at the end of the job.
+ The project will be rebuilt at the end of the pipeline.
%pre
:plain
@@ -89,7 +89,7 @@
%p.light
Add
%code variables[VARIABLE]=VALUE
- to an API request. Variable values can be used to distinguish between triggered jobs and normal jobs.
+ to an API request. Variable values can be used to distinguish between triggered pipelines and normal pipelines.
With cURL: