From bf75e1457363739f9ea4329da71c03e48a0bb8af Mon Sep 17 00:00:00 2001
From: Clemens <cle1000.cb@gmail.com>
Date: Tue, 14 Jun 2016 11:20:48 +0200
Subject: added flowMenu

---
 web/src/js/components/Header/FlowMenu.jsx | 32 +++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 web/src/js/components/Header/FlowMenu.jsx

(limited to 'web/src/js/components/Header/FlowMenu.jsx')

diff --git a/web/src/js/components/Header/FlowMenu.jsx b/web/src/js/components/Header/FlowMenu.jsx
new file mode 100644
index 00000000..4a43f40f
--- /dev/null
+++ b/web/src/js/components/Header/FlowMenu.jsx
@@ -0,0 +1,32 @@
+import React, { PropTypes } from 'react'
+import { Button } from '../common.js'
+import {FlowActions} from "../../actions.js";
+import {MessageUtils} from "../../flow/utils.js";
+import { connect } from 'react-redux'
+
+FlowMenu.title = "Flow"
+
+FlowMenu.propTypes = {
+    flow: PropTypes.object.isRequired,
+}
+
+function FlowMenu({ flow }) {
+
+    return (
+        <div>
+            <div className="menu-row">
+               <Button disabled title="[r]eplay flow" text="Replay" icon="fa-repeat" onClick={FlowActions.replay.bind(null, flow)} />
+               <Button title="[D]uplicate flow" text="Duplicate" icon="fa-copy" onClick={FlowActions.duplicate.bind(null, flow)} />
+               <Button title="[d]elete flow" text="Delete" icon="fa-trash" onClick={FlowActions.delete.bind(null, flow)}/>
+               <Button title="download" text="Download" icon="fa-download" onClick={() => window.location = MessageUtils.getContentURL(flow, flow.response)}/>
+            </div>
+            <div className="clearfix"/>
+        </div>
+    )
+}
+
+export default connect(
+    state => ({
+        flow: state.flows.all.byId[state.flows.selected[0]]
+    })
+)(FlowMenu)
-- 
cgit v1.2.3

