-
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.
Merge pull request #1135 from sgratch/add-provider-ui-details-item
🐾 Support a new details item field for the remote provider's web ui
- Loading branch information
Showing
16 changed files
with
238 additions
and
85 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
29 changes: 29 additions & 0 deletions
29
...rklift-console-plugin/src/modules/Providers/modals/EditProviderUI/EditProviderUIModal.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,29 @@ | ||
import React from 'react'; | ||
|
||
import { Modify, V1beta1Provider } from '@kubev2v/types'; | ||
import { K8sModel } from '@openshift-console/dynamic-plugin-sdk/lib/api/core-api'; | ||
|
||
import { EditModalProps } from '../EditModal'; | ||
|
||
export type EditProviderUIModalProps = Modify< | ||
EditModalProps, | ||
{ | ||
resource: V1beta1Provider; | ||
title?: string; | ||
label?: string; | ||
model?: K8sModel; | ||
jsonPath?: string | string[]; | ||
content?: string; | ||
} | ||
>; | ||
|
||
export const EditProviderUIModal: React.FC<EditProviderUIModalProps> = (props) => { | ||
switch (props.resource?.spec?.type) { | ||
case 'ovirt': | ||
case 'openshift': | ||
case 'openstack': | ||
case 'vsphere': | ||
default: | ||
return <></>; | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/forklift-console-plugin/src/modules/Providers/modals/EditProviderUI/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// @index('./*.tsx', f => `export * from '${f.path}';`) | ||
export * from './EditProviderUIModal'; | ||
// @endindex |
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
10 changes: 10 additions & 0 deletions
10
packages/forklift-console-plugin/src/modules/Providers/utils/helpers/ensureArray.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,10 @@ | ||
/** | ||
* Function to ensure that the input node is always an array. | ||
*/ | ||
export const ensureArray = (node: unknown | unknown[]): unknown[] => { | ||
if (Array.isArray(node)) { | ||
return node; | ||
} else { | ||
return [node]; // Wrap the single ReactNode in an array | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/forklift-console-plugin/src/modules/Providers/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
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
Oops, something went wrong.