Skip to content

Commit a7861d1

Browse files
authored
fix(search): search filters, keyword mapping (#112)
* docs.embedded, last resort embedded docs on fail * docs.filterWords, lists for filtering keywords * docs.json, adjust writing guidance placement * pf.getResources, api prep, keywords mapping, simplify returned data * pf.helpers, remove unused filter, search response adjustment * pf.search, filtering standalone func, any value search * server.search, any value search, annotations refactor * tools, move tools to new search response
1 parent 2dfe03b commit a7861d1

21 files changed

+1491
-733
lines changed

src/__tests__/__snapshots__/docs.embedded.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exports[`EMBEDDED_DOCS should export the expected embedded docs structure: docs
3838
},
3939
{
4040
"category": "reference",
41-
"description": "PatternFly organization on GitHub (Core & React).",
41+
"description": "PatternFly organization on GitHub.",
4242
"displayName": "PatternFly GitHub",
4343
"path": "https://github.com/patternfly",
4444
"pathSlug": "patternfly-github",

src/__tests__/__snapshots__/patternFly.getResources.test.ts.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

3+
exports[`getPatternFlyComponentNames should return multiple organized facets: properties 1`] = `
4+
[
5+
"componentNamesIndex",
6+
"componentNamesIndexMap",
7+
"byVersion",
8+
]
9+
`;
10+
311
exports[`getPatternFlyMcpResources should return multiple organized facets: properties 1`] = `
412
[
513
"availableSemVer",
@@ -15,8 +23,9 @@ exports[`getPatternFlyMcpResources should return multiple organized facets: prop
1523
"resources",
1624
"docsIndex",
1725
"componentsIndex",
18-
"keywordsIndex",
1926
"isFallbackDocumentation",
27+
"keywordsIndex",
28+
"keywordsMap",
2029
"pathIndex",
2130
"byPath",
2231
"byUri",
@@ -25,15 +34,6 @@ exports[`getPatternFlyMcpResources should return multiple organized facets: prop
2534
]
2635
`;
2736

28-
exports[`getPatternFlyReactComponentNames should return multiple organized facets: properties 1`] = `
29-
[
30-
"byVersion",
31-
"componentNamesIndex",
32-
"componentNamesWithSchemasIndex",
33-
"componentNamesWithSchemasMap",
34-
]
35-
`;
36-
3737
exports[`setCategoryDisplayLabel should normalize categories and apply linking markdown, accessibility 1`] = `"Accessibility"`;
3838

3939
exports[`setCategoryDisplayLabel should normalize categories and apply linking markdown, design 1`] = `"Design Guidelines"`;

src/__tests__/__snapshots__/patternFly.helpers.test.ts.snap

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,5 @@
11
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

3-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, current 1`] = `
4-
[
5-
"v6",
6-
]
7-
`;
8-
9-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, detected 1`] = `
10-
[
11-
"v6",
12-
]
13-
`;
14-
15-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, empty 1`] = `
16-
[
17-
"current",
18-
"latest",
19-
"v6",
20-
]
21-
`;
22-
23-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, exact semver 1`] = `
24-
[
25-
"v6",
26-
]
27-
`;
28-
29-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, latest 1`] = `
30-
[
31-
"v6",
32-
]
33-
`;
34-
35-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, null 1`] = `
36-
[
37-
"current",
38-
"latest",
39-
"v6",
40-
]
41-
`;
42-
43-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, semver 1`] = `
44-
[
45-
"v6",
46-
]
47-
`;
48-
49-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, tag 1`] = `
50-
[
51-
"v6",
52-
]
53-
`;
54-
55-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, unavailable exact semver 1`] = `
56-
[
57-
"current",
58-
"latest",
59-
"v6",
60-
]
61-
`;
62-
63-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, unavailable semver 1`] = `
64-
[
65-
"current",
66-
"latest",
67-
"v6",
68-
]
69-
`;
70-
71-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, unavailable tag 1`] = `
72-
[
73-
"current",
74-
"latest",
75-
"v6",
76-
]
77-
`;
78-
79-
exports[`filterEnumeratedPatternFlyVersions should attempt to refine a PatternFly versions based on available enumerations, undefined 1`] = `
80-
[
81-
"current",
82-
"latest",
83-
"v6",
84-
]
85-
`;
86-
873
exports[`getPatternFlyVersionContext should temporarily return option.defaults and latest versions with specific properties: keys 1`] = `
884
[
895
"availableSemVer",

src/__tests__/__snapshots__/patternFly.search.test.ts.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ exports[`searchPatternFly should attempt to return an array of all available res
55
"isSearchWildCardAll",
66
"firstExactMatch",
77
"exactMatches",
8+
"remainingMatches",
9+
"totalResults",
10+
"totalPotentialMatches",
811
]
912
`;
1013

@@ -13,6 +16,9 @@ exports[`searchPatternFly should attempt to return an array of all available res
1316
"isSearchWildCardAll",
1417
"firstExactMatch",
1518
"exactMatches",
19+
"remainingMatches",
20+
"totalResults",
21+
"totalPotentialMatches",
1622
]
1723
`;
1824

@@ -21,5 +27,8 @@ exports[`searchPatternFly should attempt to return an array of all available res
2127
"isSearchWildCardAll",
2228
"firstExactMatch",
2329
"exactMatches",
30+
"remainingMatches",
31+
"totalResults",
32+
"totalPotentialMatches",
2433
]
2534
`;

0 commit comments

Comments
 (0)