client/src/components/Session.js
changeset 138 a1fb2ced3049
parent 137 279e1dffa213
child 143 cfcbf4bc66f1
--- a/client/src/components/Session.js	Thu Aug 03 23:04:33 2017 +0200
+++ b/client/src/components/Session.js	Fri Aug 04 09:48:09 2017 +0200
@@ -13,6 +13,7 @@
 import * as userActions from '../actions/userActions';
 import { getSession, getSessionNotes } from '../selectors/coreSelectors';
 import { getAutoSubmit } from '../selectors/authSelectors';
+import { extractAnnotationCategories, defaultAnnotationsCategories } from '../constants';
 
 class Session extends Component {
   render() {
@@ -31,6 +32,7 @@
                 notes={this.props.notes}
                 deleteNote={this.props.notesActions.deleteNote}
                 updateNote={this.props.notesActions.updateNote}
+                annotationCategories={this.props.annotationCategories}
               />
             </div>
           </div>
@@ -42,7 +44,8 @@
                     session={this.props.currentSession}
                     autoSubmit={this.props.autoSubmit}
                     addNote={this.props.notesActions.addNote}
-                    setAutoSubmit={this.props.userActions.setAutoSubmit} />
+                    setAutoSubmit={this.props.userActions.setAutoSubmit}
+                    annotationCategories={this.props.annotationCategories}/>
                 </Col>
               </Row>
             </Grid>
@@ -60,11 +63,13 @@
   const autoSubmit = getAutoSubmit(state);
   const currentSession = getSession(sessionId, state);
   const currentNotes = getSessionNotes(sessionId, state);
+  const annotationCategories = currentSession?extractAnnotationCategories(currentSession.get('protocol')):defaultAnnotationsCategories;
 
   return {
     currentSession,
     notes: currentNotes,
-    autoSubmit
+    autoSubmit,
+    annotationCategories
   };
 }