Demos: DataGrid/TreeList aicolumn - handle inline module#33639
Open
flagmanAndrew wants to merge 3 commits into
Open
Demos: DataGrid/TreeList aicolumn - handle inline module#33639flagmanAndrew wants to merge 3 commits into
flagmanAndrew wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the jQuery DataGrid/AIColumns and TreeList/AIColumns demos to move the inline type="module" OpenAI SDK import into standalone openai-init.js files, and updates the CSP demo allowlist accordingly (removing the now-unneeded unsafe-inline exception).
Changes:
- Removed
script-src: 'unsafe-inline'overrides forDataGrid/AIColumnsandTreeList/AIColumnsin the CSP server allowlist. - Added
openai-init.jsmodule files that importAzureOpenAIfromesm.shand expose it onwindow. - Updated the two demo
index.htmlfiles to load the new module file instead of using an inline module script.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/demos/utils/server/csp-server.js | Removes AIColumns-specific CSP unsafe-inline allowances now that the OpenAI import is no longer inline. |
| apps/demos/Demos/TreeList/AIColumns/jQuery/openai-init.js | New external ESM initializer that imports AzureOpenAI and assigns it to window. |
| apps/demos/Demos/TreeList/AIColumns/jQuery/index.html | Switches from inline module import to loading openai-init.js as a module script. |
| apps/demos/Demos/DataGrid/AIColumns/jQuery/openai-init.js | New external ESM initializer that imports AzureOpenAI and assigns it to window. |
| apps/demos/Demos/DataGrid/AIColumns/jQuery/index.html | Switches from inline module import to loading openai-init.js as a module script. |
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 inline js to a separate file in demos: DataGrid - AI Column, TreeList - AI Column