|
@@ -7,10 +7,25 @@ import { createSubscribedElement } from '../../UnstatedUtils';
|
|
|
|
|
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
import AdminNotificationContainer from '../../../services/AdminNotificationContainer';
|
|
import AdminNotificationContainer from '../../../services/AdminNotificationContainer';
|
|
|
|
|
+import NotificationDeleteModal from './NotificationDeleteModal';
|
|
|
|
|
|
|
|
|
|
|
|
|
class GlobalNotificationList extends React.Component {
|
|
class GlobalNotificationList extends React.Component {
|
|
|
|
|
|
|
|
|
|
+ constructor(props) {
|
|
|
|
|
+ super(props);
|
|
|
|
|
+
|
|
|
|
|
+ this.state = {
|
|
|
|
|
+ isNotificationDeleteModalShown: false,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.toggleDeleteModal = this.toggleDeleteModal.bind(this);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ toggleDeleteModal() {
|
|
|
|
|
+ this.setState({ isNotificationDeleteModalShown: !this.state.isNotificationDeleteModalShown });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const { t, adminNotificationContainer } = this.props;
|
|
const { t, adminNotificationContainer } = this.props;
|
|
|
const { globalNotifications } = adminNotificationContainer.state;
|
|
const { globalNotifications } = adminNotificationContainer.state;
|
|
@@ -76,24 +91,18 @@ class GlobalNotificationList extends React.Component {
|
|
|
<i className="icon-fw icon-note"></i> {t('Edit')}
|
|
<i className="icon-fw icon-note"></i> {t('Edit')}
|
|
|
</a>
|
|
</a>
|
|
|
</li>
|
|
</li>
|
|
|
- {/* TODO GW-780 create delete modal */}
|
|
|
|
|
- <li className="btn-delete">
|
|
|
|
|
- <a
|
|
|
|
|
- href="#"
|
|
|
|
|
- data-setting-id="{{ notification.id }}"
|
|
|
|
|
- data-target="#admin-delete-global-notification"
|
|
|
|
|
- data-toggle="modal"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <li onClick={this.toggleDeleteModal}>
|
|
|
|
|
+ <a>
|
|
|
<i className="icon-fw icon-fire text-danger"></i> {t('Delete')}
|
|
<i className="icon-fw icon-fire text-danger"></i> {t('Delete')}
|
|
|
</a>
|
|
</a>
|
|
|
</li>
|
|
</li>
|
|
|
-
|
|
|
|
|
</ul>
|
|
</ul>
|
|
|
</div>
|
|
</div>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
);
|
|
);
|
|
|
})}
|
|
})}
|
|
|
|
|
+ <NotificationDeleteModal isOpen={this.state.isNotificationDeleteModalShown} onClose={this.toggleDeleteModal} />;
|
|
|
</React.Fragment>
|
|
</React.Fragment>
|
|
|
);
|
|
);
|
|
|
|
|
|