From 5d1e435861a94948b2e0763d32137be622a69ef0 Mon Sep 17 00:00:00 2001
From: Audrey Hamelers <hamelers@ebi.ac.uk>
Date: Fri, 30 Nov 2018 16:35:18 +0000
Subject: [PATCH] WIP: linting

---
 app/components/Citation.jsx        |  7 +++--
 app/components/FileTable.jsx       | 37 +++++++++++++--------------
 app/components/PubMedSearch.jsx    | 22 ++++++++--------
 app/components/UploadFiles.jsx     | 35 +++++++++++++------------
 app/components/XMLReview.jsx       | 41 ++++++++++++++----------------
 app/components/ui/atoms/Select.jsx | 21 ++++++++-------
 6 files changed, 77 insertions(+), 86 deletions(-)

diff --git a/app/components/Citation.jsx b/app/components/Citation.jsx
index 853c468a9..61607bdd8 100755
--- a/app/components/Citation.jsx
+++ b/app/components/Citation.jsx
@@ -21,10 +21,9 @@ const Citation = props => {
             }
           />
         </span>
-        {articleId &&
-          articleId.length > 0 && (
-            <span>, PMID: {articleId.find(id => id.type === 'pmid').id}</span>
-          )}
+        {articleId && articleId.length > 0 && (
+          <span>, PMID: {articleId.find(id => id.type === 'pmid').id}</span>
+        )}
       </Small>
     </p>
   )
diff --git a/app/components/FileTable.jsx b/app/components/FileTable.jsx
index d9e5cb06e..14093255c 100755
--- a/app/components/FileTable.jsx
+++ b/app/components/FileTable.jsx
@@ -42,25 +42,24 @@ const FileTable = ({ files }) => (
         <th>Filename</th>
         <th>Label</th>
       </tr>
-      {files.map(
-        file =>
-          file.type === 'manuscript' ? (
-            <tr key="manuscript">
-              <td>manuscript</td>
-              <td>
-                <FilePreview file={file} />
-              </td>
-              <td />
-            </tr>
-          ) : (
-            <tr key={file.url}>
-              <td>{file.type}</td>
-              <td>
-                <FilePreview file={file} />
-              </td>
-              <td>{file.label}</td>
-            </tr>
-          ),
+      {files.map(file =>
+        file.type === 'manuscript' ? (
+          <tr key="manuscript">
+            <td>manuscript</td>
+            <td>
+              <FilePreview file={file} />
+            </td>
+            <td />
+          </tr>
+        ) : (
+          <tr key={file.url}>
+            <td>{file.type}</td>
+            <td>
+              <FilePreview file={file} />
+            </td>
+            <td>{file.label}</td>
+          </tr>
+        ),
       )}
     </tbody>
   </Table>
diff --git a/app/components/PubMedSearch.jsx b/app/components/PubMedSearch.jsx
index fe0dc9b2d..41a3f4621 100755
--- a/app/components/PubMedSearch.jsx
+++ b/app/components/PubMedSearch.jsx
@@ -288,20 +288,18 @@ class PubMedSearch extends React.Component {
                     <LoadingIcon />
                   </Loading>
                 )}
-                {results.length < hitcount &&
-                  !loading && (
-                    <LoadMore onClick={this.onLoad} secondary>
-                      Load More Results
-                    </LoadMore>
-                  )}
+                {results.length < hitcount && !loading && (
+                  <LoadMore onClick={this.onLoad} secondary>
+                    Load More Results
+                  </LoadMore>
+                )}
               </Results>
             )}
-            {results.length === 0 &&
-              loading && (
-                <Loading>
-                  <LoadingIcon />
-                </Loading>
-              )}
+            {results.length === 0 && loading && (
+              <Loading>
+                <LoadingIcon />
+              </Loading>
+            )}
           </div>
         )}
       </SearchArea>
diff --git a/app/components/UploadFiles.jsx b/app/components/UploadFiles.jsx
index 08ad4f792..6c43a056a 100755
--- a/app/components/UploadFiles.jsx
+++ b/app/components/UploadFiles.jsx
@@ -78,24 +78,23 @@ const UploadFiles = props => {
       {files.length > 0 ? (
         <div>
           <FileList>
-            {files.map(
-              file =>
-                file.type === 'manuscript' ? (
-                  <UploadFileListItem
-                    file={file}
-                    fileData={addManuscript}
-                    key="manuscript"
-                    status={status}
-                  />
-                ) : (
-                  <UploadFileListItem
-                    checked={checked}
-                    file={file}
-                    fileData={updateFile}
-                    key={file.url}
-                    types={types}
-                  />
-                ),
+            {files.map(file =>
+              file.type === 'manuscript' ? (
+                <UploadFileListItem
+                  file={file}
+                  fileData={addManuscript}
+                  key="manuscript"
+                  status={status}
+                />
+              ) : (
+                <UploadFileListItem
+                  checked={checked}
+                  file={file}
+                  fileData={updateFile}
+                  key={file.url}
+                  types={types}
+                />
+              ),
             )}
           </FileList>
           <DropMore
diff --git a/app/components/XMLReview.jsx b/app/components/XMLReview.jsx
index 9ad6f30cc..585843648 100755
--- a/app/components/XMLReview.jsx
+++ b/app/components/XMLReview.jsx
@@ -405,28 +405,25 @@ class EPMCTagged extends React.Component {
                 </Content>
               </Section>
             )}
-            {pane === 'pdf' &&
-              pdf && (
-                <AnnotatePDF
-                  reload={this.listAnnotations()}
-                  toMark={`${currentVersion.id}-pdf`}
-                  url={pdf.url}
-                  user={currentUser.id}
-                />
-              )}
-            {pane === 'web' &&
-              html && (
-                <AnnotateHTML
-                  html={html}
-                  reload={this.listAnnotations()}
-                  toMark={`${currentVersion.id}-web`}
-                  user={currentUser.id}
-                />
-              )}
-            {pane === 'original' &&
-              manuscript && (
-                <ManuscriptPreview file={manuscript} source={source} />
-              )}
+            {pane === 'pdf' && pdf && (
+              <AnnotatePDF
+                reload={this.listAnnotations()}
+                toMark={`${currentVersion.id}-pdf`}
+                url={pdf.url}
+                user={currentUser.id}
+              />
+            )}
+            {pane === 'web' && html && (
+              <AnnotateHTML
+                html={html}
+                reload={this.listAnnotations()}
+                toMark={`${currentVersion.id}-web`}
+                user={currentUser.id}
+              />
+            )}
+            {pane === 'original' && manuscript && (
+              <ManuscriptPreview file={manuscript} source={source} />
+            )}
           </PanelContent>
         </PreviewPanel>
         <EditPanel style={{ minWidth: showManuscript ? 0 : 'auto' }}>
diff --git a/app/components/ui/atoms/Select.jsx b/app/components/ui/atoms/Select.jsx
index 22f0ca1dc..a5950a42c 100755
--- a/app/components/ui/atoms/Select.jsx
+++ b/app/components/ui/atoms/Select.jsx
@@ -93,17 +93,16 @@ class Select extends React.Component {
         {label && <Label htmlFor={this.inputId}>{label}</Label>}
         <Dropdown>
           <DropdownText id={this.inputId} value={value} {...props}>
-            {options.map(
-              opt =>
-                typeof opt === 'object' ? (
-                  <option key={opt.value} value={opt.value}>
-                    {opt.label}
-                  </option>
-                ) : (
-                  <option key={opt} value={opt}>
-                    {opt}
-                  </option>
-                ),
+            {options.map(opt =>
+              typeof opt === 'object' ? (
+                <option key={opt.value} value={opt.value}>
+                  {opt.label}
+                </option>
+              ) : (
+                <option key={opt} value={opt}>
+                  {opt}
+                </option>
+              ),
             )}
           </DropdownText>
           <DropIcon icon={icon} />
-- 
GitLab