-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathNavData.tsx
330 lines (318 loc) · 7.96 KB
/
NavData.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
import type { ReactElement } from 'react'
import deepFreeze from 'deep-freeze'
import { APP_CATALOG_BASE_URL } from './consts/routes'
import type { Repo } from './data/getRepos'
export type NavMenuId = 'docs' | 'appCatalog'
export type MenuId = NavMenuId | 'plural'
export type NavData = Record<NavMenuId, NavMenu>
export type NavItem = {
title?: string
href?: string
toMenu?: MenuId
icon?: ReactElement
sections?: NavItem[]
}
export type NavMenu = NavItem[]
export function findNavItem(
test: (arg: NavItem) => boolean,
section: NavMenu
): NavItem | null {
for (const item of section) {
if (test(item)) {
return item
}
const search = findNavItem(test, item.sections || [])
if (search) {
return search
}
}
return null
}
const rootNavData: NavMenu = deepFreeze([
{
title: 'Overview',
sections: [
{
title: 'Introduction',
href: '/introduction',
},
],
},
{
title: 'Plural Fleet Management',
sections: [
{
href: '/getting-started/deployments',
title: 'Getting Started',
sections: [
{
title: 'Architecture',
href: '/deployments/architecture',
},
{
href: '/deployments/existing-cluster',
title: 'Set Up on your own Cluster',
},
{
title: 'Quickstart with our CLI',
href: '/deployments/cli-quickstart',
},
{
href: '/deployments/advanced-configuration',
title: 'Advanced Configuration',
sections: [
{
title: 'Sandboxing Your Cluster',
href: '/deployments/sandboxing',
},
{
title: 'Network Configuration',
href: '/deployments/network-configuration',
},
{
title: 'Private CAs',
href: '/deployments/private-ca',
},
],
},
],
},
{
href: '/how-to',
title: 'How To Use Plural',
sections: [
{
title: 'Setting Up Your Management Cluster',
href: '/how-to/set-up/mgmt-cluster',
},
{
title: 'Setting Up Your Kubernetes Dashboard with RBAC',
href: '/how-to/set-up/rbac',
},
{
title: 'Integrate with your Source Control Provider',
href: '/how-to/set-up/scm-connection',
},
{
title: 'Set Up Your First Workload Cluster',
href: '/how-to/set-up/workload-cluster',
},
{
title: 'Set Up a Network Stack and other K8s Add-Ons',
href: '/how-to/set-up/controllers',
},
{
title: 'Set Up a Basic Self-Service Worklfow with PR Automations',
href: '/how-to/deploy/pr-automation',
},
{
title: 'Deploy Your First Microservice to a Workload Cluster',
href: '/how-to/deploy/microservice',
},
{
title: 'Setup Your First Microservice Promotion Pipeline',
href: '/how-to/deploy/pipelines',
},
],
},
{
href: '/deployments/using-operator',
title: 'Deploying Using Plural Continuous Deployment',
sections: [
{
title: 'Architecture',
href: '/deployments/operator/architecture',
},
{
title: 'API Reference',
href: '/deployments/operator/api',
},
{
title: 'Git Services',
href: '/deployments/operator/git-service',
},
{
title: 'Helm Services',
href: '/deployments/operator/helm-service',
},
{
title: 'Global Services',
href: '/deployments/operator/global-service',
},
],
},
{
href: '/stacks/',
title: 'Iac Management with Stacks',
sections: [
{
title: 'Overview',
href: '/stacks/overview',
},
{
title: 'Customizing Stack Runners',
href: '/stacks/customize-runners',
},
{
title: 'Pull Request Workflow',
href: '/stacks/pr-workflow',
},
{
title: 'Manual Runs',
href: '/stacks/manual-runs',
},
{
title: 'Executing IaC Locally',
href: '/stacks/local-execution',
},
{
title: 'Custom Stacks',
href: '/stacks/custom-stacks',
},
{
title: 'Auto-Cancellation',
href: '/stacks/auto-cancellation',
},
{
href: '/deployments/terraform-interop',
title: 'Service Contexts',
},
],
},
{
href: '/deployments/pr-automation',
title: 'Pull Request Automation',
sections: [
{
title: 'On Demand Pull Requests',
href: '/deployments/pr/crds',
},
{
title: 'Testing PR Automations',
href: '/deployments/pr/testing',
},
{
title: 'Pull Request Pipelines',
href: '/deployments/pr/pipelines',
},
],
},
{
href: '/deployments/multi-tenancy',
title: 'Projects and Multi-Tenancy',
},
{
href: '/deployments/dashboard',
title: 'Kubernetes Dashboard',
},
{
href: '/deployments/templating',
title: 'Service Templating',
sections: [
{
href: '/deployments/templating-filters',
title: 'Supported Liquid Filters',
},
],
},
{
href: '/deployments/notifications',
title: 'Notifications',
},
{
href: '/deployments/operations',
title: 'Advanced Operations',
sections: [
{
title: 'Managing Deprecations and K8s upgrades',
href: '/deployments/deprecations',
},
],
},
],
},
{
title: 'Plural AI',
sections: [
{
href: '/ai/overview',
title: 'What is Plural AI?',
},
{
href: '/ai/setup',
title: 'Setting Up Plural AI',
},
{
href: '/ai/architecture',
title: 'How Plural AI Works',
},
{
href: '/ai/cost',
title: 'How Much Will Plural AI Cost',
},
],
},
{
title: 'Service Catalog',
sections: [
{
href: '/catalog/overview',
title: 'Overview',
},
{
href: '/catalog/creation',
title: 'Creating Your Own Catalog',
},
{
href: '/catalog/contributing',
title: 'Contributing to the Mainline Plural Catalog',
},
],
},
{
title: 'FAQ',
sections: [
{
href: '/operations/security',
title: 'What does Plural have access to?',
},
{
href: '/operations/auth-access-control/openid-connect',
title: 'What is Plural OIDC?',
},
{
href: '/faq/certifications',
title: 'What certifications does Plural have?',
},
{
href: '/faq/plural-paid-tiers',
title: 'How do the paid Plural tiers work?',
},
],
},
{
title: 'Changelog',
sections: [
{
href: '/reference/release-notes',
title: 'Release Notes',
},
],
},
])
export const getNavData = ({ repos }: { repos: Repo[] }): NavData => ({
docs: rootNavData,
appCatalog: [
{
title: 'Application Catalog',
href: APP_CATALOG_BASE_URL,
sections: [
{ title: 'Catalog Overview', href: APP_CATALOG_BASE_URL },
...repos.map((repo) => ({
title: repo.displayName,
href: `${APP_CATALOG_BASE_URL}/${repo.name}`,
})),
],
},
],
})