Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
ae436dd0c5
commit
5ef8690cb9
|
|
@ -1,4 +1,5 @@
|
|||
<script>
|
||||
import { __ } from '~/locale';
|
||||
import StatusIcon from '../widget/status_icon.vue';
|
||||
|
||||
const ICON_NAMES = {
|
||||
|
|
@ -7,6 +8,16 @@ const ICON_NAMES = {
|
|||
passed: 'success',
|
||||
};
|
||||
|
||||
const FAILURE_REASONS = {
|
||||
broken_status: __('Cannot merge the source into the target branch, due to a conflict.'),
|
||||
ci_must_pass: __('Pipeline must succeed.'),
|
||||
conflict: __('Merge conflicts must be resolved.'),
|
||||
discussions_not_resolved: __('Unresolved discussions must be resolved.'),
|
||||
draft_status: __('Merge request must not be draft.'),
|
||||
not_open: __('Merge request must be open.'),
|
||||
need_rebase: __('Merge request must be rebased, because a fast-forward merge is not possible.'),
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'MergeChecksMessage',
|
||||
components: {
|
||||
|
|
@ -28,6 +39,9 @@ export default {
|
|||
return ICON_NAMES[this.check.result];
|
||||
},
|
||||
},
|
||||
i18n: {
|
||||
FAILURE_REASONS,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -36,7 +50,7 @@ export default {
|
|||
<div class="gl-display-flex">
|
||||
<status-icon :icon-name="iconName" :level="2" />
|
||||
<div class="gl-w-full gl-min-w-0">
|
||||
<div class="gl-display-flex">{{ check.failureReason }}</div>
|
||||
<div class="gl-display-flex">{{ $options.i18n.FAILURE_REASONS[check.identifier] }}</div>
|
||||
</div>
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -62,8 +62,7 @@ const Template = ({
|
|||
return defaultRender({
|
||||
apolloProvider,
|
||||
check: {
|
||||
failureReason: 'Needs rebasing',
|
||||
identifier: 'rebase',
|
||||
identifier: 'need_rebase',
|
||||
result: failed ? 'failed' : 'passed',
|
||||
},
|
||||
mr: { onlyAllowMergeIfPipelineSucceeds },
|
||||
|
|
|
|||
|
|
@ -34,13 +34,11 @@ const Template = ({ canMerge, failed, pushToSourceBranch }) => {
|
|||
userPermissions: { canMerge },
|
||||
mergeChecks: [
|
||||
{
|
||||
failureReason: 'Unresolved discussions',
|
||||
identifier: 'unresolved_discussions',
|
||||
identifier: 'discussions_not_resolved',
|
||||
result: failed ? 'failed' : 'passed',
|
||||
},
|
||||
{
|
||||
failureReason: 'Resolve conflicts',
|
||||
identifier: 'conflicts',
|
||||
identifier: 'conflict',
|
||||
result: failed ? 'failed' : 'passed',
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -92,13 +92,11 @@ module NavHelper
|
|||
# should return true
|
||||
return Feature.enabled?(:super_sidebar_logged_out) unless user
|
||||
|
||||
# Users who got the special `super_sidebar_nav_enrolled` enabled,
|
||||
# see the new nav as long as they don't explicitly opt-out via the toggle
|
||||
if user.use_new_navigation.nil? && Feature.enabled?(:super_sidebar_nav_enrolled, user)
|
||||
true
|
||||
else
|
||||
!!user.use_new_navigation
|
||||
end
|
||||
# Users who get the new nav unless they explicitly
|
||||
# opt-out via the toggle
|
||||
return true if user.use_new_navigation.nil?
|
||||
|
||||
!!user.use_new_navigation
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -334,27 +334,6 @@ module UsersHelper
|
|||
end
|
||||
end
|
||||
|
||||
def user_table_headers
|
||||
[
|
||||
{
|
||||
section_class_name: 'section-40',
|
||||
header_text: _('Name')
|
||||
},
|
||||
{
|
||||
section_class_name: 'section-10',
|
||||
header_text: _('Projects')
|
||||
},
|
||||
{
|
||||
section_class_name: 'section-15',
|
||||
header_text: _('Created on')
|
||||
},
|
||||
{
|
||||
section_class_name: 'section-15',
|
||||
header_text: _('Last activity')
|
||||
}
|
||||
]
|
||||
end
|
||||
|
||||
# the keys should match the user model defined roles in app/models/user.rb
|
||||
def localized_user_roles
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
- page_title _('Bitbucket import')
|
||||
- header_title _('Projects'), root_path
|
||||
|
||||
%h1.page-title.gl-font-size-h-display.d-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('bitbucket', css_class: 'gl-mr-2')
|
||||
= sprite_icon('bitbucket', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import projects from Bitbucket')
|
||||
|
||||
= render 'import/githubish_status', provider: 'bitbucket', default_namespace: @namespace
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
- header_title _("New project"), new_project_path
|
||||
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')
|
||||
|
||||
%h1.page-title.gl-font-size-h-display.d-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('bitbucket', css_class: 'gl-mr-2')
|
||||
= sprite_icon('bitbucket', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import repositories from Bitbucket Server')
|
||||
%hr
|
||||
|
||||
%p
|
||||
= _('Enter in your Bitbucket Server URL and personal access token below')
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
- page_title _('Bitbucket Server import')
|
||||
|
||||
%h1.page-title.gl-font-size-h-display.d-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('bitbucket', css_class: 'gl-mr-2')
|
||||
= sprite_icon('bitbucket', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import projects from Bitbucket Server')
|
||||
|
||||
= render 'import/githubish_status', provider: 'bitbucket_server', paginatable: true, default_namespace: @namespace, extra_data: { reconfigure_path: configure_import_bitbucket_server_path }
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
- header_title _("New project"), new_project_path
|
||||
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')
|
||||
|
||||
%h1.page-title.gl-font-size-h-display.d-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('bug', css_class: 'gl-mr-2')
|
||||
= sprite_icon('bug', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import projects from FogBugz')
|
||||
%hr
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
- page_title _("FogBugz import")
|
||||
%h1.page-title.gl-font-size-h-display.d-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('bug', css_class: 'gl-mr-2')
|
||||
= sprite_icon('bug', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import projects from FogBugz')
|
||||
|
||||
%p.light
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@
|
|||
- header_title _("New project"), new_project_path
|
||||
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')
|
||||
|
||||
%h1.page-title.gl-font-size-h-display
|
||||
= custom_icon('gitea_logo')
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('gitea', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import projects from Gitea')
|
||||
%hr
|
||||
|
||||
%p
|
||||
- link_to_personal_token = link_to(_('personal access token'), 'https://docs.gitea.io/en-us/api-usage/#authentication-via-the-api')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
- page_title _("Gitea import")
|
||||
%h1.page-title.gl-font-size-h-display
|
||||
= custom_icon('gitea_logo')
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('gitea', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import projects from Gitea')
|
||||
|
||||
= render 'import/githubish_status', provider: 'gitea', default_namespace: @namespace
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@
|
|||
- header_title _("New project"), new_project_path
|
||||
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')
|
||||
|
||||
%h1.page-title.gl-font-size-h-display
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('github', css_class: 'gl-mr-3', size: 48)
|
||||
= title
|
||||
%hr
|
||||
|
||||
%p
|
||||
= import_github_authorize_message
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
- title = has_ci_cd_only_params? ? _('Connect repositories from GitHub') : _('GitHub import')
|
||||
- page_title title
|
||||
%h1.page-title.gl-font-size-h-display.mb-0.gl-display-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('github', css_class: 'gl-mr-2')
|
||||
= sprite_icon('github', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import repositories from GitHub')
|
||||
|
||||
= render 'import/githubish_status',
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
- header_title _("New project"), new_project_path
|
||||
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')
|
||||
|
||||
%h1.page-title.gl-font-size-h-display.d-flex
|
||||
%h1.page-title.gl-font-size-h-display.d-flex.gl-align-items-center
|
||||
.gl-display-flex.gl-align-items-center.gl-justify-content-center
|
||||
= sprite_icon('tanuki', css_class: 'gl-mr-2')
|
||||
= sprite_icon('tanuki', css_class: 'gl-mr-3', size: 48)
|
||||
= _('Import an exported GitLab project')
|
||||
%hr
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
name: runners_dashboard
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125301
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/417002
|
||||
milestone: '16.2'
|
||||
type: development
|
||||
group: group::runner
|
||||
default_enabled: false
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
name: super_sidebar_nav_enrolled
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119506
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/410121
|
||||
milestone: '16.0'
|
||||
type: development
|
||||
group: group::foundations
|
||||
default_enabled: true
|
||||
|
|
@ -4,7 +4,7 @@ group: Authentication
|
|||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# Use Shibboleth as an OAuth 2.0 authentication provider **(FREE ALL)**
|
||||
# Use Shibboleth as an OAuth 2.0 authentication provider **(FREE SELF)**
|
||||
|
||||
NOTE:
|
||||
Use the [GitLab SAML integration](saml.md) to integrate specific Shibboleth identity providers (IdPs). For Shibboleth federation support (Discovery Service), use this document.
|
||||
|
|
|
|||
|
|
@ -26,9 +26,6 @@ module API
|
|||
status 200
|
||||
|
||||
authenticate!
|
||||
|
||||
check_api_read!
|
||||
check_api_write! unless request.get? || request.head?
|
||||
end
|
||||
|
||||
rescue_from ActiveRecord::ActiveRecordError do |e|
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ module API
|
|||
class Experiments < ::API::Base
|
||||
feature_category :mlops
|
||||
|
||||
before do
|
||||
check_api_read!
|
||||
check_api_write! unless request.get? || request.head?
|
||||
end
|
||||
|
||||
resource :experiments do
|
||||
desc 'Fetch experiment by experiment_id' do
|
||||
success Entities::Ml::Mlflow::GetExperiment
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ module API
|
|||
class Runs < ::API::Base
|
||||
feature_category :mlops
|
||||
|
||||
before do
|
||||
check_api_read!
|
||||
check_api_write! unless request.get? || request.head?
|
||||
end
|
||||
|
||||
resource :runs do
|
||||
desc 'Creates a Run.' do
|
||||
success Entities::Ml::Mlflow::Run
|
||||
|
|
|
|||
|
|
@ -9520,6 +9520,9 @@ msgstr ""
|
|||
msgid "Cannot merge"
|
||||
msgstr ""
|
||||
|
||||
msgid "Cannot merge the source into the target branch, due to a conflict."
|
||||
msgstr ""
|
||||
|
||||
msgid "Cannot modify %{profile_name} referenced in security policy"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -21704,6 +21707,9 @@ msgstr ""
|
|||
msgid "GitLab Community Edition"
|
||||
msgstr ""
|
||||
|
||||
msgid "GitLab Duo didn't respond. Try again? If it fails again, your request might be too large."
|
||||
msgstr ""
|
||||
|
||||
msgid "GitLab Enterprise Edition"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -29552,6 +29558,9 @@ msgstr ""
|
|||
msgid "Merge conflicts"
|
||||
msgstr ""
|
||||
|
||||
msgid "Merge conflicts must be resolved."
|
||||
msgstr ""
|
||||
|
||||
msgid "Merge date & time could not be determined"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -29603,6 +29612,15 @@ msgstr ""
|
|||
msgid "Merge request events"
|
||||
msgstr ""
|
||||
|
||||
msgid "Merge request must be open."
|
||||
msgstr ""
|
||||
|
||||
msgid "Merge request must be rebased, because a fast-forward merge is not possible."
|
||||
msgstr ""
|
||||
|
||||
msgid "Merge request must not be draft."
|
||||
msgstr ""
|
||||
|
||||
msgid "Merge request not merged"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -34444,6 +34462,9 @@ msgstr ""
|
|||
msgid "Pipeline editor"
|
||||
msgstr ""
|
||||
|
||||
msgid "Pipeline must succeed."
|
||||
msgstr ""
|
||||
|
||||
msgid "Pipeline ran in fork of project"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -50841,6 +50862,9 @@ msgstr ""
|
|||
msgid "Unresolved"
|
||||
msgstr ""
|
||||
|
||||
msgid "Unresolved discussions must be resolved."
|
||||
msgstr ""
|
||||
|
||||
msgid "Unschedule job"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe '"Your work" navbar', feature_category: :navigation do
|
||||
RSpec.describe '"Your work" navbar', :js, feature_category: :navigation do
|
||||
include_context 'dashboard navbar structure'
|
||||
|
||||
let_it_be(:user) { create(:user, :no_super_sidebar) }
|
||||
let_it_be(:user) { create(:user) }
|
||||
|
||||
it_behaves_like 'verified navigation bar' do
|
||||
before do
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe '"Explore" navbar', feature_category: :navigation do
|
||||
RSpec.describe '"Explore" navbar', :js, feature_category: :navigation do
|
||||
include_context '"Explore" navbar structure'
|
||||
|
||||
it_behaves_like 'verified navigation bar' do
|
||||
before do
|
||||
stub_feature_flags(global_ci_catalog: false)
|
||||
stub_feature_flags(super_sidebar_logged_out: false)
|
||||
visit explore_projects_path
|
||||
end
|
||||
end
|
||||
|
|
@ -19,7 +18,6 @@ RSpec.describe '"Explore" navbar', feature_category: :navigation do
|
|||
it_behaves_like 'verified navigation bar', global_ci_catalog: true do
|
||||
before do
|
||||
stub_feature_flags(global_ci_catalog: true)
|
||||
stub_feature_flags(super_sidebar_logged_out: false)
|
||||
visit explore_projects_path
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Group navbar', :with_license, feature_category: :navigation do
|
||||
RSpec.describe 'Group navbar', :with_license, :js, feature_category: :navigation do
|
||||
include NavbarStructureHelper
|
||||
include WikiHelpers
|
||||
|
||||
include_context 'group navbar structure'
|
||||
|
||||
let_it_be(:user) { create(:user, :no_super_sidebar) }
|
||||
let_it_be(:user) { create(:user) }
|
||||
|
||||
let(:group) { create(:group) }
|
||||
|
||||
before do
|
||||
insert_package_nav(_('Kubernetes'))
|
||||
insert_after_nav_item(_('Analytics'), new_nav_item: settings_for_maintainer_nav_item) if Gitlab.ee?
|
||||
create_package_nav(_('Operate'))
|
||||
insert_after_nav_item(_('Analyze'), new_nav_item: settings_for_maintainer_nav_item) if Gitlab.ee?
|
||||
|
||||
stub_config(dependency_proxy: { enabled: false })
|
||||
stub_config(registry: { enabled: false })
|
||||
|
|
@ -46,9 +46,9 @@ RSpec.describe 'Group navbar', :with_license, feature_category: :navigation do
|
|||
|
||||
before do
|
||||
if Gitlab.ee?
|
||||
insert_customer_relations_nav(_('Analytics'))
|
||||
insert_customer_relations_nav(_('Iterations'))
|
||||
else
|
||||
insert_customer_relations_nav(_('Packages and registries'))
|
||||
insert_customer_relations_nav(_('Milestones'))
|
||||
end
|
||||
|
||||
visit group_path(group)
|
||||
|
|
@ -85,7 +85,7 @@ RSpec.describe 'Group navbar', :with_license, feature_category: :navigation do
|
|||
before do
|
||||
group.update!(harbor_integration: harbor_integration)
|
||||
|
||||
insert_harbor_registry_nav(_('Package Registry'))
|
||||
insert_harbor_registry_nav(_('Kubernetes'))
|
||||
|
||||
visit group_path(group)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Project navbar', :with_license, feature_category: :groups_and_projects do
|
||||
RSpec.describe 'Project navbar', :with_license, :js, feature_category: :groups_and_projects do
|
||||
include NavbarStructureHelper
|
||||
include WaitForRequests
|
||||
|
||||
include_context 'project navbar structure'
|
||||
|
||||
let_it_be(:user) { create(:user, :no_super_sidebar) }
|
||||
let_it_be(:user) { create(:user) }
|
||||
let_it_be(:project) { create(:project, :repository, namespace: user.namespace) }
|
||||
|
||||
before do
|
||||
|
|
@ -16,7 +16,7 @@ RSpec.describe 'Project navbar', :with_license, feature_category: :groups_and_pr
|
|||
|
||||
stub_config(registry: { enabled: false })
|
||||
stub_feature_flags(ml_experiment_tracking: false)
|
||||
insert_package_nav(_('Deployments'))
|
||||
insert_package_nav
|
||||
insert_infrastructure_registry_nav
|
||||
insert_infrastructure_google_cloud_nav
|
||||
insert_infrastructure_aws_nav
|
||||
|
|
@ -28,29 +28,13 @@ RSpec.describe 'Project navbar', :with_license, feature_category: :groups_and_pr
|
|||
end
|
||||
end
|
||||
|
||||
context 'when value stream is available' do
|
||||
before do
|
||||
visit project_path(project)
|
||||
end
|
||||
|
||||
it 'redirects to value stream when Analytics item is clicked' do
|
||||
page.within('.sidebar-top-level-items') do
|
||||
find('.shortcuts-analytics').click
|
||||
end
|
||||
|
||||
wait_for_requests
|
||||
|
||||
expect(page).to have_current_path(project_cycle_analytics_path(project))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when pages are available' do
|
||||
before do
|
||||
stub_config(pages: { enabled: true })
|
||||
|
||||
insert_after_sub_nav_item(
|
||||
_('Releases'),
|
||||
within: _('Deployments'),
|
||||
_('Package Registry'),
|
||||
within: _('Deploy'),
|
||||
new_sub_nav_item_name: _('Pages')
|
||||
)
|
||||
|
||||
|
|
@ -86,7 +70,7 @@ RSpec.describe 'Project navbar', :with_license, feature_category: :groups_and_pr
|
|||
let_it_be(:harbor_integration) { create(:harbor_integration, project: project) }
|
||||
|
||||
before do
|
||||
insert_harbor_registry_nav(_('Terraform modules'))
|
||||
insert_harbor_registry_nav(_('AWS'))
|
||||
|
||||
visit project_path(project)
|
||||
end
|
||||
|
|
@ -98,7 +82,11 @@ RSpec.describe 'Project navbar', :with_license, feature_category: :groups_and_pr
|
|||
before do
|
||||
stub_feature_flags(ml_experiment_tracking: true)
|
||||
|
||||
insert_model_experiments_nav(_('Terraform modules'))
|
||||
if Gitlab.ee? # rubocop: disable RSpec/AvoidConditionalStatements
|
||||
insert_model_experiments_nav(_('Merge request analytics'))
|
||||
else
|
||||
insert_model_experiments_nav(_('Repository analytics'))
|
||||
end
|
||||
|
||||
visit project_path(project)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
import { buildClient } from '~/observability/client';
|
||||
|
||||
export function createMockClient() {
|
||||
const mockClient = buildClient({
|
||||
provisioningUrl: 'provisioning-url',
|
||||
tracingUrl: 'tracing-url',
|
||||
servicesUrl: 'services-url',
|
||||
operationsUrl: 'operations-url',
|
||||
});
|
||||
|
||||
Object.getOwnPropertyNames(mockClient)
|
||||
.filter((item) => typeof mockClient[item] === 'function')
|
||||
.forEach((item) => {
|
||||
mockClient[item] = jest.fn();
|
||||
});
|
||||
|
||||
return mockClient;
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ function factory({
|
|||
apolloProvider,
|
||||
propsData: {
|
||||
mr,
|
||||
check: { result, failureReason: 'Conflicts message' },
|
||||
check: { result, identifier: 'conflict' },
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ describe('Merge request merge checks conflicts component', () => {
|
|||
it('renders failure reason text', () => {
|
||||
factory();
|
||||
|
||||
expect(wrapper.text()).toEqual('Conflicts message');
|
||||
expect(wrapper.text()).toEqual('Merge conflicts must be resolved.');
|
||||
});
|
||||
|
||||
it.each`
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ function factory(propsData = {}) {
|
|||
|
||||
describe('Merge request merge checks message component', () => {
|
||||
it('renders failure reason text', () => {
|
||||
factory({ check: { result: 'passed', failureReason: 'Failed message' } });
|
||||
factory({ check: { result: 'passed', identifier: 'discussions_not_resolved' } });
|
||||
|
||||
expect(wrapper.text()).toEqual('Failed message');
|
||||
expect(wrapper.text()).toEqual('Unresolved discussions must be resolved.');
|
||||
});
|
||||
|
||||
it.each`
|
||||
|
|
@ -23,7 +23,7 @@ describe('Merge request merge checks message component', () => {
|
|||
${'failed'} | ${'failed'}
|
||||
${'allowed_to_fail'} | ${'neutral'}
|
||||
`('renders $icon icon for $result result', ({ result, icon }) => {
|
||||
factory({ check: { result, failureReason: 'Failed message' } });
|
||||
factory({ check: { result } });
|
||||
|
||||
expect(wrapper.findComponent(StatusIcon).props('iconName')).toBe(icon);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ function createWrapper({ propsData = {}, provideData = {}, handler = mockQueryHa
|
|||
mr: {},
|
||||
service: {},
|
||||
check: {
|
||||
failureReason: '',
|
||||
identifier: 'need_rebase',
|
||||
result: 'failed',
|
||||
},
|
||||
...propsData,
|
||||
|
|
|
|||
|
|
@ -145,14 +145,6 @@ RSpec.describe NavHelper, feature_category: :navigation do
|
|||
let(:user_preference) { nil }
|
||||
|
||||
specify { expect(subject).to eq true }
|
||||
|
||||
context 'when the user was not enrolled into the new nav via a special feature flag' do
|
||||
before do
|
||||
stub_feature_flags(super_sidebar_nav_enrolled: false)
|
||||
end
|
||||
|
||||
specify { expect(subject).to eq false }
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user has new nav disabled' do
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ RSpec.describe SearchController, type: :request, feature_category: :global_searc
|
|||
let_it_be(:projects) { create_list(:project, 5, :public, :repository, :wiki_repo) }
|
||||
|
||||
before do
|
||||
stub_feature_flags(super_sidebar_nav_enrolled: false)
|
||||
login_as(user)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -301,8 +301,6 @@ RSpec.configure do |config|
|
|||
# https://gitlab.com/gitlab-org/gitlab/-/issues/385453
|
||||
stub_feature_flags(vscode_web_ide: false)
|
||||
|
||||
stub_feature_flags(ai_global_switch: false)
|
||||
|
||||
enable_rugged = example.metadata[:enable_rugged].present?
|
||||
|
||||
# Disable Rugged features by default
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@ module NavbarStructureHelper
|
|||
structure.insert(index + 1, new_nav_item)
|
||||
end
|
||||
|
||||
def insert_before_nav_item(after_nav_item_name, new_nav_item:)
|
||||
expect(structure).to include(a_hash_including(nav_item: after_nav_item_name))
|
||||
|
||||
index = structure.find_index { |h| h[:nav_item] == after_nav_item_name if h }
|
||||
structure.insert(index, new_nav_item)
|
||||
end
|
||||
|
||||
def insert_after_sub_nav_item(before_sub_nav_item_name, within:, new_sub_nav_item_name:)
|
||||
expect(structure).to include(a_hash_including(nav_item: within))
|
||||
hash = structure.find { |h| h[:nav_item] == within if h }
|
||||
|
|
@ -30,49 +37,57 @@ module NavbarStructureHelper
|
|||
hash[:nav_sub_items].insert(index, new_sub_nav_item_name)
|
||||
end
|
||||
|
||||
def insert_package_nav(within)
|
||||
insert_after_nav_item(
|
||||
within,
|
||||
def insert_package_nav
|
||||
insert_after_sub_nav_item(
|
||||
_("Feature flags"),
|
||||
within: _('Deploy'),
|
||||
new_sub_nav_item_name: _("Package Registry")
|
||||
)
|
||||
end
|
||||
|
||||
def create_package_nav(before)
|
||||
insert_before_nav_item(
|
||||
before,
|
||||
new_nav_item: {
|
||||
nav_item: _('Packages and registries'),
|
||||
nav_sub_items: [_('Package Registry')]
|
||||
nav_item: _("Deploy"),
|
||||
nav_sub_items: [_("Package Registry")]
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
def insert_customer_relations_nav(within)
|
||||
insert_after_nav_item(
|
||||
within,
|
||||
new_nav_item: {
|
||||
nav_item: _('Customer relations'),
|
||||
nav_sub_items: [
|
||||
_('Contacts'),
|
||||
_('Organizations')
|
||||
]
|
||||
}
|
||||
def insert_customer_relations_nav(after)
|
||||
insert_after_sub_nav_item(
|
||||
after,
|
||||
within: _('Plan'),
|
||||
new_sub_nav_item_name: _("Customer contacts")
|
||||
)
|
||||
insert_after_sub_nav_item(
|
||||
_("Customer contacts"),
|
||||
within: _('Plan'),
|
||||
new_sub_nav_item_name: _("Customer organizations")
|
||||
)
|
||||
end
|
||||
|
||||
def insert_container_nav
|
||||
insert_after_sub_nav_item(
|
||||
_('Package Registry'),
|
||||
within: _('Packages and registries'),
|
||||
within: _('Deploy'),
|
||||
new_sub_nav_item_name: _('Container Registry')
|
||||
)
|
||||
end
|
||||
|
||||
def insert_dependency_proxy_nav
|
||||
insert_after_sub_nav_item(
|
||||
_('Package Registry'),
|
||||
within: _('Packages and registries'),
|
||||
insert_before_sub_nav_item(
|
||||
_('Kubernetes'),
|
||||
within: _('Operate'),
|
||||
new_sub_nav_item_name: _('Dependency Proxy')
|
||||
)
|
||||
end
|
||||
|
||||
def insert_infrastructure_registry_nav
|
||||
insert_after_sub_nav_item(
|
||||
_('Package Registry'),
|
||||
within: _('Packages and registries'),
|
||||
s_('Terraform|Terraform states'),
|
||||
within: _('Operate'),
|
||||
new_sub_nav_item_name: _('Terraform modules')
|
||||
)
|
||||
end
|
||||
|
|
@ -80,15 +95,15 @@ module NavbarStructureHelper
|
|||
def insert_harbor_registry_nav(within)
|
||||
insert_after_sub_nav_item(
|
||||
within,
|
||||
within: _('Packages and registries'),
|
||||
within: _('Operate'),
|
||||
new_sub_nav_item_name: _('Harbor Registry')
|
||||
)
|
||||
end
|
||||
|
||||
def insert_infrastructure_google_cloud_nav
|
||||
insert_after_sub_nav_item(
|
||||
s_('Terraform|Terraform states'),
|
||||
within: _('Infrastructure'),
|
||||
s_('Terraform|Terraform modules'),
|
||||
within: _('Operate'),
|
||||
new_sub_nav_item_name: _('Google Cloud')
|
||||
)
|
||||
end
|
||||
|
|
@ -96,7 +111,7 @@ module NavbarStructureHelper
|
|||
def insert_infrastructure_aws_nav
|
||||
insert_after_sub_nav_item(
|
||||
_('Google Cloud'),
|
||||
within: _('Infrastructure'),
|
||||
within: _('Operate'),
|
||||
new_sub_nav_item_name: _('AWS')
|
||||
)
|
||||
end
|
||||
|
|
@ -104,25 +119,24 @@ module NavbarStructureHelper
|
|||
def insert_model_experiments_nav(within)
|
||||
insert_after_sub_nav_item(
|
||||
within,
|
||||
within: _('Packages and registries'),
|
||||
within: _('Analyze'),
|
||||
new_sub_nav_item_name: _('Model experiments')
|
||||
)
|
||||
end
|
||||
|
||||
def project_analytics_sub_nav_item
|
||||
[
|
||||
_('Value stream'),
|
||||
_('CI/CD'),
|
||||
(_('Code review') if Gitlab.ee?),
|
||||
(_('Merge request') if Gitlab.ee?),
|
||||
_('Repository')
|
||||
_('Value stream analytics'),
|
||||
_('Contributor statistics'),
|
||||
_('CI/CD analytics'),
|
||||
_('Repository analytics'),
|
||||
(_('Code review analytics') if Gitlab.ee?),
|
||||
(_('Merge request analytics') if Gitlab.ee?)
|
||||
]
|
||||
end
|
||||
|
||||
def group_analytics_sub_nav_item
|
||||
[
|
||||
_('Contribution')
|
||||
]
|
||||
[_("Contribution analytics")]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
RSpec.shared_context 'project navbar structure' do
|
||||
include NavbarStructureHelper
|
||||
|
||||
let(:security_and_compliance_nav_item) do
|
||||
let(:secure_nav_item) do
|
||||
{
|
||||
nav_item: _('Security and Compliance'),
|
||||
nav_item: _('Secure'),
|
||||
nav_sub_items: [
|
||||
(_('Audit events') if Gitlab.ee?),
|
||||
_('Security configuration')
|
||||
|
|
@ -16,65 +16,58 @@ RSpec.shared_context 'project navbar structure' do
|
|||
let(:structure) do
|
||||
[
|
||||
{
|
||||
nav_item: "#{project.name[0, 1].upcase} #{project.name}",
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _('Project information'),
|
||||
nav_item: _('Manage'),
|
||||
nav_sub_items: [
|
||||
_('Activity'),
|
||||
_('Labels'),
|
||||
_('Members')
|
||||
_('Members'),
|
||||
_('Labels')
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Repository'),
|
||||
nav_item: _('Plan'),
|
||||
nav_sub_items: [
|
||||
_('Files'),
|
||||
_('Commits'),
|
||||
_('Issues'),
|
||||
_('Issue boards'),
|
||||
_('Milestones'),
|
||||
_('Wiki')
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Code'),
|
||||
nav_sub_items: [
|
||||
_('Merge requests'),
|
||||
_('Repository'),
|
||||
_('Branches'),
|
||||
_('Commits'),
|
||||
_('Tags'),
|
||||
_('Contributor statistics'),
|
||||
_('Graph'),
|
||||
_('Repository graph'),
|
||||
_('Compare revisions'),
|
||||
_('Snippets'),
|
||||
(_('Locked files') if Gitlab.ee?)
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Issues'),
|
||||
nav_sub_items: [
|
||||
_('List'),
|
||||
_('Boards'),
|
||||
_('Service Desk'),
|
||||
_('Milestones')
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Merge requests'),
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _('CI/CD'),
|
||||
nav_item: _('Build'),
|
||||
nav_sub_items: [
|
||||
_('Pipelines'),
|
||||
s_('Pipelines|Editor'),
|
||||
_('Jobs'),
|
||||
_('Artifacts'),
|
||||
_('Schedules')
|
||||
_('Pipeline editor'),
|
||||
_('Pipeline schedules'),
|
||||
_('Artifacts')
|
||||
]
|
||||
},
|
||||
security_and_compliance_nav_item,
|
||||
secure_nav_item,
|
||||
{
|
||||
nav_item: _('Deployments'),
|
||||
nav_item: _('Deploy'),
|
||||
nav_sub_items: [
|
||||
_('Releases'),
|
||||
s_('FeatureFlags|Feature flags')
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Operate'),
|
||||
nav_sub_items: [
|
||||
_('Environments'),
|
||||
s_('FeatureFlags|Feature flags'),
|
||||
_('Releases')
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Infrastructure'),
|
||||
nav_sub_items: [
|
||||
_('Kubernetes clusters'),
|
||||
s_('Terraform|Terraform states')
|
||||
]
|
||||
|
|
@ -84,21 +77,14 @@ RSpec.shared_context 'project navbar structure' do
|
|||
nav_sub_items: [
|
||||
_('Error Tracking'),
|
||||
_('Alerts'),
|
||||
_('Incidents')
|
||||
_('Incidents'),
|
||||
_('Service Desk')
|
||||
]
|
||||
},
|
||||
{
|
||||
nav_item: _('Analytics'),
|
||||
nav_item: _('Analyze'),
|
||||
nav_sub_items: project_analytics_sub_nav_item
|
||||
},
|
||||
{
|
||||
nav_item: _('Wiki'),
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _('Snippets'),
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _('Settings'),
|
||||
nav_sub_items: [
|
||||
|
|
@ -120,9 +106,9 @@ RSpec.shared_context 'project navbar structure' do
|
|||
end
|
||||
|
||||
RSpec.shared_context 'group navbar structure' do
|
||||
let(:analytics_nav_item) do
|
||||
let(:analyze_nav_item) do
|
||||
{
|
||||
nav_item: _('Analytics'),
|
||||
nav_item: _("Analyze"),
|
||||
nav_sub_items: group_analytics_sub_nav_item
|
||||
}
|
||||
end
|
||||
|
|
@ -148,65 +134,46 @@ RSpec.shared_context 'group navbar structure' do
|
|||
|
||||
let(:settings_for_maintainer_nav_item) do
|
||||
{
|
||||
nav_item: _('Settings'),
|
||||
nav_sub_items: [
|
||||
_('Repository')
|
||||
]
|
||||
nav_item: _("Settings"),
|
||||
nav_sub_items: [_("Repository")]
|
||||
}
|
||||
end
|
||||
|
||||
let(:security_and_compliance_nav_item) do
|
||||
let(:secure_nav_item) do
|
||||
{
|
||||
nav_item: _('Security and Compliance'),
|
||||
nav_sub_items: [
|
||||
_('Audit events')
|
||||
]
|
||||
nav_item: _("Secure"),
|
||||
nav_sub_items: [_("Audit events")]
|
||||
}
|
||||
end
|
||||
|
||||
let(:issues_nav_items) do
|
||||
[
|
||||
_('List'),
|
||||
_('Board'),
|
||||
_('Milestones'),
|
||||
(_('Iterations') if Gitlab.ee?)
|
||||
]
|
||||
let(:plan_nav_items) do
|
||||
[_("Issues"), _("Issue board"), _("Milestones"), (_('Iterations') if Gitlab.ee?)]
|
||||
end
|
||||
|
||||
let(:structure) do
|
||||
[
|
||||
{
|
||||
nav_item: "#{group.name[0, 1].upcase} #{group.name}",
|
||||
nav_sub_items: []
|
||||
nav_item: _("Manage"),
|
||||
nav_sub_items: [_("Activity"), _("Members"), _("Labels")]
|
||||
},
|
||||
{
|
||||
nav_item: group.root? ? _('Group information') : _('Subgroup information'),
|
||||
nav_sub_items: [
|
||||
_('Activity'),
|
||||
_('Labels'),
|
||||
_('Members')
|
||||
]
|
||||
nav_item: _("Plan"),
|
||||
nav_sub_items: plan_nav_items
|
||||
},
|
||||
{
|
||||
nav_item: _('Issues'),
|
||||
nav_sub_items: issues_nav_items
|
||||
nav_item: _("Code"),
|
||||
nav_sub_items: [_("Merge requests")]
|
||||
},
|
||||
{
|
||||
nav_item: _('Merge requests'),
|
||||
nav_sub_items: []
|
||||
nav_item: _("Build"),
|
||||
nav_sub_items: [_("Runners")]
|
||||
},
|
||||
(security_and_compliance_nav_item if Gitlab.ee?),
|
||||
(secure_nav_item if Gitlab.ee?),
|
||||
{
|
||||
nav_item: _('CI/CD'),
|
||||
nav_sub_items: [
|
||||
s_('Runners|Runners')
|
||||
]
|
||||
nav_item: _("Operate"),
|
||||
nav_sub_items: [_("Kubernetes")]
|
||||
},
|
||||
{
|
||||
nav_item: _('Kubernetes'),
|
||||
nav_sub_items: []
|
||||
},
|
||||
(analytics_nav_item if Gitlab.ee?)
|
||||
(analyze_nav_item if Gitlab.ee?)
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
@ -214,10 +181,6 @@ end
|
|||
RSpec.shared_context 'dashboard navbar structure' do
|
||||
let(:structure) do
|
||||
[
|
||||
{
|
||||
nav_item: "Your work",
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _("Projects"),
|
||||
nav_sub_items: []
|
||||
|
|
@ -237,8 +200,8 @@ RSpec.shared_context 'dashboard navbar structure' do
|
|||
{
|
||||
nav_item: _("Merge requests"),
|
||||
nav_sub_items: [
|
||||
_('Assigned 0'),
|
||||
_('Review requests 0')
|
||||
_('Assigned'),
|
||||
_('Review requests')
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -264,10 +227,6 @@ end
|
|||
RSpec.shared_context '"Explore" navbar structure' do
|
||||
let(:structure) do
|
||||
[
|
||||
{
|
||||
nav_item: "Explore",
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _("Projects"),
|
||||
nav_sub_items: []
|
||||
|
|
@ -291,10 +250,6 @@ end
|
|||
RSpec.shared_context '"Explore" navbar structure with global_ci_catalog FF' do
|
||||
let(:structure) do
|
||||
[
|
||||
{
|
||||
nav_item: "Explore",
|
||||
nav_sub_items: []
|
||||
},
|
||||
{
|
||||
nav_item: _("Projects"),
|
||||
nav_sub_items: []
|
||||
|
|
|
|||
|
|
@ -8,17 +8,12 @@ RSpec.shared_examples 'verified navigation bar' do
|
|||
end
|
||||
|
||||
it 'renders correctly' do
|
||||
# we are using * here in the selectors to prevent a regression where we added a non 'li' inside an 'ul'
|
||||
current_structure = page.all('.sidebar-top-level-items > *', class: ['!hidden']).map do |item|
|
||||
next if item.find_all('a').empty?
|
||||
|
||||
nav_item = item.find_all('a').first.text.gsub(/\s+\d+$/, '') # remove counts at the end
|
||||
|
||||
nav_sub_items = item.all('.sidebar-sub-level-items > *', class: ['!fly-out-top-item']).map do |list_item|
|
||||
list_item.all('a').first.text
|
||||
current_structure = page.all('[data-testid="non-static-items-section"] > li').map do |item|
|
||||
nav_sub_items = item.all('li', visible: :all).map do |list_item|
|
||||
list_item.all('a', visible: :all).first.text(:all).gsub(/\s+\d+$/, '') # remove counts at the end
|
||||
end
|
||||
|
||||
{ nav_item: nav_item, nav_sub_items: nav_sub_items }
|
||||
{ nav_item: item.text, nav_sub_items: nav_sub_items }
|
||||
end.compact
|
||||
|
||||
expect(current_structure).to eq(expected_structure)
|
||||
|
|
|
|||
Loading…
Reference in New Issue