Skip to content

Commit

Permalink
fix(pci.instances): windows gen 3 (#14884)
Browse files Browse the repository at this point in the history
ref: TAPC-2559

Signed-off-by: Selmen AKRMI <[email protected]>
  • Loading branch information
selm3n authored Jan 17, 2025
1 parent 41ae4e6 commit 848b77b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export default class FlavorsList {
);
const groupedPlanCodesByName = groupBy(hourlyPlanCodes, 'name');
return map(groupedPlanCodesByName, (groupedFlavors) => {
const resource = groupedFlavors[0];
const resource = groupedFlavors.find(
(groupedFlavor) => !groupedFlavor?.region?.includes('LZ'),
);
const planCodeList = groupedFlavors.map(
(flavor) => flavor.planCodes.hourly,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,6 @@ export default class PciInstancesAddController {
images = [this.model?.image],
) {
const {
windowsGen3: { isFeatureAvailable },
model: { flavorGroup },
} = this;

Expand All @@ -1739,7 +1738,6 @@ export default class PciInstancesAddController {
const is1AZRegion = !this.isLocalZone();

return (
isFeatureAvailable &&
isWindowsDistribution &&
hasWindowsServerImages &&
isLicensedFlavor &&
Expand All @@ -1758,7 +1756,7 @@ export default class PciInstancesAddController {
`${convertedPrice}`.split('.').pop().length,
3,
),
}).format(convertedPrice * multiplier);
}).format(convertedPrice * multiplier * this.model.number);
}

getWindowsLicensePriceText(distribution, images) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,11 @@ export default /* @ngInject */ ($stateProvider) => {
PCI_FEATURES.ACTIONS.INSTANCE_LOCALZONE_BACKUP,
);
},
windowsGen3: /* @ngInject */ (catalog, pciFeatures) => ({
windowsGen3: /* @ngInject */ (catalog) => ({
price:
catalog.addons.find(
({ planCode }) => planCode === WINDOWS_GEN_3_ADDON_PLANCODE,
)?.pricings[0]?.price || null,
isFeatureAvailable: Boolean(
pciFeatures.isFeatureAvailable(
PCI_FEATURES.ACTIONS.INSTANCE_WINDOWS_GEN_3,
) || true,
),
}),
},
});
Expand Down

0 comments on commit 848b77b

Please sign in to comment.