|
| 1 | +<div style="display: flex; height: 100vh"> |
| 2 | + <goabx-work-side-menu |
| 3 | + heading="Workspace Demo" |
| 4 | + url="/" |
| 5 | + userName="John Doe" |
| 6 | + userSecondaryText="john.doe@gov.ab.ca" |
| 7 | + [open]="menuOpen" |
| 8 | + (onToggle)="toggleMenu()" |
| 9 | + [primaryContent]="primaryTpl" |
| 10 | + [secondaryContent]="secondaryTpl" |
| 11 | + [accountContent]="accountTpl" |
| 12 | + /> |
| 13 | + |
| 14 | + <ng-template #primaryTpl> |
| 15 | + <goabx-work-side-menu-item |
| 16 | + icon="grid" |
| 17 | + label="Dashboard" |
| 18 | + url="/features/2885" |
| 19 | + /> |
| 20 | + <goabx-work-side-menu-item |
| 21 | + icon="search" |
| 22 | + label="Search" |
| 23 | + url="/features/2885/search" |
| 24 | + /> |
| 25 | + <goabx-work-side-menu-item |
| 26 | + icon="list" |
| 27 | + label="Cases" |
| 28 | + url="/features/2885/cases" |
| 29 | + badge="5" |
| 30 | + type="success" |
| 31 | + /> |
| 32 | + <goabx-work-side-menu-item |
| 33 | + icon="document" |
| 34 | + label="Documents" |
| 35 | + url="/features/2885/documents" |
| 36 | + [divider]="true" |
| 37 | + /> |
| 38 | + <goabx-work-side-menu-item |
| 39 | + icon="alert-circle" |
| 40 | + label="Alerts" |
| 41 | + badge="3" |
| 42 | + type="emergency" |
| 43 | + [popoverContent]="alertsTpl" |
| 44 | + /> |
| 45 | + </ng-template> |
| 46 | + |
| 47 | + <ng-template #alertsTpl> |
| 48 | + <div style="padding: 1rem; width: 280px"> |
| 49 | + <h3 style="margin: 0 0 0.5rem 0; font-size: 1rem"> |
| 50 | + Custom Popover Content |
| 51 | + </h3> |
| 52 | + <p style="margin: 0 0 1rem 0; color: #666; font-size: 0.875rem"> |
| 53 | + This demonstrates that <code>popoverContent</code> accepts any Angular |
| 54 | + template, not just |
| 55 | + <code>GoabxWorkSideNotificationPanel</code>. |
| 56 | + </p> |
| 57 | + <ul style="margin: 0; padding-left: 1.25rem; font-size: 0.875rem"> |
| 58 | + <li>Custom alerts</li> |
| 59 | + <li>Quick actions</li> |
| 60 | + <li>Mini dashboards</li> |
| 61 | + <li>Any custom UI</li> |
| 62 | + </ul> |
| 63 | + <div style="margin-top: 1rem; text-align: right"> |
| 64 | + <goa-button type="tertiary" size="compact" action="close"> |
| 65 | + Close |
| 66 | + </goa-button> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + </ng-template> |
| 70 | + |
| 71 | + <ng-template #secondaryTpl> |
| 72 | + <goabx-work-side-menu-item |
| 73 | + icon="notifications" |
| 74 | + label="Notifications" |
| 75 | + badge="12" |
| 76 | + type="success" |
| 77 | + [popoverContent]="notificationsTpl" |
| 78 | + /> |
| 79 | + <goabx-work-side-menu-item |
| 80 | + icon="help-circle" |
| 81 | + label="Help" |
| 82 | + url="/features/2885/help" |
| 83 | + /> |
| 84 | + </ng-template> |
| 85 | + |
| 86 | + <ng-template #notificationsTpl> |
| 87 | + <goabx-work-side-notification-panel |
| 88 | + heading="Notifications" |
| 89 | + activeTab="unread" |
| 90 | + (onMarkAllRead)="handleMarkAllRead()" |
| 91 | + (onViewAll)="handleViewAll()" |
| 92 | + > |
| 93 | + <goabx-work-side-notification-item |
| 94 | + *ngFor="let notif of notifications; trackBy: trackById" |
| 95 | + [title]="notif.title" |
| 96 | + [description]="notif.description" |
| 97 | + [timestamp]="notif.timestamp" |
| 98 | + [type]="notif.type" |
| 99 | + [readStatus]="notif.readStatus" |
| 100 | + [priority]="notif.priority" |
| 101 | + (onClick)="handleNotificationClick(notif.id)" |
| 102 | + /> |
| 103 | + </goabx-work-side-notification-panel> |
| 104 | + </ng-template> |
| 105 | + |
| 106 | + <ng-template #accountTpl> |
| 107 | + <goabx-work-side-menu-item |
| 108 | + icon="settings" |
| 109 | + label="Settings" |
| 110 | + url="/features/2885/settings" |
| 111 | + /> |
| 112 | + <goabx-work-side-menu-item |
| 113 | + icon="log-out" |
| 114 | + label="Log out" |
| 115 | + url="/logout" |
| 116 | + /> |
| 117 | + </ng-template> |
| 118 | + |
| 119 | + <main |
| 120 | + style=" |
| 121 | + flex: 1; |
| 122 | + padding: 2rem; |
| 123 | + background-color: #f3f3f3; |
| 124 | + overflow: auto; |
| 125 | + " |
| 126 | + > |
| 127 | + <div class="mobile-menu-toggle"> |
| 128 | + <goab-icon-button |
| 129 | + icon="menu" |
| 130 | + variant="dark" |
| 131 | + (onClick)="openMenu()" |
| 132 | + /> |
| 133 | + </div> |
| 134 | + |
| 135 | + <h1>Feature #2885: Work Side Menu with Notification Popover</h1> |
| 136 | + <p> |
| 137 | + This demonstrates the <code>GoabxWorkSideMenu</code> with the new |
| 138 | + notification popover feature. |
| 139 | + </p> |
| 140 | + |
| 141 | + <h2>New Features</h2> |
| 142 | + <ul> |
| 143 | + <li> |
| 144 | + <strong>Notification Popover</strong> - Click the "Notifications" menu |
| 145 | + item to see the popover panel |
| 146 | + </li> |
| 147 | + <li> |
| 148 | + <strong>Custom Popover Content</strong> - Click the "Alerts" menu item |
| 149 | + to see a custom div, demonstrating that <code>popoverContent</code> |
| 150 | + accepts any Angular template |
| 151 | + </li> |
| 152 | + <li> |
| 153 | + <strong>GoabxWorkSideNotificationPanel</strong> - Panel with tabs |
| 154 | + (Unread, Urgent, All) |
| 155 | + </li> |
| 156 | + <li> |
| 157 | + <strong>GoabxWorkSideNotificationItem</strong> - Individual notification |
| 158 | + cards with: |
| 159 | + <ul> |
| 160 | + <li>Title and description</li> |
| 161 | + <li>Smart timestamp formatting (e.g., "5 min ago", "2 h ago")</li> |
| 162 | + <li>Type badges (info, success, warning, critical)</li> |
| 163 | + <li>Read/unread status indicator (green dot)</li> |
| 164 | + <li>Urgent priority styling</li> |
| 165 | + </ul> |
| 166 | + </li> |
| 167 | + <li> |
| 168 | + <strong>Footer actions</strong> - "View all" and "Mark all as read" |
| 169 | + buttons |
| 170 | + </li> |
| 171 | + </ul> |
| 172 | + |
| 173 | + <h2>Console Output</h2> |
| 174 | + <p> |
| 175 | + Open the browser console to see events when clicking notifications or |
| 176 | + footer actions. |
| 177 | + </p> |
| 178 | + </main> |
| 179 | +</div> |
0 commit comments