handleCloseClick() { const { closeWithoutSave, reject } = this.props; closeWithoutSave( reject, () => { this.dialogRef.current.open(); } ); return false; }
render() { const { description, closeWithoutSave, saveAndClose, resolve, reject } = this.props; const buttons = []; buttons.push( { class: styles.importDataButton, text: i18n.dialogButtonImportDataText, title: i18n.dialogButtonImportDataTitle, click: this.triggerImportDataDialogOpen, } ); buttons.push( { text: i18n.dialogButtonSaveText, title: i18n.dialogButtonSaveTitle, click: () => { saveAndClose( resolve, reject ); }, } ); buttons.push( { text: i18n.dialogButtonCancelText, title: i18n.dialogButtonCancelTitle, click() { closeWithoutSave( reject ); }, } ); return [ <DialogWithTabs buttons={buttons} className={styles.wef_dialog} key="editorDialog" minWidth={950} onBeforeClose={this.handleCloseClick} ref={this.dialogRef} tabs={description.tabs} title={description.dialogTitle} />, this.state.dialogOpen && <ImportDataDialog key="importDataDialog" onClose={this.triggerImportDataDialogOpen} />, ]; }
closeWithoutSave: reject => dispatch( closeWithoutSave( reject ) ),