diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-13 03:06:53 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-13 03:06:53 +0000 |
commit | c0b9c14ebd1524a1e2334e656f997ec680a18966 (patch) | |
tree | 4437aea2c4239279131a56adca1679f636683d29 /app | |
parent | 98638cd5e43611aac2193a5c2f80f72374040430 (diff) | |
download | gitlab-ce-c0b9c14ebd1524a1e2334e656f997ec680a18966.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
42 files changed, 211 insertions, 131 deletions
diff --git a/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue b/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue index b78224e93b0..66957365261 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue @@ -10,6 +10,7 @@ export default { browseTemplates: __('Browse templates'), help: __('Help'), jobAssistant: s__('JobAssistant|Job assistant'), + aiAssistant: s__('PipelinesAiAssistant|Ai assistant'), }, TEMPLATE_REPOSITORY_URL, components: { @@ -25,6 +26,10 @@ export default { type: Boolean, required: true, }, + showAiAssistantDrawer: { + type: Boolean, + required: true, + }, }, methods: { toggleDrawer() { @@ -40,6 +45,11 @@ export default { this.showJobAssistantDrawer ? 'close-job-assistant-drawer' : 'open-job-assistant-drawer', ); }, + toggleAiAssistantDrawer() { + this.$emit( + this.showAiAssistantDrawer ? 'close-ai-assistant-drawer' : 'open-ai-assistant-drawer', + ); + }, trackHelpDrawerClick() { const { label, actions } = pipelineEditorTrackingOptions; this.track(actions.openHelpDrawer, { label }); @@ -85,5 +95,15 @@ export default { > {{ $options.i18n.jobAssistant }} </gl-button> + <gl-button + v-if="glFeatures.aiCiConfigGenerator" + icon="bulb" + size="small" + data-testid="ai-assistant-drawer-toggle" + data-qa-selector="ai_assistant_drawer_toggle" + @click="toggleAiAssistantDrawer" + > + {{ $options.i18n.aiAssistant }} + </gl-button> </div> </template> diff --git a/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue b/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue index e965ac12aa5..403793a255a 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue @@ -99,6 +99,10 @@ export default { type: Boolean, required: true, }, + showAiAssistantDrawer: { + type: Boolean, + required: true, + }, }, apollo: { appStatus: { @@ -194,6 +198,7 @@ export default { <ci-editor-header :show-drawer="showDrawer" :show-job-assistant-drawer="showJobAssistantDrawer" + :show-ai-assistant-drawer="showAiAssistantDrawer" v-on="$listeners" /> <text-editor :commit-sha="commitSha" :value="ciFileContent" v-on="$listeners" /> diff --git a/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_home.vue b/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_home.vue index 1329042ee4c..647e33333ce 100644 --- a/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_home.vue +++ b/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_home.vue @@ -1,6 +1,7 @@ <script> import { GlModal } from '@gitlab/ui'; import { __ } from '~/locale'; +import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import CommitSection from './components/commit/commit_section.vue'; import PipelineEditorDrawer from './components/drawer/pipeline_editor_drawer.vue'; import JobAssistantDrawer from './components/job_assistant_drawer/job_assistant_drawer.vue'; @@ -10,6 +11,9 @@ import PipelineEditorHeader from './components/header/pipeline_editor_header.vue import PipelineEditorTabs from './components/pipeline_editor_tabs.vue'; import { CREATE_TAB, FILE_TREE_DISPLAY_KEY } from './constants'; +const AiAssistantDrawer = () => + import('ee_component/ci/pipeline_editor/components/ai_assistant_drawer.vue'); + export default { commitSectionRef: 'commitSectionRef', modal: { @@ -30,11 +34,13 @@ export default { GlModal, PipelineEditorDrawer, JobAssistantDrawer, + AiAssistantDrawer, PipelineEditorFileNav, PipelineEditorFileTree, PipelineEditorHeader, PipelineEditorTabs, }, + mixins: [glFeatureFlagMixin()], props: { ciConfigData: { type: Object, @@ -66,8 +72,10 @@ export default { shouldLoadNewBranch: false, showDrawer: false, showJobAssistantDrawer: false, + showAiAssistantDrawer: false, drawerIndex: 200, jobAssistantIndex: 200, + aiAssistantIndex: 200, showFileTree: false, showSwitchBranchModal: false, }; @@ -93,6 +101,13 @@ export default { closeJobAssistantDrawer() { this.showJobAssistantDrawer = false; }, + closeAiAssistantDrawer() { + this.showAiAssistantDrawer = false; + }, + openAiAssistantDrawer() { + this.showAiAssistantDrawer = true; + this.aiAssistantIndex = this.drawerIndex + 1; + }, handleConfirmSwitchBranch() { this.showSwitchBranchModal = true; }, @@ -167,11 +182,14 @@ export default { :is-new-ci-config-file="isNewCiConfigFile" :show-drawer="showDrawer" :show-job-assistant-drawer="showJobAssistantDrawer" + :show-ai-assistant-drawer="showAiAssistantDrawer" v-on="$listeners" @open-drawer="openDrawer" @close-drawer="closeDrawer" @open-job-assistant-drawer="openJobAssistantDrawer" @close-job-assistant-drawer="closeJobAssistantDrawer" + @open-ai-assistant-drawer="openAiAssistantDrawer" + @close-ai-assistant-drawer="closeAiAssistantDrawer" @set-current-tab="setCurrentTab" @walkthrough-popover-cta-clicked="setScrollToCommitForm" /> @@ -202,5 +220,11 @@ export default { v-on="$listeners" @close-job-assistant-drawer="closeJobAssistantDrawer" /> + <ai-assistant-drawer + v-if="glFeatures.aiCiConfigGenerator" + :is-visible="showAiAssistantDrawer" + :z-index="aiAssistantIndex" + @close-ai-assistant-drawer="closeAiAssistantDrawer" + /> </div> </template> diff --git a/app/assets/javascripts/ci/runner/components/cells/runner_summary_cell.vue b/app/assets/javascripts/ci/runner/components/cells/runner_summary_cell.vue index 24c1b4f5c3b..f24fb5575ae 100644 --- a/app/assets/javascripts/ci/runner/components/cells/runner_summary_cell.vue +++ b/app/assets/javascripts/ci/runner/components/cells/runner_summary_cell.vue @@ -71,7 +71,7 @@ export default { <template> <div> - <div> + <div class="gl-mb-3"> <slot :runner="runner" name="runner-name"> <runner-name :runner="runner" /> </slot> @@ -84,22 +84,23 @@ export default { <runner-type-badge :type="runner.runnerType" size="sm" class="gl-vertical-align-middle" /> </div> - <div class="gl-ml-auto gl-display-inline-flex gl-max-w-full gl-py-2"> - <div class="gl-flex-shrink-0"> - <runner-upgrade-status-icon :runner="runner" /> - <gl-sprintf v-if="runner.version" :message="$options.i18n.I18N_VERSION_LABEL"> - <template #version>{{ runner.version }}</template> - </gl-sprintf> - </div> - <div class="gl-text-secondary gl-mx-2" aria-hidden="true">·</div> + <div class="gl-mb-3 gl-ml-auto gl-display-inline-flex gl-max-w-full"> + <template v-if="runner.version"> + <div class="gl-flex-shrink-0"> + <runner-upgrade-status-icon :runner="runner" /> + <gl-sprintf :message="$options.i18n.I18N_VERSION_LABEL"> + <template #version>{{ runner.version }}</template> + </gl-sprintf> + </div> + <div class="gl-text-secondary gl-mx-2" aria-hidden="true">·</div> + </template> <tooltip-on-truncate - v-if="runner.description" class="gl-text-truncate gl-display-block" + :class="{ 'gl-text-secondary': !runner.description }" :title="runner.description" > - {{ runner.description }} + {{ runner.description || $options.i18n.I18N_NO_DESCRIPTION }} </tooltip-on-truncate> - <span v-else class="gl-text-secondary">{{ $options.i18n.I18N_NO_DESCRIPTION }}</span> </div> <div> @@ -148,6 +149,6 @@ export default { </runner-summary-field> </div> - <runner-tags class="gl-display-block gl-pt-2" :tag-list="runner.tagList" size="sm" /> + <runner-tags class="gl-display-block" :tag-list="runner.tagList" size="sm" /> </div> </template> diff --git a/app/assets/javascripts/ci/runner/components/cells/runner_summary_field.vue b/app/assets/javascripts/ci/runner/components/cells/runner_summary_field.vue index 20681873436..742259ee491 100644 --- a/app/assets/javascripts/ci/runner/components/cells/runner_summary_field.vue +++ b/app/assets/javascripts/ci/runner/components/cells/runner_summary_field.vue @@ -24,7 +24,7 @@ export default { </script> <template> - <div v-gl-tooltip="tooltip" class="gl-display-inline-block gl-text-secondary gl-my-2 gl-mr-4"> + <div v-gl-tooltip="tooltip" class="gl-display-inline-block gl-text-secondary gl-mb-3 gl-mr-4"> <gl-icon v-if="icon" :name="icon" /> <!-- display tooltip as a label for screen readers --> <span class="gl-sr-only">{{ tooltip }}</span> diff --git a/app/assets/javascripts/commit/pipelines/pipelines_table.vue b/app/assets/javascripts/commit/pipelines/pipelines_table.vue index b0a1c46e619..f2dac15a99e 100644 --- a/app/assets/javascripts/commit/pipelines/pipelines_table.vue +++ b/app/assets/javascripts/commit/pipelines/pipelines_table.vue @@ -234,6 +234,7 @@ export default { <template v-else-if="shouldRenderEmptyState"> <gl-empty-state :svg-path="emptyStateSvgPath" + :svg-height="150" :title="$options.i18n.emptyStateTitle" data-testid="pipeline-empty-state" > diff --git a/app/assets/javascripts/environments/components/empty_state.vue b/app/assets/javascripts/environments/components/empty_state.vue index e40c37b5095..3ac32f0d045 100644 --- a/app/assets/javascripts/environments/components/empty_state.vue +++ b/app/assets/javascripts/environments/components/empty_state.vue @@ -1,12 +1,13 @@ <script> -import { GlEmptyState, GlLink } from '@gitlab/ui'; +import { GlButton, GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui'; import { s__ } from '~/locale'; -import { ENVIRONMENTS_SCOPE } from '../constants'; export default { components: { + GlButton, GlEmptyState, GlLink, + GlSprintf, }, inject: ['newEnvironmentPath'], props: { @@ -14,10 +15,6 @@ export default { type: String, required: true, }, - scope: { - type: String, - required: true, - }, hasTerm: { type: Boolean, required: false, @@ -26,40 +23,40 @@ export default { }, computed: { title() { - return this.hasTerm - ? this.$options.i18n.searchingTitle - : this.$options.i18n.title[this.scope]; + return this.hasTerm ? this.$options.i18n.searchingTitle : this.$options.i18n.title; }, content() { return this.hasTerm ? this.$options.i18n.searchingContent : this.$options.i18n.content; }, - buttonText() { - return this.hasTerm ? this.$options.i18n.newEnvironmentButtonLabel : ''; - }, }, i18n: { - title: { - [ENVIRONMENTS_SCOPE.AVAILABLE]: s__("Environments|You don't have any environments."), - [ENVIRONMENTS_SCOPE.STOPPED]: s__("Environments|You don't have any stopped environments."), - }, - content: s__( - 'Environments|Environments are places where code gets deployed, such as staging or production.', - ), searchingTitle: s__('Environments|No results found'), + title: s__('Environments|Get started with environments'), searchingContent: s__('Environments|Edit your search and try again'), - link: s__('Environments|How do I create an environment?'), - newEnvironmentButtonLabel: s__('Environments|New environment'), + content: s__( + 'Environments|Environments are places where code gets deployed, such as staging or production. You can create an environment in the UI or in your .gitlab-ci.yml file. You can also enable review apps, which assist with providing an environment to showcase product changes. %{linkStart}Learn more%{linkEnd} about environments.', + ), + newEnvironmentButtonLabel: s__('Environments|Create an environment'), + enablingReviewButtonLabel: s__('Environments|Enable review apps'), }, }; </script> <template> - <gl-empty-state :primary-button-text="buttonText" :primary-button-link="newEnvironmentPath"> - <template #title> - <h4>{{ title }}</h4> - </template> + <gl-empty-state class="gl-layout-w-limited" :title="title"> <template #description> - <p>{{ content }}</p> - <gl-link v-if="!hasTerm" :href="helpPath">{{ $options.i18n.link }}</gl-link> + <gl-sprintf :message="content"> + <template #link="{ content: contentToDisplay }"> + <gl-link :href="helpPath">{{ contentToDisplay }}</gl-link> + </template> + </gl-sprintf> + </template> + <template v-if="!hasTerm" #actions> + <gl-button :href="newEnvironmentPath" variant="confirm"> + {{ $options.i18n.newEnvironmentButtonLabel }} + </gl-button> + <gl-button @click="$emit('enable-review')"> + {{ $options.i18n.enablingReviewButtonLabel }} + </gl-button> </template> </gl-empty-state> </template> diff --git a/app/assets/javascripts/environments/components/environments_app.vue b/app/assets/javascripts/environments/components/environments_app.vue index b2a69cdb6c6..a95b5b273f7 100644 --- a/app/assets/javascripts/environments/components/environments_app.vue +++ b/app/assets/javascripts/environments/components/environments_app.vue @@ -76,7 +76,7 @@ export default { inject: ['newEnvironmentPath', 'canCreateEnvironment', 'helpPagePath'], i18n: { newEnvironmentButtonLabel: s__('Environments|New environment'), - reviewAppButtonLabel: s__('Environments|Enable review app'), + reviewAppButtonLabel: s__('Environments|Enable review apps'), cleanUpEnvsButtonLabel: s__('Environments|Clean up environments'), available: __('Available'), stopped: __('Stopped'), @@ -124,12 +124,24 @@ export default { hasEnvironments() { return this.environments.length > 0 || this.folders.length > 0; }, + showEmptyState() { + return !this.$apollo.queries.environmentApp.loading && !this.hasEnvironments; + }, hasSearch() { return Boolean(this.search); }, availableCount() { return this.environmentApp?.availableCount; }, + stoppedCount() { + return this.environmentApp?.stoppedCount; + }, + hasAnyEnvironment() { + return this.availableCount > 0 || this.stoppedCount > 0; + }, + showContent() { + return this.hasAnyEnvironment || this.hasSearch; + }, addEnvironment() { if (!this.canCreateEnvironment) { return null; @@ -170,9 +182,6 @@ export default { }, }; }, - stoppedCount() { - return this.environmentApp?.stoppedCount; - }, totalItems() { return this.pageInfo?.total; }, @@ -253,45 +262,45 @@ export default { <stop-environment-modal :environment="environmentToStop" graphql /> <confirm-rollback-modal :environment="environmentToRollback" graphql /> <canary-update-modal :environment="environmentToChangeCanary" :weight="weight" /> - <gl-tabs - :action-secondary="openReviewAppModal" - :action-primary="openCleanUpEnvsModal" - :action-tertiary="addEnvironment" - sync-active-tab-with-query-params - query-param-name="scope" - @secondary="showReviewAppModal" - @primary="showCleanUpEnvsModal" - > - <gl-tab - :query-param-value="$options.ENVIRONMENTS_SCOPE.AVAILABLE" - @click="setScope($options.ENVIRONMENTS_SCOPE.AVAILABLE)" + <template v-if="showContent"> + <gl-tabs + :action-secondary="openReviewAppModal" + :action-primary="openCleanUpEnvsModal" + :action-tertiary="addEnvironment" + sync-active-tab-with-query-params + query-param-name="scope" + @secondary="showReviewAppModal" + @primary="showCleanUpEnvsModal" > - <template #title> - <span>{{ $options.i18n.available }}</span> - <gl-badge size="sm" class="gl-tab-counter-badge"> - {{ availableCount }} - </gl-badge> - </template> - </gl-tab> - <gl-tab - :query-param-value="$options.ENVIRONMENTS_SCOPE.STOPPED" - @click="setScope($options.ENVIRONMENTS_SCOPE.STOPPED)" - > - <template #title> - <span>{{ $options.i18n.stopped }}</span> - <gl-badge size="sm" class="gl-tab-counter-badge"> - {{ stoppedCount }} - </gl-badge> - </template> - </gl-tab> - </gl-tabs> - <gl-search-box-by-type - class="gl-mb-4" - :value="search" - :placeholder="$options.i18n.searchPlaceholder" - @input="setSearch" - /> - <template v-if="hasEnvironments"> + <gl-tab + :query-param-value="$options.ENVIRONMENTS_SCOPE.AVAILABLE" + @click="setScope($options.ENVIRONMENTS_SCOPE.AVAILABLE)" + > + <template #title> + <span>{{ $options.i18n.available }}</span> + <gl-badge size="sm" class="gl-tab-counter-badge"> + {{ availableCount }} + </gl-badge> + </template> + </gl-tab> + <gl-tab + :query-param-value="$options.ENVIRONMENTS_SCOPE.STOPPED" + @click="setScope($options.ENVIRONMENTS_SCOPE.STOPPED)" + > + <template #title> + <span>{{ $options.i18n.stopped }}</span> + <gl-badge size="sm" class="gl-tab-counter-badge"> + {{ stoppedCount }} + </gl-badge> + </template> + </gl-tab> + </gl-tabs> + <gl-search-box-by-type + class="gl-mb-4" + :value="search" + :placeholder="$options.i18n.searchPlaceholder" + @input="setSearch" + /> <environment-folder v-for="folder in folders" :key="folder.name" @@ -309,10 +318,10 @@ export default { /> </template> <empty-state - v-else-if="!$apollo.queries.environmentApp.loading" + v-if="showEmptyState" :help-path="helpPagePath" - :scope="scope" :has-term="hasSearch" + @enable-review="showReviewAppModal" /> <gl-pagination align="center" diff --git a/app/assets/javascripts/environments/constants.js b/app/assets/javascripts/environments/constants.js index e675a73ba7d..448cee530f6 100644 --- a/app/assets/javascripts/environments/constants.js +++ b/app/assets/javascripts/environments/constants.js @@ -51,7 +51,7 @@ export const ENVIRONMENT_COUNT_BY_SCOPE = { }; export const REVIEW_APP_MODAL_I18N = { - title: s__('ReviewApp|Enable Review App'), + title: s__('Environments|Enable Review Apps'), intro: s__( 'EnableReviewApp|Review apps are dynamic environments that you can use to provide a live preview of changes made in a feature branch.', ), diff --git a/app/assets/javascripts/google_tag_manager/index.js b/app/assets/javascripts/google_tag_manager/index.js index 98c9db1fc9a..0a1a7a74d21 100644 --- a/app/assets/javascripts/google_tag_manager/index.js +++ b/app/assets/javascripts/google_tag_manager/index.js @@ -123,17 +123,6 @@ export const trackSaasTrialSubmit = () => { pushEvent('saasTrialSubmit'); }; -export const trackSaasTrialSkip = () => { - if (!isSupported()) { - return; - } - - const skipLink = document.querySelector('.js-skip-trial'); - skipLink.addEventListener('click', () => { - pushEvent('saasTrialSkip'); - }); -}; - export const trackSaasTrialGroup = () => { if (!isSupported()) { return; diff --git a/app/assets/javascripts/ide/components/pipelines/empty_state.vue b/app/assets/javascripts/ide/components/pipelines/empty_state.vue index 194deb2ece0..25e1698e3f4 100644 --- a/app/assets/javascripts/ide/components/pipelines/empty_state.vue +++ b/app/assets/javascripts/ide/components/pipelines/empty_state.vue @@ -28,6 +28,7 @@ export default { <gl-empty-state :title="$options.i18n.title" :svg-path="pipelinesEmptyStateSvgPath" + :svg-height="150" :description="$options.i18n.description" :primary-button-text="$options.i18n.primaryButtonText" :primary-button-link="ciHelpPagePath" diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js index f33484f4192..7bf34dbaa2e 100644 --- a/app/assets/javascripts/lib/utils/url_utility.js +++ b/app/assets/javascripts/lib/utils/url_utility.js @@ -5,8 +5,11 @@ const PATH_SEPARATOR_LEADING_REGEX = new RegExp(`^${PATH_SEPARATOR}+`); const PATH_SEPARATOR_ENDING_REGEX = new RegExp(`${PATH_SEPARATOR}+$`); const SHA_REGEX = /[\da-f]{40}/gi; +// GitLab default domain (override in jh) +export const DOMAIN = 'gitlab.com'; + // About GitLab default host (overwrite in jh) -export const PROMO_HOST = 'about.gitlab.com'; +export const PROMO_HOST = `about.${DOMAIN}`; // about.gitlab.com // About Gitlab default url (overwrite in jh) export const PROMO_URL = `https://${PROMO_HOST}`; diff --git a/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue b/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue index a0d2b47c89c..1dd07fe90d2 100644 --- a/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue +++ b/app/assets/javascripts/notes/components/discussion_notes_replies_wrapper.vue @@ -21,7 +21,7 @@ export default { 'li', { class: - 'discussion-collapsible gl-border-solid gl-border-gray-100 gl-border-1 gl-rounded-base clearfix gl-pt-5', + 'discussion-collapsible gl-border-solid gl-border-gray-100 gl-border-1 gl-rounded-base clearfix', }, [h('ul', { class: 'notes' }, children)], ); diff --git a/app/assets/javascripts/super_sidebar/components/help_center.vue b/app/assets/javascripts/super_sidebar/components/help_center.vue index caefeaa5eb4..1fffbb05d03 100644 --- a/app/assets/javascripts/super_sidebar/components/help_center.vue +++ b/app/assets/javascripts/super_sidebar/components/help_center.vue @@ -8,7 +8,7 @@ import { } from '@gitlab/ui'; import GitlabVersionCheckBadge from '~/gitlab_version_check/components/gitlab_version_check_badge.vue'; import { helpPagePath } from '~/helpers/help_page_helper'; -import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility'; +import { DOMAIN, PROMO_URL } from 'jh_else_ce/lib/utils/url_utility'; import { __, s__ } from '~/locale'; import { STORAGE_KEY } from '~/whats_new/utils/notification'; import Tracking from '~/tracking'; @@ -93,7 +93,7 @@ export default { }, { text: this.$options.i18n.docs, - href: 'https://docs.gitlab.com', + href: `https://docs.${DOMAIN}`, extraAttrs: { ...this.trackingAttrs('gitlab_documentation'), }, @@ -107,7 +107,7 @@ export default { }, { text: this.$options.i18n.forum, - href: 'https://forum.gitlab.com/', + href: `https://forum.${DOMAIN}/`, extraAttrs: { ...this.trackingAttrs('community_forum'), }, @@ -121,7 +121,7 @@ export default { }, { text: this.$options.i18n.feedback, - href: 'https://about.gitlab.com/submit-feedback', + href: `${PROMO_URL}/submit-feedback`, extraAttrs: { ...this.trackingAttrs('submit_feedback'), }, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/nothing_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/nothing_to_merge.vue index e6a0b5fd8be..30cd9fa752f 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/nothing_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/nothing_to_merge.vue @@ -1,6 +1,6 @@ <script> import { GlButton, GlSprintf, GlLink } from '@gitlab/ui'; -import EMPTY_STATE_SVG_URL from '@gitlab/svgs/dist/illustrations/merge_requests.svg?url'; +import EMPTY_STATE_SVG_URL from '@gitlab/svgs/dist/illustrations/empty-state/empty-merge-requests-md.svg?url'; import api from '~/api'; import { helpPagePath } from '~/helpers/help_page_helper'; @@ -31,14 +31,14 @@ export default { <div class="mr-widget-body mr-widget-empty-state"> <div class="row"> <div - class="col-md-5 order-md-last col-12 text-center d-flex justify-content-center align-items-center svg-content svg-250 pb-0" + class="col-md-3 col-12 text-center d-flex justify-content-center align-items-center svg-content svg-150 pb-0 pt-0" > <img :alt="s__('mrWidgetNothingToMerge|This merge request contains no changes.')" :src="$options.EMPTY_STATE_SVG_URL" /> </div> - <div class="text col-md-7 order-md-first col-12"> + <div class="text col-md-9 col-12"> <p class="highlight"> {{ s__('mrWidgetNothingToMerge|This merge request contains no changes.') }} </p> diff --git a/app/controllers/jira_connect/branches_controller.rb b/app/controllers/jira_connect/branches_controller.rb index 12ea6560e3a..4c1b0d2b208 100644 --- a/app/controllers/jira_connect/branches_controller.rb +++ b/app/controllers/jira_connect/branches_controller.rb @@ -23,7 +23,8 @@ class JiraConnect::BranchesController < ApplicationController def new_branch_data { initial_branch_name: initial_branch_name, - success_state_svg_path: ActionController::Base.helpers.image_path('illustrations/merge_requests.svg') + success_state_svg_path: + ActionController::Base.helpers.image_path('illustrations/empty-state/empty-merge-requests-md.svg') } end end diff --git a/app/controllers/projects/ci/pipeline_editor_controller.rb b/app/controllers/projects/ci/pipeline_editor_controller.rb index 45584f3048a..d874c60daec 100644 --- a/app/controllers/projects/ci/pipeline_editor_controller.rb +++ b/app/controllers/projects/ci/pipeline_editor_controller.rb @@ -4,6 +4,7 @@ class Projects::Ci::PipelineEditorController < Projects::ApplicationController before_action :check_can_collaborate! before_action do push_frontend_feature_flag(:ci_job_assistant_drawer, @project) + push_frontend_feature_flag(:ai_ci_config_generator, @project) end feature_category :pipeline_composition diff --git a/app/controllers/projects/google_cloud/configuration_controller.rb b/app/controllers/projects/google_cloud/configuration_controller.rb index e109ab95d39..d35b2d54c53 100644 --- a/app/controllers/projects/google_cloud/configuration_controller.rb +++ b/app/controllers/projects/google_cloud/configuration_controller.rb @@ -10,7 +10,8 @@ module Projects databasesUrl: project_google_cloud_databases_path(project), serviceAccounts: ::GoogleCloud::ServiceAccountsService.new(project).find_for_project, createServiceAccountUrl: project_google_cloud_service_accounts_path(project), - emptyIllustrationUrl: ActionController::Base.helpers.image_path('illustrations/pipelines_empty.svg'), + emptyIllustrationUrl: + ActionController::Base.helpers.image_path('illustrations/empty-state/empty-pipeline-md.svg'), configureGcpRegionsUrl: project_google_cloud_gcp_regions_path(project), gcpRegions: gcp_regions, revokeOauthUrl: revoke_oauth_url diff --git a/app/controllers/projects/google_cloud/databases_controller.rb b/app/controllers/projects/google_cloud/databases_controller.rb index 9c20f10809c..ea79efd9f4f 100644 --- a/app/controllers/projects/google_cloud/databases_controller.rb +++ b/app/controllers/projects/google_cloud/databases_controller.rb @@ -15,7 +15,8 @@ module Projects cloudsqlMysqlUrl: new_project_google_cloud_database_path(project, :mysql), cloudsqlSqlserverUrl: new_project_google_cloud_database_path(project, :sqlserver), cloudsqlInstances: ::GoogleCloud::GetCloudsqlInstancesService.new(project).execute, - emptyIllustrationUrl: ActionController::Base.helpers.image_path('illustrations/pipelines_empty.svg') + emptyIllustrationUrl: + ActionController::Base.helpers.image_path('illustrations/empty-state/empty-pipeline-md.svg') } @js_data = Gitlab::Json.dump(js_data) diff --git a/app/helpers/ci/pipelines_helper.rb b/app/helpers/ci/pipelines_helper.rb index 90c89f04dc7..6b15f0c9e20 100644 --- a/app/helpers/ci/pipelines_helper.rb +++ b/app/helpers/ci/pipelines_helper.rb @@ -91,7 +91,7 @@ module Ci artifacts_endpoint: downloadable_artifacts_project_pipeline_path(project, artifacts_endpoint_placeholder, format: :json), artifacts_endpoint_placeholder: artifacts_endpoint_placeholder, pipeline_schedule_url: pipeline_schedules_path(project), - empty_state_svg_path: image_path('illustrations/pipelines_empty.svg'), + empty_state_svg_path: image_path('illustrations/empty-state/empty-pipeline-md.svg'), error_state_svg_path: image_path('illustrations/pipelines_failed.svg'), no_pipelines_svg_path: image_path('illustrations/pipelines_pending.svg'), can_create_pipeline: can?(current_user, :create_pipeline, project).to_s, diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb index b2ae1386727..b1d61474700 100644 --- a/app/helpers/clusters_helper.rb +++ b/app/helpers/clusters_helper.rb @@ -64,7 +64,11 @@ module ClustersHelper when 'apps' render 'applications' when 'integrations' - render 'integrations' + if Feature.enabled?(:remove_monitor_metrics) + render('details', expanded: expanded) + else + render 'integrations' + end when 'settings' render 'advanced_settings_container' else diff --git a/app/helpers/ide_helper.rb b/app/helpers/ide_helper.rb index 0112dc6a35e..448909543c4 100644 --- a/app/helpers/ide_helper.rb +++ b/app/helpers/ide_helper.rb @@ -43,7 +43,7 @@ module IdeHelper 'empty-state-svg-path' => image_path('illustrations/multi_file_editor_empty.svg'), 'no-changes-state-svg-path' => image_path('illustrations/multi-editor_no_changes_empty.svg'), 'committed-state-svg-path' => image_path('illustrations/multi-editor_all_changes_committed_empty.svg'), - 'pipelines-empty-state-svg-path': image_path('illustrations/pipelines_empty.svg'), + 'pipelines-empty-state-svg-path': image_path('illustrations/empty-state/empty-pipeline-md.svg'), 'switch-editor-svg-path': image_path('illustrations/rocket-launch-md.svg'), 'promotion-svg-path': image_path('illustrations/web-ide_promotion.svg'), 'ci-help-page-path' => help_page_path('ci/quick_start/index'), diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb index d35778046da..55b1aff51da 100644 --- a/app/models/abuse_report.rb +++ b/app/models/abuse_report.rb @@ -208,3 +208,5 @@ class AbuseReport < ApplicationRecord ) end end + +AbuseReport.prepend_mod diff --git a/app/models/ci/trigger.rb b/app/models/ci/trigger.rb index 0cfe2d50283..58da1b4bd7e 100644 --- a/app/models/ci/trigger.rb +++ b/app/models/ci/trigger.rb @@ -8,7 +8,7 @@ module Ci TRIGGER_TOKEN_PREFIX = 'glptt-' - ignore_column :ref, remove_with: '15.4', remove_after: '2022-08-22' + ignore_column :ref, remove_with: '16.1', remove_after: '2023-05-22' self.limit_name = 'pipeline_triggers' self.limit_scope = :project diff --git a/app/models/user_custom_attribute.rb b/app/models/user_custom_attribute.rb index 91aa6cfa9dc..9a186cb9038 100644 --- a/app/models/user_custom_attribute.rb +++ b/app/models/user_custom_attribute.rb @@ -14,6 +14,7 @@ class UserCustomAttribute < ApplicationRecord BLOCKED_BY = 'blocked_by' UNBLOCKED_BY = 'unblocked_by' ARKOSE_RISK_BAND = 'arkose_risk_band' + AUTO_BANNED_BY_ABUSE_REPORT_ID = 'auto_banned_by_abuse_report_id' class << self def upsert_custom_attributes(custom_attributes) diff --git a/app/policies/base_policy.rb b/app/policies/base_policy.rb index 7c745c5731f..d6aaa3e983d 100644 --- a/app/policies/base_policy.rb +++ b/app/policies/base_policy.rb @@ -35,6 +35,10 @@ class BasePolicy < DeclarativePolicy::Base with_options scope: :user, score: 0 condition(:security_bot) { @user&.security_bot? } + desc "User is security policy bot" + with_options scope: :user, score: 0 + condition(:security_policy_bot) { @user&.security_policy_bot? } + desc "User is automation bot" with_options scope: :user, score: 0 condition(:automation_bot) { @user&.automation_bot? } diff --git a/app/policies/concerns/policy_actor.rb b/app/policies/concerns/policy_actor.rb index 8fa09683b06..e000f1514e5 100644 --- a/app/policies/concerns/policy_actor.rb +++ b/app/policies/concerns/policy_actor.rb @@ -53,6 +53,10 @@ module PolicyActor false end + def security_policy_bot? + false + end + def automation_bot? false end diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb index 3e5a1a356ad..b96ad9a73c8 100644 --- a/app/policies/global_policy.rb +++ b/app/policies/global_policy.rb @@ -62,10 +62,14 @@ class GlobalPolicy < BasePolicy rule { ~can?(:access_api) }.prevent :execute_graphql_mutation - rule { blocked | (internal & ~migration_bot & ~security_bot) }.policy do + rule { blocked | (internal & ~migration_bot & ~security_bot & ~security_policy_bot) }.policy do prevent :access_git end + rule { security_policy_bot }.policy do + enable :access_git + end + rule { project_bot | service_account }.policy do prevent :log_in prevent :receive_notifications diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index c963b364e4a..47d8d0eef3e 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -38,6 +38,9 @@ class ProjectPolicy < BasePolicy desc "User is a project bot" condition(:project_bot) { user.project_bot? && team_member? } + desc "User is a security policy bot on the project" + condition(:security_policy_bot) { user&.security_policy_bot? && team_member? } + desc "Project is public" condition(:public_project, scope: :subject, score: 0) { project.public? } diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml index bfeb0d3d7f0..19ca9407513 100644 --- a/app/views/clusters/clusters/show.html.haml +++ b/app/views/clusters/clusters/show.html.haml @@ -33,7 +33,7 @@ = render 'clusters/clusters/details_tab' = render_if_exists 'clusters/clusters/environments_tab' = render 'clusters/clusters/health_tab' if !Feature.enabled?(:remove_monitor_metrics) - = render 'clusters/clusters/integrations_tab' + = render 'clusters/clusters/integrations_tab' if !Feature.enabled?(:remove_monitor_metrics) = render 'clusters/clusters/advanced_settings_tab' .tab-content.py-3 diff --git a/app/views/explore/projects/page_out_of_bounds.html.haml b/app/views/explore/projects/page_out_of_bounds.html.haml index 1b65cdb0c56..dc92787a41f 100644 --- a/app/views/explore/projects/page_out_of_bounds.html.haml +++ b/app/views/explore/projects/page_out_of_bounds.html.haml @@ -3,7 +3,7 @@ .nothing-here-block .svg-content - = image_tag 'illustrations/profile-page/personal-project.svg', size: '75' + = image_tag 'illustrations/empty-state/empty-projects-md.svg', size: '75' .text-content %h5= _("Maximum page reached") %p= _("Sorry, you have exceeded the maximum browsable page number. Please use the API to explore further.") diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 8d7a7dd6b1b..e42f524467d 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -7,7 +7,7 @@ - if show_invite_banner?(@group) = content_for :group_invite_members_banner do .container-fluid.container-limited{ class: "gl-pb-2! gl-pt-6! #{@content_class}" } - .js-group-invite-members-banner{ data: { svg_path: image_path('illustrations/merge_requests.svg'), + .js-group-invite-members-banner{ data: { svg_path: image_path('illustrations/empty-state/empty-merge-requests-md.svg'), track_label: 'invite_members_banner', invite_members_path: group_group_members_path(@group), callouts_path: group_callouts_path, diff --git a/app/views/projects/commit/_pipelines_list.haml b/app/views/projects/commit/_pipelines_list.haml index dd7b5eae80e..f7ae462e8f9 100644 --- a/app/views/projects/commit/_pipelines_list.haml +++ b/app/views/projects/commit/_pipelines_list.haml @@ -4,7 +4,7 @@ #commit-pipeline-table-view{ data: { disable_initialization: disable_initialization, endpoint: endpoint, full_path: @project.full_path, - "empty-state-svg-path" => image_path('illustrations/pipelines_empty.svg'), + "empty-state-svg-path" => image_path('illustrations/empty-state/empty-pipeline-md.svg'), "error-state-svg-path" => image_path('illustrations/pipelines_failed.svg'), "project-id": @project.id, "artifacts-endpoint" => downloadable_artifacts_project_pipeline_path(@project, artifacts_endpoint_placeholder, format: :json), diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index de7f976717b..11c36b5ea6d 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -1,5 +1,6 @@ -- breadcrumb_title _("Environments") -- page_title _("New Environment") +- add_to_breadcrumbs s_("Environments|Environments"), project_environments_path(@project) +- breadcrumb_title s_("Environments|New") +- page_title s_("Environments|New Environment") - add_page_specific_style 'page_bundles/environments' #js-new-environment{ data: { project_environments_path: project_environments_path(@project) } } diff --git a/app/views/projects/find_file/show.html.haml b/app/views/projects/find_file/show.html.haml index 1d4e907dd61..afb49c48146 100644 --- a/app/views/projects/find_file/show.html.haml +++ b/app/views/projects/find_file/show.html.haml @@ -17,8 +17,8 @@ %table.table.files-slider{ class: "table_#{@hex_path} tree-table" } %tbody .col-12.empty-state.hidden - .svg-250.svg-content - = image_tag('illustrations/profile-page/personal-projects.svg', alt: 'No files svg', lazy: true) + .svg-150.svg-content + = image_tag('illustrations/empty-state/empty-search-md.svg', alt: 'No files svg', lazy: true) .text-center %h4 = _('There are no matching files') diff --git a/app/views/projects/merge_requests/_widget.html.haml b/app/views/projects/merge_requests/_widget.html.haml index e097d25802e..576fed58609 100644 --- a/app/views/projects/merge_requests/_widget.html.haml +++ b/app/views/projects/merge_requests/_widget.html.haml @@ -16,7 +16,7 @@ window.gl.mrWidgetData.license_compliance_docs_path = '#{help_page_path('user/compliance/license_compliance/index.md')}'; window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/approvals/rules.md', anchor: 'eligible-approvers')}'; window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/approvals/index.md")}'; - window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}'; + window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/empty-state/empty-pipeline-md.svg')}'; window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; window.gl.mrWidgetData.false_positive_doc_url = '#{help_page_path('user/application_security/vulnerabilities/index')}'; window.gl.mrWidgetData.can_view_false_positive = '#{@merge_request.project.licensed_feature_available?(:sast_fp_reduction).to_s}'; diff --git a/app/views/projects/pipelines/new.html.haml b/app/views/projects/pipelines/new.html.haml index 63b44de0d74..210f9c35c79 100644 --- a/app/views/projects/pipelines/new.html.haml +++ b/app/views/projects/pipelines/new.html.haml @@ -1,4 +1,5 @@ -- breadcrumb_title _('Pipelines') +- breadcrumb_title s_('Pipeline|Run pipeline') +- add_to_breadcrumbs s_('Pipeline|Pipelines'), project_pipelines_path(@project) - page_title s_('Pipeline|Run pipeline') %h1.page-title.gl-font-size-h-display diff --git a/app/views/projects/releases/new.html.haml b/app/views/projects/releases/new.html.haml index 87197f2662d..908cbd00f47 100644 --- a/app/views/projects/releases/new.html.haml +++ b/app/views/projects/releases/new.html.haml @@ -1,4 +1,5 @@ -- page_title s_('Releases|New Release') +- add_to_breadcrumbs s_("Releases|Releases"), project_releases_path(@project) +- page_title s_('Releases|New') - add_page_specific_style 'page_bundles/releases' #js-new-release-page{ data: data_for_new_release_page } diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml index 2f8291d255f..bd37a6258a2 100644 --- a/app/views/projects/tags/new.html.haml +++ b/app/views/projects/tags/new.html.haml @@ -1,4 +1,5 @@ -- page_title s_('TagsPage|New Tag') +- add_to_breadcrumbs s_('TagsPage|Tags'), project_tags_path(@project) +- page_title s_('TagsPage|New') - default_ref = params[:ref] || @project.default_branch - if @error diff --git a/app/views/shared/empty_states/_merge_requests.html.haml b/app/views/shared/empty_states/_merge_requests.html.haml index 8e4051fa335..94589996c3a 100644 --- a/app/views/shared/empty_states/_merge_requests.html.haml +++ b/app/views/shared/empty_states/_merge_requests.html.haml @@ -7,8 +7,8 @@ .row.empty-state.merge-requests .col-12 - .svg-content - = image_tag 'illustrations/merge_requests.svg', { auto_dark: true } + .svg-content.svg-150 + = image_tag 'illustrations/empty-state/empty-merge-requests-md.svg', { auto_dark: true } .col-12 .text-content - if has_filter_bar_param? diff --git a/app/views/shared/groups/_list.html.haml b/app/views/shared/groups/_list.html.haml index c5b39c7db08..550f079bf3b 100644 --- a/app/views/shared/groups/_list.html.haml +++ b/app/views/shared/groups/_list.html.haml @@ -1,4 +1,4 @@ -- illustration_path = 'illustrations/profile-page/groups.svg' +- illustration_path = 'illustrations/empty-state/empty-groups-md.svg' - current_user_empty_message_header = s_('UserProfile|You can create a group for several dependent projects.') - current_user_empty_message_description = s_('UserProfile|Groups are the best way to manage projects and members.') - primary_button_label = _('New group') diff --git a/app/views/shared/users/index.html.haml b/app/views/shared/users/index.html.haml index c6a61e1c4df..ef5552943df 100644 --- a/app/views/shared/users/index.html.haml +++ b/app/views/shared/users/index.html.haml @@ -1,7 +1,7 @@ -- followers_illustration_path = 'illustrations/empty-state/empty-projects-starred-md.svg' +- followers_illustration_path = 'illustrations/empty-state/empty-friends-md.svg' - followers_visitor_empty_message = s_('UserProfile|This user doesn\'t have any followers.') - followers_current_user_empty_message_header = s_('UserProfile|You do not have any followers.') -- following_illustration_path = 'illustrations/empty-state/empty-projects-starred-md.svg' +- following_illustration_path = 'illustrations/empty-state/empty-friends-md.svg' - following_visitor_empty_message = s_('UserProfile|This user isn\'t following other users.') - following_current_user_empty_message_header = s_('UserProfile|You are not following other users.') |