Browse Source

HUE-3340 [oozie] Add Jasmine to Oozie

Enrico Berti 9 years ago
parent
commit
3c59959

+ 21 - 0
apps/oozie/src/oozie/static/oozie/spec/workflowEditorSpec.js

@@ -0,0 +1,21 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you 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.
+
+describe("Workflow Editor", function () {
+  it("WorkflowEditorViewModel should be defined", function () {
+    expect(WorkflowEditorViewModel).toBeDefined()
+  });
+});

+ 33 - 0
apps/oozie/src/oozie/templates/jasmine.mako

@@ -0,0 +1,33 @@
+## Licensed to Cloudera, Inc. under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  Cloudera, Inc. licenses this file
+## to you 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.
+##
+
+<%inherit file="common_jasmine.mako"/>
+
+<%block name="specs">
+  <script type="text/javascript" charset="utf-8">
+    require(['jasmine-boot', 'jasmine', 'knockout'], function (boot, jasmine, ko) {
+      window.ko = ko;
+      $.when(
+        $.getScript('${ static('oozie/js/workflow-editor.ko.js') }'),
+        $.getScript('${ static('oozie/js/workflow-editor.utils.js') }'),
+        $.getScript('${ static('oozie/spec/workflowEditorSpec.js') }')
+      ).done(function () {
+        window.onload();
+      });
+    });
+  </script>
+</%block>

+ 5 - 0
apps/oozie/src/oozie/urls.py

@@ -145,3 +145,8 @@ urlpatterns += patterns(
 
 
   url(r'^list_oozie_sla/$', 'list_oozie_sla', name='list_oozie_sla'),
   url(r'^list_oozie_sla/$', 'list_oozie_sla', name='list_oozie_sla'),
 )
 )
+
+urlpatterns += patterns(
+  'oozie.views.common',
+  url(r'^jasmine', 'jasmine', name='jasmine'),
+)

+ 22 - 0
apps/oozie/src/oozie/views/common.py

@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# Licensed to Cloudera, Inc. under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  Cloudera, Inc. licenses this file
+# to you 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.
+
+from desktop.lib.django_util import render
+
+def jasmine(request):
+  return render('jasmine.mako', request, None)
+

+ 1 - 4
apps/useradmin/src/useradmin/templates/layout.mako

@@ -13,10 +13,7 @@
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## See the License for the specific language governing permissions and
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## limitations under the License.
-##
-##
-## no spaces in this method please; we're declaring a CSS class, and ART uses this value for stuff, and it splits on spaces, and
-## multiple spaces and line breaks cause issues
+
 <%!
 <%!
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 
 

+ 1 - 4
desktop/core/src/desktop/templates/about_layout.mako

@@ -13,10 +13,7 @@
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## See the License for the specific language governing permissions and
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## limitations under the License.
-##
-##
-## no spaces in this method please; we're declaring a CSS class, and ART uses this value for stuff, and it splits on spaces, and
-## multiple spaces and line breaks cause issues
+
 <%!
 <%!
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 
 

+ 0 - 3
desktop/core/src/desktop/templates/jasmine.mako

@@ -14,9 +14,6 @@
 ## See the License for the specific language governing permissions and
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## limitations under the License.
 ##
 ##
-##
-## no spaces in this method please; we're declaring a CSS class, and ART uses this value for stuff, and it splits on spaces, and
-## multiple spaces and line breaks cause issues
 
 
 <%inherit file="common_jasmine.mako"/>
 <%inherit file="common_jasmine.mako"/>