Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add tooltips for Priority and Preemption columns #2005

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.",
Copy link
Collaborator

@mguetta1 mguetta1 Jul 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I am not sure about this description regarding the priority value. The values can range from zero to any positive whole number.
Low-High doesn't say much to me. wdyt?

Copy link
Collaborator

@mguetta1 mguetta1 Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Please use something like: Tasks priority, 0 to any positive integer (Low-High). Impacts tasks scheduling policy. as the tooltip

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change made in #2028

"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") },
};
sjd78 marked this conversation as resolved.
Show resolved Hide resolved

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
Loading