@f5-sales-demo/docs-theme 4.9.0 → 4.9.1
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.
- package/config.ts +4 -6
- package/package.json +1 -1
- package/src/utils/localize-ecosystem-href.test.ts +13 -13
package/config.ts
CHANGED
|
@@ -156,11 +156,9 @@ export const defaultMegaMenuItems: MegaMenuItem[] = [
|
|
|
156
156
|
translations: categoryTitles['App & API Security'],
|
|
157
157
|
items: [
|
|
158
158
|
{
|
|
159
|
-
label: 'Web App
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
descriptionTranslations: itemDescriptions['Firewall policies and configuration'],
|
|
163
|
-
href: 'https://f5-sales-demo.github.io/waf/',
|
|
159
|
+
label: 'Web App & API Protection',
|
|
160
|
+
description: 'Web application and API protection demonstrations',
|
|
161
|
+
href: 'https://f5-sales-demo.github.io/webapp-api-protection/',
|
|
164
162
|
icon: resolveMegaMenuIcon('f5xc:web-app-and-api-protection'),
|
|
165
163
|
},
|
|
166
164
|
{
|
|
@@ -660,7 +658,7 @@ export const federatedSearchSites = [
|
|
|
660
658
|
{ repo: 'bot-standard', label: 'Bot Standard' },
|
|
661
659
|
{ repo: 'bot-advanced', label: 'Bot Advanced' },
|
|
662
660
|
{ repo: 'ddos', label: 'DDoS' },
|
|
663
|
-
{ repo: '
|
|
661
|
+
{ repo: 'webapp-api-protection', label: 'Web App & API Protection' },
|
|
664
662
|
{ repo: 'api-protection', label: 'API Security' },
|
|
665
663
|
{ repo: 'xcsh', label: 'xcsh' },
|
|
666
664
|
{ repo: 'xcsh-action', label: 'xcsh Manifest Automation' },
|
package/package.json
CHANGED
|
@@ -21,28 +21,28 @@ describe('langToSlug', () => {
|
|
|
21
21
|
|
|
22
22
|
describe('localizeEcosystemHref', () => {
|
|
23
23
|
it('injects locale slug into ecosystem URLs', () => {
|
|
24
|
-
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/
|
|
25
|
-
expect(result).toBe('https://f5-sales-demo.github.io/
|
|
24
|
+
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/webapp-api-protection/', 'fr');
|
|
25
|
+
expect(result).toBe('https://f5-sales-demo.github.io/webapp-api-protection/fr/');
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
it('does not double-inject if locale already present', () => {
|
|
29
|
-
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/
|
|
30
|
-
expect(result).toBe('https://f5-sales-demo.github.io/
|
|
29
|
+
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/webapp-api-protection/fr/', 'fr');
|
|
30
|
+
expect(result).toBe('https://f5-sales-demo.github.io/webapp-api-protection/fr/');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
it('returns href unchanged for non-ecosystem hosts', () => {
|
|
34
|
-
const result = localizeEcosystemHref('https://example.com/
|
|
35
|
-
expect(result).toBe('https://example.com/
|
|
34
|
+
const result = localizeEcosystemHref('https://example.com/webapp-api-protection/', 'fr');
|
|
35
|
+
expect(result).toBe('https://example.com/webapp-api-protection/');
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it('returns href unchanged for invalid locale slug', () => {
|
|
39
|
-
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/
|
|
40
|
-
expect(result).toBe('https://f5-sales-demo.github.io/
|
|
39
|
+
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/webapp-api-protection/', 'xx-invalid');
|
|
40
|
+
expect(result).toBe('https://f5-sales-demo.github.io/webapp-api-protection/');
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
it('returns href unchanged for empty locale', () => {
|
|
44
|
-
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/
|
|
45
|
-
expect(result).toBe('https://f5-sales-demo.github.io/
|
|
44
|
+
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/webapp-api-protection/', '');
|
|
45
|
+
expect(result).toBe('https://f5-sales-demo.github.io/webapp-api-protection/');
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
it('returns invalid URLs unchanged', () => {
|
|
@@ -53,14 +53,14 @@ describe('localizeEcosystemHref', () => {
|
|
|
53
53
|
it('works with all 13 supported locale slugs', () => {
|
|
54
54
|
const slugs = ['en', 'fr', 'es', 'de', 'pt-br', 'ja', 'ko', 'zh-cn', 'zh-tw', 'ar', 'it', 'hi', 'th'];
|
|
55
55
|
for (const slug of slugs) {
|
|
56
|
-
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/
|
|
56
|
+
const result = localizeEcosystemHref('https://f5-sales-demo.github.io/webapp-api-protection/', slug);
|
|
57
57
|
expect(result).toContain(`/${slug}/`);
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
it('supports custom ecosystem host', () => {
|
|
62
|
-
const result = localizeEcosystemHref('https://docs.example.com/
|
|
63
|
-
expect(result).toBe('https://docs.example.com/
|
|
62
|
+
const result = localizeEcosystemHref('https://docs.example.com/webapp-api-protection/', 'fr', 'docs.example.com');
|
|
63
|
+
expect(result).toBe('https://docs.example.com/webapp-api-protection/fr/');
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('does not localize single-locale ecosystem sites (would 404)', () => {
|