-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional changes: 1. create task manager entry in the sidebar navigation list 2. place task page under /tasks route 3. present tasks in a server-filtered table 4. row actions supported: canceling, enable/disable preemption flag 5. use column management to hide optional columns: pod, started, terminated Related features: 1. make id property required in Task type 2. switch task update endpoint to use patch method 3. provide icon-to-state mapping that preserves original state names which are required for server filtering Resolves: #1931 --------- Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
- Loading branch information
Showing
12 changed files
with
510 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./OptionalTooltip"; | ||
export * from "./IconedStatus"; | ||
export * from "./IconWithLabel"; | ||
export * from "./taskStateToIcon"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { TaskState } from "@app/api/models"; | ||
import React from "react"; | ||
import { Icon } from "@patternfly/react-core"; | ||
import CheckCircleIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon"; | ||
import TimesCircleIcon from "@patternfly/react-icons/dist/esm/icons/times-circle-icon"; | ||
import InProgressIcon from "@patternfly/react-icons/dist/esm/icons/in-progress-icon"; | ||
import ExclamationCircleIcon from "@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon"; | ||
import UnknownIcon from "@patternfly/react-icons/dist/esm/icons/unknown-icon"; | ||
|
||
export const taskStateToIcon = (state?: TaskState) => { | ||
switch (state) { | ||
case "not supported": | ||
case "No task": | ||
return <UnknownIcon />; | ||
case "Canceled": | ||
return <TimesCircleIcon />; | ||
case "Succeeded": | ||
return ( | ||
<Icon status={"success"}> | ||
<CheckCircleIcon /> | ||
</Icon> | ||
); | ||
case "Failed": | ||
return ( | ||
<Icon status={"danger"}> | ||
<ExclamationCircleIcon /> | ||
</Icon> | ||
); | ||
case "Pending": | ||
return <InProgressIcon />; | ||
case "Created": | ||
case "QuotaBlocked": | ||
case "Running": | ||
case "Ready": | ||
case "Postponed": | ||
default: | ||
return <></>; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.