Records Multiline (#24991)

* pre-wrap for labeledlist

* multiline for pdas

* consoles fix

* update tgui

* update tgui bundle
This commit is contained in:
larentoun
2024-04-30 11:40:41 +00:00
committed by GitHub
parent 54d563ada1
commit 94b5d22034
6 changed files with 96 additions and 90 deletions
@@ -29,6 +29,7 @@ type LabeledListItemProps = {
textAlign?: string | BooleanLike;
buttons?: InfernoNode;
tooltip?: string | BooleanLike;
preserveWhitespace?: BooleanLike;
/** @deprecated */
content?: any;
children?: InfernoNode;
@@ -45,6 +46,7 @@ const LabeledListItem = (props: LabeledListItemProps) => {
tooltip,
content,
children,
preserveWhitespace,
} = props;
let listItem = (
<tr className={classes(['LabeledList__row', className])}>
@@ -61,6 +63,7 @@ const LabeledListItem = (props: LabeledListItemProps) => {
textAlign={textAlign}
className={classes(['LabeledList__cell', 'LabeledList__content'])}
colSpan={buttons ? undefined : 2}
preserveWhitespace={preserveWhitespace}
>
{content}
{children}
@@ -1,4 +1,4 @@
import { createSearch } from 'common/string';
import { createSearch, decodeHtmlEntities } from 'common/string';
import { useBackend, useLocalState } from '../backend';
import {
Box,
@@ -394,14 +394,13 @@ const MedicalRecordsViewMedical = (_properties, context) => {
<Stack.Item grow>
<LabeledList>
{medical.fields.map((field, i) => (
<LabeledList.Item key={i} label={field.field}>
<Box height="20px" inline>
{field.value}
</Box>
<LabeledList.Item key={i} label={field.field} preserveWhitespace>
{decodeHtmlEntities(field.value)}
{!!field.edit && (
<Button
icon="pen"
ml="0.5rem"
mb={field.line_break ? '1rem' : 'initial'}
onClick={() => doEdit(context, field)}
/>
)}
@@ -434,7 +433,7 @@ const MedicalRecordsViewComments = (_properties, context) => {
<Box color="label">No comments found.</Box>
) : (
medical.comments.map((comment, i) => (
<Box key={i} prewrap>
<Box key={i}>
<Box color="label" inline>
{comment.header}
</Box>
@@ -316,7 +316,11 @@ const SecurityRecordsPageView = (properties, context) => {
<Stack.Item>
<LabeledList>
{security.fields.map((field, i) => (
<LabeledList.Item key={i} label={field.field} prewrap>
<LabeledList.Item
key={i}
label={field.field}
preserveWhitespace
>
{decodeHtmlEntities(field.value)}
{!!field.edit && (
<Button
@@ -356,7 +360,7 @@ const SecurityRecordsViewGeneral = (_properties, context) => {
<Stack.Item grow>
<LabeledList>
{general.fields.map((field, i) => (
<LabeledList.Item key={i} label={field.field} prewrap>
<LabeledList.Item key={i} label={field.field} preserveWhitespace>
{decodeHtmlEntities('' + field.value)}
{!!field.edit && (
<Button
@@ -412,7 +416,7 @@ const SecurityRecordsViewSecurity = (_properties, context) => {
<Box color="label">No comments found.</Box>
) : (
security.comments.map((comment, i) => (
<Box key={i} prewrap>
<Box key={i} preserveWhitespace>
<Box color="label" inline>
{comment.header || 'Auto-generated'}
</Box>
@@ -101,7 +101,7 @@ const RecordView = (props, context) => {
<LabeledList.Item label="Details">
{medical.cdi_d}
</LabeledList.Item>
<LabeledList.Item label="Important Notes">
<LabeledList.Item label="Important Notes" preserveWhitespace>
{medical.notes}
</LabeledList.Item>
</LabeledList>
@@ -133,7 +133,7 @@ const RecordView = (props, context) => {
<LabeledList.Item label="Details">
{security.ma_crim_d}
</LabeledList.Item>
<LabeledList.Item label="Important Notes">
<LabeledList.Item label="Important Notes" preserveWhitespace>
{security.notes}
</LabeledList.Item>
</LabeledList>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long