From a6254b633948dc161a183b0df891bca10e4eb0d2 Mon Sep 17 00:00:00 2001 From: Bruno MARQUES <139278215+BrunoMarquesOVH@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:04:26 +0200 Subject: [PATCH] fix(dedicated): sort disk list on installation (#9827) ref: MANAGER-11948 Signed-off-by: Bruno MARQUES --- .../server/install/image/components/options/controller.js | 5 ++++- .../ovh/dedicated-server-installation-ovh.controller.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/manager/apps/dedicated/client/app/dedicated/server/install/image/components/options/controller.js b/packages/manager/apps/dedicated/client/app/dedicated/server/install/image/components/options/controller.js index dc9875e505cb..25cc0902a4d1 100644 --- a/packages/manager/apps/dedicated/client/app/dedicated/server/install/image/components/options/controller.js +++ b/packages/manager/apps/dedicated/client/app/dedicated/server/install/image/components/options/controller.js @@ -1,5 +1,8 @@ export default class DedicatedServerInstallImageOptionsCtrl { $onInit() { - [this.model.diskGroup] = this.server.hardware.specifications.diskGroups; + [this.model.diskGroup] = + this.server.hardware.specifications.diskGroups?.sort((a, b) => + a.description.localeCompare(b.description), + ) || []; } } diff --git a/packages/manager/apps/dedicated/client/app/dedicated/server/installation/ovh/dedicated-server-installation-ovh.controller.js b/packages/manager/apps/dedicated/client/app/dedicated/server/installation/ovh/dedicated-server-installation-ovh.controller.js index 54deef9d5d6d..31447af824fc 100644 --- a/packages/manager/apps/dedicated/client/app/dedicated/server/installation/ovh/dedicated-server-installation-ovh.controller.js +++ b/packages/manager/apps/dedicated/client/app/dedicated/server/installation/ovh/dedicated-server-installation-ovh.controller.js @@ -409,7 +409,10 @@ angular function getHardwareSpecification() { return Server.getHardwareSpecifications($stateParams.productId).then( (spec) => { - $scope.informations.diskGroups = spec.diskGroups; + $scope.informations.diskGroups = + spec.diskGroups?.sort((a, b) => + a.description.localeCompare(b.description), + ) || []; resetDiskGroup(); }, );