Refactor deep-linking, in the process extracted out OperationsTag (#4349)

* add configsActions.loaded hook

* add OperationTag to hold Operations

* fix test for operations

* refactor deep-linking plugin
This commit is contained in:
Josh Ponelat
2018-06-01 22:19:44 +02:00
committed by kyle
parent 5ea2150ae7
commit 90157c1a40
12 changed files with 412 additions and 208 deletions

View File

@@ -0,0 +1,26 @@
import React from "react"
import ImPropTypes from "react-immutable-proptypes"
const Wrapper = (Ori, system) => class OperationWrapper extends React.Component {
static propTypes = {
operation: ImPropTypes.map.isRequired,
}
onLoad = (ref) => {
const { operation } = this.props
const { tag, operationId } = operation.toObject()
const isShownKey = ["operations", tag, operationId]
system.layoutActions.readyToScroll(isShownKey, ref)
}
render() {
return (
<span ref={this.onLoad}>
<Ori {...this.props} />
</span>
)
}
}
export default Wrapper