Skip to content

Commit 223ad03

Browse files
Merge pull request #2249 from redis/DOC-5826
Enable keyword search in integration summaries
2 parents ab29cd9 + 599cd3e commit 223ad03

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

layouts/integrate/list.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ <h1>{{ .Title }}</h1>
4646
{{ $labelColors := (dict "library" "bg-redis-yellow-500" "framework" "bg-violet-300" "observability" "bg-blue-300" "provisioning" "bg-redis-red-500" "mig" "bg-pink-300" "di" "bg-teal-300" "cloud-service" "bg-rose-300") }}
4747
{{ $labelText := (dict "mig" "data migration" "di" "data integration" "cloud-service" "cloud service") }}
4848
{{ range .CurrentSection.Sections }}
49-
<article
50-
class="flex flex-col gap-2 relative transition h-full text-redis-ink-900 hover:text-red-900 focus-within:text-red-900 bg-white hover:bg-red-50/50 focus-within:bg-red-50/50 border border-redis-pen-800 focus-within:ring-red-200 focus-within:ring-[3px] focus-within:outline-none bg-clip-padding rounded-md group"
51-
data-name="{{ .Title }}"
49+
<article
50+
class="flex flex-col gap-2 relative transition h-full text-redis-ink-900 hover:text-red-900 focus-within:text-red-900 bg-white hover:bg-red-50/50 focus-within:bg-red-50/50 border border-redis-pen-800 focus-within:ring-red-200 focus-within:ring-[3px] focus-within:outline-none bg-clip-padding rounded-md group"
51+
data-name="{{ .Title }}"
52+
data-summary="{{ .Params.summary }}"
5253
data-group="{{ .Params.group }}"
5354
data-version
5455
data-top

static/js/integrations-filters.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ function filterGridItems() {
2323
// Loop through each grid item
2424
gridItems.forEach(item => {
2525
const itemName = item.dataset.name.toLowerCase(); // Get the value of data-name attribute
26+
const itemSummary = (item.dataset.summary || '').toLowerCase(); // Get the value of data-summary attribute
2627
const itemGroup = item.dataset.group; // Get the value of data-group attribute
2728
const firstLetter = itemName.charAt(0); // Get the first letter of the item name
28-
29+
2930
// Check if the item matches the selected group (or if no group is selected), the name query, and the command query
3031
const matchesGroup = selectedGroup === '' || selectedGroup === itemGroup;
31-
const matchesName = itemName.includes(nameQuery);
32+
const matchesName = itemName.includes(nameQuery) || itemSummary.includes(nameQuery);
3233
const matchesAlpha = !selectedAlpha || firstLetter === selectedAlpha;
3334

3435
console.log(selectedGroup)
35-
36+
3637
// Show the item if it matches the selected group (or no group selected), the name query, and the command query, otherwise hide it
3738
item.style.display = matchesGroup && matchesName && matchesAlpha ? 'flex' : 'none';
3839
});

0 commit comments

Comments
 (0)