Skip to content

Commit c32ecf5

Browse files
rashadismLakshanSS
authored andcommitted
feat: make plugin category optional and drop it from default componenttypes
Make `category` an optional field on the marketplace Plugin type so entries can omit it entirely. When absent: - the category sidebar skips the plugin (no empty row, no count) - the category filter excludes the plugin only when a filter is active - the item detail page skips rendering the category badge Drop `category` from the four default ComponentType entries (service, web-application, worker, scheduled-task) which had no natural category fit. Signed-off-by: Rashad Sirajudeen <rashad@wso2.com>
1 parent 99d5e1e commit c32ecf5

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/components/PluginCard/PluginCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Plugin {
88
group: string;
99
name: string;
1010
description: string;
11-
category: string;
11+
category?: string;
1212
tags: string[];
1313
logoUrl?: string;
1414
author: string;

src/data/marketplace-plugins.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,7 @@
660660
"id": "componenttype-service",
661661
"group": "component-type",
662662
"name": "Service",
663-
"description": "A long-running request-serving component with one or more endpoints.",
664-
"category": "Default",
663+
"description": "A request-serving workload like a backend API or microservice. Listens on one or more endpoints and stays running to handle incoming traffic. Runs as a Kubernetes Deployment.",
665664
"tags": [
666665
"component-type",
667666
"default",
@@ -677,8 +676,7 @@
677676
"id": "componenttype-web-application",
678677
"group": "component-type",
679678
"name": "Web Application",
680-
"description": "A long-running component that serves web requests and exposes at least one HTTP endpoint.",
681-
"category": "Default",
679+
"description": "An HTTP-serving frontend or full-stack web app, such as a single-page app, server-rendered app, or static site with a build step. Exposes at least one HTTP endpoint that end users hit in the browser. Runs as a Kubernetes Deployment.",
682680
"tags": [
683681
"component-type",
684682
"default",
@@ -694,8 +692,7 @@
694692
"id": "componenttype-worker",
695693
"group": "component-type",
696694
"name": "Worker",
697-
"description": "A long-running background or event-driven component with no endpoints.",
698-
"category": "Default",
695+
"description": "A background or event-driven workload that doesn't accept inbound requests, such as a queue consumer, stream processor, event handler, or long-running agent. Stays running and pulls work or reacts to events. Runs as a Kubernetes Deployment.",
699696
"tags": [
700697
"component-type",
701698
"default",
@@ -711,8 +708,7 @@
711708
"id": "componenttype-scheduled-task",
712709
"group": "component-type",
713710
"name": "Scheduled Task",
714-
"description": "A component that runs to completion on a schedule.",
715-
"category": "Default",
711+
"description": "A batch job that runs to completion on a recurring schedule, such as a report, cleanup, or periodic data sync. Starts, does its work, and exits until the next scheduled time. Runs as a Kubernetes CronJob.",
716712
"tags": [
717713
"component-type",
718714
"default",

src/pages/ecosystem.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface Plugin {
1212
group: string;
1313
name: string;
1414
description: string;
15-
category: string;
15+
category?: string;
1616
tags: string[];
1717
logoUrl?: string;
1818
author: string;
@@ -75,7 +75,8 @@ export default function Ecosystem(): ReactNode {
7575
selectedGroup === 'all' || p.group === selectedGroup;
7676

7777
const matchesCategory = (p: Plugin) =>
78-
selectedCategories.size === 0 || selectedCategories.has(p.category);
78+
selectedCategories.size === 0 ||
79+
(p.category !== undefined && selectedCategories.has(p.category));
7980

8081
const filteredPlugins = useMemo(() => {
8182
const result = plugins
@@ -99,6 +100,7 @@ export default function Ecosystem(): ReactNode {
99100
.filter((p) => matchesSearch(p, searchQuery))
100101
.filter(matchesGroup)
101102
.forEach((p) => {
103+
if (!p.category) return;
102104
counts.set(p.category, (counts.get(p.category) ?? 0) + 1);
103105
});
104106
return Array.from(counts.entries())

src/pages/ecosystem/item.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface Plugin {
1414
group: string;
1515
name: string;
1616
description: string;
17-
category: string;
17+
category?: string;
1818
tags: string[];
1919
logoUrl?: string;
2020
author: string;
@@ -602,7 +602,9 @@ export default function EcosystemItem(): ReactNode {
602602
<span className={`${styles.groupBadge} ${groupBadgeClass}`}>
603603
{groupLabel}
604604
</span>
605-
<span className={styles.categoryBadge}>{plugin.category}</span>
605+
{plugin.category && (
606+
<span className={styles.categoryBadge}>{plugin.category}</span>
607+
)}
606608
</div>
607609
<div className={styles.tagRow}>
608610
{plugin.tags.map((tag) => (

0 commit comments

Comments
 (0)