@f5-sales-demo/docs-theme 4.12.0 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Sidebar from '@astrojs/starlight/components/Sidebar.astro';
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<div data-statistics-sidebar>
|
|
6
|
+
<Sidebar />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<script is:inline>
|
|
10
|
+
// Restore the active reading path after Starlight restores saved toggle state.
|
|
11
|
+
document.querySelectorAll('[data-statistics-sidebar] details').forEach((group) => {
|
|
12
|
+
if (group.querySelector('a[aria-current="page"]')) group.open = true;
|
|
13
|
+
});
|
|
14
|
+
</script>
|
package/index.ts
CHANGED
|
@@ -43,7 +43,9 @@ export default function f5xcDocsTheme(repository = process.env.GITHUB_REPOSITORY
|
|
|
43
43
|
? {
|
|
44
44
|
Sidebar: '@f5-sales-demo/docs-theme/components/CanadaSidebar.astro',
|
|
45
45
|
}
|
|
46
|
-
:
|
|
46
|
+
: repository.split('/').pop() === 'statistics'
|
|
47
|
+
? { Sidebar: '@f5-sales-demo/docs-theme/components/StatisticsSidebar.astro' }
|
|
48
|
+
: {}),
|
|
47
49
|
Banner: '@f5-sales-demo/docs-theme/components/Banner.astro',
|
|
48
50
|
EditLink: '@f5-sales-demo/docs-theme/components/EditLink.astro',
|
|
49
51
|
Footer: '@f5-sales-demo/docs-theme/components/Footer.astro',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@f5-sales-demo/docs-theme",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"description": "F5 Distributed Cloud branded Starlight documentation theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"./assets/canada-flag.svg": "./assets/canada-flag.svg",
|
|
51
51
|
"./assets/canada-favicon.svg": "./assets/canada-favicon.svg",
|
|
52
52
|
"./styles/shell.css": "./styles/shell.css",
|
|
53
|
-
"./components/LocalHeader.astro": "./components/LocalHeader.astro"
|
|
53
|
+
"./components/LocalHeader.astro": "./components/LocalHeader.astro",
|
|
54
|
+
"./components/StatisticsSidebar.astro": "./components/StatisticsSidebar.astro"
|
|
54
55
|
},
|
|
55
56
|
"files": [
|
|
56
57
|
"index.ts",
|
|
@@ -25,3 +25,14 @@ describe('Canada-only sidebar override', () => {
|
|
|
25
25
|
expect(configuredComponents('f5-sales-demo/multi-cloud-networking')).not.toHaveProperty('Sidebar');
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
|
|
29
|
+
describe('Statistics sidebar override', () => {
|
|
30
|
+
it('selects the sidebar that restores the active reading path', () => {
|
|
31
|
+
expect(configuredComponents('f5-sales-demo/statistics').Sidebar).toBe(
|
|
32
|
+
'@f5-sales-demo/docs-theme/components/StatisticsSidebar.astro',
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
it('preserves unrelated repository sidebars', () => {
|
|
36
|
+
expect(configuredComponents('f5-sales-demo/statistics-extra')).not.toHaveProperty('Sidebar');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -66,9 +66,9 @@ describe('Statistics publication', () => {
|
|
|
66
66
|
});
|
|
67
67
|
expect(repositoryPublicationProfile('statistics')?.favicon).toBeUndefined();
|
|
68
68
|
});
|
|
69
|
-
it('preserves
|
|
69
|
+
it('preserves existing routes and places Shell Scripts before Infrastructure', () => {
|
|
70
70
|
const sidebar = publicationSidebar('f5-sales-demo/statistics', []);
|
|
71
|
-
expect(sidebar?.slice(0,
|
|
71
|
+
expect(sidebar?.slice(0, 9)).toEqual([
|
|
72
72
|
{ slug: 'index' },
|
|
73
73
|
{ slug: 'access-logs' },
|
|
74
74
|
{ slug: 'service-graph' },
|
|
@@ -78,9 +78,33 @@ describe('Statistics publication', () => {
|
|
|
78
78
|
{ slug: 'firewall-metrics' },
|
|
79
79
|
{ slug: 'security-events' },
|
|
80
80
|
{ slug: 'troubleshooting' },
|
|
81
|
-
{ slug: 'api-catalog' },
|
|
82
|
-
{ slug: 'setup' },
|
|
83
81
|
]);
|
|
82
|
+
const catalog = sidebar?.[9];
|
|
83
|
+
expect(catalog).toMatchObject({ label: 'Statistics APIs', collapsed: true });
|
|
84
|
+
if (!catalog || !('items' in catalog)) throw new Error('Statistics APIs must be a submenu');
|
|
85
|
+
const expected = [
|
|
86
|
+
'api-catalog',
|
|
87
|
+
'api-catalog/query-concepts',
|
|
88
|
+
'api-catalog/application-traffic',
|
|
89
|
+
'api-catalog/api-analytics',
|
|
90
|
+
'api-catalog/application-security',
|
|
91
|
+
'api-catalog/bot-defense',
|
|
92
|
+
'api-catalog/client-side-defense',
|
|
93
|
+
'api-catalog/device-data-intelligence',
|
|
94
|
+
'api-catalog/ddos-protection',
|
|
95
|
+
'api-catalog/dns',
|
|
96
|
+
'api-catalog/cdn',
|
|
97
|
+
'api-catalog/networking',
|
|
98
|
+
'api-catalog/kubernetes-storage',
|
|
99
|
+
'api-catalog/logs-events-alerts',
|
|
100
|
+
'api-catalog/synthetic-monitoring',
|
|
101
|
+
'api-catalog/billing-usage',
|
|
102
|
+
];
|
|
103
|
+
expect(catalog.items.map((item) => ('slug' in item ? item.slug : ''))).toEqual(expected);
|
|
104
|
+
expect(catalog.items.every((item) => 'label' in item && item.label.split(/\s+/).length <= 3)).toBe(true);
|
|
105
|
+
expect(catalog.items[0]).toEqual({ label: 'Overview', slug: 'api-catalog' });
|
|
106
|
+
expect(catalog.items[1]).toEqual({ label: 'Query concepts', slug: 'api-catalog/query-concepts' });
|
|
107
|
+
expect(sidebar?.[10]).toEqual({ slug: 'setup' });
|
|
84
108
|
expect(sidebar?.[11]).toEqual({ slug: 'shell-scripts' });
|
|
85
109
|
expect(sidebar?.[12]).toEqual({
|
|
86
110
|
label: 'Infrastructure',
|
|
@@ -95,8 +119,8 @@ describe('Statistics publication', () => {
|
|
|
95
119
|
? item.items.map((child) => ('slug' in child ? child.slug : ''))
|
|
96
120
|
: [],
|
|
97
121
|
);
|
|
98
|
-
expect(routes).toHaveLength(
|
|
99
|
-
expect(new Set(routes).size).toBe(
|
|
122
|
+
expect(routes).toHaveLength(29);
|
|
123
|
+
expect(new Set(routes).size).toBe(29);
|
|
100
124
|
});
|
|
101
125
|
it('preserves supplied fallback navigation for other repositories', () => {
|
|
102
126
|
const fallback = [{ slug: 'index' }, { label: 'Existing', items: [{ slug: 'existing' }] }];
|
|
@@ -24,7 +24,28 @@ export const publicationProfiles: Record<string, PublicationProfile> = {
|
|
|
24
24
|
{ slug: 'firewall-metrics' },
|
|
25
25
|
{ slug: 'security-events' },
|
|
26
26
|
{ slug: 'troubleshooting' },
|
|
27
|
-
{
|
|
27
|
+
{
|
|
28
|
+
label: 'Statistics APIs',
|
|
29
|
+
collapsed: true,
|
|
30
|
+
items: [
|
|
31
|
+
{ label: 'Overview', slug: 'api-catalog' },
|
|
32
|
+
{ label: 'Query concepts', slug: 'api-catalog/query-concepts' },
|
|
33
|
+
{ label: 'Application traffic', slug: 'api-catalog/application-traffic' },
|
|
34
|
+
{ label: 'API analytics', slug: 'api-catalog/api-analytics' },
|
|
35
|
+
{ label: 'Application security', slug: 'api-catalog/application-security' },
|
|
36
|
+
{ label: 'Bot defense', slug: 'api-catalog/bot-defense' },
|
|
37
|
+
{ label: 'Client-side defense', slug: 'api-catalog/client-side-defense' },
|
|
38
|
+
{ label: 'Device intelligence', slug: 'api-catalog/device-data-intelligence' },
|
|
39
|
+
{ label: 'DDoS protection', slug: 'api-catalog/ddos-protection' },
|
|
40
|
+
{ label: 'DNS', slug: 'api-catalog/dns' },
|
|
41
|
+
{ label: 'CDN', slug: 'api-catalog/cdn' },
|
|
42
|
+
{ label: 'Networking', slug: 'api-catalog/networking' },
|
|
43
|
+
{ label: 'Kubernetes & storage', slug: 'api-catalog/kubernetes-storage' },
|
|
44
|
+
{ label: 'Logs & events', slug: 'api-catalog/logs-events-alerts' },
|
|
45
|
+
{ label: 'Synthetic monitoring', slug: 'api-catalog/synthetic-monitoring' },
|
|
46
|
+
{ label: 'Billing & usage', slug: 'api-catalog/billing-usage' },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
28
49
|
{ slug: 'setup' },
|
|
29
50
|
{ slug: 'shell-scripts' },
|
|
30
51
|
{
|