17417: remove the coffee-rails gem dependency in wb1, and convert the
authorWard Vandewege <ward@curii.com>
Wed, 29 Dec 2021 02:41:54 +0000 (21:41 -0500)
committerWard Vandewege <ward@jhvc.com>
Wed, 29 Dec 2021 03:03:14 +0000 (22:03 -0500)
       two files where we used it to straight up javascript.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

apps/workbench/Gemfile
apps/workbench/Gemfile.lock
apps/workbench/app/assets/javascripts/bootstrap.js [new file with mode: 0644]
apps/workbench/app/assets/javascripts/bootstrap.js.coffee [deleted file]
apps/workbench/app/assets/javascripts/keep_disks.js [new file with mode: 0644]
apps/workbench/app/assets/javascripts/keep_disks.js.coffee [deleted file]
build/package-testing/common-test-rails-server-package.sh

index 8005cb32119c1b32956cb0fade37df91ad7ed579..00dbad0860a4f078f20821bf9444a4116d69214f 100644 (file)
@@ -18,13 +18,6 @@ gem 'responders', '~> 2.0'
 # See: https://github.com/rails/sprockets-rails/issues/443
 gem 'sprockets', '~> 3.0'
 
-# Note: keeping this out of the "group :assets" section "may" allow us
-# to use Coffescript for UJS responses. It also prevents a
-# warning/problem when running tests: "WARN: tilt autoloading
-# 'coffee_script' in a non thread-safe way; explicit require
-# 'coffee_script' suggested."
-gem 'coffee-rails'
-
 # Gems used only for assets and not required
 # in production environments by default.
 group :assets do
index 12e14518e3b97139ccd4270608d21c9569746e5b..b82568e7d278e41643fd65e14c8eebeddb15bbd4 100644 (file)
@@ -111,13 +111,6 @@ GEM
     childprocess (0.9.0)
       ffi (~> 1.0, >= 1.0.11)
     cliver (0.3.2)
-    coffee-rails (4.2.2)
-      coffee-script (>= 2.2.0)
-      railties (>= 4.0.0)
-    coffee-script (2.4.1)
-      coffee-script-source
-      execjs
-    coffee-script-source (1.12.2)
     concurrent-ruby (1.1.9)
     crass (1.0.6)
     deep_merge (1.2.1)
@@ -323,7 +316,6 @@ DEPENDENCIES
   bootstrap-x-editable-rails
   byebug
   capybara (~> 2.5.0)
-  coffee-rails
   deep_merge
   flamegraph
   headless (~> 1.0.2)
diff --git a/apps/workbench/app/assets/javascripts/bootstrap.js b/apps/workbench/app/assets/javascripts/bootstrap.js
new file mode 100644 (file)
index 0000000..e315ab5
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+(function() {
+  jQuery(function() {
+    $("a[rel=popover]").popover();
+    $(".tooltip").tooltip();
+    return $("a[rel=tooltip]").tooltip();
+  });
+}).call(this);
diff --git a/apps/workbench/app/assets/javascripts/bootstrap.js.coffee b/apps/workbench/app/assets/javascripts/bootstrap.js.coffee
deleted file mode 100644 (file)
index 441d77f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-### Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: AGPL-3.0 ###
-
-jQuery ->
-  $("a[rel=popover]").popover()
-  $(".tooltip").tooltip()
-  $("a[rel=tooltip]").tooltip()
diff --git a/apps/workbench/app/assets/javascripts/keep_disks.js b/apps/workbench/app/assets/javascripts/keep_disks.js
new file mode 100644 (file)
index 0000000..b3fb6dc
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+(function() {
+  var cache_age_axis_label, cache_age_hover, cache_age_in_days, float_as_percentage;
+
+  cache_age_in_days = function(milliseconds_age) {
+    var ONE_DAY;
+    ONE_DAY = 1000 * 60 * 60 * 24;
+    return milliseconds_age / ONE_DAY;
+  };
+
+  cache_age_hover = function(milliseconds_age) {
+    return 'Cache age ' + cache_age_in_days(milliseconds_age).toFixed(1) + ' days.';
+  };
+
+  cache_age_axis_label = function(milliseconds_age) {
+    return cache_age_in_days(milliseconds_age).toFixed(0) + ' days';
+  };
+
+  float_as_percentage = function(proportion) {
+    return (proportion.toFixed(4) * 100) + '%';
+  };
+
+  $.renderHistogram = function(histogram_data) {
+    return Morris.Area({
+      element: 'cache-age-vs-disk-histogram',
+      pointSize: 0,
+      lineWidth: 0,
+      data: histogram_data,
+      xkey: 'age',
+      ykeys: ['persisted', 'cache'],
+      labels: ['Persisted Storage Disk Utilization', 'Cached Storage Disk Utilization'],
+      ymax: 1,
+      ymin: 0,
+      xLabelFormat: cache_age_axis_label,
+      yLabelFormat: float_as_percentage,
+      dateFormat: cache_age_hover
+    });
+  };
+
+}).call(this);
diff --git a/apps/workbench/app/assets/javascripts/keep_disks.js.coffee b/apps/workbench/app/assets/javascripts/keep_disks.js.coffee
deleted file mode 100644 (file)
index d33312d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-### Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: AGPL-3.0 ###
-
-cache_age_in_days = (milliseconds_age) ->
-  ONE_DAY = 1000 * 60 * 60 * 24
-  milliseconds_age / ONE_DAY
-
-cache_age_hover = (milliseconds_age) ->
-  'Cache age ' + cache_age_in_days(milliseconds_age).toFixed(1) + ' days.'
-
-cache_age_axis_label = (milliseconds_age) ->
-  cache_age_in_days(milliseconds_age).toFixed(0) + ' days'
-
-float_as_percentage = (proportion) ->
-  (proportion.toFixed(4) * 100) + '%'
-
-$.renderHistogram = (histogram_data) ->
-  Morris.Area({
-    element: 'cache-age-vs-disk-histogram',
-    pointSize: 0,
-    lineWidth: 0,
-    data: histogram_data,
-    xkey: 'age',
-    ykeys: ['persisted', 'cache'],
-    labels: ['Persisted Storage Disk Utilization', 'Cached Storage Disk Utilization'],
-    ymax: 1,
-    ymin: 0,
-    xLabelFormat: cache_age_axis_label,
-    yLabelFormat: float_as_percentage,
-    dateFormat: cache_age_hover
-  })
index 33167f049b6ea5beb86a2c701fa5b6254a837313..e04556bb6b50b2312129726cbddcd354b4fb7685 100755 (executable)
@@ -15,7 +15,7 @@ fi
 if [ "$PACKAGE_NAME" = "arvados-workbench" ]; then
   mkdir -p /etc/arvados
   cat <<'EOF' >/etc/arvados/config.yml
---- 
+---
 Clusters:
   xxxxx:
     Services: