diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 12:13:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 12:13:03 +0300 |
commit | bfbd788e0910597b93b31020300b15952828c386 (patch) | |
tree | a6899cf46ca9938616e3c6f38c0f8aab353b8ee5 /app | |
parent | bef328bb8c0e287ecd68e21bae40bdb335971212 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
6 files changed, 47 insertions, 17 deletions
diff --git a/app/assets/javascripts/pages/dashboard/todos/index/todos.js b/app/assets/javascripts/pages/dashboard/todos/index/todos.js index 946076cfb29..a1e7eb5d3de 100644 --- a/app/assets/javascripts/pages/dashboard/todos/index/todos.js +++ b/app/assets/javascripts/pages/dashboard/todos/index/todos.js @@ -1,4 +1,4 @@ -/* eslint-disable class-methods-use-this, no-unneeded-ternary */ +/* eslint-disable class-methods-use-this */ import $ from 'jquery'; import { getGroups } from '~/api/groups_api'; @@ -78,7 +78,7 @@ export default class Todos { initDeprecatedJQueryDropdown($dropdown, { fieldName, selectable: true, - filterable: searchFields ? true : false, + filterable: Boolean(searchFields), search: { fields: searchFields }, data: $dropdown.data('data'), clicked: () => { @@ -172,8 +172,8 @@ export default class Todos { updateBadges(data) { $(document).trigger('todo:toggle', data.count); - document.querySelector('.todos-pending .badge').innerHTML = addDelimiter(data.count); - document.querySelector('.todos-done .badge').innerHTML = addDelimiter(data.done_count); + document.querySelector('.js-todos-pending .badge').innerHTML = addDelimiter(data.count); + document.querySelector('.js-todos-done .badge').innerHTML = addDelimiter(data.done_count); } goToTodoUrl(e) { diff --git a/app/assets/javascripts/security_configuration/components/constants.js b/app/assets/javascripts/security_configuration/components/constants.js index b6f0bd18d0f..d0a7b0d0b89 100644 --- a/app/assets/javascripts/security_configuration/components/constants.js +++ b/app/assets/javascripts/security_configuration/components/constants.js @@ -17,6 +17,7 @@ import { } from '~/vue_shared/security_reports/constants'; import configureSastMutation from '../graphql/configure_sast.mutation.graphql'; +import configureSastIacMutation from '../graphql/configure_iac.mutation.graphql'; import configureSecretDetectionMutation from '../graphql/configure_secret_detection.mutation.graphql'; /** @@ -162,6 +163,11 @@ export const securityFeatures = [ configurationHelpPath: SAST_IAC_CONFIG_HELP_PATH, type: REPORT_TYPE_SAST_IAC, + // This field is currently hardcoded because SAST IaC is always available. + // It will eventually come from the Backend, the progress is tracked in + // https://gitlab.com/gitlab-org/gitlab/-/issues/331622 + available: true, + // This field will eventually come from the backend, the progress is // tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/331621 canEnableByMergeRequest: true, @@ -269,6 +275,21 @@ export const featureToMutationMap = { }, }), }, + ...(gon?.features?.configureIacScanningViaMr + ? { + [REPORT_TYPE_SAST_IAC]: { + mutationId: 'configureSastIac', + getMutationPayload: (projectPath) => ({ + mutation: configureSastIacMutation, + variables: { + input: { + projectPath, + }, + }, + }), + }, + } + : {}), [REPORT_TYPE_SECRET_DETECTION]: { mutationId: 'configureSecretDetection', getMutationPayload: (projectPath) => ({ diff --git a/app/assets/javascripts/security_configuration/graphql/configure_iac.mutation.graphql b/app/assets/javascripts/security_configuration/graphql/configure_iac.mutation.graphql new file mode 100644 index 00000000000..26b826ef722 --- /dev/null +++ b/app/assets/javascripts/security_configuration/graphql/configure_iac.mutation.graphql @@ -0,0 +1,6 @@ +mutation configureSastIac($input: ConfigureSastIacInput!) { + configureSastIac(input: $input) { + successPath + errors + } +} diff --git a/app/helpers/tab_helper.rb b/app/helpers/tab_helper.rb index a6bb2f3b246..d1046b7b668 100644 --- a/app/helpers/tab_helper.rb +++ b/app/helpers/tab_helper.rb @@ -210,3 +210,11 @@ module TabHelper current_page?(options) end end + +def gl_tab_counter_badge(count, html_options = {}) + badge_classes = %w[badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge] + content_tag(:span, + count, + class: [*html_options[:class], badge_classes].join(' ') + ) +end diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index ba9665555cc..540e8f7b970 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -25,6 +25,7 @@ module Ci Gitlab::Ci::Pipeline::Chain::Populate, Gitlab::Ci::Pipeline::Chain::StopDryRun, Gitlab::Ci::Pipeline::Chain::Create, + Gitlab::Ci::Pipeline::Chain::CreateCrossDatabaseAssociations, Gitlab::Ci::Pipeline::Chain::Limit::Activity, Gitlab::Ci::Pipeline::Chain::Limit::JobActivity, Gitlab::Ci::Pipeline::Chain::CancelPendingPipelines, diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml index 58f817bf63b..aa54a1e589e 100644 --- a/app/views/dashboard/todos/index.html.haml +++ b/app/views/dashboard/todos/index.html.haml @@ -10,19 +10,13 @@ - if current_user.todos.any? .top-area - %ul.nav-links.mobile-separator.nav.nav-tabs - %li.todos-pending{ class: active_when(params[:state].blank? || params[:state] == 'pending') }> - = link_to todos_filter_path(state: 'pending') do - %span - To Do - %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm - = number_with_delimiter(todos_pending_count) - %li.todos-done{ class: active_when(params[:state] == 'done') }> - = link_to todos_filter_path(state: 'done') do - %span - Done - %span.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm - = number_with_delimiter(todos_done_count) + = gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0' }) do + = gl_tab_link_to todos_filter_path(state: 'pending'), item_active: params[:state].blank? || params[:state] == 'pending', class: "js-todos-pending" do + = _("To Do") + = gl_tab_counter_badge number_with_delimiter(todos_pending_count) + = gl_tab_link_to todos_filter_path(state: 'done'), item_active: params[:state] == 'done', class: "js-todos-done" do + = _("Done") + = gl_tab_counter_badge number_with_delimiter(todos_done_count) .nav-controls - if @allowed_todos.any?(&:pending?) |