debian-mirror-gitlab/spec/support/shared_contexts/navbar_structure_context.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

224 lines
4.5 KiB
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
RSpec.shared_context 'project navbar structure' do
2022-06-21 17:19:12 +05:30
include NavbarStructureHelper
2021-02-22 17:27:13 +05:30
let(:security_and_compliance_nav_item) do
{
nav_item: _('Security & Compliance'),
nav_sub_items: [
2022-01-26 12:08:38 +05:30
(_('Audit events') if Gitlab.ee?),
2021-09-04 01:27:46 +05:30
_('Configuration')
2021-02-22 17:27:13 +05:30
]
}
end
2020-04-22 19:07:51 +05:30
let(:structure) do
[
2021-09-30 23:02:18 +05:30
{
nav_item: "#{project.name[0, 1].upcase} #{project.name}",
nav_sub_items: []
},
{
nav_item: _('Project information'),
nav_sub_items: [
_('Activity'),
_('Labels'),
_('Members')
]
},
2020-04-22 19:07:51 +05:30
{
nav_item: _('Repository'),
nav_sub_items: [
_('Files'),
_('Commits'),
_('Branches'),
_('Tags'),
_('Contributors'),
_('Graph'),
_('Compare'),
(_('Locked Files') if Gitlab.ee?)
]
},
{
nav_item: _('Issues'),
nav_sub_items: [
_('List'),
_('Boards'),
2020-07-28 23:09:34 +05:30
_('Service Desk'),
2022-07-16 23:28:13 +05:30
_('Milestones')
2020-04-22 19:07:51 +05:30
]
},
{
2021-04-29 21:17:54 +05:30
nav_item: _('Merge requests'),
2020-04-22 19:07:51 +05:30
nav_sub_items: []
},
{
2021-04-17 20:07:23 +05:30
nav_item: _('CI/CD'),
2020-04-22 19:07:51 +05:30
nav_sub_items: [
_('Pipelines'),
2021-01-29 00:20:46 +05:30
s_('Pipelines|Editor'),
2020-04-22 19:07:51 +05:30
_('Jobs'),
_('Artifacts'),
_('Schedules')
]
},
2021-03-11 19:13:27 +05:30
security_and_compliance_nav_item,
2021-09-30 23:02:18 +05:30
{
nav_item: _('Deployments'),
nav_sub_items: [
_('Environments'),
2023-01-13 00:05:48 +05:30
_('Feature Flags'),
2021-09-30 23:02:18 +05:30
_('Releases')
]
},
2022-07-16 23:28:13 +05:30
{
nav_item: _('Infrastructure'),
nav_sub_items: [
_('Kubernetes clusters'),
_('Terraform')
]
},
2021-09-30 23:02:18 +05:30
{
nav_item: _('Monitor'),
nav_sub_items: [
_('Metrics'),
_('Error Tracking'),
_('Alerts'),
2023-01-13 00:05:48 +05:30
_('Incidents')
2021-09-30 23:02:18 +05:30
]
},
{
nav_item: _('Analytics'),
2022-07-16 23:28:13 +05:30
nav_sub_items: project_analytics_sub_nav_item
2021-09-30 23:02:18 +05:30
},
2020-04-22 19:07:51 +05:30
{
nav_item: _('Wiki'),
nav_sub_items: []
},
{
nav_item: _('Snippets'),
nav_sub_items: []
},
{
nav_item: _('Settings'),
2021-09-30 23:02:18 +05:30
nav_sub_items: [
_('General'),
_('Integrations'),
_('Webhooks'),
_('Access Tokens'),
_('Repository'),
2022-10-11 01:57:18 +05:30
_('Merge requests'),
2021-09-30 23:02:18 +05:30
_('CI/CD'),
2022-10-11 01:57:18 +05:30
_('Packages and registries'),
2021-11-11 11:23:49 +05:30
_('Monitor'),
2021-12-11 22:18:48 +05:30
s_('UsageQuota|Usage Quotas')
2021-09-30 23:02:18 +05:30
]
2020-04-22 19:07:51 +05:30
}
].compact
end
end
RSpec.shared_context 'group navbar structure' do
let(:analytics_nav_item) do
{
nav_item: _('Analytics'),
2022-07-16 23:28:13 +05:30
nav_sub_items: group_analytics_sub_nav_item
2020-04-22 19:07:51 +05:30
}
end
let(:settings_nav_item) do
{
nav_item: _('Settings'),
nav_sub_items: [
_('General'),
2020-11-24 15:15:51 +05:30
_('Integrations'),
2022-07-23 23:45:48 +05:30
_('Webhooks'),
2022-03-02 08:16:31 +05:30
_('Access Tokens'),
2020-04-22 19:07:51 +05:30
_('Projects'),
2020-04-25 10:58:03 +05:30
_('Repository'),
2021-04-17 20:07:23 +05:30
_('CI/CD'),
2021-04-29 21:17:54 +05:30
_('Applications'),
2022-10-11 01:57:18 +05:30
_('Packages and registries'),
_('Domain Verification')
]
}
end
let(:settings_for_maintainer_nav_item) do
{
nav_item: _('Settings'),
nav_sub_items: [
_('Repository')
2020-04-22 19:07:51 +05:30
]
}
end
let(:administration_nav_item) do
{
nav_item: _('Administration'),
nav_sub_items: [
s_('UsageQuota|Usage Quotas')
]
}
end
2021-02-22 17:27:13 +05:30
let(:security_and_compliance_nav_item) do
{
nav_item: _('Security & Compliance'),
nav_sub_items: [
2022-01-26 12:08:38 +05:30
_('Audit events')
2021-02-22 17:27:13 +05:30
]
}
end
2021-10-27 15:23:28 +05:30
let(:ci_cd_nav_item) do
{
nav_item: _('CI/CD'),
nav_sub_items: [
s_('Runners|Runners')
]
}
end
2021-06-08 01:23:25 +05:30
let(:issues_nav_items) do
[
_('List'),
_('Board'),
2022-01-26 12:08:38 +05:30
_('Milestones'),
(_('Iterations') if Gitlab.ee?)
2021-06-08 01:23:25 +05:30
]
end
2020-04-22 19:07:51 +05:30
let(:structure) do
[
2021-09-30 23:02:18 +05:30
{
nav_item: "#{group.name[0, 1].upcase} #{group.name}",
nav_sub_items: []
},
{
2022-05-07 20:08:51 +05:30
nav_item: group.root? ? _('Group information') : _('Subgroup information'),
2021-09-30 23:02:18 +05:30
nav_sub_items: [
_('Activity'),
_('Labels'),
_('Members')
]
},
2020-04-22 19:07:51 +05:30
{
nav_item: _('Issues'),
2021-06-08 01:23:25 +05:30
nav_sub_items: issues_nav_items
2020-04-22 19:07:51 +05:30
},
{
2021-04-29 21:17:54 +05:30
nav_item: _('Merge requests'),
2020-04-22 19:07:51 +05:30
nav_sub_items: []
},
2021-09-30 23:02:18 +05:30
(security_and_compliance_nav_item if Gitlab.ee?),
2020-04-22 19:07:51 +05:30
{
nav_item: _('Kubernetes'),
nav_sub_items: []
},
2021-06-08 01:23:25 +05:30
(analytics_nav_item if Gitlab.ee?)
2020-04-22 19:07:51 +05:30
]
end
end