Skip to content

Commit

Permalink
🐛 Add tooltips for Priority and Preemption columns (#2005)
Browse files Browse the repository at this point in the history
Resolves: https://issues.redhat.com/browse/MTA-3235

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
rszwajko authored Jul 11, 2024
1 parent caac127 commit 7d24ba1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"save": "Failed to save {{type}}."
}
},
"tooltip": {
"priority": "Tasks priority(Low-High). Impacts tasks scheduling policy.",
"preemption": "If enabled, allows the scheduler to cancel a running task and free the resources for higher priority tasks."
},
"validation": {
"email": "This field requires a valid email.",
"max": "This field must be less than {{value}}.",
Expand Down
21 changes: 19 additions & 2 deletions client/src/app/pages/tasks/tasks-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ import {
ToolbarContent,
ToolbarItem,
} from "@patternfly/react-core";
import { Table, Tbody, Th, Thead, Tr, Td } from "@patternfly/react-table";
import {
Table,
Tbody,
Th,
Thead,
Tr,
Td,
ThProps,
} from "@patternfly/react-table";
import { CubesIcon } from "@patternfly/react-icons";

import { FilterToolbar, FilterType } from "@app/components/FilterToolbar";
Expand Down Expand Up @@ -189,6 +197,11 @@ export const TasksPage: React.FC = () => {
columnState,
} = tableControls;

const tooltips: Record<string, ThProps["info"]> = {
priority: { tooltip: t("tooltip.priority") },
preemption: { tooltip: t("tooltip.preemption") },
};

const clearFilters = () => {
const currentPath = history.location.pathname;
const newSearch = new URLSearchParams(history.location.search);
Expand Down Expand Up @@ -275,7 +288,11 @@ export const TasksPage: React.FC = () => {
{columnState.columns
.filter(({ id }) => getColumnVisibility(id))
.map(({ id }) => (
<Th key={id} {...getThProps({ columnKey: id })} />
<Th
key={id}
{...getThProps({ columnKey: id })}
info={tooltips[id]}
/>
))}
<Th width={10} />
</TableHeaderContentWithControls>
Expand Down

0 comments on commit 7d24ba1

Please sign in to comment.