Skip to content

Print one policy per line in the Settings Report (Fixes #54) - #73

Open
juandresrodca wants to merge 1 commit into
MG-Cloudflow:mainfrom
juandresrodca:fix/54-settings-report-one-policy-per-line
Open

Print one policy per line in the Settings Report (Fixes #54)#73
juandresrodca wants to merge 1 commit into
MG-Cloudflow:mainfrom
juandresrodca:fix/54-settings-report-one-policy-per-line

Conversation

@juandresrodca

Copy link
Copy Markdown
Contributor

Print one policy per line in the Settings Report (Fixes #54)

Problem

In the Settings Report export, when a setting is configured by more than one policy, the
"Policy Name(s)" column (and likewise the "Configured Value" column) is rendered as a single
"; "-joined line. For settings shared across several policies this becomes one long, hard-to-read
line. Reported in #54 with a screenshot (the AV - Tamper Internal; AV - Tamper Demo; … cell and
the On; Off value cell).

Fix

Scripts/SettingsReportButton.ps1 builds the Policy Name(s) and Configured Value values by
joining with "; ". This change breaks those two cells onto one item per line in both the HTML
and Markdown exports:

  • HTML: split the joined string on "; ", HTML-encode each part, then join with <br>.
    Splitting before encoding matters — encoding first would turn & into &amp; and the
    line-break replacement could then break inside that entity (e.g. Security & Compliance
    Security &amp<br>Compliance). Splitting first avoids that.
  • Markdown: replace "; " with <br> in the two cells (GitHub-flavoured Markdown renders
    <br> inside table cells).
  • CSV: unchanged — it already uses ; as the field delimiter, and one-item-per-line there would
    mean embedded newlines.

The Settings Report joined every policy that configures a shared setting into
a single "; "-separated cell for the "Policy Name(s)" and "Configured Value"
columns, so multi-policy settings rendered as one long line (issue MG-Cloudflow#54).

Break those two cells on the "; " separator so each policy / value appears on
its own line in the HTML and Markdown exports. For HTML the value is split
before HTML-encoding so encoded entities such as "&amp;" are not broken by the
line-break replacement. CSV output is unchanged.

Fixes MG-Cloudflow#54
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.

Export HTML when two policy for the same workload

1 participant