Skip to content

Commit

Permalink
wildcards front end
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Jan 30, 2020
1 parent e2e3566 commit 05908b2
Show file tree
Hide file tree
Showing 28 changed files with 1,853 additions and 1,355 deletions.
15 changes: 14 additions & 1 deletion dash-renderer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dash-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"prop-types": "15.7.2",
"cookie": "^0.3.1",
"dependency-graph": "^0.5.0",
"fast-isnumeric": "^1.1.3",
"radium": "^0.22.1",
"ramda": "^0.26.1",
"react-redux": "^4.4.5",
Expand Down
33 changes: 10 additions & 23 deletions dash-renderer/src/APIController.react.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import {connect} from 'react-redux';
import {includes, isEmpty, isNil} from 'ramda';
import {includes, isEmpty} from 'ramda';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import TreeContainer from './TreeContainer';
import GlobalErrorContainer from './components/error/GlobalErrorContainer.react';
import {
computeGraphs,
computePaths,
hydrateInitialOutputs,
setLayout,
} from './actions/index';
import {applyPersistence} from './persistence';
import {hydrateInitialOutputs, setGraphs, setPaths, setLayout} from './actions';
import {computePaths} from './actions/paths';
import {computeGraphs} from './actions/dependencies';
import apiThunk from './actions/api';
import {applyPersistence} from './persistence';
import {getAppState} from './reducers/constants';
import {STATUS} from './constants/constants';

Expand Down Expand Up @@ -42,7 +39,6 @@ class UnconnectedContainer extends Component {
graphs,
layout,
layoutRequest,
paths,
} = props;

if (isEmpty(layoutRequest)) {
Expand All @@ -53,9 +49,8 @@ class UnconnectedContainer extends Component {
layoutRequest.content,
dispatch
);
dispatch(setPaths(computePaths(finalLayout, [])));
dispatch(setLayout(finalLayout));
} else if (isNil(paths)) {
dispatch(computePaths({subTree: layout, startingPath: []}));
}
}

Expand All @@ -67,7 +62,7 @@ class UnconnectedContainer extends Component {
dependenciesRequest.status === STATUS.OK &&
isEmpty(graphs)
) {
dispatch(computeGraphs(dependenciesRequest.content));
dispatch(setGraphs(computeGraphs(dependenciesRequest.content)));
}

if (
Expand All @@ -77,7 +72,6 @@ class UnconnectedContainer extends Component {
// LayoutRequest and its computed stores
layoutRequest.status === STATUS.OK &&
!isEmpty(layout) &&
!isNil(paths) &&
// Hasn't already hydrated
appLifecycle === getAppState('STARTED')
) {
Expand Down Expand Up @@ -118,20 +112,15 @@ class UnconnectedContainer extends Component {
return (
<div className="_dash-error">Error loading dependencies</div>
);
} else if (
appLifecycle === getAppState('HYDRATED') &&
config.ui === true
) {
return (
} else if (appLifecycle === getAppState('HYDRATED')) {
return config.ui === true ? (
<GlobalErrorContainer>
<TreeContainer
_dashprivate_layout={layout}
_dashprivate_path={[]}
/>
</GlobalErrorContainer>
);
} else if (appLifecycle === getAppState('HYDRATED')) {
return (
) : (
<TreeContainer
_dashprivate_layout={layout}
_dashprivate_path={[]}
Expand All @@ -151,7 +140,6 @@ UnconnectedContainer.propTypes = {
dependenciesRequest: PropTypes.object,
layoutRequest: PropTypes.object,
layout: PropTypes.object,
paths: PropTypes.object,
history: PropTypes.any,
error: PropTypes.object,
config: PropTypes.object,
Expand All @@ -165,7 +153,6 @@ const Container = connect(
layoutRequest: state.layoutRequest,
layout: state.layout,
graphs: state.graphs,
paths: state.paths,
history: state.history,
error: state.error,
config: state.config,
Expand Down
Loading

0 comments on commit 05908b2

Please sign in to comment.