fix(spaces): filter disabled modules from space dashboard
renderSpaceDashboard was showing all modules regardless of space's enabledModules setting — both in the app cards grid and the app-switcher dropdown. Now filters using getSpaceShellMeta, same as renderShell. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cc504d4a86
commit
823d2c4110
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import type { ModuleInfo } from "../shared/module";
|
||||
import { escapeHtml, escapeAttr, MODULE_LANDING_CSS, RICH_LANDING_CSS, versionAssetUrls } from "./shell";
|
||||
import { escapeHtml, escapeAttr, MODULE_LANDING_CSS, RICH_LANDING_CSS, versionAssetUrls, getSpaceShellMeta } from "./shell";
|
||||
|
||||
export function renderMainLanding(modules: ModuleInfo[]): string {
|
||||
const moduleListJSON = JSON.stringify(modules);
|
||||
|
|
@ -266,13 +266,18 @@ export function renderMainLanding(modules: ModuleInfo[]): string {
|
|||
// ── Space Dashboard ──
|
||||
|
||||
export function renderSpaceDashboard(space: string, modules: ModuleInfo[]): string {
|
||||
const moduleListJSON = JSON.stringify(modules);
|
||||
// Filter modules by space's enabledModules
|
||||
const enabledModules = getSpaceShellMeta(space).enabledModules;
|
||||
const visibleModules = enabledModules
|
||||
? modules.filter(m => m.id === "rspace" || enabledModules.includes(m.id))
|
||||
: modules;
|
||||
const moduleListJSON = JSON.stringify(visibleModules);
|
||||
const displayName = space === "demo" ? "Demo Space" : space;
|
||||
const subtitle = space === "demo"
|
||||
? "Explore the rSpace ecosystem — click any rApp to try it live with sample data."
|
||||
: `${modules.length} rApps available in this space.`;
|
||||
: `${visibleModules.length} rApps available in this space.`;
|
||||
|
||||
const appCards = modules
|
||||
const appCards = visibleModules
|
||||
.map((m) => {
|
||||
return `
|
||||
<a href="/${escapeAttr(m.id)}" class="sd-card" data-module="${escapeAttr(m.id)}">
|
||||
|
|
|
|||
Loading…
Reference in New Issue