-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hpc-managed-vcd): add delete button for storage & compute
ref: MANAGER-16676 Signed-off-by: David Arsène <[email protected]>
- Loading branch information
Showing
7 changed files
with
200 additions
and
86 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
89 changes: 89 additions & 0 deletions
89
...er/apps/hpc-vmware-managed-vcd/src/components/datagrid/compute/ComputeCells.component.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,89 @@ | ||
import React from 'react'; | ||
import { | ||
ODS_BUTTON_SIZE, | ||
ODS_BUTTON_VARIANT, | ||
ODS_ICON_NAME, | ||
ODS_ICON_SIZE, | ||
} from '@ovhcloud/ods-components'; | ||
import { | ||
OsdsButton, | ||
OsdsIcon, | ||
OsdsTooltip, | ||
OsdsTooltipContent, | ||
OsdsText, | ||
} from '@ovhcloud/ods-components/react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { | ||
ODS_THEME_COLOR_HUE, | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_LEVEL, | ||
ODS_THEME_TYPOGRAPHY_SIZE, | ||
} from '@ovhcloud/ods-common-theming'; | ||
import { VCDCompute } from '@ovh-ux/manager-module-vcd-api'; | ||
import { DataGridTextCell } from '@ovh-ux/manager-react-components'; | ||
|
||
export const DatagridIdCell = (vcdCompute: VCDCompute) => ( | ||
<DataGridTextCell>{vcdCompute?.id}</DataGridTextCell> | ||
); | ||
|
||
export const DatagridVHostProfilCell = (vcdCompute: VCDCompute) => ( | ||
<DataGridTextCell>{vcdCompute?.currentState?.profile}</DataGridTextCell> | ||
); | ||
|
||
export const DatagridCpuCountCell = (vcdCompute: VCDCompute) => ( | ||
<DataGridTextCell>{vcdCompute.currentState?.vCPUCount}</DataGridTextCell> | ||
); | ||
|
||
export const DatagridBillingCell = (vcdCompute: VCDCompute) => { | ||
const { t } = useTranslation('datacentres/compute'); | ||
return ( | ||
<DataGridTextCell> | ||
{t( | ||
`managed_vcd_vdc_compute_billing_${vcdCompute.currentState?.billingType}`, | ||
)} | ||
</DataGridTextCell> | ||
); | ||
}; | ||
|
||
export const DatagridRamCountCell = (vcdCompute: VCDCompute) => { | ||
const { t } = useTranslation('datacentres'); | ||
|
||
return ( | ||
<DataGridTextCell> | ||
{t('managed_vcd_vdc_quota_value', { | ||
quota: vcdCompute.currentState?.memoryQuota, | ||
})} | ||
</DataGridTextCell> | ||
); | ||
}; | ||
|
||
export const ActionDeleteCell = () => { | ||
const { t } = useTranslation('datacentres'); | ||
|
||
return ( | ||
<OsdsTooltip> | ||
<OsdsButton | ||
size={ODS_BUTTON_SIZE.sm} | ||
variant={ODS_BUTTON_VARIANT.ghost} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
disabled | ||
> | ||
<OsdsIcon | ||
name={ODS_ICON_NAME.BIN} | ||
size={ODS_ICON_SIZE.xs} | ||
color={ODS_THEME_COLOR_INTENT.default} | ||
/> | ||
</OsdsButton> | ||
<OsdsTooltipContent slot="tooltip-content"> | ||
<OsdsText | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.body} | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
size={ODS_THEME_TYPOGRAPHY_SIZE._100} | ||
hue={ODS_THEME_COLOR_HUE._500} | ||
> | ||
{t('managed_vcd_vdc_contact_support')} | ||
</OsdsText> | ||
</OsdsTooltipContent> | ||
</OsdsTooltip> | ||
); | ||
}; |
45 changes: 45 additions & 0 deletions
45
...er/apps/hpc-vmware-managed-vcd/src/components/datagrid/storage/StorageCells.component.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,45 @@ | ||
import React from 'react'; | ||
import { VCDStorage } from '@ovh-ux/manager-module-vcd-api'; | ||
import { DataGridTextCell } from '@ovh-ux/manager-react-components'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { capitalize } from '@/utils/capitalize'; | ||
|
||
export const DatagridIdCell = (vcdStorage: VCDStorage) => ( | ||
<DataGridTextCell>{vcdStorage?.id}</DataGridTextCell> | ||
); | ||
|
||
export const DatagridNameCell = (vcdStorage: VCDStorage) => ( | ||
<DataGridTextCell>{vcdStorage?.currentState?.name}</DataGridTextCell> | ||
); | ||
|
||
export const DatagridProfileCell = (vcdStorage: VCDStorage) => ( | ||
<DataGridTextCell>{vcdStorage?.currentState?.profile}</DataGridTextCell> | ||
); | ||
|
||
export const DatagridTypeCell = (vcdStorage: VCDStorage) => ( | ||
<DataGridTextCell> | ||
{capitalize(vcdStorage?.currentState?.type)} | ||
</DataGridTextCell> | ||
); | ||
|
||
export const DatagridCapacityCell = (vcdStorage: VCDStorage) => { | ||
const { t } = useTranslation('datacentres'); | ||
return ( | ||
<DataGridTextCell> | ||
{t('managed_vcd_vdc_quota_value', { | ||
quota: vcdStorage?.currentState.capacity, | ||
})} | ||
</DataGridTextCell> | ||
); | ||
}; | ||
|
||
export const DatagridBillingCell = (vcdStorage: VCDStorage) => { | ||
const { t } = useTranslation('datacentres/compute'); | ||
return ( | ||
<DataGridTextCell> | ||
{t( | ||
`managed_vcd_vdc_compute_billing_${vcdStorage?.currentState?.billingType}`, | ||
)} | ||
</DataGridTextCell> | ||
); | ||
}; |
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