Display ActionsDropDown in related panel
authorFrank Bessou <frank.bessou@logilab.fr>
Wed, 17 May 2017 17:43:00 +0200
changeset 210 bb3261911433
parent 209 c15e53a5b67c
child 211 e406f2aea20d
Display ActionsDropDown in related panel
src/components/Entity.js
--- a/src/components/Entity.js	Wed May 17 17:18:04 2017 +0200
+++ b/src/components/Entity.js	Wed May 17 17:43:00 2017 +0200
@@ -5,7 +5,7 @@
 import Api from '../Api';
 import HypermediaClient from '../services/hypermedia';
 import {PropTypeJsonaryWrapper} from '../jsonaryutils';
-import {CollectionView} from './BaseViews';
+import {ActionsDropDown, CollectionView} from './BaseViews';
 import {AttributeValue} from './Attribute';
 
 export function EntityAttributes(props) {
@@ -93,11 +93,22 @@
         this.componentDidMount();
     }
 
+    renderActions() {
+        const related = this.state.related;
+        if (!related || related.allowedActions.length <= 1) {
+            return null;
+        }
+        return <ActionsDropDown target={related} ignore={['view']} />;
+
+    }
+
     renderTitle() {
         const title = this.state.link.title;
         return (
             <div>
                 { title }
+                { this.renderActions() }
+                <div className="clearfix" />
             </div>
         );
     }