Skip to content

Commit

Permalink
Merge pull request #4127 from NCI-Agency/AZ-608-make-rich-text-headin…
Browse files Browse the repository at this point in the history
…gs-smaller

Make rich text headings smaller
  • Loading branch information
midmarch authored Nov 9, 2022
2 parents bd6a467 + 6d8ddf0 commit 0f56d6b
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 9 deletions.
1 change: 1 addition & 0 deletions client/src/components/CustomFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const ReadonlySpecialField = ({
name={name}
isCompact={isCompact}
component={FieldHelper.ReadonlyField}
className="rich-text-readonly"
humanValue={parseHtmlWithLinkTo(fieldValue)}
{...Object.without(otherFieldProps, "style")}
/>
Expand Down
10 changes: 7 additions & 3 deletions client/src/components/MergeField.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const MergeField = ({
align,
action,
mergeState,
dispatchMergeActions
dispatchMergeActions,
className
}) => {
const fieldRef = useRef(null)
const [height, setSetHeight] = useState("auto")
Expand Down Expand Up @@ -43,7 +44,9 @@ const MergeField = ({
>
<div style={{ flex: "1 1 auto" }}>
<LabelBox align={align}>{label}</LabelBox>
<ValueBox align={align}>{value}</ValueBox>
<ValueBox className={className} align={align}>
{value}
</ValueBox>
</div>
{action}
</MergeFieldBox>
Expand Down Expand Up @@ -95,7 +98,8 @@ MergeField.propTypes = {
align: PropTypes.oneOf(Object.values(ALIGN_OPTIONS)).isRequired,
action: PropTypes.node,
mergeState: PropTypes.object,
dispatchMergeActions: PropTypes.func
dispatchMergeActions: PropTypes.func,
className: PropTypes.string
}

export default MergeField
1 change: 1 addition & 0 deletions client/src/components/RelatedObjectNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ const RelatedObjectNotes = ({
))}
</div>
<div
className="rich-text-readonly"
style={{
overflowWrap: "break-word",
wordWrap: "break-word" // IE
Expand Down
17 changes: 17 additions & 0 deletions client/src/components/editor/RichTextEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,20 @@
.editor-link-chooser {
z-index: 1300;
}

/*
* Rich text editor style overrides.
* when making a change, change rich-text-readonly class accordingly.
*/

.editable h1 {
font-size: 1.5rem;
}

.editable h2 {
font-size: 1.25rem;
}

.editable h3 {
font-size: 1.0rem;
}
2 changes: 1 addition & 1 deletion client/src/components/previews/PersonPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const PersonPreview = ({ className, uuid }) => {
</Row>

<div className="preview-field-label">Biography</div>
<div className="preview-field-value">
<div className="preview-field-value rich-text-readonly">
{parseHtmlWithLinkTo(person.biography)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/previews/ReportPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const ReportPreview = ({ className, uuid }) => {
{report.reportText && (
<React.Fragment>
<h4>{Settings.fields.report.reportText}</h4>
<div className="preview-section">
<div className="preview-section rich-text-readonly">
{parseHtmlWithLinkTo(report.reportText)}
</div>
</React.Fragment>
Expand Down
12 changes: 12 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1308,3 +1308,15 @@ div[id*='fg-entityAssessment'] {
text-align: left;
}
}

.rich-text-readonly h1 {
font-size: 1.5rem;
}

.rich-text-readonly h2 {
font-size: 1.25rem;
}

.rich-text-readonly h3 {
font-size: 1.0rem;
}
2 changes: 2 additions & 0 deletions client/src/pages/admin/merge/MergePeople.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ const MergePeople = ({ pageDispatchers }) => {
<PersonField
label="Biography"
value={parseHtmlWithLinkTo(mergedPerson.biography)}
className="rich-text-readonly"
align={ALIGN_OPTIONS.CENTER}
action={getClearButton(() =>
dispatchMergeActions(setAMergedField("biography", "", null))
Expand Down Expand Up @@ -845,6 +846,7 @@ const PersonColumn = ({ align, label, mergeState, dispatchMergeActions }) => {
<PersonField
label="Biography"
fieldName="biography"
className="rich-text-readonly"
value={parseHtmlWithLinkTo(person.biography)}
align={align}
action={getActionButton(
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/people/Compact.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ const CompactPersonView = ({ pageDispatchers }) => {

function mapNonCustomFields() {
const classNameExceptions = {
biography: "biography"
biography: "biography rich-text-readonly"
}

const idExceptions = {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/people/Show.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const PersonShow = ({ pageDispatchers }) => {

function mapNonCustomFields() {
const classNameExceptions = {
biography: "biography"
biography: "biography rich-text-readonly"
}

// map fields that have specific human person
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/reports/Compact.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const CompactReportView = ({ pageDispatchers }) => {
<CompactRow
label={Settings.fields.report.reportText}
content={parseHtmlWithLinkTo(report.reportText)}
className="reportField"
className="reportField rich-text-readonly"
/>
) : null}
{Settings.fields.report.customFields ? (
Expand Down
6 changes: 5 additions & 1 deletion client/src/pages/reports/Show.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,16 @@ const ReportShow = ({ setSearchQuery, pageDispatchers }) => {
<Fieldset
title={Settings.fields.report.reportText}
id="report-text"
className="rich-text-readonly"
>
{parseHtmlWithLinkTo(report.reportText)}
</Fieldset>
)}
{report.reportSensitiveInformation?.text && (
<Fieldset title="Sensitive information">
<Fieldset
title="Sensitive information"
className="rich-text-readonly"
>
{parseHtmlWithLinkTo(report.reportSensitiveInformation.text)}
{(hasAuthorizationGroups && (
<div>
Expand Down

0 comments on commit 0f56d6b

Please sign in to comment.