Andrew Bogott has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/334353 )

Change subject: Horizon:  In mitaka, remove some instance-creation workflow 
steps
......................................................................


Horizon:  In mitaka, remove some instance-creation workflow steps

Defauly horizon has several steps to configure network settings,
set up custom keys, set up metadata, etc.  This patch replaces
the .js file that enumerates those steps and provides
a simpler wizard with fewer steps.

Change-Id: I6c88cac5131fd74d631d83fbe868e09f8742f660
---
A 
modules/openstack/files/mitaka/horizon/jsoverrides/launch-instance-workflow.service.js
M modules/openstack/manifests/horizon/service.pp
2 files changed, 124 insertions(+), 0 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/modules/openstack/files/mitaka/horizon/jsoverrides/launch-instance-workflow.service.js
 
b/modules/openstack/files/mitaka/horizon/jsoverrides/launch-instance-workflow.service.js
new file mode 100644
index 0000000..31e8228
--- /dev/null
+++ 
b/modules/openstack/files/mitaka/horizon/jsoverrides/launch-instance-workflow.service.js
@@ -0,0 +1,110 @@
+/*
+ *    (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+(function () {
+  'use strict';
+
+  angular
+    .module('horizon.dashboard.project.workflow.launch-instance')
+    .factory('horizon.dashboard.project.workflow.launch-instance.workflow', 
launchInstanceWorkflow);
+
+  launchInstanceWorkflow.$inject = [
+    'horizon.dashboard.project.workflow.launch-instance.basePath',
+    'horizon.app.core.workflow.factory'
+  ];
+
+  function launchInstanceWorkflow(basePath, dashboardWorkflow) {
+    return dashboardWorkflow({
+      title: gettext('Launch Instance'),
+
+      /* WMF Hack:  Several unneeded steps have been removed here.  */
+      steps: [
+        {
+          id: 'details',
+          title: gettext('Details'),
+          templateUrl: basePath + 'details/details.html',
+          helpUrl: basePath + 'details/details.help.html',
+          formName: 'launchInstanceDetailsForm'
+        },
+        {
+          id: 'source',
+          title: gettext('Source'),
+          templateUrl: basePath + 'source/source.html',
+          helpUrl: basePath + 'source/source.help.html',
+          formName: 'launchInstanceSourceForm'
+        },
+        {
+          id: 'flavor',
+          title: gettext('Flavor'),
+          templateUrl: basePath + 'flavor/flavor.html',
+          helpUrl: basePath + 'flavor/flavor.help.html',
+          formName: 'launchInstanceFlavorForm'
+        },
+        {
+          id: 'networks',
+          title: gettext('Networks'),
+          templateUrl: basePath + 'network/network.html',
+          helpUrl: basePath + 'network/network.help.html',
+          formName: 'launchInstanceNetworkForm',
+          requiredServiceTypes: ['network']
+        },
+        {
+          id: 'ports',
+          title: gettext('Network Ports'),
+          templateUrl: basePath + 'networkports/ports.html',
+          helpUrl: basePath + 'networkports/ports.help.html',
+          formName: 'launchInstanceNetworkPortForm',
+          requiredServiceTypes: ['network']
+        },
+        {
+          id: 'secgroups',
+          title: gettext('Security Groups'),
+          templateUrl: basePath + 'security-groups/security-groups.html',
+          helpUrl: basePath + 'security-groups/security-groups.help.html',
+          formName: 'launchInstanceAccessAndSecurityForm'
+        },
+        {
+          id: 'keypair',
+          title: gettext('Key Pair'),
+          templateUrl: basePath + 'keypair/keypair.html',
+          helpUrl: basePath + 'keypair/keypair.help.html',
+          formName: 'launchInstanceKeypairForm'
+        },
+        {
+          id: 'configuration',
+          title: gettext('Configuration'),
+          templateUrl: basePath + 'configuration/configuration.html',
+          helpUrl: basePath + 'configuration/configuration.help.html',
+          formName: 'launchInstanceConfigurationForm'
+        },
+        {
+          title: gettext('Metadata'),
+          templateUrl: basePath + 'metadata/metadata.html',
+          helpUrl: basePath + 'metadata/metadata.help.html',
+          formName: 'launchInstanceMetadataForm'
+        }
+      ],
+
+      btnText: {
+        finish: gettext('Launch Instance')
+      },
+
+      btnIcon: {
+        finish: 'fa fa-cloud-upload'
+      }
+    });
+  }
+
+})();
diff --git a/modules/openstack/manifests/horizon/service.pp 
b/modules/openstack/manifests/horizon/service.pp
index ffd5a7b..d29cb0b 100644
--- a/modules/openstack/manifests/horizon/service.pp
+++ b/modules/openstack/manifests/horizon/service.pp
@@ -202,6 +202,20 @@
         require => Package['python-designate-dashboard', 
'openstack-dashboard'],
     }
 
+    if $openstack_version != 'liberty' {
+        # Override some .js files to provide a simplified user experience.  
Alas
+        #  we can't do this via the overrides.py monkeypatch below
+
+        file { 
'/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-workflow.service.js':
+            source  => 
"puppet:///modules/openstack/${openstack_version}/horizon/jsoverrides/launch-instance-workflow.service.py",
+            owner   => 'root',
+            group   => 'root',
+            require => Package['openstack-dashboard'],
+            notify  => Exec['djangorefresh'],
+            mode    => '0644',
+        }
+    }
+
     # Monkeypatches for Horizon customization
     file { '/usr/lib/python2.7/dist-packages/horizon/overrides.py':
         source  => 
"puppet:///modules/openstack/${openstack_version}/horizon/overrides.py",

-- 
To view, visit https://gerrit.wikimedia.org/r/334353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c88cac5131fd74d631d83fbe868e09f8742f660
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to