Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Job list: add retries column (#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhut authored Mar 28, 2019
1 parent 563322b commit deeee3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {getModified, getDuration, getStatusIndex} from './utils';

export default class Ordering {
/**
* @param {"name" | "modified" | "user" | "duration" | "virtualCluster"| "status" | undefined} field
* @param {"name" | "modified" | "user" | "duration" | "virtualCluster" | "retries" | "status" | undefined} field
* @param {boolean | undefined} descending
*/
constructor(field, descending=false) {
Expand Down Expand Up @@ -36,6 +36,10 @@ export default class Ordering {
comparator = descending
? (a, b) => String(b.virtualCluster).localeCompare(a.virtualCluster)
: (a, b) => String(a.virtualCluster).localeCompare(b.virtualCluster);
} else if (field === 'retries') {
comparator = descending
? (a, b) => b.retries - a.retries
: (a, b) => a.retries - b.retries;
} else if (field === 'status') {
comparator = descending
? (a, b) => getStatusIndex(b) - getStatusIndex(a)
Expand Down
10 changes: 10 additions & 0 deletions src/webportal/src/app/job/job-view/fabric/JobList/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ export default function Table() {
isResizable: true,
isFiltered: filter.virtualClusters.size > 0,
});
const retriesColumn = applySortProps({
key: 'retries',
minWidth: 60,
name: 'Retries',
fieldName: 'retries',
className: FontClassNames.mediumPlus,
headerClassName: FontClassNames.medium,
isResizable: true,
});
const statusColumn = applySortProps({
key: 'status',
minWidth: 100,
Expand Down Expand Up @@ -213,6 +222,7 @@ export default function Table() {
userColumn,
durationColumn,
virtualClusterColumn,
retriesColumn,
statusColumn,
actionsColumn,
];
Expand Down

0 comments on commit deeee3f

Please sign in to comment.