From fceb5e8069f4c7d5618949f6a8ff3504ff042cd8 Mon Sep 17 00:00:00 2001
From: john <johnbarlas39@gmail.com>
Date: Fri, 18 Nov 2016 00:45:41 +0200
Subject: [PATCH] linter fixes and new routes

---
 .gitignore                                 |  2 +
 .nvmrc                                     |  1 +
 app/components/BookBuilder/BookBuilder.jsx | 24 +++++------
 app/components/BookBuilder/BookList.jsx    | 15 ++++---
 app/components/BookBuilder/Chapter.jsx     | 50 +++++++++++-----------
 5 files changed, 48 insertions(+), 44 deletions(-)
 create mode 100644 .nvmrc

diff --git a/.gitignore b/.gitignore
index 5afe0b5..93c09b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,6 @@ api/db/*
 api/db/*
 logs/*
 node_modules
+public/assets/*
+pubsweet.log
 
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 0000000..1e8b314
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+6
diff --git a/app/components/BookBuilder/BookBuilder.jsx b/app/components/BookBuilder/BookBuilder.jsx
index b5fab82..50b54a9 100644
--- a/app/components/BookBuilder/BookBuilder.jsx
+++ b/app/components/BookBuilder/BookBuilder.jsx
@@ -151,11 +151,11 @@ export class BookBuilder extends React.Component {
     const productionEditor = this.state.productionEditor || 'unassigned'
 
     return (
-      <div className="bootstrap pubsweet-component pubsweet-component-scroll">
+      <div className='bootstrap pubsweet-component pubsweet-component-scroll'>
         <div className={styles.bookBuilder}>
           <div
-            className="col-lg-offset-2 col-lg-8 col-md-8 col-sm-12 col-xs-12"
-            ref="outerContainer">
+            className='col-lg-offset-2 col-lg-8 col-md-8 col-sm-12 col-xs-12'
+            ref='outerContainer'>
 
             <h1>{this.props.book.title}</h1>
 
@@ -166,8 +166,8 @@ export class BookBuilder extends React.Component {
             </div>
 
             <Division
-              title="Front Matter"
-              type="front"
+              title='Front Matter'
+              type='front'
               outerContainer={outerContainer}
               add={createFragment}
               remove={deleteFragment}
@@ -180,8 +180,8 @@ export class BookBuilder extends React.Component {
             <div className={styles.sectionDivider} />
 
             <Division
-              title="Body"
-              type="body"
+              title='Body'
+              type='body'
               outerContainer={outerContainer}
               add={createFragment}
               remove={deleteFragment}
@@ -194,8 +194,8 @@ export class BookBuilder extends React.Component {
             <div className={styles.sectionDivider} />
 
             <Division
-              title="Back Matter"
-              type="back"
+              title='Back Matter'
+              type='back'
               outerContainer={outerContainer}
               add={createFragment}
               remove={deleteFragment}
@@ -209,12 +209,12 @@ export class BookBuilder extends React.Component {
         </div>
 
         <BookBuilderModal
-          title="Editoria Team Manager"
-          action="EditoriaTeamManager"
+          title='Editoria Team Manager'
+          action='EditoriaTeamManager'
           show={this.state.showTeamManager}
           toggle={this._toggleTeamManager}
           container={outerContainer}
-          size="large"
+          size='large'
           teams={teams}
           users={users}
           updateTeam={updateTeam}
diff --git a/app/components/BookBuilder/BookList.jsx b/app/components/BookBuilder/BookList.jsx
index 774fbb4..ed9cc75 100644
--- a/app/components/BookBuilder/BookList.jsx
+++ b/app/components/BookBuilder/BookList.jsx
@@ -25,6 +25,7 @@ export class BookList extends React.Component {
   }
 
   render () {
+    console.log('render')
     const { book } = this.props
     const { showModal } = this.state
     let bookTitle = book ? book.title : 'Fetching...'
@@ -32,9 +33,9 @@ export class BookList extends React.Component {
 
     return (
       <div className={styles.bookList + ' bootstrap'}>
-        <div className="container col-lg-offset-2 col-lg-8">
+        <div className='container col-lg-offset-2 col-lg-8'>
 
-          <div className="col-lg-12">
+          <div className='col-lg-12'>
             <h1 className={styles.bookTitle}>
               Books
               <div className={styles.addBookBtn} onClick={this._toggleModal}>
@@ -43,11 +44,11 @@ export class BookList extends React.Component {
             </h1>
           </div>
 
-          <div className="col-lg-12">
+          <div className='col-lg-12'>
             <div className={styles.bookContainer}>
               <h2>{bookTitle}</h2>
-              <LinkContainer to={`/manage/books/${bookId}/book-builder`}>
-                <a href="#"
+              <LinkContainer to={`/books/${bookId}/book-builder`}>
+                <a href='#'
                   className={styles.editBook}
                   onClick={this._toggleModal} >
                   Edit
@@ -59,7 +60,7 @@ export class BookList extends React.Component {
         </div>
 
         <Modal
-          className="modal"
+          className='modal'
           show={showModal}
           onHide={this._toggleModal}
           container={this}
@@ -76,7 +77,7 @@ export class BookList extends React.Component {
           </Modal.Body>
 
           <Modal.Footer>
-            <a className="modal-button discard-chapter"
+            <a className='modal-button discard-chapter'
               onClick={this._toggleModal}>
               Close
             </a>
diff --git a/app/components/BookBuilder/Chapter.jsx b/app/components/BookBuilder/Chapter.jsx
index 6abe04f..790009c 100644
--- a/app/components/BookBuilder/Chapter.jsx
+++ b/app/components/BookBuilder/Chapter.jsx
@@ -292,8 +292,8 @@ export class Chapter extends React.Component {
 
       const input = (
         <TextInput
-          className="edit"
-          ref="chapterInput"
+          className='edit'
+          ref='chapterInput'
           onSave={this._onSaveRename}
           value={title}
         />
@@ -313,7 +313,7 @@ export class Chapter extends React.Component {
       // could do with refs, but that would mean mounting instead of
       // shallow rendering to access enzyme's refs() api method
       renameButton = (
-        <a id="bb-rename"
+        <a id='bb-rename'
           onClick={renameButtonFunction}>
           { renameButtonText } &nbsp;&nbsp;
         </a>
@@ -393,7 +393,7 @@ export class Chapter extends React.Component {
       titleArea = (
         <DropdownButton
           title={title}
-          id="dropbutton"
+          id='dropbutton'
           className={styles.dropDown}
           open={this.state.open}
           onClick={this._toggleList}
@@ -401,10 +401,10 @@ export class Chapter extends React.Component {
           <div style={{ width: width }}>
             <div className={styles.dropDownInputContairer}>
               <TextInput
-                ref="dropDownInput"
+                ref='dropDownInput'
                 className={styles.dropDownInput}
                 onSave={this._onClickCustomTitle}
-                placeholder="Type a custom title"
+                placeholder='Type a custom title'
               />
             </div>
 
@@ -421,13 +421,13 @@ export class Chapter extends React.Component {
       <div>
         { renameButton }
         <LinkContainer
-          to={`/manage/books/${book.id}/fragments/${chapter.id}`}
-          id="bb-edit"
+          to={`/books/${book.id}/fragments/${chapter.id}`}
+          id='bb-edit'
         >
           <a>{ editOrView } &nbsp;&nbsp;</a>
         </LinkContainer>
 
-        <a id="bb-delete"
+        <a id='bb-delete'
           onClick={this._toggleDelete}>
           Delete
         </a>
@@ -442,14 +442,14 @@ export class Chapter extends React.Component {
       }
 
       editorArea = (
-        <a id="bb-unlock"
+        <a id='bb-unlock'
           className={styles.lEditing}
           onClick={this._toggleUnlock}>
 
           <i
             className={styles.lockIcon + ' fa fa-lock'}
-            aria-hidden="true"
-            alt="unlock"
+            aria-hidden='true'
+            alt='unlock'
           />
           <span className={styles.lockMessage}>
             { chapter.lock.editor.username + message}
@@ -469,7 +469,7 @@ export class Chapter extends React.Component {
         className={styles.chapterContainer + ' col-lg-12 bb-chapter ' + (chapter.subCategory === 'chapter' ? styles.isChapter : styles.isPart)}
         style={{ opacity: opacity }}>
         <div className={styles.grabIcon + ' ' + (chapter.division === 'body' ? styles.grabIconBody : '')}>
-          <i className="fa fa-circle" />
+          <i className='fa fa-circle' />
           <div className={styles.tooltip}>
             Grab to sort
           </div>
@@ -490,19 +490,19 @@ export class Chapter extends React.Component {
 
           <div className={styles.secondLineContainer}>
             <div className={styles.noPadding + ' col-lg-2 col-md-12 col-sm-12 col-xs-12'}>
-              <div id="bb-upload" className={styles.btnFile}>
+              <div id='bb-upload' className={styles.btnFile}>
                 Upload Word
                 <input
-                  type="file"
-                  accept=".docx"
-                  title=" "
+                  type='file'
+                  accept='.docx'
+                  title=' '
                 />
               </div>
             </div>
 
             <ul className={styles.secondActions + ' col-lg-7 col-md-12 col-sm-12 col-xs-12'}>
               <ProgressIndicator
-                type="style"
+                type='style'
                 book={book}
                 chapter={chapter}
                 update={update}
@@ -513,7 +513,7 @@ export class Chapter extends React.Component {
               />
 
               <ProgressIndicator
-                type="edit"
+                type='edit'
                 book={book}
                 chapter={chapter}
                 update={update}
@@ -524,7 +524,7 @@ export class Chapter extends React.Component {
               />
 
               <ProgressIndicator
-                type="review"
+                type='review'
                 book={book}
                 chapter={chapter}
                 update={update}
@@ -535,7 +535,7 @@ export class Chapter extends React.Component {
               />
 
               <ProgressIndicator
-                type="clean"
+                type='clean'
                 book={book}
                 chapter={chapter}
                 roles={roles}
@@ -576,8 +576,8 @@ export class Chapter extends React.Component {
         <BookBuilderModal
           title={'Delete ' + type}
           chapter={chapter}
-          action="delete"
-          successText="Delete"
+          action='delete'
+          successText='Delete'
           type={type}
           successAction={this._onClickDelete}
           show={this.state.showDeleteModal}
@@ -588,8 +588,8 @@ export class Chapter extends React.Component {
         <BookBuilderModal
           title={'Unlock ' + type}
           chapter={chapter}
-          action="unlock"
-          successText="Unlock"
+          action='unlock'
+          successText='Unlock'
           type={type}
           successAction={this._onClickUnlock}
           show={this.state.showUnlockModal}
-- 
GitLab