fix(workspace): pass the active document into sign and audit views

This commit is contained in:
2026-05-05 19:46:01 +00:00
parent 79ca3a07f1
commit b3a30bfb96
5 changed files with 23 additions and 10 deletions
@@ -24,6 +24,7 @@ export class SdigWorkspace extends DeesElement {
@property({ type: String }) public accessor initialView: TWorkspaceView = 'inbox';
@property({ type: String, reflect: true }) public accessor view: TWorkspaceView = 'inbox';
@property({ attribute: false }) public accessor documents: IDocumentRow[] = demoDocuments;
@property({ type: String }) public accessor activeDocumentId: string = '';
public connectedCallback = async () => {
await super.connectedCallback();
@@ -159,11 +160,12 @@ export class SdigWorkspace extends DeesElement {
}
private renderView(): TemplateResult {
const activeDocument = this.documents.find((document) => document.id === this.activeDocumentId) || this.documents[0] || demoDocuments[0];
switch (this.view) {
case 'inbox': return html`<sdig-workspace-inbox class="view-host" .density=${this.density} .documents=${this.documents}></sdig-workspace-inbox>`;
case 'compose': return html`<sdig-workspace-compose class="view-host"></sdig-workspace-compose>`;
case 'sign': return html`<sdig-workspace-sign class="view-host"></sdig-workspace-sign>`;
case 'audit': return html`<sdig-workspace-audit class="view-host"></sdig-workspace-audit>`;
case 'sign': return html`<sdig-workspace-sign class="view-host" .document=${activeDocument}></sdig-workspace-sign>`;
case 'audit': return html`<sdig-workspace-audit class="view-host" .document=${activeDocument}></sdig-workspace-audit>`;
case 'developers': return html`<sdig-workspace-developers class="view-host"></sdig-workspace-developers>`;
case 'templates': return html`<sdig-workspace-placeholder class="view-host" label="Templates" subtitle="Reusable agreement templates"></sdig-workspace-placeholder>`;
case 'team': return html`<sdig-workspace-placeholder class="view-host" label="Team" subtitle="Workspace members & roles"></sdig-workspace-placeholder>`;