refactor(rnetwork): move Open CRM to sub-nav header
Remove standalone "Open CRM" button from graph view body and add "Open Twenty CRM" as an external link in the module sub-nav bar, next to Community CRM. Dashed border + margin-left:auto pushes it to the right edge for visual distinction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e6f78a67e8
commit
cab80f30e7
|
|
@ -622,8 +622,7 @@ routes.get("/", (c) => {
|
||||||
spaceSlug: space,
|
spaceSlug: space,
|
||||||
modules: getModuleInfoList(),
|
modules: getModuleInfoList(),
|
||||||
head: GRAPH3D_HEAD,
|
head: GRAPH3D_HEAD,
|
||||||
body: `<div class="rapp-nav" style="padding:0 1rem;margin-top:8px"><span class="rapp-nav__title"></span><a href="/${space}/rnetwork/crm" class="rapp-nav__btn--app-toggle">Open CRM</a></div>
|
body: `<folk-graph-viewer space="${space}"></folk-graph-viewer>`,
|
||||||
<folk-graph-viewer space="${space}"></folk-graph-viewer>`,
|
|
||||||
scripts: `<script type="module" src="/modules/rnetwork/folk-graph-viewer.js"></script>`,
|
scripts: `<script type="module" src="/modules/rnetwork/folk-graph-viewer.js"></script>`,
|
||||||
styles: `<link rel="stylesheet" href="/modules/rnetwork/network.css">`,
|
styles: `<link rel="stylesheet" href="/modules/rnetwork/network.css">`,
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -1362,6 +1362,13 @@ const SUBNAV_CSS = `
|
||||||
border-color: var(--rs-border);
|
border-color: var(--rs-border);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
.rapp-nav-pill--external {
|
||||||
|
margin-left: auto;
|
||||||
|
color: var(--rs-text-muted);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
border: 1px dashed var(--rs-border);
|
||||||
|
}
|
||||||
|
.rapp-nav-pill--external:hover { color: var(--rs-text-primary); border-style: solid; }
|
||||||
`;
|
`;
|
||||||
|
|
||||||
/** Build the module sub-nav bar from outputPaths + subPageInfos. */
|
/** Build the module sub-nav bar from outputPaths + subPageInfos. */
|
||||||
|
|
@ -1397,6 +1404,7 @@ function renderModuleSubNav(moduleId: string, spaceSlug: string, modules: Module
|
||||||
...items.map(it =>
|
...items.map(it =>
|
||||||
`<a class="rapp-nav-pill" href="${base}/${escapeAttr(it.path)}">${it.icon ? escapeHtml(it.icon) + ' ' : ''}${escapeHtml(it.label)}</a>`
|
`<a class="rapp-nav-pill" href="${base}/${escapeAttr(it.path)}">${it.icon ? escapeHtml(it.icon) + ' ' : ''}${escapeHtml(it.label)}</a>`
|
||||||
),
|
),
|
||||||
|
...(mod.externalApp ? [`<a class="rapp-nav-pill rapp-nav-pill--external" href="${escapeAttr(mod.externalApp.url)}" target="_blank" rel="noopener">Open ${escapeHtml(mod.externalApp.name)} ↗</a>`] : []),
|
||||||
];
|
];
|
||||||
|
|
||||||
return `<nav class="rapp-subnav" id="rapp-subnav">${pills.join('')}</nav>
|
return `<nav class="rapp-subnav" id="rapp-subnav">${pills.join('')}</nav>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue