From a40ba2f27e7459bf68373390c8ec11e5734f7297 Mon Sep 17 00:00:00 2001
From: Shannon
Date: Wed, 5 Mar 2014 14:30:17 +1100
Subject: [PATCH] Updates the RequiresExecution logic so we can skip steps
based on some user input (i.e. skip the starter kit installation). Fixes the
start kit js stuff to update the model correctly and continue. Fixes the
error view to restart - it cannot just go back because there might not be a
view there.
---
.../Install/InstallHelperTests.cs | 2 +-
.../src/installer/installer.controller.js | 4 ++
.../src/installer/installer.service.js | 26 ++++----
.../src/installer/steps/continueinstall.html | 13 ++++
.../src/installer/steps/error.html | 8 ++-
.../installer/steps/starterkit.controller.js | 3 +-
.../src/installer/steps/starterkit.html | 19 +++---
.../src/installer/steps/upgrade.html | 2 +-
.../config/ClientDependency.config | 2 +-
.../Controllers/InstallApiController.cs | 60 +++++++++++++++----
src/Umbraco.Web/Install/InstallHelper.cs | 36 +++++++++--
.../InstallSteps/DatabaseConfigureStep.cs | 2 +-
.../InstallSteps/DatabaseInstallStep.cs | 2 +-
.../InstallSteps/DatabaseUpgradeStep.cs | 2 +-
.../InstallSteps/FilePermissionsStep.cs | 2 +-
.../MajorVersion7UpgradeReport.cs | 2 +-
.../{UserStep.cs => NewInstallStep.cs} | 23 +++++--
.../InstallSteps/SetUmbracoVersionStep.cs | 2 +-
.../InstallSteps/StarterKitCleanupStep.cs | 2 +-
.../InstallSteps/StarterKitDownloadStep.cs | 14 ++++-
.../InstallSteps/StarterKitInstallStep.cs | 2 +-
.../{Upgrade.cs => UpgradeStep.cs} | 4 +-
.../Install/Models/InstallSetupStep.cs | 12 ++--
src/Umbraco.Web/Umbraco.Web.csproj | 4 +-
24 files changed, 180 insertions(+), 68 deletions(-)
create mode 100644 src/Umbraco.Web.UI.Client/src/installer/steps/continueinstall.html
rename src/Umbraco.Web/Install/InstallSteps/{UserStep.cs => NewInstallStep.cs} (79%)
rename src/Umbraco.Web/Install/InstallSteps/{Upgrade.cs => UpgradeStep.cs} (79%)
diff --git a/src/Umbraco.Tests/Install/InstallHelperTests.cs b/src/Umbraco.Tests/Install/InstallHelperTests.cs
index 1338df0239..cd1b6471d3 100644
--- a/src/Umbraco.Tests/Install/InstallHelperTests.cs
+++ b/src/Umbraco.Tests/Install/InstallHelperTests.cs
@@ -40,7 +40,7 @@ namespace Umbraco.Tests.Install
var expected = new[]
{
- typeof (FilePermissionsStep), typeof (UserStep), typeof(MajorVersion7UpgradeReport), typeof (DatabaseConfigureStep), typeof (DatabaseInstallStep),
+ typeof (FilePermissionsStep), typeof (NewInstallStep), typeof(MajorVersion7UpgradeReport), typeof (DatabaseConfigureStep), typeof (DatabaseInstallStep),
typeof (DatabaseUpgradeStep), typeof (StarterKitDownloadStep), typeof (StarterKitInstallStep), typeof (StarterKitCleanupStep),
typeof (SetUmbracoVersionStep)
};
diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer.controller.js b/src/Umbraco.Web.UI.Client/src/installer/installer.controller.js
index 043e8d5152..79d4b28b6b 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/installer.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/installer/installer.controller.js
@@ -20,4 +20,8 @@ angular.module("umbraco.install").controller("Umbraco.InstallerController",
$scope.gotoStep = function(step){
installerService.gotoNamedStep(step);
};
+
+ $scope.restart = function () {
+ installerService.gotoStep(0);
+ };
});
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 7873c57f65..441e576d9f 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js
+++ b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js
@@ -89,20 +89,20 @@ angular.module("umbraco.install").factory('installerService', function($q, $time
},
gotoNamedStep : function(stepName){
- var step = _.find(service.status.steps, function(s, index){
- if (s.view && s.name === stepName) {
- service.status.index = index;
- return true;
- }
- return false;
- });
-
- step.view = resolveView(step.view);
- if(!step.model){
- step.model = {};
+ var step = _.find(service.status.steps, function(s, index){
+ if (s.view && s.name === stepName) {
+ service.status.index = index;
+ return true;
}
- service.retrieveCurrentStep();
- service.status.current = step;
+ return false;
+ });
+
+ step.view = resolveView(step.view);
+ if(!step.model){
+ step.model = {};
+ }
+ service.retrieveCurrentStep();
+ service.status.current = step;
},
/**
diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/continueinstall.html b/src/Umbraco.Web.UI.Client/src/installer/steps/continueinstall.html
new file mode 100644
index 0000000000..28fa1d3fff
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/installer/steps/continueinstall.html
@@ -0,0 +1,13 @@
+
+
Continue Umbraco Installation
+
+ You see this screen because your Umbraco installation did not complete correctly.
+
+
+ Simply click continue below to be guided through the rest of the installation process.
+
+
+
+ Continue
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/error.html b/src/Umbraco.Web.UI.Client/src/installer/steps/error.html
index 5c4dabf96e..234f86e1a4 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/steps/error.html
+++ b/src/Umbraco.Web.UI.Client/src/installer/steps/error.html
@@ -1,7 +1,9 @@
-
Error during installation
+
Error during installation
-
{{installer.current.model.message}}
+
{{installer.current.model.message}}
-
Go back
+
See log for full details
+
+
Go back
diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.controller.js
index bc1604354c..81958ddd55 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.controller.js
@@ -4,7 +4,8 @@ angular.module("umbraco.install").controller("Umbraco.Installer.PackagesControll
$scope.packages = response.data;
});
- $scope.setPackageAndContinue = function (pck) {
+ $scope.setPackageAndContinue = function (pckId) {
+ installerService.status.current.model = pckId;
installerService.forward();
};
diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html b/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html
index 4183df869d..7347023c9d 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html
+++ b/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html
@@ -6,14 +6,15 @@
and simple foundation to build on top of.
-
+
-
- No thanks, I do not want to install a starter website
+
+ No thanks, I do not want to install a starter website
+
diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html b/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html
index ebbcd1d641..3638f7f37a 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html
+++ b/src/Umbraco.Web.UI.Client/src/installer/steps/upgrade.html
@@ -5,7 +5,7 @@
it is completely harmless and will simply ensure your website is kept as fast, secure and uptodate as possible.
- Simply click continue below to be guided through the rest of the upgrade
+ Simply click continue below to be guided through the rest of the upgrade
diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config
index 585ff05a10..e09251e424 100644
--- a/src/Umbraco.Web.UI/config/ClientDependency.config
+++ b/src/Umbraco.Web.UI/config/ClientDependency.config
@@ -10,7 +10,7 @@ NOTES:
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
* A new version will invalidate both client and server cache and create new persisted files
-->
-
+