Skip to content

Commit

Permalink
fix for create instance in network type fields condition show or not …
Browse files Browse the repository at this point in the history
…show (omnistrate-oss#494)

fix for create instance in  network type fileds
  • Loading branch information
mohandholu43 authored Jan 10, 2025
1 parent b10c1e4 commit b5d7b24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion pages/access/service/[serviceId].js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ function MarketplaceService() {
(instance) => instance.kubernetesDashboardEndpoint
);

const isMultiTenancy = useMemo(
() =>
service?.productTierType === productTierTypes.OMNISTRATE_MULTI_TENANCY,

[service]
);

const handleViewAccountConfigInstructions = (row) => {
setViewInstructionsItem(row);
const result_params = row.result_params;
Expand Down Expand Up @@ -938,7 +945,11 @@ function MarketplaceService() {
}
}

if (!isCloudProvider || isCustomNetworkEnabled) {
if (
!isCloudProvider ||
isMultiTenancy ||
!service?.supportsPublicNetwork
) {
delete data["network_type"];
}

Expand Down Expand Up @@ -2024,6 +2035,7 @@ function MarketplaceService() {
gcp: service?.gcpRegions || [],
}}
isCustomNetworkEnabled={isCustomNetworkEnabled}
isMultiTenancy={isMultiTenancy}
/>
}
/>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Forms/CreateResourceInstanceForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function CreateResourceInstanceForm(props) {
service,
subscriptionId,
isCustomNetworkEnabled = false,
isMultiTenancy,
} = props;

const [isSchemaLoading, setIsSchemaLoading] = useState(true);
Expand Down Expand Up @@ -234,7 +235,7 @@ function CreateResourceInstanceForm(props) {

const networkTypeFieldExists =
cloudProviderFieldExists &&
!isCustomNetworkEnabled &&
!isMultiTenancy &&
service?.supportsPublicNetwork;

if (isSchemaLoading)
Expand Down

0 comments on commit b5d7b24

Please sign in to comment.