Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
process doesn't open directly #664
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed Apr 21, 2017
1 parent 28cce0a commit 9ebfb2d
Showing 1 changed file with 52 additions and 2 deletions.
54 changes: 52 additions & 2 deletions src/containers/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,47 @@ import PropTypes from 'prop-types';
import {connect} from 'react-redux';
import Container from '../components/Container';
import DraggableWrapper from '../components/widget/DraggableWrapper';
import Modal from '../components/app/Modal';

export class Dashboard extends Component {
constructor(props){
super(props);
}

render() {
const {location} = this.props;
const {
location, modal, selected, rawModal,
indicator
} = this.props;

return (
<Container
siteName="Dashboard"
noMargin={true}
>
{modal.visible &&
<Modal
windowType={modal.type}
data={modal.data}
layout={modal.layout}
rowData={modal.rowData}
tabId={modal.tabId}
rowId={modal.rowId}
modalTitle={modal.title}
modalType={modal.modalType}
modalViewId={modal.viewId}
selected={selected}
viewId={null}
rawModalVisible={rawModal.visible}
indicator={indicator}
isDocumentNotSaved={
(modal.saveStatus && !modal.saveStatus.saved) &&
(modal.validStatus &&
!modal.validStatus.initialValue)
}
/>
}

<div className="container-fluid dashboard-wrapper">
<DraggableWrapper
dashboard={location.pathname}
Expand All @@ -30,6 +58,28 @@ Dashboard.propTypes = {
dispatch: PropTypes.func.isRequired
};

Dashboard = connect()(Dashboard);
function mapStateToProps(state) {
const {
windowHandler
} = state;

const {
modal,
rawModal,
selected,
indicator
} = windowHandler || {
modal: false,
rawModal: false,
selected: [],
indicator: ''
}

return {
modal, selected, indicator, rawModal
}
}

Dashboard = connect(mapStateToProps)(Dashboard);

export default Dashboard

0 comments on commit 9ebfb2d

Please sign in to comment.