-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jeff Puzzo <[email protected]>
- Loading branch information
Showing
10 changed files
with
87 additions
and
54 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
packages/common/src/components/LoadingSpinner/LoadingSpinner.tsx
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,14 @@ | ||
import React, { PropsWithChildren } from 'react'; | ||
|
||
import { Spinner, SpinnerProps } from '@patternfly/react-core'; | ||
|
||
type LoadingSpinnerProps = PropsWithChildren & | ||
SpinnerProps & { | ||
isLoading: boolean; | ||
}; | ||
|
||
export const LoadingSpinner: React.FC<LoadingSpinnerProps> = ({ | ||
isLoading, | ||
children, | ||
...spinnerProps | ||
}) => (isLoading ? <Spinner {...spinnerProps} /> : children); |
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 @@ | ||
export { LoadingSpinner } from './LoadingSpinner'; |
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
17 changes: 17 additions & 0 deletions
17
packages/forklift-console-plugin/src/modules/Plans/utils/helpers/getConditionTypes.ts
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,17 @@ | ||
import { V1beta1Plan } from '@kubev2v/types'; | ||
|
||
import { PlanConditionStatus } from '../types/PlanCondition'; | ||
|
||
/** | ||
* Gets a record of plan types with truthful ('True') statuses | ||
* @param plan V1beta1Plan | ||
* @returns Record<string, boolean> | ||
*/ | ||
export const getConditionTypes = (plan: V1beta1Plan): Record<string, boolean> => | ||
plan?.status?.conditions?.reduce((acc, condition) => { | ||
if (condition.status === PlanConditionStatus.True) { | ||
acc[condition.type] = true; | ||
} | ||
|
||
return acc; | ||
}, {}); |
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
1 change: 1 addition & 0 deletions
1
packages/forklift-console-plugin/src/modules/Plans/utils/helpers/index.ts
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