From 8731954e18e2c5969d4a5f67d187892312c463c4 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 10 Jul 2023 18:08:26 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../accordion_items/artifacts_and_cache_item.vue | 2 +- .../error_tracking/components/timeline_chart.vue | 4 +- .../javascripts/ide/components/ide_status_bar.vue | 1 + .../jira_connect/subscriptions/components/app.vue | 68 +++++++++++++--------- .../subscriptions/components/feedback_banner.vue | 57 ++++++++++++++++++ app/assets/javascripts/mr_more_dropdown.js | 4 ++ .../pages/projects/merge_requests/page.js | 2 + .../pages/projects/merge_requests/show/index.js | 4 -- .../command_palette/command_palette_items.vue | 7 +++ .../global_search/command_palette/constants.js | 6 +- .../javascripts/vue_shared/components/ci_icon.vue | 12 +++- .../stylesheets/page_bundles/jira_connect.scss | 8 ++- app/graphql/types/ci/job_type.rb | 10 +++- app/graphql/types/ci/stage_type.rb | 2 +- app/models/user.rb | 3 + app/models/user_preference.rb | 2 + .../application_settings/_help_page.html.haml | 2 +- 17 files changed, 145 insertions(+), 49 deletions(-) create mode 100644 app/assets/javascripts/jira_connect/subscriptions/components/feedback_banner.vue (limited to 'app') diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/artifacts_and_cache_item.vue b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/artifacts_and_cache_item.vue index 794763e0cd8..76db9613dc1 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/artifacts_and_cache_item.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/artifacts_and_cache_item.vue @@ -26,7 +26,7 @@ export default { return [ { key: 'artifacts.paths', - title: i18n.ARTIFACTS_AND_CACHE, + title: i18n.ARTIFACTS_PATHS, paths: this.job.artifacts.paths, generateInputDataTestId: (index) => `artifacts-paths-input-${index}`, generateDeleteButtonDataTestId: (index) => `delete-artifacts-paths-button-${index}`, diff --git a/app/assets/javascripts/error_tracking/components/timeline_chart.vue b/app/assets/javascripts/error_tracking/components/timeline_chart.vue index 51e0c900e4b..907a6c8557f 100644 --- a/app/assets/javascripts/error_tracking/components/timeline_chart.vue +++ b/app/assets/javascripts/error_tracking/components/timeline_chart.vue @@ -1,6 +1,6 @@ + + diff --git a/app/assets/javascripts/mr_more_dropdown.js b/app/assets/javascripts/mr_more_dropdown.js index ca50028a93a..4a9e10be5ad 100644 --- a/app/assets/javascripts/mr_more_dropdown.js +++ b/app/assets/javascripts/mr_more_dropdown.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import { initReportAbuse } from '~/projects/report_abuse'; import MrMoreDropdown from '~/vue_shared/components/mr_more_dropdown.vue'; export const initMrMoreDropdown = () => { @@ -37,6 +38,9 @@ export const initMrMoreDropdown = () => { reportAbusePath: el.dataset.reportAbusePath, showSummaryNotesToggle: Boolean(document.querySelector('#js-summary-notes')), }, + beforeCreate() { + initReportAbuse(); + }, render: (createElement) => createElement(MrMoreDropdown, { props: { diff --git a/app/assets/javascripts/pages/projects/merge_requests/page.js b/app/assets/javascripts/pages/projects/merge_requests/page.js index 552e75da9b8..75e308e706f 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/page.js +++ b/app/assets/javascripts/pages/projects/merge_requests/page.js @@ -9,6 +9,7 @@ import store from '~/mr_notes/stores'; import initSidebarBundle from '~/sidebar/sidebar_bundle'; import { apolloProvider } from '~/graphql_shared/issuable_client'; import { parseBoolean } from '~/lib/utils/common_utils'; +import { initMrMoreDropdown } from '~/mr_more_dropdown'; import initShow from './init_merge_request_show'; import getStateQuery from './queries/get_state.query.graphql'; @@ -17,6 +18,7 @@ Vue.use(VueApollo); export function initMrPage() { initMrNotes(); initShow(); + initMrMoreDropdown(); startCodeReviewMessaging({ signalBus: diffsEventHub }); } diff --git a/app/assets/javascripts/pages/projects/merge_requests/show/index.js b/app/assets/javascripts/pages/projects/merge_requests/show/index.js index 1cc7e892ca0..9eaf490abb2 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/show/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/show/index.js @@ -1,9 +1,5 @@ import mountNotesApp from 'ee_else_ce/mr_notes/mount_app'; -import { initReportAbuse } from '~/projects/report_abuse'; -import { initMrMoreDropdown } from '~/mr_more_dropdown'; import { initMrPage } from 'ee_else_ce/pages/projects/merge_requests/page'; initMrPage(); mountNotesApp(); -initReportAbuse(); -initMrMoreDropdown(); diff --git a/app/assets/javascripts/super_sidebar/components/global_search/command_palette/command_palette_items.vue b/app/assets/javascripts/super_sidebar/components/global_search/command_palette/command_palette_items.vue index 1e31a1cbbee..a1d0e400b5f 100644 --- a/app/assets/javascripts/super_sidebar/components/global_search/command_palette/command_palette_items.vue +++ b/app/assets/javascripts/super_sidebar/components/global_search/command_palette/command_palette_items.vue @@ -59,6 +59,13 @@ export default { case COMMAND_HANDLE: this.getCommandsAndPages(); break; + /* TODO: Search for recent issues initiated by #(ISSUE_HANDLE) from the command palette scope + was removed as using the # in command palette conflicted + with the existing global search functionality to search for issue by its id. + The code that performs the Recent issues search was not removed from the code base + as it would be nice to bring it back when we decide how to combine both search by id and text. + In scope of https://gitlab.com/gitlab-org/gitlab/-/issues/417434 + we either bring back the search by #issue_text or remove the related code completely */ case USER_HANDLE: case PROJECT_HANDLE: case ISSUE_HANDLE: diff --git a/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js b/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js index 83b262cf0d7..a43e621da44 100644 --- a/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js +++ b/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js @@ -2,14 +2,14 @@ import { s__, sprintf } from '~/locale'; export const COMMAND_HANDLE = '>'; export const USER_HANDLE = '@'; -export const PROJECT_HANDLE = '&'; +export const PROJECT_HANDLE = ':'; export const ISSUE_HANDLE = '#'; export const PATH_HANDLE = '/'; -export const COMMON_HANDLES = [COMMAND_HANDLE, USER_HANDLE, PROJECT_HANDLE, ISSUE_HANDLE]; +export const COMMON_HANDLES = [COMMAND_HANDLE, USER_HANDLE, PROJECT_HANDLE]; export const SEARCH_OR_COMMAND_MODE_PLACEHOLDER = sprintf( s__( - 'CommandPalette|Type %{commandHandle} for command, %{userHandle} for user, %{projectHandle} for project, %{issueHandle} for issue, %{pathHandle} for project file or perform generic search...', + 'CommandPalette|Type %{commandHandle} for command, %{userHandle} for user, %{projectHandle} for project, %{pathHandle} for project file, or perform generic search...', ), { commandHandle: COMMAND_HANDLE, diff --git a/app/assets/javascripts/vue_shared/components/ci_icon.vue b/app/assets/javascripts/vue_shared/components/ci_icon.vue index 0d7547d88a1..6670b931416 100644 --- a/app/assets/javascripts/vue_shared/components/ci_icon.vue +++ b/app/assets/javascripts/vue_shared/components/ci_icon.vue @@ -36,6 +36,15 @@ export default { status: { type: Object, required: true, + validator(status) { + const { group, icon } = status; + return ( + typeof group === 'string' && + group.length && + typeof icon === 'string' && + icon.startsWith('status_') + ); + }, }, size: { type: Number, @@ -69,7 +78,7 @@ export default { computed: { wrapperStyleClasses() { const status = this.status.group; - return `ci-status-icon ci-status-icon-${status} js-ci-status-icon-${status} gl-rounded-full gl-justify-content-center gl-line-height-0`; + return `ci-status-icon ci-status-icon-${status} gl-rounded-full gl-justify-content-center gl-line-height-0`; }, icon() { return this.isBorderless ? `${this.status.icon}_borderless` : this.status.icon; @@ -84,7 +93,6 @@ export default { { interactive: isInteractive, active: isActive, borderless: isBorderless }, ]" :style="{ height: `${size}px`, width: `${size}px` }" - data-testid="ci-icon-wrapper" > diff --git a/app/assets/stylesheets/page_bundles/jira_connect.scss b/app/assets/stylesheets/page_bundles/jira_connect.scss index 2c54c819543..6972e98b0bf 100644 --- a/app/assets/stylesheets/page_bundles/jira_connect.scss +++ b/app/assets/stylesheets/page_bundles/jira_connect.scss @@ -9,6 +9,8 @@ @import '@gitlab/ui/src/components/base/alert/alert'; @import '@gitlab/ui/src/components/base/avatar/avatar'; @import '@gitlab/ui/src/components/base/button/button'; +@import '@gitlab/ui/src/components/base/banner/banner'; +@import '@gitlab/ui/src/components/base/card/card'; @import '@gitlab/ui/src/components/base/icon/icon'; @import '@gitlab/ui/src/components/base/link/link'; @import '@gitlab/ui/src/components/base/loading_icon/loading_icon'; @@ -23,7 +25,7 @@ @import '@gitlab/ui/src/components/base/form/form_group/form_group'; @import '@gitlab/ui/src/components/base/search_box_by_type/search_box_by_type'; -$header-height: 40px; +$header-height: $gl-spacing-scale-8; .jira-connect-header { min-height: $header-height; @@ -35,6 +37,6 @@ $header-height: 40px; .jira-connect-app { margin-top: $header-height; - height: calc(100% - #{$header-height}); - max-width: 1000px; + height: 100%; + max-height: calc(100% - #{$header-height + $gl-spacing-scale-7 * 2}); } diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb index a779ceb2e2a..02b10f3e4bd 100644 --- a/app/graphql/types/ci/job_type.rb +++ b/app/graphql/types/ci/job_type.rb @@ -87,8 +87,10 @@ module Types description: 'Play path of the job.' field :playable, GraphQL::Types::Boolean, null: false, method: :playable?, description: 'Indicates the job can be played.' - field :previous_stage_jobs_or_needs, Types::Ci::JobNeedUnion.connection_type, null: true, - description: 'Jobs that must complete before the job runs. Returns `BuildNeed`, which is the needed jobs if the job uses the `needs` keyword, or the previous stage jobs otherwise.' + field :previous_stage_jobs_or_needs, Types::Ci::JobNeedUnion.connection_type, + null: true, + description: 'Jobs that must complete before the job runs. Returns `BuildNeed`, ' \ + 'which is the needed jobs if the job uses the `needs` keyword, or the previous stage jobs otherwise.' field :ref_name, GraphQL::Types::String, null: true, description: 'Ref name of the job.' field :ref_path, GraphQL::Types::String, null: true, @@ -179,7 +181,9 @@ module Types stages = pipeline.stages.by_position(positions) stages.each do |stage| - loader.call([pipeline, stage.position], stage.latest_statuses) + # Without `.to_a`, the memoization will only preserve the activerecord relation object. And when there is + # a call, the SQL query will be executed again. + loader.call([pipeline, stage.position], stage.latest_statuses.to_a) end end end diff --git a/app/graphql/types/ci/stage_type.rb b/app/graphql/types/ci/stage_type.rb index c0f3d1db57b..a9d8075329d 100644 --- a/app/graphql/types/ci/stage_type.rb +++ b/app/graphql/types/ci/stage_type.rb @@ -33,7 +33,7 @@ module Types by_pipeline = keys.group_by(&:pipeline) include_needs = keys.any? do |k| k.requires?(%i[nodes jobs nodes needs]) || - k.requires?(%i[nodes jobs nodes previousStageJobsAndNeeds]) + k.requires?(%i[nodes jobs nodes previousStageJobsOrNeeds]) end by_pipeline.each do |pl, key_group| diff --git a/app/models/user.rb b/app/models/user.rb index 7fd5d25d7e0..93c15229e03 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -317,6 +317,9 @@ class User < ApplicationRecord validates :color_scheme_id, allow_nil: true, inclusion: { in: Gitlab::ColorSchemes.valid_ids, message: ->(*) { _("%{placeholder} is not a valid color scheme") % { placeholder: '%{value}' } } } + validates :hide_no_ssh_key, allow_nil: false, inclusion: { in: [true, false] } + validates :hide_no_password, allow_nil: false, inclusion: { in: [true, false] } + validates :notified_of_own_activity, allow_nil: false, inclusion: { in: [true, false] } after_initialize :set_projects_limit before_validation :sanitize_attrs diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb index e527542e357..78ccce2aaae 100644 --- a/app/models/user_preference.rb +++ b/app/models/user_preference.rb @@ -23,6 +23,8 @@ class UserPreference < ApplicationRecord format: { with: ColorsHelper::HEX_COLOR_PATTERN }, allow_blank: true + validates :time_display_relative, allow_nil: false, inclusion: { in: [true, false] } + validates :render_whitespace_in_code, allow_nil: false, inclusion: { in: [true, false] } validates :pass_user_identities_to_ci_jwt, allow_nil: false, inclusion: { in: [true, false] } validates :pinned_nav_items, json_schema: { filename: 'pinned_nav_items' } diff --git a/app/views/admin/application_settings/_help_page.html.haml b/app/views/admin/application_settings/_help_page.html.haml index e76a83662af..9509806fc41 100644 --- a/app/views/admin/application_settings/_help_page.html.haml +++ b/app/views/admin/application_settings/_help_page.html.haml @@ -18,7 +18,7 @@ .form-group = f.label :help_page_documentation_base_url, _('Documentation pages URL'), class: 'gl-font-weight-bold' = f.text_field :help_page_documentation_base_url, class: 'form-control gl-form-input', placeholder: 'https://docs.gitlab.com' - - docs_link_url = help_page_path('user/admin_area/settings/help_page', anchor: 'destination-requirements') + - docs_link_url = help_page_path('administration/settings/help_page', anchor: 'destination-requirements') - docs_link_start = ''.html_safe % { url: docs_link_url } %span.form-text.text-muted#support_help_block= html_escape(_('Requests for pages at %{code_start}%{help_text_url}%{code_end} redirect to the URL. The destination must meet certain requirements. %{docs_link_start}Learn more.%{docs_link_end}')) % { code_start: ''.html_safe, help_text_url: help_url, code_end: ''.html_safe, docs_link_start: docs_link_start, docs_link_end: ''.html_safe } = f.submit _('Save changes'), pajamas_button: true -- cgit v1.2.3