OpenSCAP / scap-workbench

SCAP Scanner And Tailoring Graphical User Interface
https://www.open-scap.org/tools/scap-workbench
GNU General Public License v3.0
223 stars 65 forks source link

Allow profile description customization #279

Closed cipherboy closed 3 years ago

cipherboy commented 3 years ago

When opening the profile editor, the description field is populated but is marked readOnly for some reason; all the back-end code existed to make this read-write (except in the case when the profile lacks a description, see the comment in TailoringWindow::setProfileDescription and TailoringWindow::setProfileTitle).

This makes the field read-write.

Note that the behavior is less than ideal: <xccdf:description /> can include HTML content, and while this is a HTML-aware editor, hitting the return key inserts merely a '\n' into the text stream and not a <br /> (or better, <xhtml:br /> with XML-NS awareness) element.

Perhaps this behavior should be corrected at the openscap library level, detecting the HTML XML namespace applied on the <xccdf:description /> element and namespacing the input correctly?

Signed-off-by: Alexander Scheel <alex.scheel@canonical.com>


n.b.: I used qtcreator to modify the UI, let me know if you want me to go back and undo the other changes to the UI file and only modify the boolean.

yuumasato commented 3 years ago

I think it makes sense to enable editing the description of a tailoring profile. Couldn't find anything preventing this in the standard.

cipherboy commented 3 years ago

Cool, thanks @yuumasato! Is there anything else? Or should I merge this tomorrow?

cipherboy commented 3 years ago

Hearing nothing, and seeing as this is a minor change, I'm going ahead and merging. Thanks for the review @yuumasato! :)