Merge branch 'ce-3776-ci-view-for-sast' into 'master'

CE port of changes made to the pipeline bundle in EE - Fixes typos and adds i18n

See merge request gitlab-org/gitlab-ce!17176
This commit is contained in:
Phil Hughes 2018-02-21 14:39:04 +00:00
commit 48b1455566
7 changed files with 23 additions and 16 deletions

View file

@ -52,7 +52,7 @@
</script> </script>
<template> <template>
<div class="build-content middle-block js-pipeline-graph"> <div class="build-content middle-block js-pipeline-graph">
<div class="pipeline-visualization pipeline-graph"> <div class="pipeline-visualization pipeline-graph pipeline-tab-content">
<div class="text-center"> <div class="text-center">
<loading-icon <loading-icon
v-if="isLoading" v-if="isLoading"

View file

@ -1,10 +1,14 @@
import Vue from 'vue'; import Vue from 'vue';
import Flash from '../flash'; import Flash from '~/flash';
import PipelinesMediator from './pipeline_details_mediatior'; import Translate from '~/vue_shared/translate';
import { __ } from '~/locale';
import PipelinesMediator from './pipeline_details_mediator';
import pipelineGraph from './components/graph/graph_component.vue'; import pipelineGraph from './components/graph/graph_component.vue';
import pipelineHeader from './components/header_component.vue'; import pipelineHeader from './components/header_component.vue';
import eventHub from './event_hub'; import eventHub from './event_hub';
Vue.use(Translate);
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const dataset = document.querySelector('.js-pipeline-details-vue').dataset; const dataset = document.querySelector('.js-pipeline-details-vue').dataset;
@ -54,7 +58,7 @@ document.addEventListener('DOMContentLoaded', () => {
postAction(action) { postAction(action) {
this.mediator.service.postAction(action.path) this.mediator.service.postAction(action.path)
.then(() => this.mediator.refreshPipeline()) .then(() => this.mediator.refreshPipeline())
.catch(() => new Flash('An error occurred while making the request.')); .catch(() => Flash(__('An error occurred while making the request.')));
}, },
}, },
render(createElement) { render(createElement) {

View file

@ -1,6 +1,7 @@
import Visibility from 'visibilityjs'; import Visibility from 'visibilityjs';
import Flash from '../flash'; import Flash from '../flash';
import Poll from '../lib/utils/poll'; import Poll from '../lib/utils/poll';
import { __ } from '../locale';
import PipelineStore from './stores/pipeline_store'; import PipelineStore from './stores/pipeline_store';
import PipelineService from './services/pipeline_service'; import PipelineService from './services/pipeline_service';
@ -47,7 +48,7 @@ export default class pipelinesMediator {
errorCallback() { errorCallback() {
this.state.isLoading = false; this.state.isLoading = false;
return new Flash('An error occurred while fetching the pipeline.'); Flash(__('An error occurred while fetching the pipeline.'));
} }
refreshPipeline() { refreshPipeline() {

View file

@ -320,14 +320,17 @@
} }
} }
// Pipeline graph .pipeline-tab-content {
.pipeline-graph {
width: 100%; width: 100%;
background-color: $gray-light; background-color: $gray-light;
padding: $gl-padding; padding: $gl-padding;
overflow: auto;
}
// Pipeline graph
.pipeline-graph {
white-space: nowrap; white-space: nowrap;
transition: max-height 0.3s, padding 0.3s; transition: max-height 0.3s, padding 0.3s;
overflow: auto;
.stage-column-list, .stage-column-list,
.builds-container > ul { .builds-container > ul {

View file

@ -3,16 +3,16 @@
.tabs-holder .tabs-holder
%ul.pipelines-tabs.nav-links.no-top.no-bottom.mobile-separator %ul.pipelines-tabs.nav-links.no-top.no-bottom.mobile-separator
%li.js-pipeline-tab-link %li.js-pipeline-tab-link
= link_to project_pipeline_path(@project, @pipeline), data: { target: 'div#js-tab-pipeline', action: 'pipelines', toggle: 'tab' }, class: 'pipeline-tab' do = link_to project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-pipeline', action: 'pipelines', toggle: 'tab' }, class: 'pipeline-tab' do
Pipeline = _("Pipeline")
%li.js-builds-tab-link %li.js-builds-tab-link
= link_to builds_project_pipeline_path(@project, @pipeline), data: {target: 'div#js-tab-builds', action: 'builds', toggle: 'tab' }, class: 'builds-tab' do = link_to builds_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-builds', action: 'builds', toggle: 'tab' }, class: 'builds-tab' do
Jobs = _("Jobs")
%span.badge.js-builds-counter= pipeline.total_size %span.badge.js-builds-counter= pipeline.total_size
- if failed_builds.present? - if failed_builds.present?
%li.js-failures-tab-link %li.js-failures-tab-link
= link_to failures_project_pipeline_path(@project, @pipeline), data: {target: 'div#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do = link_to failures_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do
Failed Jobs = _("Failed Jobs")
%span.badge.js-failures-counter= failed_builds.count %span.badge.js-failures-counter= failed_builds.count
.tab-content .tab-content

View file

@ -1,6 +1,6 @@
import _ from 'underscore'; import _ from 'underscore';
import Vue from 'vue'; import Vue from 'vue';
import PipelineMediator from '~/pipelines/pipeline_details_mediatior'; import PipelineMediator from '~/pipelines/pipeline_details_mediator';
describe('PipelineMdediator', () => { describe('PipelineMdediator', () => {
let mediator; let mediator;

View file

@ -8,7 +8,6 @@ describe('Pipeline Store', () => {
}); });
it('should set defaults', () => { it('should set defaults', () => {
expect(store.state).toEqual({ pipeline: {} });
expect(store.state.pipeline).toEqual({}); expect(store.state.pipeline).toEqual({});
}); });