Skip to content

Commit 7afe8e9

Browse files
authored
Merge pull request #1165 from grafana/extension-cards-update
fix: extensions counts when filtering
2 parents 0326468 + 57fcb20 commit 7afe8e9

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/components/pages/doc-extensions/extension-selection/extension-selection.view.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,13 @@ export const ExtensionSelection = ({ data, description = '' }) => {
9595
);
9696

9797
const totalActiveExtensions = useMemo(
98-
() =>
99-
activeCategories
100-
.map((category) => filteredExtensionsByCategory(category))
101-
.flat(),
98+
() => [
99+
...new Set(
100+
activeCategories
101+
.map((category) => filteredExtensionsByCategory(category))
102+
.flat(),
103+
),
104+
],
102105
[activeCategories, activeTier, activeType, extensions],
103106
);
104107

@@ -352,7 +355,8 @@ export const ExtensionSelection = ({ data, description = '' }) => {
352355
<p className={styles.result}>
353356
<span>
354357
<b className={styles.number}>{totalActiveExtensions.length}</b>{' '}
355-
result{totalActiveExtensions.length === 1 ? '' : 's'} found
358+
result
359+
{totalActiveExtensions.length === 1 ? '' : 's'} found
356360
</span>{' '}
357361
<Button
358362
className={styles.clearButton}
@@ -391,7 +395,7 @@ export const ExtensionSelection = ({ data, description = '' }) => {
391395
</div>
392396
</div>
393397
)}
394-
<div className="">
398+
<div>
395399
{/* eslint-disable-next-line no-nested-ternary */}
396400
{totalActiveExtensions.length === 0 ? (
397401
<div className={styles.notFoundWrapper}>

src/components/shared/form-message/form-message.view.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import MarketoForm from 'components/shared/marketo-form';
21
import PropTypes from 'prop-types';
32
import React from 'react';
43

@@ -26,7 +25,7 @@ const FormMessage = ({ type }) => (
2625
</div>
2726
);
2827

29-
MarketoForm.propTypes = {
28+
FormMessage.propTypes = {
3029
type: PropTypes.string.isRequired,
3130
};
3231

src/templates/docs/bundle-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const BundleBuilderPage = ({ pageContext: { sidebarTree, navLinks } }) => {
102102
Don&apos;t see what you need? Learn how you can{' '}
103103
<Link
104104
to={'/extensions/get-started/create/'}
105-
class={docPageContent.link}
105+
className={docPageContent.link}
106106
>
107107
create
108108
</Link>{' '}

0 commit comments

Comments
 (0)