feat(dashboards): add social listening sidebar entry for ed persona (LFXV2-1689)#792
Conversation
…FXV2-1689) - refactor metrics items into a local array to enable conditional append - add social listening entry with pcc deep-link url when foundation uid is present - hide entry when no foundation is selected to avoid broken deep links - reading selectedFoundation() inside computed auto-wires reactive updates on foundation switch Signed-off-by: Audi Young <audi.mycloud@gmail.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a backend endpoint and client method to fetch a project's Salesforce SFID, exposes that SFID via ProjectContextService as a signal, and uses the signal to conditionally append a Social Listening external link to the executive-director Metrics menu. ChangesMetrics Menu Enhancement + SFID lookup
Sequence Diagram(s)sequenceDiagram
participant MainLayout
participant ProjectContextService
participant ProjectService
participant ProjectsRoute
participant ProjectController
MainLayout->>ProjectContextService: read selectedFoundationSfid()
ProjectContextService->>ProjectService: getProjectSfid(uid)
ProjectService->>ProjectsRoute: HTTP GET /api/projects/:uid/sfid
ProjectsRoute->>ProjectController: getProjectSfid(req)
ProjectController->>ProjectService: projectService.getProjectSfidByUid(uid)
ProjectController-->>ProjectService: returns sfid
ProjectService-->>ProjectContextService: returns sfid (or null)
ProjectContextService-->>MainLayout: signal emits sfid (or null)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Updates the Foundation-lens sidebar navigation for the executive-director persona by refactoring the “Metrics” section to be built dynamically and adding a conditional “Social Listening” entry (opening an external PCC report in a new tab) when a foundation is selected.
Changes:
- Builds a
metricsItemsarray for EDs and conditionally appends a “Social Listening” external link using the selected foundation UID. - Refactors the “Metrics” section to render from
metricsItemsinstead of inline hardcoded items.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Deployment StatusYour branch has been deployed to: https://ui-pr-792.dev.v2.cluster.linuxfound.info Deployment Details:
The deployment will be automatically removed when this PR is closed. |
…XV2-1689) Signed-off-by: Audi Young <audi.mycloud@gmail.com>
- Register GET /api/projects/:uid/sfid route, mounted before documents block to keep the /:uid/<verb> family clustered
- Add ProjectController.getProjectSfid wrapping the existing NATS-backed getProjectSfidByUid helper
- Return { sfid: string | null } with HTTP 200 on lookup failure so callers can hide affordances uniformly
Signed-off-by: Audi Young <audi.mycloud@gmail.com>
- Adopt validateUidParameter (canonical helper per server-helpers.md) to bring getProjectSfid in line with every other /:uid endpoint in this controller - Closes Important finding from post-commit code review on 04c2708 (defense-in-depth consistency gap) Signed-off-by: Audi Young <audi.mycloud@gmail.com>
- add getProjectSfid(uid) on client ProjectService hitting /api/projects/:uid/sfid
- unwrap { sfid } response to string | null at the rxjs layer
- catchError to of(null) so caller hides cleanly on lookup failure
- import map from rxjs alphabetically alongside catchError
Signed-off-by: Audi Young <audi.mycloud@gmail.com>
- wrap uid in encodeURIComponent on /api/projects/:uid/sfid URL - console.error before of(null) so silent 401s/5xx surface in console - aligns with sibling list GETs in project.service.ts that log on failure Signed-off-by: Audi Young <audi.mycloud@gmail.com>
…V2-1689) - add selectedFoundationSfid: Signal<string | null> to ProjectContextService - initializer mirrors initCanWrite shape via toObservable + switchMap - short-circuits to of(null) when no foundation selected (no http call) - switchMap cancels in-flight lookups on foundation switch Signed-off-by: Audi Young <audi.mycloud@gmail.com>
…1689) - swap selectedFoundation()?.uid for selectedFoundationSfid() signal - compose PCC URL with /project/<sfid>/reports/social-listening - hide sidebar entry until sfid resolves (no broken UUID-based URL) - no behaviour change to ED gate or sibling Metrics items Signed-off-by: Audi Young <audi.mycloud@gmail.com>
Signed-off-by: Audi Young <audi.mycloud@gmail.com>
Signed-off-by: Audi Young <audi.mycloud@gmail.com>
Signed-off-by: Audi Young <audi.mycloud@gmail.com>
🧹 Deployment RemovedThe deployment for PR #792 has been removed. |
Summary
This pull request updates the sidebar menu for users with the
executive-directorpersona in theMainLayoutComponent. The main change is the dynamic construction of the "Metrics" section, which now includes an additional "Social Listening" menu item when a foundation is selected, and refactors how the metrics items are defined.Sidebar menu improvements for executive directors:
metricsItemsarray to include "Health Metrics" and "Marketing Impact" links, and conditionally adds a "Social Listening" link (which opens in a new tab) if a foundation is selected. (apps/lfx-one/src/app/layouts/main-layout/main-layout.component.ts)metricsItemsarray, replacing the previous hardcoded items. (apps/lfx-one/src/app/layouts/main-layout/main-layout.component.ts)