-
Notifications
You must be signed in to change notification settings - Fork 3
feature/AB#31396-AIFeatureRefactor #1907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 pull request implements an AI feature refactor for the Grant Manager application, focusing on modularizing the AI analysis functionality and improving code organization.
Changes:
- Extracted AI analysis functionality into a separate module (
ai-analysis.js) for better code organization and reusability - Added permission-based access control for AI Reporting features with proper menu configuration
- Improved DataTable rendering performance through optimized column adjustment and loading strategies
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| ai-analysis.js | New module containing AI analysis rendering logic, template-based UI generation, and API integration for dismiss/restore operations |
| Details.js | Refactored to move utility functions outside IIFE scope, updated to use modern JavaScript methods (Number.parseFloat, Number.isNaN, replaceAll), removed AI analysis code (now in separate module) |
| Details.cshtml | Added conditional rendering for AI Analysis tab, included new ai-analysis.js script, added HTML templates for dynamic content generation, cached feature flag lookups |
| Mapping.cshtml | Updated terminology from "Intake Fields" to "Core Fields" and adjusted layout spacing |
| GrantManagerMenuContributor.cs | Added permission requirement for AIReporting menu item |
| GrantApplicationPermissions.cs | Added new AIReporting permission class |
| en.json | Added localization entry for AI Reporting permission |
| GrantApplicationPermissionDefinitionProvider.cs | Registered new AI Reporting permission in the permission system |
| GrantManagerFeaturesDefinitionProvider.cs | Updated AIReporting feature display name |
| table-utils.js | Refactored DataTable initialization with helper functions, improved column adjustment logic, enhanced state management with retry mechanisms, modernized typeof comparisons |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Details.js
Outdated
Show resolved
Hide resolved
...nager/src/Unity.GrantManager.Application.Contracts/GrantManagerFeaturesDefinitionProvider.cs
Show resolved
Hide resolved
...cations/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/ai-analysis.js
Outdated
Show resolved
Hide resolved
...ications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/ApplicationForms/Mapping.cshtml
Show resolved
Hide resolved
...cations/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/ai-analysis.js
Outdated
Show resolved
Hide resolved
| console.warn('Failed to load application data, showing demo AI analysis', error); | ||
| }); | ||
| } | ||
|
|
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loadAIAnalysis function is called from Details.js but is not exported to the global scope. Consider adding globalThis.loadAIAnalysis = loadAIAnalysis; after the function definition, similar to how dismissAIIssue and restoreAIIssue are exported, to ensure it's accessible from other modules.
| globalThis.loadAIAnalysis = loadAIAnalysis; |
No description provided.