Skip to content

Commit

Permalink
Improve error message for Timeout status
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianogorza committed Mar 14, 2024
1 parent 2b775fe commit 939cdcc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
9 changes: 9 additions & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,23 @@ export const API_NAME_TASK_STATUS = {
DONE: 'Done',
IN_PROGRESS: 'In progress',
FAILED: 'Failed',
TIMEOUT: 'Timeout',
} as const;

export const UI_TASK_STATUS = [
API_NAME_TASK_STATUS.DONE,
API_NAME_TASK_STATUS.IN_PROGRESS,
API_NAME_TASK_STATUS.FAILED,
API_NAME_TASK_STATUS.TIMEOUT,
];

export const UI_TASK_STATUS_COLORS = {
[API_NAME_TASK_STATUS.DONE]: 'success',
[API_NAME_TASK_STATUS.IN_PROGRESS]: 'warning',
[API_NAME_TASK_STATUS.FAILED]: 'danger',
[API_NAME_TASK_STATUS.TIMEOUT]: 'subdued',
};

// Documentation
export const DOCUMENTATION_WEB_BASE_URL = 'https://documentation.wazuh.com';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
API_NAME_TASK_STATUS,
SEARCH_BAR_WQL_VALUE_SUGGESTIONS_COUNT,
UI_TASK_STATUS,
UI_TASK_STATUS_COLORS,
} from '../../../../common/constants';
import { WzRequest } from '../../../react-services/wz-request';
import { get as getLodash, uniqBy as uniqByLodash } from 'lodash';
Expand Down Expand Up @@ -104,15 +105,7 @@ export const AgentUpgradesTaskDetailsModal = ({
searchable: true,
show: true,
render: value => (
<EuiHealth
color={
value === API_NAME_TASK_STATUS.DONE
? 'success'
: value === API_NAME_TASK_STATUS.IN_PROGRESS
? 'warning'
: 'danger'
}
>
<EuiHealth color={UI_TASK_STATUS_COLORS[value]}>
{value}
</EuiHealth>
),
Expand All @@ -123,6 +116,12 @@ export const AgentUpgradesTaskDetailsModal = ({
show: true,
searchable: true,
width: '250px',
render: (value, task) => {
if (task.status === API_NAME_TASK_STATUS.TIMEOUT) {
return 'Upgrade task has appears to be done but the notification has never reached the manager';
}
return value;
},
},
]}
tableInitialSortingField='last_update_time'
Expand Down

0 comments on commit 939cdcc

Please sign in to comment.