diff --git a/app/assets/scripts/components/documents/journal-pdf-preview/index.js b/app/assets/scripts/components/documents/journal-pdf-preview/index.js index 8deba358..7e8bfffe 100644 --- a/app/assets/scripts/components/documents/journal-pdf-preview/index.js +++ b/app/assets/scripts/components/documents/journal-pdf-preview/index.js @@ -114,9 +114,8 @@ const DocumentHeading = styled.h1` const AuthorsSection = styled.div` display: flex; flex-direction: column; - gap: 2rem; -`; -const AuthorsSectionHeader = styled.div` + align-items: center; + gap: 1.5rem; text-align: center; `; @@ -594,7 +593,7 @@ function JournalPdfPreview() { {resolveTitle(atbd.title)} - {contacts?.items} +
{contacts?.items}
{contacts?.affiliations_list.map((affiliation, i) => ( // eslint-disable-next-line react/no-array-index-key @@ -815,7 +814,7 @@ function JournalPdfPreview() { )} {referencesVisible && ( -
+
{referenceList}
)} diff --git a/app/assets/scripts/components/documents/pdf-preview/index.js b/app/assets/scripts/components/documents/pdf-preview/index.js index 8c621910..9b1f2d0d 100644 --- a/app/assets/scripts/components/documents/pdf-preview/index.js +++ b/app/assets/scripts/components/documents/pdf-preview/index.js @@ -10,6 +10,7 @@ import DocumentTitle from '../single-view/document-title'; import { DocumentProse } from '../single-view/document-content'; import { ScrollAnchorProvider } from '../single-view/scroll-manager'; import { applyNumberCaptionsToDocument } from '../../../utils/apply-number-captions-to-document'; +import { isDefined } from '../../../utils/common'; const TocHeader = styled.h1` border-bottom: 3px solid #000; @@ -65,7 +66,6 @@ function generateTocAndHeadingNumbering(content) { currentHeading, currentLevel, sectionContainer, - parentContainer, parentHeadingNumber ) { const currentSubHeadings = []; @@ -148,7 +148,6 @@ function generateTocAndHeadingNumbering(content) { subHeading, currentLevel + 1, subHeadingSections, - subHeading.parentNode, headingNumber ); }); @@ -192,13 +191,7 @@ function generateTocAndHeadingNumbering(content) { const sectionTitle = getTitleElement(heading.id, heading.innerText); section.append(sectionTitle); - generateSubHeadings( - heading, - 2, - section, - heading.parentNode, - headingNumber - ); + generateSubHeadings(heading, 2, section, headingNumber); }); } @@ -239,11 +232,11 @@ function PdfPreview() { setPreviewReady(true); } - if (atbd.status === 'succeeded') { + if (atbd.status === 'succeeded' && isDefined(atbd.data)) { setDocument(applyNumberCaptionsToDocument(atbd.data.document)); waitForImages(); } - }, [atbd.status]); + }, [atbd.data, atbd.status]); // This useEffect is responsible for generating the ToC and numbering // after the document is transformed diff --git a/app/assets/scripts/components/documents/single-view/document-body.js b/app/assets/scripts/components/documents/single-view/document-body.js index 0c1408d7..903f95a3 100644 --- a/app/assets/scripts/components/documents/single-view/document-body.js +++ b/app/assets/scripts/components/documents/single-view/document-body.js @@ -512,7 +512,7 @@ const htmlAtbdContentSections = [ ), children: [ { - label: 'Assumptions', + label: 'Scientific Theory Assumptions', id: 'scientific_theory_assumptions', editorSubsections: (document, { id }) => subsectionsFromSlateDocument( @@ -557,7 +557,7 @@ const htmlAtbdContentSections = [ ), children: [ { - label: 'Assumptions', + label: 'Mathematical Theory Assumptions', id: 'mathematical_theory_assumptions', editorSubsections: (document, { id }) => subsectionsFromSlateDocument( @@ -695,12 +695,12 @@ const htmlAtbdContentSections = [ ) }, { - label: 'Performance Assessment Validation', + label: 'Performance Assessment', id: 'validation', render: AtbdSectionPassThrough, children: [ { - label: 'Performance Assessment Validation Methods', + label: 'Validation Methods', id: 'validation_method', editorSubsections: (document, { id }) => subsectionsFromSlateDocument( @@ -720,7 +720,7 @@ const htmlAtbdContentSections = [ ) }, { - label: 'Performance Assessment Validation Uncertainties', + label: 'Uncertainties', id: 'validation_uncert', editorSubsections: (document, { id }) => subsectionsFromSlateDocument( @@ -742,7 +742,7 @@ const htmlAtbdContentSections = [ ) }, { - label: 'Performance Assessment Validation Errors', + label: 'Validation Errors', id: 'validation_err', editorSubsections: (document, { id }) => subsectionsFromSlateDocument( @@ -764,12 +764,12 @@ const htmlAtbdContentSections = [ ] }, { - label: 'Data Access', + label: 'Algorithm Implementation', id: 'data_access', render: AtbdSectionPassThrough, children: [ { - label: 'Input Data Data Access', + label: 'Input Data Access', id: 'data_access_input_data', render: (props) => ( ( ( (