Skip to content

Commit

Permalink
M #~: Minor fix to containers (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Betanzos authored Jun 10, 2022
1 parent 04aed03 commit fa6917f
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Clusters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Clusters() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<ClustersTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Datastores/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Datastores() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<DatastoresTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Groups/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Groups() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<GroupsTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Hosts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Hosts() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<HostsTable
onSelectedRowsChange={onSelectedRowsChange}
globalActions={actions}
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Images/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Images() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<ImagesTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function MarketplaceApps() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<MarketplaceAppsTable
onSelectedRowsChange={onSelectedRowsChange}
globalActions={actions}
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Marketplaces/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Marketplaces() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<MarketplacesTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function ServiceTemplates() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<ServiceTemplatesTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Services() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<ServicesTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Users() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<UsersTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function VNetworkTemplates() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<VNetworkTemplatesTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
12 changes: 7 additions & 5 deletions src/fireedge/src/client/containers/VirtualMachines/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function VirtualMachines() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<VmsTable
onSelectedRowsChange={onSelectedRowsChange}
globalActions={actions}
Expand Down Expand Up @@ -79,7 +79,9 @@ function VirtualMachines() {
* @returns {ReactElement} VM details
*/
const InfoTabs = memo(({ vm, gotoPage, unselect }) => {
const [getVm, { isFetching }] = useLazyGetVmQuery()
const [getVm, { data: lazyData, isFetching }] = useLazyGetVmQuery()
const id = lazyData?.ID ?? vm.ID
const name = lazyData?.NAME ?? vm.NAME

return (
<Stack overflow="auto">
Expand All @@ -89,7 +91,7 @@ const InfoTabs = memo(({ vm, gotoPage, unselect }) => {
icon={<RefreshDouble />}
tooltip={Tr(T.Refresh)}
isSubmitting={isFetching}
onClick={() => getVm({ id: vm?.ID })}
onClick={() => getVm({ id })}
/>
{typeof gotoPage === 'function' && (
<SubmitButton
Expand All @@ -108,10 +110,10 @@ const InfoTabs = memo(({ vm, gotoPage, unselect }) => {
/>
)}
<Typography color="text.primary" noWrap>
{`#${vm?.ID} | ${vm?.NAME}`}
{`#${id} | ${name}`}
</Typography>
</Stack>
<VmTabs id={vm?.ID} />
<VmTabs id={id} />
</Stack>
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function VirtualNetworks() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<VNetworksTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down
12 changes: 7 additions & 5 deletions src/fireedge/src/client/containers/VmTemplates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function VmTemplates() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<VmTemplatesTable
onSelectedRowsChange={onSelectedRowsChange}
globalActions={actions}
Expand Down Expand Up @@ -79,7 +79,9 @@ function VmTemplates() {
* @returns {ReactElement} VM Template details
*/
const InfoTabs = memo(({ template, gotoPage, unselect }) => {
const [getTemplate, { isFetching }] = useLazyGetTemplateQuery()
const [getTemplate, { data, isFetching }] = useLazyGetTemplateQuery()
const id = data?.ID ?? template.ID
const name = data?.NAME ?? template.NAME

return (
<Stack overflow="auto">
Expand All @@ -89,7 +91,7 @@ const InfoTabs = memo(({ template, gotoPage, unselect }) => {
icon={<RefreshDouble />}
tooltip={Tr(T.Refresh)}
isSubmitting={isFetching}
onClick={() => getTemplate({ id: template?.ID })}
onClick={() => getTemplate({ id })}
/>
{typeof gotoPage === 'function' && (
<SubmitButton
Expand All @@ -108,10 +110,10 @@ const InfoTabs = memo(({ template, gotoPage, unselect }) => {
/>
)}
<Typography color="text.primary" noWrap>
{`#${template?.ID || ''} | ${template?.NAME || ''}`}
{`#${id} | ${name}`}
</Typography>
</Stack>
<VmTemplateTabs id={template?.ID} />
<VmTemplateTabs id={id} />
</Stack>
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/fireedge/src/client/containers/Zones/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Zones() {
return (
<SplitPane gridTemplateRows="1fr auto 1fr">
{({ getGridProps, GutterComponent }) => (
<Box {...(hasSelectedRows && getGridProps())}>
<Box height={1} {...(hasSelectedRows && getGridProps())}>
<ZonesTable onSelectedRowsChange={onSelectedRowsChange} />

{hasSelectedRows && (
Expand Down

0 comments on commit fa6917f

Please sign in to comment.