-
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.
Convert Providers screen to Console page
Code changes: 1. use StandardPage list component 2. entity list is produced by merging results from k8s API and exsting Forklift inventory REST API. 3. actions in the table (kebab actions) are provided via extension point 'console.action/provider' 4. use existing actions for Add/Edit/Delete/Select Network Functional changes: 1. display all providers in one table 2. use only 'Ready' condition to describe the state of the provider 3. disable rich content in Network/Storage columns until the design for the details page is known Signed-off-by: Radoslaw Szwajkowski <[email protected]>
- Loading branch information
Showing
20 changed files
with
886 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,53 @@ | ||
{ | ||
"{{type}} provider {{name}} will no longer be selectable as a migration source.": "{{type}} provider {{name}} will no longer be selectable as a migration source.", | ||
"{{type}} provider {{name}} will no longer be selectable as a migration target.": "{{type}} provider {{name}} will no longer be selectable as a migration target.", | ||
"Actions": "Actions", | ||
"Add Provider": "Add Provider", | ||
"Cancel": "Cancel", | ||
"Cannot remove provider": "Cannot remove provider", | ||
"Clear all filters": "Clear all filters", | ||
"Clusters": "Clusters", | ||
"Delete": "Delete", | ||
"Delete Provider": "Delete Provider", | ||
"Edit Provider": "Edit Provider", | ||
"Endpoint": "Endpoint", | ||
"False": "False", | ||
"Filter by endpoint": "Filter by endpoint", | ||
"Filter by name": "Filter by name", | ||
"Filter by namespace": "Filter by namespace", | ||
"Hosts": "Hosts", | ||
"KubeVirt": "KubeVirt", | ||
"Loading": "Loading", | ||
"Manage Columns": "Manage Columns", | ||
"Mappings for VM Import": "Mappings for VM Import", | ||
"Name": "Name", | ||
"Namespace": "Namespace", | ||
"Networks": "Networks", | ||
"No information": "No information", | ||
"No results found": "No results found", | ||
"No results match the filter criteria. Clear all filters and try again.": "No results match the filter criteria. Clear all filters and try again.", | ||
"oVirt": "oVirt", | ||
"Permanently delete provider?": "Permanently delete provider?", | ||
"Plans for VM Import": "Plans for VM Import", | ||
"Providers": "Providers", | ||
"Providers for VM Import": "Providers for VM Import", | ||
"Ready": "Ready", | ||
"Reorder": "Reorder", | ||
"Restore default colums": "Restore default colums", | ||
"Save": "Save", | ||
"Select a default migration network for the provider. This network will be used for migrating data to all namespaces to which it is attached.": "Select a default migration network for the provider. This network will be used for migrating data to all namespaces to which it is attached.", | ||
"Select Filter": "Select Filter", | ||
"Select migration network": "Select migration network", | ||
"Selected columns will be displayed in the table.": "Selected columns will be displayed in the table.", | ||
"Storage": "Storage", | ||
"Table column management": "Table column management", | ||
"The host provider cannot be edited": "The host provider cannot be edited", | ||
"This provider cannot be edited because it has running migrations": "This provider cannot be edited because it has running migrations", | ||
"True": "True", | ||
"Type": "Type", | ||
"Unable to retrieve data": "Unable to retrieve data", | ||
"Virtualization": "Virtualization" | ||
"Unknown": "Unknown", | ||
"Virtualization": "Virtualization", | ||
"VMs": "VMs", | ||
"VMware": "VMware" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, { useState } from 'react'; | ||
import { useTranslation } from 'src/internal/i18n'; | ||
|
||
import { ActionService } from '@openshift-console/dynamic-plugin-sdk'; | ||
import { Dropdown, DropdownItem, DropdownToggle, KebabToggle } from '@patternfly/react-core'; | ||
|
||
export const createActions = (variant: 'kebab' | 'dropdown') => | ||
function GenericActions({ actions }: ActionService) { | ||
const { t } = useTranslation(); | ||
const [isActionMenuOpen, setIsActionMenuOpen] = useState(false); | ||
const isPlain = variant === 'kebab'; | ||
const toggle = | ||
variant === 'kebab' ? ( | ||
<KebabToggle onToggle={setIsActionMenuOpen} /> | ||
) : ( | ||
<DropdownToggle onToggle={setIsActionMenuOpen}>{t('Actions')}</DropdownToggle> | ||
); | ||
return ( | ||
<> | ||
<Dropdown | ||
position="right" | ||
onSelect={() => setIsActionMenuOpen(!isActionMenuOpen)} | ||
toggle={toggle} | ||
isOpen={isActionMenuOpen} | ||
isPlain={isPlain} | ||
dropdownItems={actions.map(({ id, label, cta, disabled, disabledTooltip }) => ( | ||
<DropdownItem | ||
key={id} | ||
onClick={typeof cta === 'function' ? cta : () => undefined} | ||
isAriaDisabled={disabled} | ||
tooltip={disabledTooltip} | ||
> | ||
{label} | ||
</DropdownItem> | ||
))} | ||
/> | ||
</> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { K8sConditionStatus } from '_/components/types'; | ||
|
||
import { ProviderType } from '@app/common/constants'; | ||
|
||
export const PROVIDERS: Record<ProviderType, (t: (k: string) => string) => string> = { | ||
vsphere: (t) => t('VMware'), | ||
ovirt: (t) => t('oVirt'), | ||
openshift: (t) => t('KubeVirt'), | ||
}; | ||
|
||
export const CONDITIONS: Record<K8sConditionStatus, (t: (k: string) => string) => string> = { | ||
True: (t) => t('True'), | ||
False: (t) => t('False'), | ||
Unknown: (t) => t('Unknown'), | ||
}; |
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 +1,2 @@ | ||
export * from './enums'; | ||
export * from './i18n'; |
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.