changeset 2986:f99b888f57e9

Possible fix for #272
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 10 Apr 2018 10:18:25 +0100
parents 1e5a9d92daa0
children 1a1d37f2b4e5 1ae8c03dd6a6
files test_create.html test_create/test_core.js
diffstat 2 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test_create.html	Tue Apr 10 09:38:05 2018 +0100
+++ b/test_create.html	Tue Apr 10 10:18:25 2018 +0100
@@ -1052,6 +1052,9 @@
             </div>
             <div class="popupContent container-fluid" ng-switch="state">
                 <div ng-switch-when="0">
+                    <h3>Please wait while assets load...</h3>
+                </div>
+                <div ng-switch-when="1">
                     <div>
                         <span>Welcome to the WAET test creator tool. This will allow you to create a new test from scratch to suit your testing needs. If you wish to update a test file, please drag and drop the XML document into the area below for processing, otherwise press 'Next' to start a new test. This tool generates files for the WAET 1.2.2 version.</span>
                     </div>
@@ -1059,7 +1062,7 @@
                         <input type="file" id="files" ng-model="files" onchange="handleFiles(event)" />
                     </div>
                 </div>
-                <div ng-switch-when="1">
+                <div ng-switch-when="2">
                     <div>
                         <span>Please select the interface you would like to use below. Selecting an interface will give a brief description of the interface type.</span>
                     </div>
--- a/test_create/test_core.js	Tue Apr 10 09:38:05 2018 +0100
+++ b/test_create/test_core.js	Tue Apr 10 10:18:25 2018 +0100
@@ -85,6 +85,7 @@
     get("xml/test-schema.xsd").then(function (text) {
         specification.processSchema(text);
         $s.globalSchema = specification.getSchema();
+        $s.$apply();
     });
     $s.availableInterfaceModules = [];
     get("interfaces/interfaces.json").then(JSON.parse).then(function (d) {
@@ -179,7 +180,7 @@
     $s.selected = undefined;
     $s.next = function () {
         $s.state++;
-        if ($s.state > 1 || $s.file) {
+        if ($s.state > 2 || $s.file) {
             $s.hidePopup();
             $s.initialise($s.selected);
         }
@@ -187,6 +188,15 @@
     $s.back = function () {
         $s.state--;
     };
+
+    $s.$watch(function () {
+        return ($s.globalSchema !== undefined)
+    }, function () {
+        if ($s.globalSchema !== undefined && $s.state === 0) {
+            $s.state = 1;
+        }
+    })
+
     $s.mouseover = function (name) {
         var obj = $s.testSpecifications.interfaces.find(function (i) {
             return i.name == name;
@@ -211,9 +221,9 @@
         }
     };
     $s.select = function (name) {
-        $s.selected = name;
-    }
-    // Get the test interface specifications
+            $s.selected = name;
+        }
+        // Get the test interface specifications
     $s.file = undefined;
     $s.description = "";