New: (History) Filter by Failed

This commit is contained in:
Qstick
2021-05-29 17:04:16 -04:00
parent 7711f5a407
commit 1639753511
10 changed files with 56 additions and 12 deletions

View File

@@ -20,9 +20,9 @@ function getIconName(eventType) {
}
}
function getIconKind(data) {
switch (data.successful) {
case 'False':
function getIconKind(successful) {
switch (successful) {
case false:
return kinds.DANGER;
default:
return kinds.DEFAULT;
@@ -44,9 +44,9 @@ function getTooltip(eventType, data, indexer) {
}
}
function HistoryEventTypeCell({ eventType, data, indexer }) {
function HistoryEventTypeCell({ eventType, successful, data, indexer }) {
const iconName = getIconName(eventType);
const iconKind = getIconKind(data);
const iconKind = getIconKind(successful);
const tooltip = getTooltip(eventType, data, indexer);
return (
@@ -64,6 +64,7 @@ function HistoryEventTypeCell({ eventType, data, indexer }) {
HistoryEventTypeCell.propTypes = {
eventType: PropTypes.string.isRequired,
successful: PropTypes.bool.isRequired,
data: PropTypes.object,
indexer: PropTypes.object
};

View File

@@ -71,6 +71,7 @@ class HistoryRow extends Component {
eventType,
date,
data,
successful,
isMarkingAsFailed,
columns,
shortDateFormat,
@@ -102,6 +103,7 @@ class HistoryRow extends Component {
indexer={indexer}
eventType={eventType}
data={data}
successful={successful}
/>
);
}
@@ -352,6 +354,7 @@ HistoryRow.propTypes = {
indexerId: PropTypes.number,
indexer: PropTypes.object.isRequired,
eventType: PropTypes.string.isRequired,
successful: PropTypes.bool.isRequired,
date: PropTypes.string.isRequired,
data: PropTypes.object.isRequired,
isMarkingAsFailed: PropTypes.bool,

View File

@@ -135,6 +135,17 @@ export const defaultState = {
type: filterTypes.EQUAL
}
]
},
{
key: 'failed',
label: translate('Failed'),
filters: [
{
key: 'successful',
value: false,
type: filterTypes.EQUAL
}
]
}
]