Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-15 18:10:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-15 18:10:31 +0300
commit39a5262a05794d1e83b3927c2f6813c1174688c2 (patch)
treeb8b647a0ac97bc8156f785619bd151bda789773b /app
parent0e11c62b96a79f7c5b40bb87c752a77f6fd986d0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue7
-rw-r--r--app/assets/javascripts/reports/components/grouped_test_reports_app.vue11
-rw-r--r--app/assets/javascripts/reports/components/modal.vue74
-rw-r--r--app/assets/javascripts/reports/store/actions.js9
-rw-r--r--app/assets/javascripts/reports/store/mutation_types.js1
-rw-r--r--app/assets/javascripts/reports/store/mutations.js14
-rw-r--r--app/assets/javascripts/reports/store/state.js1
-rw-r--r--app/models/concerns/milestoneable.rb2
-rw-r--r--app/views/admin/runners/index.html.haml10
-rw-r--r--app/views/projects/ci/builds/_build.html.haml10
-rw-r--r--app/views/projects/pipelines/_info.html.haml14
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml2
-rw-r--r--app/views/shared/runners/_runner_description.html.haml4
13 files changed, 94 insertions, 65 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
index c80e1712e31..d18e604f087 100644
--- a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
+++ b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
@@ -1,5 +1,5 @@
<script>
-import { GlTooltipDirective, GlButton, GlLink, GlLoadingIcon } from '@gitlab/ui';
+import { GlTooltipDirective, GlButton, GlLink, GlLoadingIcon, GlBadge } from '@gitlab/ui';
import CiStatus from '~/vue_shared/components/ci_icon.vue';
import { __, sprintf } from '~/locale';
import { accessValue } from './accessors';
@@ -15,6 +15,7 @@ export default {
GlButton,
GlLink,
GlLoadingIcon,
+ GlBadge,
},
inject: {
dataMethod: {
@@ -172,7 +173,9 @@ export default {
</div>
</div>
<div class="gl-pt-2">
- <span class="badge badge-primary" data-testid="downstream-pipeline-label">{{ label }}</span>
+ <gl-badge size="sm" variant="info" data-testid="downstream-pipeline-label">
+ {{ label }}
+ </gl-badge>
</div>
<gl-button
:id="buttonId"
diff --git a/app/assets/javascripts/reports/components/grouped_test_reports_app.vue b/app/assets/javascripts/reports/components/grouped_test_reports_app.vue
index 24c7a8dadaf..bf1868d427e 100644
--- a/app/assets/javascripts/reports/components/grouped_test_reports_app.vue
+++ b/app/assets/javascripts/reports/components/grouped_test_reports_app.vue
@@ -45,6 +45,7 @@ export default {
...mapState({
modalTitle: (state) => state.modal.title || '',
modalData: (state) => state.modal.data || {},
+ modalOpen: (state) => state.modal.open || false,
}),
...mapGetters(['summaryStatus']),
groupedSummaryText() {
@@ -76,7 +77,7 @@ export default {
this.fetchReports();
},
methods: {
- ...mapActions(['setEndpoint', 'fetchReports']),
+ ...mapActions(['setEndpoint', 'fetchReports', 'closeModal']),
reportText(report) {
const { name, summary } = report || {};
@@ -170,8 +171,12 @@ export default {
class="report-block-group-list"
/>
</template>
-
- <modal :title="modalTitle" :modal-data="modalData" />
+ <modal
+ :visible="modalOpen"
+ :title="modalTitle"
+ :modal-data="modalData"
+ @hide="closeModal"
+ />
</div>
</template>
</report-section>
diff --git a/app/assets/javascripts/reports/components/modal.vue b/app/assets/javascripts/reports/components/modal.vue
index ca95db6c826..6243bddf941 100644
--- a/app/assets/javascripts/reports/components/modal.vue
+++ b/app/assets/javascripts/reports/components/modal.vue
@@ -1,15 +1,21 @@
<script>
-// import { sprintf, __ } from '~/locale';
-import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue';
+import { GlModal, GlLink, GlSprintf } from '@gitlab/ui';
+
import CodeBlock from '~/vue_shared/components/code_block.vue';
import { fieldTypes } from '../constants';
export default {
components: {
- Modal: DeprecatedModal2,
CodeBlock,
+ GlModal,
+ GlLink,
+ GlSprintf,
},
props: {
+ visible: {
+ type: Boolean,
+ required: true,
+ },
title: {
type: String,
required: true,
@@ -23,39 +29,43 @@ export default {
};
</script>
<template>
- <modal
- id="modal-mrwidget-reports"
- :header-title-text="title"
- class="modal-security-report-dast modal-hide-footer"
+ <gl-modal
+ :visible="visible"
+ modal-id="modal-mrwidget-reports"
+ :title="title"
+ :hide-footer="true"
+ @hide="$emit('hide')"
>
- <slot>
- <div
- v-for="(field, key, index) in modalData"
- v-if="field.value"
- :key="index"
- class="row gl-mt-3 gl-mb-3"
- >
- <strong class="col-sm-3 text-right"> {{ field.text }}: </strong>
+ <div
+ v-for="(field, key, index) in modalData"
+ v-if="field.value"
+ :key="index"
+ class="row gl-mt-3 gl-mb-3"
+ >
+ <strong class="col-sm-3 text-right"> {{ field.text }}: </strong>
- <div class="col-sm-9 text-secondary">
- <code-block v-if="field.type === $options.fieldTypes.codeBock" :code="field.value" />
+ <div class="col-sm-9 text-secondary">
+ <code-block v-if="field.type === $options.fieldTypes.codeBock" :code="field.value" />
- <template v-else-if="field.type === $options.fieldTypes.link">
- <a :href="field.value" target="_blank" rel="noopener noreferrer" class="js-modal-link">
- {{ field.value }}
- </a>
- </template>
+ <gl-link
+ v-else-if="field.type === $options.fieldTypes.link"
+ :href="field.value"
+ target="_blank"
+ >
+ {{ field.value }}
+ </gl-link>
- <template v-else-if="field.type === $options.fieldTypes.seconds">{{
- sprintf(__('%{value} s'), { value: field.value })
- }}</template>
+ <gl-sprintf
+ v-else-if="field.type === $options.fieldTypes.seconds"
+ :message="__('%{value} s')"
+ >
+ <template #value>{{ field.value }}</template>
+ </gl-sprintf>
- <template v-else-if="field.type === $options.fieldTypes.text">
- {{ field.value }}
- </template>
- </div>
+ <template v-else-if="field.type === $options.fieldTypes.text">
+ {{ field.value }}
+ </template>
</div>
- </slot>
- <div slot="footer"></div>
- </modal>
+ </div>
+ </gl-modal>
</template>
diff --git a/app/assets/javascripts/reports/store/actions.js b/app/assets/javascripts/reports/store/actions.js
index c5860db6601..301fdce7989 100644
--- a/app/assets/javascripts/reports/store/actions.js
+++ b/app/assets/javascripts/reports/store/actions.js
@@ -1,5 +1,4 @@
import Visibility from 'visibilityjs';
-import $ from 'jquery';
import axios from '../../lib/utils/axios_utils';
import Poll from '../../lib/utils/poll';
import * as types from './mutation_types';
@@ -78,10 +77,6 @@ export const receiveReportsSuccess = ({ commit }, response) => {
export const receiveReportsError = ({ commit }) => commit(types.RECEIVE_REPORTS_ERROR);
-export const openModal = ({ dispatch }, payload) => {
- dispatch('setModalData', payload);
+export const openModal = ({ commit }, payload) => commit(types.SET_ISSUE_MODAL_DATA, payload);
- $('#modal-mrwidget-reports').modal('show');
-};
-
-export const setModalData = ({ commit }, payload) => commit(types.SET_ISSUE_MODAL_DATA, payload);
+export const closeModal = ({ commit }, payload) => commit(types.RESET_ISSUE_MODAL_DATA, payload);
diff --git a/app/assets/javascripts/reports/store/mutation_types.js b/app/assets/javascripts/reports/store/mutation_types.js
index 599d4862dfe..337085f9bf0 100644
--- a/app/assets/javascripts/reports/store/mutation_types.js
+++ b/app/assets/javascripts/reports/store/mutation_types.js
@@ -4,3 +4,4 @@ export const REQUEST_REPORTS = 'REQUEST_REPORTS';
export const RECEIVE_REPORTS_SUCCESS = 'RECEIVE_REPORTS_SUCCESS';
export const RECEIVE_REPORTS_ERROR = 'RECEIVE_REPORTS_ERROR';
export const SET_ISSUE_MODAL_DATA = 'SET_ISSUE_MODAL_DATA';
+export const RESET_ISSUE_MODAL_DATA = 'RESET_ISSUE_MODAL_DATA';
diff --git a/app/assets/javascripts/reports/store/mutations.js b/app/assets/javascripts/reports/store/mutations.js
index d0727e722bb..3bb31d71d8f 100644
--- a/app/assets/javascripts/reports/store/mutations.js
+++ b/app/assets/javascripts/reports/store/mutations.js
@@ -52,5 +52,19 @@ export default {
};
}
});
+
+ state.modal.open = true;
+ },
+ [types.RESET_ISSUE_MODAL_DATA](state) {
+ state.modal.open = false;
+
+ // Resetting modal data
+ state.modal.title = null;
+ Object.keys(state.modal.data).forEach((key) => {
+ state.modal.data[key] = {
+ ...state.modal.data[key],
+ value: null,
+ };
+ });
},
};
diff --git a/app/assets/javascripts/reports/store/state.js b/app/assets/javascripts/reports/store/state.js
index 4f9eb53e787..e8a0db2e1a8 100644
--- a/app/assets/javascripts/reports/store/state.js
+++ b/app/assets/javascripts/reports/store/state.js
@@ -38,6 +38,7 @@ export default () => ({
modal: {
title: null,
+ open: false,
data: {
class: {
diff --git a/app/models/concerns/milestoneable.rb b/app/models/concerns/milestoneable.rb
index b1698bc2ee3..ccb334343ff 100644
--- a/app/models/concerns/milestoneable.rb
+++ b/app/models/concerns/milestoneable.rb
@@ -51,7 +51,7 @@ module Milestoneable
# Overridden on EE module
#
def supports_milestone?
- respond_to?(:milestone_id) && !incident?
+ respond_to?(:milestone_id)
end
end
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
index ae1396340f3..9f19d3f5d4e 100644
--- a/app/views/admin/runners/index.html.haml
+++ b/app/views/admin/runners/index.html.haml
@@ -14,23 +14,23 @@
%span= _('Runners can be:')
%ul
%li
- %span.badge.badge-success shared
+ %span.badge.badge-pill.gl-badge.sm.badge-success shared
\-
= _('Runs jobs from all unassigned projects.')
%li
- %span.badge.badge-success group
+ %span.badge.badge-pill.gl-badge.sm.badge-success group
\-
= _('Runs jobs from all unassigned projects in its group.')
%li
- %span.badge.badge-info specific
+ %span.badge.badge-pill.gl-badge.sm.badge-info specific
\-
= _('Runs jobs from assigned projects.')
%li
- %span.badge.badge-warning locked
+ %span.badge.badge-pill.gl-badge.sm.badge-warning locked
\-
= _('Cannot be assigned to other projects.')
%li
- %span.badge.badge-danger paused
+ %span.badge.badge-pill.gl-badge.sm.badge-danger paused
\-
= _('Not available to run jobs.')
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index cee6eb1189f..017c804ced0 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -43,16 +43,16 @@
.label-container
- if job.tags.any?
- job.tags.each do |tag|
- %span.badge.badge-primary
+ %span.badge.badge-pill.gl-badge.sm.badge-primary
= tag
- if job.try(:trigger_request)
- %span.badge.badge-info= _('triggered')
+ %span.badge.badge-pill.gl-badge.sm.badge-info= _('triggered')
- if job.try(:allow_failure) && !job.success?
- %span.badge.badge-warning= _('allowed to fail')
+ %span.badge.badge-pill.gl-badge.sm.badge-warning= _('allowed to fail')
- if job.schedulable?
- %span.badge.badge-info= s_('DelayedJobs|delayed')
+ %span.badge.badge-pill.gl-badge.sm.badge-info= s_('DelayedJobs|delayed')
- elsif job.action?
- %span.badge.badge-info= _('manual')
+ %span.badge.badge-pill.gl-badge.sm.badge-info= _('manual')
- if pipeline_link
%td
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index f77f22cc555..77aa537dfdb 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -21,24 +21,24 @@
.icon-container
= sprite_icon('flag')
- if @pipeline.child?
- %span.js-pipeline-child.badge.badge-primary.has-tooltip{ title: s_("Pipelines|This is a child pipeline within the parent pipeline") }
+ %span.js-pipeline-child.badge.badge-pill.gl-badge.sm.badge-primary.has-tooltip{ title: s_("Pipelines|This is a child pipeline within the parent pipeline") }
= s_('Pipelines|Child pipeline')
= surround '(', ')' do
= link_to s_('Pipelines|parent'), pipeline_path(@pipeline.triggered_by_pipeline), class: 'text-white text-underline'
- if @pipeline.latest?
- %span.js-pipeline-url-latest.badge.badge-success.has-tooltip{ title: _("Latest pipeline for the most recent commit on this branch") }
+ %span.js-pipeline-url-latest.badge.badge-pill.gl-badge.sm.badge-success.has-tooltip{ title: _("Latest pipeline for the most recent commit on this branch") }
latest
- if @pipeline.has_yaml_errors?
- %span.js-pipeline-url-yaml.badge.badge-danger.has-tooltip{ title: @pipeline.yaml_errors }
+ %span.js-pipeline-url-yaml.badge.badge-pill.gl-badge.sm.badge-danger.has-tooltip{ title: @pipeline.yaml_errors }
yaml invalid
- if @pipeline.failure_reason?
- %span.js-pipeline-url-failure.badge.badge-danger.has-tooltip{ title: @pipeline.failure_reason }
+ %span.js-pipeline-url-failure.badge.badge-pill.gl-badge.sm.badge-danger.has-tooltip{ title: @pipeline.failure_reason }
error
- if @pipeline.auto_devops_source?
- popover_title_text = html_escape(_('This pipeline makes use of a predefined CI/CD configuration enabled by %{b_open}Auto DevOps.%{b_close}')) % { b_open: '<b>'.html_safe, b_close: '</b>'.html_safe }
- popover_content_url = help_page_path('topics/autodevops/index.md')
- popover_content_text = _('Learn more about Auto DevOps')
- %a.js-pipeline-url-autodevops.badge.badge-info.autodevops-badge{ href: "#", tabindex: "0", role: "button", data: { container: "body",
+ %a.js-pipeline-url-autodevops.badge.badge-pill.gl-badge.sm.badge-info.autodevops-badge{ href: "#", tabindex: "0", role: "button", data: { container: "body",
toggle: "popover",
placement: "top",
html: "true",
@@ -48,10 +48,10 @@
} }
Auto DevOps
- if @pipeline.detached_merge_request_pipeline?
- %span.js-pipeline-url-mergerequest.badge.badge-info.has-tooltip{ title: _('Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.') }
+ %span.js-pipeline-url-mergerequest.badge.badge-pill.gl-badge.sm.badge-info.has-tooltip{ title: _('Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.') }
detached
- if @pipeline.stuck?
- %span.js-pipeline-url-stuck.badge.badge-warning
+ %span.js-pipeline-url-stuck.badge.badge-pill.gl-badge.sm.badge-warning
stuck
.well-segment.branch-info
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 760bfb5c2a1..911bef482dd 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -58,7 +58,7 @@
.selectbox.hide-collapsed
= f.hidden_field 'milestone_id', value: milestone[:id], id: nil
= dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable_type}[milestone_id]", project_id: issuable_sidebar[:project_id], issuable_id: issuable_sidebar[:id], ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], use_id: true, default_no: true, selected: milestone[:title], null_default: true, display: 'static' }})
- - if @project.group.present?
+ - if @project.group.present? && issuable_sidebar[:supports_iterations]
= render_if_exists 'shared/issuable/iteration_select', can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type
- if issuable_sidebar[:supports_time_tracking]
diff --git a/app/views/shared/runners/_runner_description.html.haml b/app/views/shared/runners/_runner_description.html.haml
index e4afaf4202e..6a65145d42b 100644
--- a/app/views/shared/runners/_runner_description.html.haml
+++ b/app/views/shared/runners/_runner_description.html.haml
@@ -5,8 +5,8 @@
%div
%ul
%li
- %span.badge.badge-success active
+ %span.badge.badge-pill.gl-badge.sm.badge-success active
= _('- Available to run jobs.')
%li
- %span.badge.badge-danger paused
+ %span.badge.badge-pill.gl-badge.sm.badge-danger paused
= _('- Not available to run jobs.')