Skip to content

AB#32543 move AI reporting into AI module#2433

Merged
JamesPasta merged 1 commit into
devfrom
feature/AB#32543-integrate-ai-reporting-code-into-unity-core
May 8, 2026
Merged

AB#32543 move AI reporting into AI module#2433
JamesPasta merged 1 commit into
devfrom
feature/AB#32543-integrate-ai-reporting-code-into-unity-core

Conversation

@jacobwillsmith
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Web module.
  • 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
  • GetUgmUrlByKeyNameAsync throws a UserFriendlyException when 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 in OnGetAsync and either (a) setting CanViewAiReporting = false, or (b) setting ReportingAiUrl to empty and displaying a user-friendly “not configured” message in the Razor page.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 675
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@jacobwillsmith jacobwillsmith force-pushed the feature/AB#32543-integrate-ai-reporting-code-into-unity-core branch from 3330347 to 7fea040 Compare May 8, 2026 21:16
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

@jacobwillsmith jacobwillsmith marked this pull request as ready for review May 8, 2026 21:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 675
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@JamesPasta JamesPasta merged commit fd76048 into dev May 8, 2026
25 checks passed
@JamesPasta JamesPasta deleted the feature/AB#32543-integrate-ai-reporting-code-into-unity-core branch May 8, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants