-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browser history and link for bot constructor
- Loading branch information
Showing
10 changed files
with
74 additions
and
23 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
lhc_web/design/defaulttheme/js/js_static/a07851a85849880a5fd11dd78f238b28.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
lhc_web/design/defaulttheme/js/js_static/a07851a85849880a5fd11dd78f238b28.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,59 @@ | ||
import React, { Component } from 'react'; | ||
import React, {Component} from 'react'; | ||
import NodeGroups from './components/NodeGroups'; | ||
import NodeTriggerBuilder from './components/NodeTriggerBuilder'; | ||
import NodeTriggerBuilderPreview from './components/NodeTriggerBuilderPreview'; | ||
import {fetchNodeGroupTriggerAction} from "./actions/nodeGroupTriggerActions" | ||
import {connect} from "react-redux"; | ||
|
||
@connect((store) => { | ||
return { | ||
currenttrigger: store.currenttrigger, | ||
nodegroups: store.nodegroups | ||
}; | ||
}) | ||
|
||
class App extends Component { | ||
render() { | ||
return ( | ||
<div className="row"> | ||
<div className="col-4"> | ||
<NodeGroups botId={this.props.botId} /> | ||
</div> | ||
<div className="col-5"> | ||
<NodeTriggerBuilder botId={this.props.botId} /> | ||
</div> | ||
<div className="col-3"> | ||
<NodeTriggerBuilderPreview /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
constructor(props) { | ||
super(props); | ||
this.hashChanged = this.hashChanged.bind(this); | ||
} | ||
|
||
componentDidMount() { | ||
window.addEventListener("hashchange", this.hashChanged, false); | ||
} | ||
|
||
componentWillUnmount() { | ||
window.removeEventListener("hashchange", this.hashChanged, false); | ||
} | ||
|
||
hashChanged() { | ||
var hash = window.location.hash; | ||
if (hash != '') { | ||
var matchData = hash.match(/\d+$/); | ||
if (matchData !== null && matchData[0]) { | ||
if (parseInt(this.props.currenttrigger.getIn(['currenttrigger','id'])) != parseInt(matchData[0])) { | ||
this.props.dispatch(fetchNodeGroupTriggerAction(parseInt(matchData[0]))) | ||
} | ||
} | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="row"> | ||
<div className="col-4"> | ||
<NodeGroups triggerId={this.props.triggerId} botId={this.props.botId}/> | ||
</div> | ||
<div className="col-5"> | ||
<NodeTriggerBuilder botId={this.props.botId}/> | ||
</div> | ||
<div className="col-3"> | ||
<NodeTriggerBuilderPreview/> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div id="root" data-bot-id="<?php echo $bot->id?>"></div> | ||
<div id="root" data-bot-id="<?php echo $bot->id?>"></div> |