Skip to content

Commit

Permalink
Merge branch 'master' into 231-save-observation-not-working
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanEngland committed Aug 16, 2024
2 parents aed23bf + 1004d26 commit 55b2e94
Show file tree
Hide file tree
Showing 10 changed files with 800 additions and 263 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ export default function JustificationsEditModal(justificationProps : Justificati
opened={opened}
onClose={props.closeModal}
title={"View/Edit " + capitalizeFirstChar(props.which) + " Justification"}
//fullScreen
size="auto"
height={75}
centered

size="60%"
>
<JustificationForm {...props} />
</Modal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const JustificationTextArea = (form : UseFormReturnType<Justification>) => {
return (
<Paper withBorder={true} bg={"gray.1"} c={"black"} p={"xs"} m={"xs"}>
<Editor
value={form.values.text!}
value={form.values.text ?? ""}
onValueChange={newValue => form.setValues({text: newValue, format: form.values.format})}
highlight={code => highlight(code, languages.asciidoc, 'asciidoc')}
highlight={code => highlight(code ?? "", languages.asciidoc, 'asciidoc')}
maxLength={MAX_CHARS_FOR_JUSTIFICATION}
{...form.getInputProps('text')}
/>
Expand All @@ -40,9 +40,9 @@ const JustificationTextArea = (form : UseFormReturnType<Justification>) => {
return (
<Paper withBorder={true} bg={"gray.1"} c={"black"} p={"xs"} m={"xs"}>
<Editor
value={form.values.text!}
value={form.values.text ?? ""}
onValueChange={newValue => form.setValues({text: newValue, format: form.values.format})}
highlight={code => highlight(code, languages.latex, 'latex')}
highlight={code => highlight(code ?? "", languages.latex, 'latex')}
maxLength={MAX_CHARS_FOR_JUSTIFICATION}
{...form.getInputProps('text')}
/>
Expand All @@ -52,9 +52,9 @@ const JustificationTextArea = (form : UseFormReturnType<Justification>) => {
return (
<Paper withBorder={true} bg={"gray.1"} c={"black"} p={"xs"} m={"xs"}>
<Editor
value={form.values.text!}
value={form.values.text ?? ""}
onValueChange={newValue => form.setValues({text: newValue, format: form.values.format})}
highlight={code => highlight(code, languages.rest, 'rest')}
highlight={code => highlight(code ?? "", languages.rest, 'rest')}
maxLength={MAX_CHARS_FOR_JUSTIFICATION}
{...form.getInputProps('text')}
/>
Expand Down Expand Up @@ -151,7 +151,7 @@ export default function JustificationForm(props: JustificationProps)
</Grid>

</form>
{form.values.format==='latex' && PreviewJustification(form.values.format!, form.values.text!)}
{form.values.format==='latex' && PreviewJustification(form.values.format!, form.values.text ?? "")}
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function JustificationsTable(justifications: JustificationKinds)
<Table.Tbody>
<Table.Tr>
<Table.Td>Scientific</Table.Td>
<Table.Td>{WordCount(justifications.scientific.text!)}</Table.Td>
<Table.Td>{WordCount(justifications.scientific.text ?? "")}</Table.Td>
<Table.Td>{justifications.scientific.format}</Table.Td>
<Table.Td>
<JustificationsEditModal
Expand All @@ -49,7 +49,7 @@ export default function JustificationsTable(justifications: JustificationKinds)
</Table.Tr>
<Table.Tr>
<Table.Td>Technical</Table.Td>
<Table.Td>{WordCount(justifications.technical.text!)}</Table.Td>
<Table.Td>{WordCount(justifications.technical.text ?? "")}</Table.Td>
<Table.Td>{justifications.technical.format}</Table.Td>
<Table.Td>
<JustificationsEditModal
Expand Down
Loading

0 comments on commit 55b2e94

Please sign in to comment.