diff --git a/platforms/marketplace/client/assets/blabsy.svg b/platforms/marketplace/client/assets/blabsy.svg deleted file mode 100644 index 8579d2462..000000000 --- a/platforms/marketplace/client/assets/blabsy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/platforms/marketplace/client/assets/pictique-logo.svg b/platforms/marketplace/client/assets/pictique-logo.svg deleted file mode 100644 index a8ac8a172..000000000 --- a/platforms/marketplace/client/assets/pictique-logo.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/platforms/marketplace/client/assets/pictique.svg b/platforms/marketplace/client/assets/pictique.svg deleted file mode 100644 index a8ac8a172..000000000 --- a/platforms/marketplace/client/assets/pictique.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/platforms/marketplace/client/client/src/data/apps.json b/platforms/marketplace/client/client/src/data/apps.json index 7a7ec1e85..5313b1f77 100644 --- a/platforms/marketplace/client/client/src/data/apps.json +++ b/platforms/marketplace/client/client/src/data/apps.json @@ -8,22 +8,6 @@ "appStoreUrl": "https://apps.apple.com/in/app/eid-for-w3ds/id6747748667", "playStoreUrl": "https://play.google.com/store/apps/details?id=foundation.metastate.eid_wallet" }, - { - "id": "blabsy", - "name": "Blabsy", - "description": "Micro blogging first style application for sharing thoughts across the W3DS ecosystem.", - "category": "Social", - "logoUrl": "/blabsy.svg", - "url": "https://blabsy.w3ds.metastate.foundation" - }, - { - "id": "pictique", - "name": "Pictique", - "description": "Photo sharing first style application for sharing moments across the W3DS ecosystem.", - "category": "Social", - "logoUrl": "/pictique.svg", - "url": "https://pictique.w3ds.metastate.foundation" - }, { "id": "evoting", "name": "eVoting", diff --git a/platforms/marketplace/client/client/src/pages/app-detail.tsx b/platforms/marketplace/client/client/src/pages/app-detail.tsx index c8105e84e..4e008615d 100644 --- a/platforms/marketplace/client/client/src/pages/app-detail.tsx +++ b/platforms/marketplace/client/client/src/pages/app-detail.tsx @@ -11,14 +11,6 @@ const appDetails: Record a.id.toLowerCase())); const staticNames = new Set(staticApps.map((a) => a.name.toLowerCase())); - // Static entries win on collision (they carry richer logos/URLs/descriptions). - const dynamicApps = (platformsData?.platforms ?? []).filter( + const livePlatforms = platformsData?.platforms ?? []; + const liveByKey = new Map(); + for (const p of livePlatforms) { + liveByKey.set(p.id.toLowerCase(), p); + liveByKey.set(p.name.toLowerCase(), p); + } + + // Static entries win on collision (they carry richer logos/URLs/descriptions), + // except for the category, which the live platform declares for itself. + const mergedStatic = staticApps.map((a) => { + const live = liveByKey.get(a.id.toLowerCase()) ?? liveByKey.get(a.name.toLowerCase()); + return live?.category ? { ...a, category: live.category } : a; + }); + const dynamicApps = livePlatforms.filter( (p) => !staticIds.has(p.id.toLowerCase()) && !staticNames.has(p.name.toLowerCase()), ); - const apps: App[] = [...staticApps, ...dynamicApps]; - - const categories = [ - "All Apps", - ...Array.from(new Set([...BASE_CATEGORIES, ...apps.map((a) => a.category)])), - ]; + const apps: App[] = [...mergedStatic, ...dynamicApps]; + + // Categories are whatever the listed platforms declare, deduped + // case-insensitively (first spelling wins), with "Other" pushed last. + const categoryLabels = new Map(); + for (const app of apps) { + const label = app.category?.trim(); + if (label && !categoryLabels.has(label.toLowerCase())) { + categoryLabels.set(label.toLowerCase(), label); + } + } + const other = categoryLabels.get("other"); + categoryLabels.delete("other"); + const categories = ["All Apps", ...Array.from(categoryLabels.values()), ...(other ? [other] : [])]; const filteredApps = apps.filter(app => { const matchesSearch = app.name.toLowerCase().includes(searchQuery.toLowerCase()) || app.description.toLowerCase().includes(searchQuery.toLowerCase()); const matchesCategory = selectedCategory === "All Apps" || - app.category.toLowerCase() === selectedCategory.toLowerCase(); + app.category?.trim().toLowerCase() === selectedCategory.toLowerCase(); return matchesSearch && matchesCategory; }); diff --git a/platforms/marketplace/client/server/aaas.ts b/platforms/marketplace/client/server/aaas.ts index 0e89ce6da..fc058aec9 100644 --- a/platforms/marketplace/client/server/aaas.ts +++ b/platforms/marketplace/client/server/aaas.ts @@ -158,7 +158,8 @@ export async function listPlatforms(): Promise { id: data.platformName, name: data.displayName || data.platformName, description: data.description || "", - category: data.category || "Other", + category: + (typeof data.category === "string" && data.category.trim()) || "Other", logoUrl: data.logoUrl || null, url: data.url || "", ename,