Skip to content

Security: Enable CSP in JS / fix Navigation demo#32852

Merged
dmlvr merged 10 commits intoDevExpress:26_1from
dmlvr:26_1_3620_fix_demos_for_csp_testing
Mar 11, 2026
Merged

Security: Enable CSP in JS / fix Navigation demo#32852
dmlvr merged 10 commits intoDevExpress:26_1from
dmlvr:26_1_3620_fix_demos_for_csp_testing

Conversation

@dmlvr
Copy link
Contributor

@dmlvr dmlvr commented Mar 10, 2026

No description provided.

@dmlvr dmlvr self-assigned this Mar 10, 2026
Copilot AI review requested due to automatic review settings March 10, 2026 15:06
@dmlvr dmlvr requested a review from a team as a code owner March 10, 2026 15:06
@dmlvr dmlvr added the 26_1 label Mar 10, 2026
Copy link
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 aims to improve Content Security Policy (CSP) compliance for the Charts/ExportCustomMarkup demo by removing inline style attributes from SVG <text> elements and replacing them with CSS classes. The corresponding CSP allowlist entry for 'unsafe-inline' in style-src is also removed.

Changes:

  • Replaced inline SVG style attributes with CSS classes (custom_markup_text, custom_markup_text--title, custom_markup_text--subtitle) across all five framework demos (jQuery, React, ReactJs, Vue, Angular).
  • Added corresponding CSS rules to each framework's stylesheet.
  • Removed the Charts/ExportCustomMarkup entry from the CSP demo allowlist since 'unsafe-inline' for style-src is no longer needed.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/demos/utils/server/csp-server.js Removes the CSP allowlist entry for ExportCustomMarkup demo
apps/demos/Demos/Charts/ExportCustomMarkup/jQuery/index.html Replaces inline styles on SVG <text> elements with CSS classes
apps/demos/Demos/Charts/ExportCustomMarkup/jQuery/styles.css Adds CSS class definitions for SVG text styling
apps/demos/Demos/Charts/ExportCustomMarkup/React/Form.tsx Replaces inline React style objects with className attributes
apps/demos/Demos/Charts/ExportCustomMarkup/React/styles.css Adds CSS class definitions for SVG text styling
apps/demos/Demos/Charts/ExportCustomMarkup/ReactJs/Form.js Replaces inline React style objects with className attributes
apps/demos/Demos/Charts/ExportCustomMarkup/ReactJs/styles.css Adds CSS class definitions for SVG text styling
apps/demos/Demos/Charts/ExportCustomMarkup/Vue/Form.vue Replaces Vue :style bindings with classes and adds <style> block
apps/demos/Demos/Charts/ExportCustomMarkup/Angular/app/app.component.html Replaces inline styles with CSS classes
apps/demos/Demos/Charts/ExportCustomMarkup/Angular/app/app.component.css Adds ::ng-deep CSS class definitions for SVG text styling

Copilot AI review requested due to automatic review settings March 10, 2026 16:38
Copy link
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings March 11, 2026 08:06
Copy link
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

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

@dmlvr dmlvr changed the title Security: Enable CSP in JS / fix demos Security: Enable CSP in JS / fix Navigation demo Mar 11, 2026
font-weight: bold;
}

.custom_markup_text--subtitle {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's use out default notation for class names using dash between words

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed class names

text-align: center;
}

::ng-deep .custom_markup_text {
Copy link
Contributor

Choose a reason for hiding this comment

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

We need improve .net demos as well

Copilot AI review requested due to automatic review settings March 11, 2026 10:23
Copy link
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

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings March 11, 2026 10:31
Copy link
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

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@dmlvr dmlvr merged commit 45457fe into DevExpress:26_1 Mar 11, 2026
131 of 132 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants