From 632a239bb95814689ce163ba3755827e09e1f225 Mon Sep 17 00:00:00 2001 From: "damian.przygodzki" Date: Tue, 30 May 2017 09:12:32 +0200 Subject: [PATCH] Modals refactor #1 --- src/components/Container.js | 79 +++++++++++++- src/containers/Dashboard.js | 49 ++++----- src/containers/DocList.js | 74 +------------ src/containers/InboxAll.js | 36 ++++++- src/containers/MasterWindow.js | 192 ++++++++++++++++----------------- 5 files changed, 228 insertions(+), 202 deletions(-) diff --git a/src/components/Container.js b/src/components/Container.js index d2e9267f7..42cee2b31 100644 --- a/src/components/Container.js +++ b/src/components/Container.js @@ -3,6 +3,9 @@ import PropTypes from 'prop-types'; import {connect} from 'react-redux'; import Header from './header/Header'; import ErrorScreen from './app/ErrorScreen'; +import Modal from './app/Modal'; +import RawModal from './app/RawModal'; +import DocumentList from './app/DocumentList'; class Container extends Component { constructor(props){ @@ -11,11 +14,13 @@ class Container extends Component { render() { const { - docActionElem, docStatusData, docNoData, docId, + docActionElem, docStatusData, docNoData, docId, processStatus, docSummaryData, dataId, windowType, breadcrumb, references, actions, showSidelist, siteName, connectionError, noMargin, entity, children, query, attachments, showIndicator, isDocumentNotSaved, hideHeader, - handleDeletedStatus, dropzoneFocused, notfound + handleDeletedStatus, dropzoneFocused, notfound, rawModal, modal, + selected, selectedWindowType, indicator, modalTitle, setModalTitle, + includedView, closeModalCallback } = this.props; return ( @@ -39,6 +44,76 @@ class Container extends Component { (noMargin ? 'dashboard' : 'container-fluid') } > + {modal.visible && + + } + + {rawModal.visible && + +
+ + + {includedView.windowType && includedView.viewId && + + } +
+
+ } {children} diff --git a/src/containers/Dashboard.js b/src/containers/Dashboard.js index 6def61017..0ee182547 100644 --- a/src/containers/Dashboard.js +++ b/src/containers/Dashboard.js @@ -3,7 +3,6 @@ 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){ @@ -12,38 +11,17 @@ export class Dashboard extends Component { render() { const { - location, modal, selected, rawModal, - indicator + location, modal, selected, rawModal, indicator, processStatus, + includedView } = this.props; return ( - {modal.visible && - - } -
- {modal.visible && - - } - - {rawModal.visible && - -
- - - {includedView.windowType && includedView.viewId && - - } -
-
- } - ) - } - - if(rawModal.visible){ - body.push( - -
- - - {includedView.windowType && includedView.viewId && - - } -
-
- ) - } - - body.push( - this.handleDropFile(accepted)} - handleRejectDropped={ - rejected => this.handleRejectDropped(rejected) - } - /> - ) + // if(modal.visible){ + // body.push( + // + // ) + // } + // + // if(rawModal.visible){ + // body.push( + // + //
+ // + // + // {includedView.windowType && includedView.viewId && + // + // } + //
+ //
+ // ) + // } return body; } render() { const { - master, modal, breadcrumb, params + master, modal, breadcrumb, params, rawModal, selected, + selectedWindowType, includedView, processStatus } = this.props; const { - dropzoneFocused + dropzoneFocused, newRow, modalTitle } = this.state; const { @@ -308,8 +290,10 @@ class MasterWindow extends Component { return ( {dataId === 'notfound' ? - : this.renderBody() + : + this.handleDropFile(accepted)} + handleRejectDropped={ + rejected => this.handleRejectDropped(rejected) + } + /> } );