Fix build
This commit is contained in:
parent
8d2d39cb0e
commit
3ed861369e
2 changed files with 11 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import { MenuItem } from "material-ui/Menu";
|
||||||
import Button from "material-ui/Button";
|
import Button from "material-ui/Button";
|
||||||
|
|
||||||
import keyOf from "utils/keyOf";
|
import keyOf from "utils/keyOf";
|
||||||
|
import { getInternals, getActuals } from "utils/state";
|
||||||
|
|
||||||
type UiItemProps<I> = {
|
type UiItemProps<I> = {
|
||||||
item: I,
|
item: I,
|
||||||
|
|
@ -45,8 +46,8 @@ export default class UiItem<I:Object> extends React.Component<UiItemProps<I>> {
|
||||||
typeof this.props.item.enableCondition == "function") {
|
typeof this.props.item.enableCondition == "function") {
|
||||||
const enableCondition = this.props.item.enableCondition;
|
const enableCondition = this.props.item.enableCondition;
|
||||||
const state = this.props.state;
|
const state = this.props.state;
|
||||||
const internals = _.mapValues(state, (x) => x.internal);
|
const internals = getInternals(state);
|
||||||
const actuals = _.mapValues(state, (x) => x.actual);
|
const actuals = getActuals(state);
|
||||||
return enableCondition(internals, actuals, state);
|
return enableCondition(internals, actuals, state);
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
8
src/utils/state.js
Normal file
8
src/utils/state.js
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
// @flow
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
export const getInternals = (state: State): Map<string, Internal> =>
|
||||||
|
_.mapValues(state, (x) => x.internal || x.actual);
|
||||||
|
|
||||||
|
export const getActuals = (state: State): Map<string, Actual> =>
|
||||||
|
_.mapValues(state, (x) => x.actual);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue