From 0d93db5f1ffaa5d98c35e18a3cb44892cdce5ef4 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 4 Mar 2014 19:28:57 +1100 Subject: [PATCH] Fixes the order that descriptions are listed during install --- .../src/installer/installer.service.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js index 4cf56f8db5..8f4c702d83 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js +++ b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js @@ -16,6 +16,18 @@ angular.module("umbraco.install").factory('installerService', function($q, $time } }; + /* + Returns the description for the step at a given index based on the order of the serverOrder of steps + Since they don't execute on the server in the order that they are displayed in the UI. + */ + function getDescriptionForStepAtIndex(steps, index) { + var sorted = _.sortBy(steps, "serverOrder"); + if (sorted[index]) { + return sorted[index].description; + } + return null; + } + var service = { status : _status, @@ -105,7 +117,7 @@ angular.module("umbraco.install").factory('installerService', function($q, $time service.status.loading = true; var feedback = 0; - service.status.feedback = service.status.steps[0].description; + service.status.feedback = getDescriptionForStepAtIndex(service.status.steps, 0); function processInstallStep(){ $http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostPerformInstall", @@ -113,9 +125,9 @@ angular.module("umbraco.install").factory('installerService', function($q, $time if(!response.data.complete){ feedback++; - var step = service.status.steps[feedback]; - if(step){ - service.status.feedback = step.description; + var desc = getDescriptionForStepAtIndex(service.status.steps, feedback); + if (desc) { + service.status.feedback = desc; } processInstallStep();