in dashboards-notifications/public/pages/Channels/Channels.tsx [53:118]
constructor(props: ChannelsProps) {
super(props);
this.state = {
total: 0,
from: 0,
size: 10,
search: '',
filters: {},
sortField: 'name',
sortDirection: SortDirection.ASC,
items: [],
selectedItems: [],
loading: true,
};
this.columns = [
{
field: 'name',
name: 'Name',
sortable: true,
truncateText: true,
render: (name: string, item: ChannelItemType) => (
<EuiLink href={`#${ROUTES.CHANNEL_DETAILS}/${item.config_id}`}>
{name}
</EuiLink>
),
},
{
field: 'is_enabled',
name: 'Notification status',
sortable: true,
render: (enabled: boolean) => {
const color = enabled ? 'success' : 'subdued';
const label = enabled ? 'Active' : 'Muted';
return <EuiHealth color={color}>{label}</EuiHealth>;
},
},
{
field: 'config_type',
name: 'Type',
sortable: true,
truncateText: false,
render: (type: string) => _.get(CHANNEL_TYPE, type, '-'),
},
{
field: 'feature_list',
name: 'Notification source',
sortable: true,
truncateText: true,
render: (features: string[]) =>
features
.map((feature) => _.get(NOTIFICATION_SOURCE, feature, '-'))
.join(', ') || '-',
},
{
field: 'description',
name: 'Description',
sortable: true,
truncateText: true,
render: (description: string) => description || '-',
},
];
this.refresh = this.refresh.bind(this);
}