feat(FN-3899): add chat rooms with send routing and delete-room UI
This merge delivers chat rooms with room send routing and delete-room UI in the dashboard (FN-3899), including fixes for bundled plugin view imports and a release changeset. Supporting changes include a merger improvement that tightens scope-warning diff base when baseBranch is missing, companies.sh Fusion-Task-Id: FN-3899
This commit is contained in:
@@ -1,8 +1,29 @@
|
||||
import { lazy } from "react";
|
||||
import type { ComponentType } from "react";
|
||||
import { registerPluginView } from "./pluginViewRegistry";
|
||||
|
||||
let registered = false;
|
||||
|
||||
function createMissingPluginView(moduleId: string): ComponentType {
|
||||
return function MissingPluginView() {
|
||||
return `Bundled plugin view unavailable: ${moduleId}`;
|
||||
};
|
||||
}
|
||||
|
||||
async function loadBundledPluginView(moduleId: string, exportName: string) {
|
||||
try {
|
||||
const mod = await import(/* @vite-ignore */ moduleId) as Record<string, ComponentType>;
|
||||
const component = mod[exportName];
|
||||
if (component) {
|
||||
return { default: component };
|
||||
}
|
||||
} catch {
|
||||
// Fall back to placeholder view when optional bundled plugin examples are unavailable.
|
||||
}
|
||||
|
||||
return { default: createMissingPluginView(moduleId) };
|
||||
}
|
||||
|
||||
export function registerBundledPluginViews(): void {
|
||||
if (registered) return;
|
||||
registered = true;
|
||||
@@ -10,18 +31,12 @@ export function registerBundledPluginViews(): void {
|
||||
registerPluginView(
|
||||
"fusion-plugin-dependency-graph",
|
||||
"graph",
|
||||
lazy(async () => {
|
||||
const mod = await import("@fusion-plugin-examples/dependency-graph/dashboard-view");
|
||||
return { default: mod.DependencyGraphDashboardView };
|
||||
}),
|
||||
lazy(() => loadBundledPluginView("@fusion-plugin-examples/dependency-graph/dashboard-view", "DependencyGraphDashboardView")),
|
||||
);
|
||||
|
||||
registerPluginView(
|
||||
"roadmap-planner",
|
||||
"roadmaps",
|
||||
lazy(async () => {
|
||||
const mod = await import("@fusion-plugin-examples/roadmap/dashboard-view");
|
||||
return { default: mod.RoadmapDashboardView };
|
||||
}),
|
||||
lazy(() => loadBundledPluginView("@fusion-plugin-examples/roadmap/dashboard-view", "RoadmapDashboardView")),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user