Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
export const GEN2_HOST_PROFILES = [
// GP-1
'pcc-host-vsphere-gp1-16x128',
'pcc-host-premier-gp1-16x128',
'pcc-host-sddc2016-gp1-16x128',
'pcc-host-sddc2018-gp1-16x128',
'pcc-host-essentials-gp1-16x128',
'pcc-host-nsx-gp1-16x128',
// GP-2
'pcc-host-vsphere-gp2-16x256',
'pcc-host-premier-gp2-16x256',
'pcc-host-sddc2016-gp2-16x256',
'pcc-host-sddc2018-gp2-16x256',
'pcc-host-essentials-gp2-16x256',
'pcc-host-nsx-gp2-16x256',
// GP-3
'pcc-host-vsphere-gp3-24x512',
'pcc-host-premier-gp3-24x512',
'pcc-host-sddc2016-gp3-24x512',
'pcc-host-sddc2018-gp3-24x512',
'pcc-host-essentials-gp3-24x512',
'pcc-host-nsx-gp3-24x512',
// GP-4
'pcc-host-vsphere-gp4-36x1024',
'pcc-host-premier-gp4-36x1024',
'pcc-host-sddc2016-gp4-36x1024',
'pcc-host-sddc2018-gp4-36x1024',
'pcc-host-essentials-gp4-36x1024',
'pcc-host-nsx-gp4-36x1024',
// GP-5
'pcc-host-vsphere-gp5-48x1536',
'pcc-host-premier-gp5-48x1536',
'pcc-host-sddc2016-gp5-48x1536',
'pcc-host-sddc2018-gp5-48x1536',
'pcc-host-essentials-gp5-48x1536',
'pcc-host-nsx-gp5-48x1536',
// STO-1
'pcc-host-vsphere-sto1-24x256',
'pcc-host-premier-sto1-24x256',
'pcc-host-sddc2016-sto1-24x256',
'pcc-host-sddc2018-sto1-24x256',
'pcc-host-nsx-sto1-24x256',
// STO-2
'pcc-host-vsphere-sto2-36x512',
'pcc-host-premier-sto2-36x512',
'pcc-host-sddc2016-sto2-36x512',
'pcc-host-sddc2018-sto2-36x512',
'pcc-host-nsx-sto2-36x512',
// STO-3
'pcc-host-vsphere-sto3-48x1024',
'pcc-host-premier-sto3-48x1024',
'pcc-host-sddc2016-sto3-48x1024',
'pcc-host-sddc2018-sto3-48x1024',
'pcc-host-nsx-sto3-48x1024',
// STO-4
'pcc-host-vsphere-sto4-72x1536',
'pcc-host-premier-sto4-72x1536',
'pcc-host-sddc2016-sto4-72x1536',
'pcc-host-sddc2018-sto4-72x1536',
'pcc-host-nsx-sto4-72x1536',
];

export const GEN2_HOST_BADGE_LABEL = 'new';

const GEN2_HOST_PROFILES_SET = new Set(GEN2_HOST_PROFILES);

export const isGen2Host = (name) => GEN2_HOST_PROFILES_SET.has(name);

export const isStorageHost = (name) => /-sto\d/.test(name);

export default {
GEN2_HOST_PROFILES,
GEN2_HOST_BADGE_LABEL,
isGen2Host,
isStorageHost,
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import {
GEN2_HOST_BADGE_LABEL,
isGen2Host,
isStorageHost,
} from './dedicatedCloud-datacenter-host-order.constants';

export default class {
/* @ngInject */
constructor($q, $translate, $http, OvhHttp, User) {
Expand All @@ -13,6 +19,7 @@ export default class {
this.selectedOffer = null;
this.quantity = 1;
this.expressOrderUrl = null;
this.gen2BadgeLabel = GEN2_HOST_BADGE_LABEL;

return this.fetchInitialData();
}
Expand Down Expand Up @@ -95,13 +102,20 @@ export default class {
...offer,
planCode: privatePlan ? privatePlan.planCode : offer.planCode,
profile: profiles.find((p) => p.name === offer.planCode),
isGen2: isGen2Host(offer.planCode),
prices,
};
})
.sort(
(offerA, offerB) =>
offerA.prices[0].price.value - offerB.prices[0].price.value,
);
)
.sort(
(offerA, offerB) =>
isStorageHost(offerA.planCode) -
isStorageHost(offerB.planCode),
)
.sort((offerA, offerB) => offerB.isGen2 - offerA.isGen2);

[this.selectedOffer] = sortedResult;
return sortedResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
data-model="$ctrl.selectedOffer"
data-value="$row"
><span data-ng-bind="$row.productName"></span>
<span
class="ml-2 oui-badge oui-badge_new"
data-ng-if="$row.isGen2"
data-ng-bind="$ctrl.gen2BadgeLabel"
></span>
</oui-radio>
</oui-datagrid-column>
<oui-datagrid-column
Expand Down
Loading