New: Show current tags for Connections
This commit is contained in:
parent
9bdc618366
commit
2016f11b1c
|
@ -3,6 +3,7 @@ import React, { Component } from 'react';
|
||||||
import Card from 'Components/Card';
|
import Card from 'Components/Card';
|
||||||
import Label from 'Components/Label';
|
import Label from 'Components/Label';
|
||||||
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
||||||
|
import TagList from 'Components/TagList';
|
||||||
import { kinds } from 'Helpers/Props';
|
import { kinds } from 'Helpers/Props';
|
||||||
import EditNotificationModalConnector from './EditNotificationModalConnector';
|
import EditNotificationModalConnector from './EditNotificationModalConnector';
|
||||||
import styles from './Notification.css';
|
import styles from './Notification.css';
|
||||||
|
@ -77,7 +78,9 @@ class Notification extends Component {
|
||||||
supportsOnHealthIssue,
|
supportsOnHealthIssue,
|
||||||
supportsOnHealthRestored,
|
supportsOnHealthRestored,
|
||||||
supportsOnApplicationUpdate,
|
supportsOnApplicationUpdate,
|
||||||
supportsOnManualInteractionRequired
|
supportsOnManualInteractionRequired,
|
||||||
|
tags,
|
||||||
|
tagList
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -197,6 +200,11 @@ class Notification extends Component {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<TagList
|
||||||
|
tags={tags}
|
||||||
|
tagList={tagList}
|
||||||
|
/>
|
||||||
|
|
||||||
<EditNotificationModalConnector
|
<EditNotificationModalConnector
|
||||||
id={id}
|
id={id}
|
||||||
isOpen={this.state.isEditNotificationModalOpen}
|
isOpen={this.state.isEditNotificationModalOpen}
|
||||||
|
@ -245,6 +253,8 @@ Notification.propTypes = {
|
||||||
supportsOnHealthRestored: PropTypes.bool.isRequired,
|
supportsOnHealthRestored: PropTypes.bool.isRequired,
|
||||||
supportsOnApplicationUpdate: PropTypes.bool.isRequired,
|
supportsOnApplicationUpdate: PropTypes.bool.isRequired,
|
||||||
supportsOnManualInteractionRequired: PropTypes.bool.isRequired,
|
supportsOnManualInteractionRequired: PropTypes.bool.isRequired,
|
||||||
|
tags: PropTypes.arrayOf(PropTypes.number).isRequired,
|
||||||
|
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
onConfirmDeleteNotification: PropTypes.func.isRequired
|
onConfirmDeleteNotification: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ class Notifications extends Component {
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
items,
|
items,
|
||||||
|
tagList,
|
||||||
onConfirmDeleteNotification,
|
onConfirmDeleteNotification,
|
||||||
...otherProps
|
...otherProps
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
@ -70,6 +71,7 @@ class Notifications extends Component {
|
||||||
<Notification
|
<Notification
|
||||||
key={item.id}
|
key={item.id}
|
||||||
{...item}
|
{...item}
|
||||||
|
tagList={tagList}
|
||||||
onConfirmDeleteNotification={onConfirmDeleteNotification}
|
onConfirmDeleteNotification={onConfirmDeleteNotification}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -108,6 +110,7 @@ Notifications.propTypes = {
|
||||||
isFetching: PropTypes.bool.isRequired,
|
isFetching: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object,
|
error: PropTypes.object,
|
||||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
|
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
onConfirmDeleteNotification: PropTypes.func.isRequired
|
onConfirmDeleteNotification: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,20 @@ import { connect } from 'react-redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { deleteNotification, fetchNotifications } from 'Store/Actions/settingsActions';
|
import { deleteNotification, fetchNotifications } from 'Store/Actions/settingsActions';
|
||||||
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
import createSortedSectionSelector from 'Store/Selectors/createSortedSectionSelector';
|
||||||
|
import createTagsSelector from 'Store/Selectors/createTagsSelector';
|
||||||
import sortByName from 'Utilities/Array/sortByName';
|
import sortByName from 'Utilities/Array/sortByName';
|
||||||
import Notifications from './Notifications';
|
import Notifications from './Notifications';
|
||||||
|
|
||||||
function createMapStateToProps() {
|
function createMapStateToProps() {
|
||||||
return createSelector(
|
return createSelector(
|
||||||
createSortedSectionSelector('settings.notifications', sortByName),
|
createSortedSectionSelector('settings.notifications', sortByName),
|
||||||
(notifications) => notifications
|
createTagsSelector(),
|
||||||
|
(notifications, tagList) => {
|
||||||
|
return {
|
||||||
|
...notifications,
|
||||||
|
tagList
|
||||||
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue