Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions apps/prs/angular/src/routes/bugs/3854/bug3854.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<goab-text tag="h1" mb="m">Bug 3854 - Work Side Menu without extra sections</goab-text>
<goab-text mb="xl">
This test page renders a Work Side Menu with only primary content. Confirm the
following:
<ul>
<li>The primary menu is visible.</li>
<li>The secondary and account menu is hidden.</li>
</ul>
</goab-text>

<div
style="
max-width: 20rem;
border: 1px solid #ddd;
min-height: 28rem;
--goa-work-side-menu-height: 400px;
"
>
<goab-work-side-menu
heading="Primary-only menu"
url="/bugs/3854"
[open]="true"
(onNavigate)="handleNavigate($event)"
[primaryContent]="primaryContent"
></goab-work-side-menu>
</div>

<ng-template #primaryContent>
<goab-work-side-menu-item
icon="home"
label="Dashboard"
url="/bugs/3854"
></goab-work-side-menu-item>
<goab-work-side-menu-item
icon="list"
label="Cases"
url="/bugs/3854"
></goab-work-side-menu-item>
<goab-work-side-menu-item
icon="settings"
label="Settings"
url="/bugs/3854"
></goab-work-side-menu-item>
</ng-template>
18 changes: 18 additions & 0 deletions apps/prs/angular/src/routes/bugs/3854/bug3854.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component } from "@angular/core";
import {
GoabText,
GoabWorkSideMenu,
GoabWorkSideMenuItem,
} from "@abgov/angular-components";

@Component({
standalone: true,
selector: "abgov-bug3854",
templateUrl: "./bug3854.component.html",
imports: [GoabText, GoabWorkSideMenu, GoabWorkSideMenuItem],
})
export class Bug3854Component {
handleNavigate(_path: string): void {
// Intentionally no-op for visual verification.
}
}
6 changes: 6 additions & 0 deletions apps/prs/angular/src/routes/bugs/3854/bug3854.route.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "bug",
"id": "3854",
"path": "bugs/3854",
"title": "Work Side Menu without secondary/account"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,21 @@ import { NgTemplateOutlet } from "@angular/common";
(_toggle)="_onToggle()"
(_navigate)="_onNavigate($event)"
>
<div slot="primary">
<ng-container [ngTemplateOutlet]="primaryContent"></ng-container>
</div>
<div slot="secondary">
<ng-container [ngTemplateOutlet]="secondaryContent"></ng-container>
</div>
<div slot="account">
<ng-container [ngTemplateOutlet]="accountContent"></ng-container>
</div>
@if (primaryContent) {
<div slot="primary">
<ng-container [ngTemplateOutlet]="primaryContent"></ng-container>
</div>
}
@if (secondaryContent) {
<div slot="secondary">
<ng-container [ngTemplateOutlet]="secondaryContent"></ng-container>
</div>
}
@if (accountContent) {
<div slot="account">
<ng-container [ngTemplateOutlet]="accountContent"></ng-container>
</div>
}
</goa-work-side-menu>
}
`,
Expand All @@ -58,11 +64,11 @@ export class GoabWorkSideMenu implements OnInit {
/** Sets a data-testid attribute for automated testing. */
@Input() testId?: string;
/** Template reference for the primary navigation slot content. */
@Input() primaryContent!: TemplateRef<any>;
@Input() primaryContent!: TemplateRef<unknown>;
/** Template reference for the secondary navigation slot content. */
@Input() secondaryContent!: TemplateRef<any>;
@Input() secondaryContent!: TemplateRef<unknown>;
/** Template reference for the account slot content. */
@Input() accountContent!: TemplateRef<any>;
@Input() accountContent!: TemplateRef<unknown>;
/** Emits when the side menu is toggled open or closed. */
@Output() onToggle = new EventEmitter();
/** Emits when a navigation link is clicked. Emits the URL as a string. */
Expand Down
Loading