OSDN Git Service

show mockhsm navigation
authorYongfeng LI <wliyongfeng@gmail.com>
Thu, 28 Dec 2017 08:15:54 +0000 (16:15 +0800)
committerYongfeng LI <wliyongfeng@gmail.com>
Thu, 28 Dec 2017 08:15:54 +0000 (16:15 +0800)
src/features/app/components/Navigation/Navigation.jsx
src/features/shared/components/BaseShow.jsx
src/features/transactions/components/Show.jsx

index dfd668f..2ad8654 100644 (file)
@@ -51,6 +51,18 @@ class Navigation extends React.Component {
             </Link>
           </li>
         </ul>
+
+        <ul className={styles.navigation}>
+          <li className={styles.navigationTitle}>services</li>
+          {this.props.mockhsm &&
+          <li>
+            <Link to='/mockhsms' activeClassName={styles.active}>
+              {navIcon('mockhsm', styles)}
+              MockHSM
+            </Link>
+          </li>
+          }
+        </ul>
       </div>
     )
   }
@@ -68,7 +80,7 @@ export default connect(
     return {
       routing: state.routing, // required for <Link>s to update active state on navigation
       showSync: state.core.configured && !state.core.generator,
-      mockhsm: state.core.mockhsm,
+      mockhsm: true,
       docVersion
     }
   },
index 4411c9c..741323c 100644 (file)
@@ -10,9 +10,6 @@ export default class BaseShow extends React.Component {
 
   componentDidMount() {
     this.props.fetchItem(this.props.params.id).then(resp => {
-      if (resp.items.length == 0) {
-        this.setState({notFound: true})
-      }
     })
   }
 
index 7472660..8b48e67 100644 (file)
@@ -82,7 +82,7 @@ const mapStateToProps = (state, ownProps) => ({
 })
 
 const mapDispatchToProps = ( dispatch ) => ({
-  fetchItem: (id) => dispatch(actions.fetchItems({filter: `id='${id}'`}))
+  fetchItem: (id) => dispatch(actions.fetchItems({id: `${id}`}))
 })
 
 export default connect(