Business intelligence made simple
Updated style [skip ci]
Andrew Kanec062ae4d6edf
diff --git a/app/assets/javascripts/blazer/queries.js b/app/assets/javascripts/blazer/queries.jsindex b2ec9204..de202d72 100644--- a/app/assets/javascripts/blazer/queries.js+++ b/app/assets/javascripts/blazer/queries.js@@ -73,7 +73,7 @@ function queryComplete(query) {}function uuid() {- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {const r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8)return v.toString(16)})diff --git a/app/assets/javascripts/blazer/routes.js b/app/assets/javascripts/blazer/routes.jsindex 29d48b91..98cbfcf8 100644--- a/app/assets/javascripts/blazer/routes.js+++ b/app/assets/javascripts/blazer/routes.js@@ -1,26 +1,26 @@var Routes = {- run_queries_path: function() {+ run_queries_path: function () {return rootPath + "queries/run"},- cancel_queries_path: function() {+ cancel_queries_path: function () {return rootPath + "queries/cancel"},- schema_queries_path: function(params) {+ schema_queries_path: function (params) {return rootPath + "queries/schema?" + pathParams(params)},- docs_queries_path: function(params) {+ docs_queries_path: function (params) {return rootPath + "queries/docs?" + pathParams(params)},- tables_queries_path: function(params) {+ tables_queries_path: function (params) {return rootPath + "queries/tables?" + pathParams(params)},- queries_path: function() {+ queries_path: function () {return rootPath + "queries"},- query_path: function(id) {+ query_path: function (id) {return rootPath + "queries/" + id},- dashboard_path: function(id) {+ dashboard_path: function (id) {return rootPath + "dashboards/" + id}}diff --git a/app/views/blazer/_variables.html.erb b/app/views/blazer/_variables.html.erbindex 7eb05914..2b9023e6 100644--- a/app/views/blazer/_variables.html.erb+++ b/app/views/blazer/_variables.html.erb@@ -22,11 +22,11 @@<% if (data = @smart_vars[var]) %><%= select_tag var, options_for_select([[nil, nil]] + data, selected: var_params[var]), style: "margin-right: 20px; width: 200px; display: none;" %><%= javascript_tag nonce: true do %>- (function() {+ (function () {<%= blazer_js_var "varId", var %>$(document.getElementById(varId)).selectize({create: true,- onChange: function() {+ onChange: function () {submitIfCompleted(this.$input.get(0).closest("form"))}})@@ -42,7 +42,7 @@</div><%= javascript_tag nonce: true do %>- (function() {+ (function () {<%= blazer_js_var "varId", var %><%= blazer_js_var "selectId", "#{var}-select" %>const input = document.getElementById(varId)@@ -55,7 +55,7 @@startDate: input.value.length > 0 ? moment.tz(input.value, timeZone) : now})// hack to start with empty date- datePicker.on("apply.daterangepicker", function(ev, picker) {+ datePicker.on("apply.daterangepicker", function (ev, picker) {datePicker.find("span").html(toDate(picker.startDate).format("MMMM D, YYYY"))input.value = toDate(picker.startDate).utc().format()submitIfCompleted(input.closest("form"))@@ -112,11 +112,11 @@opens: "right",alwaysShowCalendars: true},- function(start, end) {+ function (start, end) {setTimeInputs(start, end)submitIfCompleted(startTime.closest("form"))}- ).on("apply.daterangepicker", function(ev, picker) {+ ).on("apply.daterangepicker", function (ev, picker) {setTimeInputs(picker.startDate, picker.endDate)reportrange.querySelector("span").textContent = toDate(picker.startDate).format("MMMM D, YYYY") + " - " + toDate(picker.endDate).format("MMMM D, YYYY")})diff --git a/app/views/blazer/dashboards/show.html.erb b/app/views/blazer/dashboards/show.html.erbindex ab03a994..7efd8753 100644--- a/app/views/blazer/dashboards/show.html.erb+++ b/app/views/blazer/dashboards/show.html.erb@@ -41,7 +41,7 @@<% run_data = {statement: query.statement, query_id: query.id, data_source: query.data_source, variables: variable_params(query), only_chart: true} %><% run_data.merge!(cohort_period: params[:cohort_period]) if params[:cohort_period] %><%= javascript_tag nonce: true do %>- (function() {+ (function () {<%= blazer_js_var "chartId", "chart-#{i}" %><%= blazer_js_var "runData", run_data %>const chart = document.getElementById(chartId)diff --git a/app/views/blazer/queries/_chart.html.erb b/app/views/blazer/queries/_chart.html.erbindex 714926c6..ec77ef1c 100644--- a/app/views/blazer/queries/_chart.html.erb+++ b/app/views/blazer/queries/_chart.html.erb@@ -1,7 +1,7 @@<% chart_id = SecureRandom.hex %><%= tag.div id: chart_id, style: "height: 300px;" %><%= javascript_tag nonce: true do %>- (function() {+ (function () {<%= blazer_js_var "chart", {type: type, id: chart_id, data: data, options: options} %>new Chartkick[chart.type](chart.id, chart.data, chart.options);})()diff --git a/app/views/blazer/queries/_form.html.erb b/app/views/blazer/queries/_form.html.erbindex 210b4b27..26e27a14 100644--- a/app/views/blazer/queries/_form.html.erb+++ b/app/views/blazer/queries/_form.html.erb@@ -187,7 +187,7 @@editor.commands.addCommand({name: "run",bindKey: {win: "Ctrl-Enter", mac: "Command-Enter"},- exec: function(editor) {+ exec: function (editor) {run()},readOnly: false // false if this command should not apply in readOnly mode@@ -215,7 +215,7 @@})$(dsSelect).selectize({})- dsSelect.selectize.on("change", function() {+ dsSelect.selectize.on("change", function () {updateDataSource()this.blur()})