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

process doesn't open directly #664 #670

Merged
merged 1 commit into from
Apr 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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