Render view components¶
The shared layouts invoke three view components for the page chrome. Each returns its own view or the shared error view.
| Field | Value |
|---|---|
| Operation ID | OP-14 |
| Trigger | Layout rendering |
| Inputs | BusinessOnlineMenu, current page name, BolPolicyModel, error message |
| Outputs | HTML fragments |
| Primary components | BolSideMenuViewComponent, BolTopMenuViewComponent, BolPolicyHeaderViewComponent |
| Entry point | src/BolMiddleware/ViewComponents/BolSideMenuViewComponent.cs |
Steps¶
- The side and top menu components receive the menu and current page. If the menu is null they return the
Errorview (BR-BOLMIDDLEWARE-016). - Otherwise they build a
BolMenuViewModeland return the component view, which lists favorites and menu items through_BolMenuItemPartial. The top menu filters items by the configuredAppMenuCategory. - The policy header component returns the
Errorview when the error message is not empty (BR-BOLMIDDLEWARE-017); otherwise it renders the policy header view, which uses Build policy dropdown when allowed. - The page header partial shows profile and logoff links only for external users, using
account.saif.comfor production environments andaccount-qa.saif.comotherwise (BR-BOLMIDDLEWARE-018).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Layout renders]) --> D1{Menu is null?}
D1 -->|Yes| E1([Error view])
D1 -->|No| S1[Render menu view]
S1 --> D2{Policy error message?}
D2 -->|Yes| E2([Error view with message])
D2 -->|No| S2[Render policy header]
S2 --> D3{External user?}
D3 -->|Yes| S3[Show profile and logoff links]
D3 -->|No| EndOk([Done])
S3 --> EndOk
Failure and edge-case behavior¶
InvokeAsyncmethods are declared async but never await, so the compiler warns and the work is synchronous.- The layouts pass an extra
showPolicyDropdownargument toBolPolicyHeaderthat the component does not declare. _MenuOnlyLayoutreferences the static assets under_content/bolMiddlewarein lowercase, which can fail on case-sensitive hosts.- The header partial treats any environment name containing
prod, includingpreprod, as production.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Configuration
- Operations and processes
- Business rules
- Security and authorization
- Service registration
- API reference
Sources¶
- src/BolMiddleware/ViewComponents/BolSideMenuViewComponent.cs
- src/BolMiddleware/ViewComponents/BolTopMenuViewComponent.cs
- src/BolMiddleware/ViewComponents/BolPolicyHeaderViewComponent.cs
- src/BolMiddleware/Pages/Components/BolSideMenu/default.cshtml
- src/BolMiddleware/Pages/Components/BolTopMenu/default.cshtml
- src/BolMiddleware/Pages/Components/BolPolicyHeader/default.cshtml
- src/BolMiddleware/Pages/Shared/_BolPageHeaderPartial.cshtml
- src/BolMiddleware/Pages/Shared/_MenuOnlyLayout.cshtml