feat(supervisor): phase 7b — activity console shell, telephony iframes, supervisor entry route#9
Conversation
…visor entry route (7b)
…d and iframe height
📝 WalkthroughWalkthroughThe Activity Area is now an enabled dashboard destination with a guarded route. Supervisor roles render a new navigation shell with telephony iframe views, while telephony URL trust is centralized in ChangesSupervisor Activity Area
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DashboardSidebarComponent
participant AppRoutes
participant InnerpageComponent
participant SupervisorShellComponent
participant TelephonyIframeComponent
participant ConfigService
DashboardSidebarComponent->>AppRoutes: Navigate to Activity Area
AppRoutes->>InnerpageComponent: Activate guarded route
InnerpageComponent->>SupervisorShellComponent: Render for Supervisor role
SupervisorShellComponent->>TelephonyIframeComponent: Render selected telephony page
TelephonyIframeComponent->>ConfigService: Build trusted telephony URL
ConfigService-->>TelephonyIframeComponent: Return SafeResourceUrl
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/app-modules/supervisor/supervisor-shell.component.ts (1)
157-165: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winURL-encode the username parameter.
If a user's username contains special characters (like spaces,
&,+, or#), it could break the query string structure of the SSO URL. Consider usingencodeURIComponentto ensure it is passed safely to the backend.♻️ Proposed fix
protected readonly ssoUrl: SafeResourceUrl = this.config.trustedTelephonyUrl( - `remote_login.php?username=${this.sessionStore.user()?.userName ?? ''}&key=undefined`, + `remote_login.php?username=${encodeURIComponent(this.sessionStore.user()?.userName ?? '')}&key=undefined`, );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/app-modules/supervisor/supervisor-shell.component.ts` around lines 157 - 165, Update the ssoUrl construction to apply encodeURIComponent to the sessionStore.user()?.userName value before interpolating it into the username query parameter, while preserving the existing empty fallback and key=undefined behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/app/app-modules/supervisor/supervisor-shell.component.ts`:
- Around line 157-165: Update the ssoUrl construction to apply
encodeURIComponent to the sessionStore.user()?.userName value before
interpolating it into the username query parameter, while preserving the
existing empty fallback and key=undefined behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: efaaf451-1320-4675-9318-bb0b658d583c
📒 Files selected for processing (10)
src/app/app-modules/auth/dashboard/components/dashboard-sidebar.component.tssrc/app/app-modules/auth/shell/shell.component.tssrc/app/app-modules/call/innerpage/innerpage.component.htmlsrc/app/app-modules/call/innerpage/innerpage.component.tssrc/app/app-modules/core/services/config.service.tssrc/app/app-modules/core/services/cti.service.tssrc/app/app-modules/supervisor/supervisor-shell.component.htmlsrc/app/app-modules/supervisor/supervisor-shell.component.tssrc/app/app-modules/supervisor/telephony-iframe.component.tssrc/app/app.routes.ts
📋 Description
app-1097-supervisor: 3 navbar menus driving ~30 numbered pages), the three CZentrix admin-UI iframe screens (Agent Status / Campaign Status / Telephony Reports), the hidden SSO iframe, the supervisor entry route (oldInnerpageComponentpath verbatim), and the dashboard sidebar's Activity Area button wired up. Screens beyond the iframes land slice-by-slice (7c–7h) — until then each page shows a placeholder naming its slice. Stacked on feat(call): phase 6 — call wizard forms (registration, services, closure, grievance) #8 — please review/merge feat(call): phase 6 — call wizard forms (registration, services, closure, grievance) #8 first; this PR's diff shows only the 2 phase-7b commits.✅ Type of Change
What's in this PR
Supervisor console shell (
app-modules/supervisor/supervisor-shell.component)Activity_Numberpage switch with the default landing = "Blacklist a Number" (oldActivity_Number = 3quirk, kept)show("2")-string vs*ngSwitchCase="2"-number mix only worked because pre-v17 Angular's NgSwitch used loose equality — modern@switchis strictPAGESmap = one source of truth for menu labels and the per-slice placeholdersTelephony iframes (
telephony-iframe.component)adminui.php?agentStatus/?campaignStatus/?reportUI— URLs byte-identical, height 700px like the old embedsremote_login.php?username={user}&key=undefined— the old login'sgetLoginKeycall was commented out, sologinKeywas always undefined and the URL literally carriedkey=undefined; kept byte-faithful. (The old app also built a never-subscribedhttp.getto the same URL — dead code, not ported.)ConfigService.trustedTelephonyUrl()— the singlebypassSecurityTrustResourceUrlsite for the telephony origin (CTI bar, SSO, adminui embeds all go through it)Inner-page role fork (old
app-1097structure kept — per mentor-side decision)1097.component.htmlfork, verbatim semantics)call/getCallTypesV1,cti/getIVRSPathDetails,cti/getAgentState,cti/getAgentCallStats) — verified live, byte-identical trafficRoute + navigation
MultiRoleScreenComponent/InnerpageComponent(old path verbatim) → the shared inner pageFaithfulness hardening (post code-review fixes, second commit)
CzentrixHttpService.agentPayload: a role with no agent id now posts{}exactly like the old app (whose{agent_id: undefined}was dropped by JSON serialization) instead of a novel{"agent_id":""}shape@elsewould have shown it to Admin — the old app rendered an empty area for Admin)Declared deviation
InnerpageComponent) had no auth guard at all. This PR guards it with the plain login check (authGuard+ role-selected check). Zero backend impact (the guard is a client-side sessionStorage read), and the oldAuthGuard(token && isOnCall !== 'yes') would have passed a supervisor anyway — this only closes the unauthenticated-access gap.Verification (live, logged in as the UAT
1097Supervisor)adminui.phpiframe URLs byte-exact; SSO iframe URL byte-exact incl. thekey=undefinedquirk (CZentrix content itself needs the UAT VPN — same as the CTI bar)cti/getAgentStatebody identical ({"agent_id":2002})ng buildclean, tsc clean, GPL header check passingℹ️ Additional Information
The "Feedback Tracking" menu item opens the grievance screen — that's what the old app does (label vs destination mismatch); ported faithfully and being flagged separately for a decision on the label.
Summary by CodeRabbit
New Features
Bug Fixes