Skip to content

Commit

Permalink
Add tooltips for Priority and Preemption columns
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
rszwajko committed Jul 10, 2024
1 parent caac127 commit 6fd4c68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,9 @@
"review": "Review analysis details"
},
"tooltip": {
"advancedAnalysisDetails": "Enable enhanced analysis details to get more information about the analysis."
"advancedAnalysisDetails": "Enable enhanced analysis details to get more information about the analysis.",
"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."
}
}
}
12 changes: 11 additions & 1 deletion client/src/app/pages/tasks/tasks-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import dayjs from "dayjs";
import { formatPath } from "@app/utils/utils";
import { Paths } from "@app/Paths";
import { TaskActionColumn } from "./TaskActionColumn";
import { ThInfoType } from "@patternfly/react-table/dist/esm/components/Table/base/types";

export const TasksPage: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -189,6 +190,11 @@ export const TasksPage: React.FC = () => {
columnState,
} = tableControls;

const tooltips: Record<string, ThInfoType> = {
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 +281,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 6fd4c68

Please sign in to comment.