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 icon and status for tf plans that are waiting for user action #3658

Merged
merged 4 commits into from
May 3, 2023
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 ui/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export enum IconType {
TemplatesIcon,
ClustersIcon,
ExploreIcon,
PendingActionIcon,
}

type Props = {
Expand Down Expand Up @@ -179,6 +180,9 @@ function getIcon(i: IconType) {
case IconType.ReconcileIcon:
return () => <img src={images.reconcileSrc} />;

case IconType.PendingActionIcon:
return () => <img src={images.pendingAction} />;

case IconType.ArrowDropDownIcon:
return ArrowDropDownIcon;

Expand Down
16 changes: 11 additions & 5 deletions ui/components/KubeStatusIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum ReadyType {
Ready = "Ready",
NotReady = "Not Ready",
Reconciling = "Reconciling",
PendingAction = "PendingAction",
Suspended = "Suspended",
None = "None",
}
Expand All @@ -40,11 +41,10 @@ export function computeReady(conditions: Condition[]): ReadyType {
return ReadyType.Ready;
}

if (
readyCondition.status === ReadyStatusValue.Unknown &&
readyCondition.reason === "Progressing"
) {
return ReadyType.Reconciling;
if (readyCondition.status === ReadyStatusValue.Unknown) {
if (readyCondition.reason === "Progressing") return ReadyType.Reconciling;
if (readyCondition.reason === "TerraformPlannedWithChanges")
return ReadyType.PendingAction;
}

if (readyCondition.status === ReadyStatusValue.None) return ReadyType.None;
Expand Down Expand Up @@ -107,6 +107,12 @@ export const getIndicatorInfo = (
icon: IconType.ReconcileIcon,
color: "primary",
};
if (ready === ReadyType.PendingAction)
return {
type: ReadyType.PendingAction,
icon: IconType.PendingActionIcon,
color: "feedbackOriginal",
};
if (ready === ReadyType.Ready)
return {
type: ReadyType.Ready,
Expand Down
1 change: 1 addition & 0 deletions ui/images/pending-action.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions ui/lib/images.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* eslint-disable */
// @ts-nocheck

import signInWheel from "data-url:../images/SignInWheel.svg";
import weaveLogo from "data-url:../images/WeaveLogo.svg";
import bg from "data-url:../images/bg-circles.png";
import failedSrc from "data-url:../images/failed.svg";
import logotype from "data-url:../images/logotype.svg";
import pendingAction from "data-url:../images/pending-action.svg";
import reconcileSrc from "data-url:../images/reconcile.svg";
import signInWheel from "data-url:../images/SignInWheel.svg";
import successSrc from "data-url:../images/success.svg";
import suspendedSrc from "data-url:../images/suspended.svg";
import weaveG from "data-url:../images/weaveG.svg";
import weaveLogo from "data-url:../images/WeaveLogo.svg";

export default {
bg,
Expand All @@ -21,4 +22,5 @@ export default {
suspendedSrc,
weaveLogo,
reconcileSrc,
pendingAction,
};