Skip to content

Commit

Permalink
Add latest changes from gitlab-org/gitlab@master
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Bot committed Jun 7, 2024
1 parent ea3ca18 commit f4d5fa8
Show file tree
Hide file tree
Showing 38 changed files with 565 additions and 295 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/ci/common/pipelines_table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default {
fixed
>
<template #head(actions)>
<span class="gl-display-block gl-lg-display-none!">{{ s__('Pipeline|Actions') }}</span>
<span class="gl-block lg:!gl-hidden">{{ s__('Pipeline|Actions') }}</span>
<slot name="table-header-actions"></slot>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default {
<gl-button
:aria-label="__('Toggle sidebar')"
category="secondary"
class="gl-lg-display-none gl-ml-2"
class="lg:gl-hidden gl-ml-2"
icon="chevron-double-lg-left"
@click="onClickSidebarButton"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default {
<gl-button
:aria-label="$options.i18n.toggleSidebar"
category="secondary"
class="gl-lg-display-none"
class="lg:gl-hidden"
icon="chevron-double-lg-right"
@click="toggleSidebar"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default {
<gl-button
v-if="canRenderPipelineButton"
block
class="gl-mt-3 gl-mb-3 gl-lg-display-none"
class="gl-mt-3 gl-mb-3 lg:gl-hidden"
variant="confirm"
data-testid="run_pipeline_button_mobile"
:loading="state.isRunningMergeRequestPipeline"
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/diffs/components/diff_stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default {
<div
class="diff-stats"
:class="{
'is-compare-versions-header gl-display-none gl-lg-display-inline-flex': isCompareVersionsHeader,
'is-compare-versions-header gl-hidden lg:gl-inline-flex': isCompareVersionsHeader,
'gl-display-none gl-sm-display-inline-flex': !isCompareVersionsHeader,
}"
>
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/groups/components/overview_tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default {
</gl-tab>
<template #tabs-end>
<li class="gl-flex-grow-1 gl-align-self-center gl-w-full gl-lg-w-auto gl-py-2">
<div class="gl-lg-display-flex gl-justify-content-end -gl-mx-2 -gl-my-2">
<div class="lg:gl-flex gl-justify-content-end -gl-mx-2 -gl-my-2">
<div class="gl-p-2 gl-lg-form-input-md gl-w-full">
<gl-search-box-by-type
:value="search"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default {
};
</script>
<template>
<section class="gl-lg-display-flex gl-justify-content-space-between">
<section class="lg:gl-flex gl-justify-content-space-between">
<div>
<template v-if="isInstanceOrGroupLevel">
<gl-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default {
<a
v-safe-html:[$options.safeHtmlConfig]="titleHtml"
href="#top"
class="gl-display-none gl-lg-display-block gl-font-bold gl-overflow-hidden gl-whitespace-nowrap gl-text-overflow-ellipsis gl-my-0 gl-ml-1 gl-mr-2 gl-text-black-normal"
class="gl-hidden lg:gl-block gl-font-bold gl-overflow-hidden gl-whitespace-nowrap gl-text-overflow-ellipsis gl-my-0 gl-ml-1 gl-mr-2 gl-text-black-normal"
></a>
<div class="gl-display-flex gl-align-items-center">
<gl-sprintf :message="__('%{source} %{copyButton} into %{target}')">
Expand Down Expand Up @@ -243,7 +243,7 @@ export default {
</gl-link>
</li>
</ul>
<div class="gl-display-none gl-lg-display-flex gl-align-items-center gl-ml-auto">
<div class="gl-hidden lg:gl-flex gl-align-items-center gl-ml-auto">
<discussion-counter :blocks-merge="blocksMerge" hide-options />
<div
v-if="isSignedIn"
Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/projects/compare/components/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export default {
</template>
</gl-sprintf>
</p>
<div
class="gl-lg-flex-direction-row gl-lg-display-flex gl-align-items-center compare-revision-cards"
>
<div class="gl-lg-flex-direction-row lg:gl-flex gl-align-items-center compare-revision-cards">
<revision-card
data-testid="sourceRevisionCard"
:refs-project-path="to.refsProjectPath"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default {
/>
<span
v-if="taskCompletionStatus && hasTasks"
class="gl-hidden md:gl-block gl-lg-display-inline-block"
class="gl-hidden md:gl-block lg:gl-inline-block"
>{{ taskStatusString }}</span
>
<gl-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ export default {
childrenCountLabel() {
return this.isLoading && this.children.length === 0 ? '...' : this.children.length;
},
activeChildNamespaceFullPath() {
return this.activeChild.namespace?.fullPath;
},
},
methods: {
showAddForm(formType) {
Expand Down Expand Up @@ -307,6 +310,7 @@ export default {
ref="modal"
:work-item-id="activeChild.id"
:work-item-iid="activeChild.iid"
:work-item-full-path="activeChildNamespaceFullPath"
@close="closeModal"
@workItemDeleted="handleWorkItemDeleted(activeChild)"
@openReportAbuse="openReportAbuseDrawer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
I18N_WORK_ITEM_ADD_MULTIPLE_BUTTON_LABEL,
I18N_WORK_ITEM_CONFIDENTIALITY_CHECKBOX_LABEL,
I18N_WORK_ITEM_CONFIDENTIALITY_CHECKBOX_TOOLTIP,
WORK_ITEM_TYPE_VALUE_EPIC,
sprintfWorkItem,
} from '../../constants';
import WorkItemProjectsListbox from './work_item_projects_listbox.vue';
Expand Down Expand Up @@ -109,6 +110,9 @@ export default {
};
},
computed: {
workItemChildIsEpic() {
return this.childrenTypeName === WORK_ITEM_TYPE_VALUE_EPIC;
},
workItemInput() {
let workItemInput = {
title: this.search?.title || this.search,
Expand Down Expand Up @@ -199,7 +203,7 @@ export default {
},
canSubmitForm() {
if (this.isCreateForm) {
if (this.isGroup) {
if (this.isGroup && !this.workItemChildIsEpic) {
return this.search.length > 0 && this.selectedProject !== null;
}
return this.search.length > 0;
Expand Down Expand Up @@ -342,7 +346,7 @@ export default {
/>
</gl-form-group>
<gl-form-group
v-if="isGroup"
v-if="!workItemChildIsEpic"
class="gl-w-full"
:label="$options.i18n.projectInputLabel"
:description="$options.i18n.projectValidationMessage"
Expand All @@ -356,7 +360,6 @@ export default {
</gl-form-group>
</div>
<gl-form-checkbox
v-if="isCreateForm"
ref="confidentialityCheckbox"
v-model="confidential"
name="isConfidential"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { STORAGE_KEY } from '~/super_sidebar/constants';
import AccessorUtilities from '~/lib/utils/accessor';
import { getTopFrequentItems } from '~/super_sidebar/utils';
import groupProjectsForLinksWidgetQuery from '../../graphql/group_projects_for_links_widget.query.graphql';
import relatedProjectsForLinksWidgetQuery from '../../graphql/related_projects_for_links_widget.query.graphql';
import { SEARCH_DEBOUNCE, MAX_FREQUENT_PROJECTS } from '../../constants';
export default {
Expand Down Expand Up @@ -45,7 +46,7 @@ export default {
apollo: {
projects: {
query() {
return groupProjectsForLinksWidgetQuery;
return this.isGroup ? groupProjectsForLinksWidgetQuery : relatedProjectsForLinksWidgetQuery;
},
variables() {
return {
Expand All @@ -54,10 +55,7 @@ export default {
};
},
update(data) {
return data.group?.projects?.nodes;
},
skip() {
return !this.isGroup;
return this.isGroup ? data.group?.projects?.nodes : data.project?.group?.projects?.nodes;
},
debounce: SEARCH_DEBOUNCE,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
query relatedProjectsForLinksWidget($fullPath: ID!, $projectSearch: String) {
project(fullPath: $fullPath) {
id
group {
id
projects(search: $projectSearch, includeSubgroups: true) {
nodes {
id
name
avatarUrl
nameWithNamespace
fullPath
namespace {
id
name
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion app/mailers/emails/imports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def github_gists_import_errors_email(user_id, errors)
def bulk_import_complete(user_id, bulk_import_id)
user = User.find(user_id)
@bulk_import = BulkImport.find(bulk_import_id)
@bulk_import_entity = @bulk_import.entities.find_by(source_type: 'group_entity') # rubocop:disable CodeReuse/ActiveRecord -- Move this to BulkImport model
@bulk_import_entity = @bulk_import.parent_group_entity
@hostname = @bulk_import.configuration.url
@source_group = @bulk_import_entity.source_full_path
title = safe_format(
Expand Down
22 changes: 22 additions & 0 deletions app/models/bulk_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class BulkImport < ApplicationRecord
# rubocop:disable Style/SymbolProc
after_transition any => [:finished, :failed, :timeout] do |bulk_import|
bulk_import.update_has_failures

if Feature.enabled?(:notify_owners_of_finished_direct_transfer, bulk_import.user)
bulk_import.notify_owners_of_completion
end
end
# rubocop:enable Style/SymbolProc

Expand Down Expand Up @@ -100,4 +104,22 @@ def supports_batched_export?
def completed?
finished? || failed? || timeout? || canceled?
end

def notify_owners_of_completion
users_to_notify = parent_group_entity&.group&.owners

return if users_to_notify.blank?

users_to_notify.each do |owner|
run_after_commit do
Notify.bulk_import_complete(owner.id, id).deliver_later
end
end
end

# Finds the root group entity of the BulkImport's entity tree.
# @return [BulkImports::Entity, nil]
def parent_group_entity
entities.group_entity.where(parent: nil).first
end
end
2 changes: 1 addition & 1 deletion app/views/groups/_home_panel.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
.home-panel-description.text-break
.home-panel-description-markdown.read-more-container{ itemprop: 'description' }
= markdown_field(@group, :description)
= render Pajamas::ButtonComponent.new(variant: :link, button_options: { class: 'js-read-more-trigger gl-lg-display-none' }) do
= render Pajamas::ButtonComponent.new(variant: :link, button_options: { class: 'js-read-more-trigger lg:gl-hidden' }) do
= _("Read more")
4 changes: 2 additions & 2 deletions app/views/layouts/header/_logo_with_title.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%header.navbar.fixed-top.navbar-gitlab.justify-content-center
.gl-display-none.gl-lg-display-block
.gl-hidden.lg:gl-block
= render partial: 'shared/logo_with_white_text', formats: :svg
.gl-lg-display-none
.lg:gl-hidden
= render partial: 'shared/logo', formats: :svg
4 changes: 2 additions & 2 deletions app/views/search/_results_status.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.search-results-status.gl-sm-display-flex.gl-items-start.gl-justify-content-space-between.gl-my-4{ class: ('gl-lg-display-none' if @search_objects.to_a.empty?) }
.search-results-status.gl-sm-display-flex.gl-items-start.gl-justify-content-space-between.gl-my-4{ class: ('lg:gl-hidden' if @search_objects.to_a.empty?) }
- unless @search_objects.to_a.empty?
%div
- unless @search_service_presenter.without_count?
Expand All @@ -17,7 +17,7 @@
- link_to_group = link_to(@group.name, @group, class: 'ml-md-1')
= safe_format(_("in group %{link_to_group}"), link_to_group: link_to_group)
.gl-flex.gl-gap-3.gl-mt-3.gl-sm-mt-0
= render Pajamas::ButtonComponent.new(category: 'primary', icon: 'filter', button_options: {id: 'js-open-mobile-filters', class: 'gl-lg-display-none gl-flex-grow-1 gl-md-flex-grow-0'}) do
= render Pajamas::ButtonComponent.new(category: 'primary', icon: 'filter', button_options: {id: 'js-open-mobile-filters', class: 'lg:gl-hidden gl-flex-grow-1 gl-md-flex-grow-0'}) do
= s_('GlobalSearch|Filters')
- if @search_service_presenter.show_sort_dropdown? && !@search_objects.to_a.empty?
#js-search-sort{ data: { "search-sort-options" => search_sort_options.to_json }, class: "gl-flex-grow-1 gl-md-flex-grow-0" }
2 changes: 1 addition & 1 deletion app/views/search/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- page_card_attributes("Namespace" => @group&.full_path, "Project" => @project&.full_path)

#js-search-topbar{ data: { "default-branch-name": @project&.default_branch } }
.results.gl-lg-display-flex.gl-mt-0
.results.lg:gl-flex.gl-mt-0
#js-search-sidebar{ data: { navigation_json: search_navigation_json, search_type: search_service.search_type, search_level: search_service.level, group_initial_json: group_attributes.to_json, project_initial_json: project_attributes.to_json, } }
- if @search_term
= render 'search/results'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: notify_owners_of_finished_direct_transfer
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/458115
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155262
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/465487
milestone: '17.1'
group: group::import and integrate
type: gitlab_com_derisk
default_enabled: false
3 changes: 1 addition & 2 deletions db/docs/token_with_ivs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
table_name: token_with_ivs
classes:
- TokenWithIv
classes: []
feature_categories:
- system_access
description: TODO
Expand Down
Loading

0 comments on commit f4d5fa8

Please sign in to comment.