AB#32543 move AI reporting into AI module#2433
Merged
JamesPasta merged 1 commit intoMay 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves the AI Reporting navigation entry out of the Grant Manager web module and into the Unity.AI module, and switches the AI Reporting page back to an iframe-hosted frontend while keeping the native Razor/vanilla-JS port parked alongside it for later reuse.
Changes:
- Removed AI Reporting menu item and localization from
Unity.GrantManager.Web. - Added AI Reporting menu item, localization, and Razor Page under the
Unity.AI.Webmodule. - Reintroduced iframe-hosted UI wiring (Razor + JS) and documented how to switch back to the native implementation.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Menus/GrantManagerMenus.cs | Removes the old AIReporting menu constant from the Grant Manager module. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Menus/GrantManagerMenuContributor.cs | Removes AI Reporting menu contribution (and related feature/permission wiring) from the Grant Manager main menu. |
| applications/Unity.GrantManager/src/Unity.GrantManager.Domain.Shared/Localization/GrantManager/en.json | Removes Menu:AIReporting localization from Grant Manager resources. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/README.md | Documents the iframe vs native-page switch process and the parked native files. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.native.js.disabled | Adds the parked native (non-iframe) JS implementation for later re-enable. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.native.css.disabled | Adds the parked native CSS implementation for later re-enable. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.native.cshtml.disabled | Updates the parked native Razor view to use the Unity.AI page model namespace. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.native.cshtml.cs.disabled | Adds the parked native Razor PageModel (disabled) variant. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.js | Implements iframe creation and postMessage-based token handoff to the hosted frontend. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.cshtml.cs | Moves the PageModel into Unity.AI namespace and provides the configured Reporting AI URL. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.cshtml | Adds the iframe-hosted Razor page and injects reportingAiUrl for the JS bootstrapping. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Menus/AIMenus.cs | Adds a new Reporting menu key under the AI module. |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Menus/AIMenuContributor.cs | Adds AI Reporting into the AI module’s main menu contribution (feature-gated + permissioned). |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AI/en.json | Adds Menu:AIReporting localization under AI resources. |
Comments suppressed due to low confidence (2)
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.cshtml.cs:29
- This page passes a JWT to the embedded AI Reporting app via
postMessage, but the iframe origin is derived from a tenant-configurable DynamicUrl (REPORTING_AI) with no validation. A misconfiguration (or compromised admin) could point this to an unintended host and receive valid tokens. Consider validating the configured URL server-side (scheme/host allow-list, HTTPS-only) before rendering it, and refuse to send a token if the origin isn’t trusted.
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/AIReporting/Index.cshtml.cs:29 GetUgmUrlByKeyNameAsyncthrows aUserFriendlyExceptionwhen the key isn’t configured, which will turn the AI Reporting page into a 500 error whenever the feature is enabled but the endpoint is missing. Consider catching this inOnGetAsyncand either (a) settingCanViewAiReporting = false, or (b) settingReportingAiUrlto empty and displaying a user-friendly “not configured” message in the Razor page.
3330347 to
7fea040
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Move AI Reporting page into Unity AI module.
Swap back to iFrame for easier development until backend can be brought into repo.