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

224 lines
4.2 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
let(:analytics_nav_item) do
{
nav_item: _('Analytics'),
nav_sub_items: [
2021-04-17 20:07:23 +05:30
_('CI/CD'),
2020-04-22 19:07:51 +05:30
(_('Code Review') if Gitlab.ee?),
2020-10-24 23:57:45 +05:30
(_('Merge Request') if Gitlab.ee?),
2020-04-22 19:07:51 +05:30
_('Repository'),
_('Value Stream')
]
}
end
2021-02-22 17:27:13 +05:30
let(:security_and_compliance_nav_item) do
{
nav_item: _('Security & Compliance'),
nav_sub_items: [
2021-03-11 19:13:27 +05:30
_('Configuration'),
(_('Audit Events') if Gitlab.ee?)
2021-02-22 17:27:13 +05:30
]
}
end
2021-06-08 01:23:25 +05:30
let(:monitor_nav_item) do
{
nav_item: _('Operations'),
nav_sub_items: monitor_menu_items
}
end
let(:monitor_menu_items) do
[
_('Metrics'),
_('Logs'),
_('Tracing'),
_('Error Tracking'),
_('Alerts'),
_('Incidents'),
_('Serverless'),
_('Terraform'),
_('Kubernetes'),
_('Environments'),
_('Feature Flags'),
_('Product Analytics')
]
end
let(:project_information_nav_item) do
{
nav_item: _('Project overview'),
nav_sub_items: [
_('Details'),
_('Activity'),
_('Releases')
]
}
end
let(:settings_menu_items) do
[
_('General'),
_('Integrations'),
_('Webhooks'),
_('Access Tokens'),
_('Repository'),
_('CI/CD'),
_('Operations')
]
end
2020-04-22 19:07:51 +05:30
let(:structure) do
[
2021-06-08 01:23:25 +05:30
project_information_nav_item,
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'),
2021-01-03 14:25:43 +05:30
_('Milestones'),
(_('Iterations') if Gitlab.ee?)
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-06-08 01:23:25 +05:30
monitor_nav_item,
2020-04-22 19:07:51 +05:30
analytics_nav_item,
{
nav_item: _('Wiki'),
nav_sub_items: []
},
{
nav_item: _('Snippets'),
nav_sub_items: []
},
{
nav_item: _('Settings'),
2021-06-08 01:23:25 +05:30
nav_sub_items: settings_menu_items
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'),
nav_sub_items: [
2021-06-08 01:23:25 +05:30
_('Contribution')
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'),
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'),
2021-03-08 18:12:59 +05:30
_('Packages & Registries'),
2021-02-22 17:27:13 +05:30
_('Webhooks')
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: [
_('Audit Events')
]
}
end
2020-11-24 15:15:51 +05:30
let(:push_rules_nav_item) do
{
nav_item: _('Push Rules'),
nav_sub_items: []
}
end
2021-06-08 01:23:25 +05:30
let(:group_information_nav_item) do
{
nav_item: _('Group information'),
nav_sub_items: [
_('Activity'),
_('Labels'),
_('Members')
]
}
end
let(:issues_nav_items) do
[
_('List'),
_('Board'),
_('Milestones')
]
end
2020-04-22 19:07:51 +05:30
let(:structure) do
[
2021-06-08 01:23:25 +05:30
group_information_nav_item,
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-03-11 19:13:27 +05:30
security_and_compliance_nav_item,
2020-11-24 15:15:51 +05:30
(push_rules_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