From 0b52e85ba73e5b3badeb1703462c5d05d3a7d224 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 10 Nov 2015 10:20:16 -0500 Subject: Added Modal base class that extends ReactBootstrap.Modal --- web/react/components/access_history_modal.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'web/react/components/access_history_modal.jsx') diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx index ab5686720..6a10f87b2 100644 --- a/web/react/components/access_history_modal.jsx +++ b/web/react/components/access_history_modal.jsx @@ -1,7 +1,7 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -var Modal = ReactBootstrap.Modal; +var Modal = require('./modal.jsx'); var UserStore = require('../stores/user_store.jsx'); var ChannelStore = require('../stores/channel_store.jsx'); var AsyncClient = require('../utils/async_client.jsx'); @@ -15,7 +15,6 @@ export default class AccessHistoryModal extends React.Component { this.onAuditChange = this.onAuditChange.bind(this); this.handleMoreInfo = this.handleMoreInfo.bind(this); this.onHide = this.onHide.bind(this); - this.onShow = this.onShow.bind(this); this.formatAuditInfo = this.formatAuditInfo.bind(this); this.handleRevokedSession = this.handleRevokedSession.bind(this); @@ -44,11 +43,6 @@ export default class AccessHistoryModal extends React.Component { componentDidMount() { UserStore.addAuditsChangeListener(this.onAuditChange); } - componentDidUpdate(prevProps) { - if (this.props.show && !prevProps.show) { - this.onShow(); - } - } componentWillUnmount() { UserStore.removeAuditsChangeListener(this.onAuditChange); } @@ -391,6 +385,7 @@ export default class AccessHistoryModal extends React.Component { -- cgit v1.2.3-1-g7c22 From 590e7f903f3b911566465b2fb51ff68c273ded96 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 10 Nov 2015 11:54:43 -0500 Subject: Renamed onModalDismissed to onHide to keep it consistent with React-Bootstrap --- web/react/components/access_history_modal.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/react/components/access_history_modal.jsx') diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx index 6a10f87b2..8306a4e8c 100644 --- a/web/react/components/access_history_modal.jsx +++ b/web/react/components/access_history_modal.jsx @@ -14,6 +14,7 @@ export default class AccessHistoryModal extends React.Component { this.onAuditChange = this.onAuditChange.bind(this); this.handleMoreInfo = this.handleMoreInfo.bind(this); + this.onShow = this.onShow.bind(this); this.onHide = this.onHide.bind(this); this.formatAuditInfo = this.formatAuditInfo.bind(this); this.handleRevokedSession = this.handleRevokedSession.bind(this); @@ -38,7 +39,7 @@ export default class AccessHistoryModal extends React.Component { } onHide() { this.setState({moreInfo: []}); - this.props.onModalDismissed(); + this.props.onHide(); } componentDidMount() { UserStore.addAuditsChangeListener(this.onAuditChange); @@ -401,5 +402,5 @@ export default class AccessHistoryModal extends React.Component { AccessHistoryModal.propTypes = { show: React.PropTypes.bool.isRequired, - onModalDismissed: React.PropTypes.func.isRequired + onHide: React.PropTypes.func.isRequired }; -- cgit v1.2.3-1-g7c22 From 70de0125abdc84d70580f82b29a4314e3515a587 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 17 Nov 2015 16:10:16 -0500 Subject: Removed Modal base class --- web/react/components/access_history_modal.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'web/react/components/access_history_modal.jsx') diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx index 8306a4e8c..65b80dfb7 100644 --- a/web/react/components/access_history_modal.jsx +++ b/web/react/components/access_history_modal.jsx @@ -1,7 +1,7 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -var Modal = require('./modal.jsx'); +var Modal = ReactBootstrap.Modal; var UserStore = require('../stores/user_store.jsx'); var ChannelStore = require('../stores/channel_store.jsx'); var AsyncClient = require('../utils/async_client.jsx'); @@ -43,6 +43,15 @@ export default class AccessHistoryModal extends React.Component { } componentDidMount() { UserStore.addAuditsChangeListener(this.onAuditChange); + + if (this.props.show) { + this.onShow(); + } + } + componentDidUpdate(prevProps) { + if (this.props.show && !prevProps.show) { + this.onShow(); + } } componentWillUnmount() { UserStore.removeAuditsChangeListener(this.onAuditChange); @@ -386,7 +395,6 @@ export default class AccessHistoryModal extends React.Component { -- cgit v1.2.3-1-g7c22