Skip to content

Commit

Permalink
dashboard bug fixes and better page titles
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 24, 2016
1 parent 89da51f commit 14f298b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
28 changes: 12 additions & 16 deletions dashed/assets/javascripts/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ var Dashboard = function (dashboardData) {
return JSON.stringify(this.filters, null, 4);
},
refreshExcept: function (slice_id) {
var immune = this.metadata.filter_immune_slices;
if (immune) {
this.slices.forEach(function (slice) {
if (slice.data.slice_id !== slice_id && immune.indexOf(slice.data.slice_id) === -1) {
slice.render();
}
});
}
var immune = this.metadata.filter_immune_slice || [];
this.slices.forEach(function (slice) {
if (slice.data.slice_id !== slice_id && immune.indexOf(slice.data.slice_id) === -1) {
slice.render();
}
});
},
clearFilters: function (slice_id) {
delete this.filters[slice_id];
Expand All @@ -79,11 +77,12 @@ var Dashboard = function (dashboardData) {
this.refreshExcept(slice_id);
},
getSlice: function (slice_id) {
this.slices.forEach(function (slice, i) {
if (slice.slice_id === slice_id) {
return slice;
slice_id = parseInt(slice_id, 10);
for (var i=0; i < this.slices.length; i++) {
if (this.slices[i].data.slice_id === slice_id) {
return this.slices[i];
}
});
}
},
initDashboardView: function () {
dashboard = this;
Expand All @@ -97,10 +96,7 @@ var Dashboard = function (dashboardData) {
resize: {
enabled: true,
stop: function (e, ui, element) {
var slice_data = $(element).data('slice');
if (slice_data) {
dashboard.getSlice(slice_data.slice_id).resize();
}
dashboard.getSlice($(element).attr('slice_id')).resize();
}
},
serialize_params: function (_w, wgd) {
Expand Down
4 changes: 2 additions & 2 deletions dashed/templates/dashed/base.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% extends "appbuilder/baselayout.html" %}

{% block head_css %}
{{super()}}
<link rel="stylesheet" type="text/css" href="/static/assets/stylesheets/dashed.css" />
<link rel="icon" type="image/png" href="/static/img/favicon.png">
<link rel="stylesheet" type="text/css" href="/static/assets/stylesheets/dashed.css" />
{{super()}}
{% endblock %}

{% block head_js %}
Expand Down
2 changes: 1 addition & 1 deletion dashed/templates/dashed/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ super() }}
<script src="/static/assets/javascripts/dist/dashboard.entry.js"></script>
{% endblock %}

{% block title %}[dashboard] {{ dashboard.dashboard_title }}{% endblock %}
{% block body %}
<div class="dashboard container-fluid" data-dashboard="{{ dashboard.json_data }}" data-css="{{ dashboard.css }}">

Expand Down
9 changes: 8 additions & 1 deletion dashed/templates/dashed/explore.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% extends "dashed/basic.html" %}

{% block title %}
{% if slice %}
[slice] {{ slice.slice_name }}
{% else %}
[explore] {{ viz.datasource.table_name }}
{% endif %}
{% endblock %}

{% block body %}
{% set datasource = viz.datasource %}
{% set form = viz.form %}
Expand Down Expand Up @@ -45,7 +53,6 @@
{% endif %}
<div class="pull-right">
<span id="is_cached" class="label label-default" title="Force refresh" data-toggle="tooltip">
<i class="fa fa-refresh"></i>
cached
</span>
<div class="btn-group results" role="group">
Expand Down

0 comments on commit 14f298b

Please sign in to comment.