-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working embeds & renamed frontend to client
- Loading branch information
Showing
207 changed files
with
123 additions
and
225 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<div class="tile m-10"> | ||
<div class="t-heading p-10"> | ||
<h3 class="th-title"> | ||
<p> | ||
<img src="{{$ctrl.logoUrl}}" style="height: 24px;"/> | ||
{{$ctrl.query.name}} | ||
<small><visualization-name visualization="$ctrl.visualization"/></small> | ||
</p> | ||
<small ng-if="$ctrl.showQueryDescription"> | ||
<div class="text-muted" ng-bind-html="$ctrl.query.description | markdown"></div> | ||
</small> | ||
</h3> | ||
</div> | ||
|
||
<visualization-renderer visualization="$ctrl.visualization" query-result="$ctrl.queryResult" class="t-body"> | ||
</visualization-renderer> | ||
|
||
<div class="bg-ace clearfix p-10"> | ||
<div class="col-sm-6"> | ||
<span class="label label-default hidden-print">Updated: <span am-time-ago="$ctrl.queryResult.getUpdatedAt()"></span></span> | ||
<span class="label label-default visible-print">Updated: {{$ctrl.queryResult.getUpdatedAt() | dateTime}}</span> | ||
</div> | ||
<div class="col-sm-6 text-right hidden-print"> | ||
<a class="btn btn-default btn-xs" ng-href="queries/{{$ctrl.query.id}}#{{$ctrl.visualization.id}}" target="_blank" tooltip="Open in Redash"> | ||
<span class="zmdi zmdi-link"></span> | ||
</a> | ||
|
||
<div class="btn-group" uib-dropdown> | ||
<button type="button" class="btn btn-default btn-xs dropdown-toggle" aria-haspopup="true" uib-dropdown-toggle | ||
aria-expanded="false"> | ||
Download Dataset <span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu pull-right" uib-dropdown-menu> | ||
<li> | ||
<a ng-href="{{$ctrl.queryResult.getLink($ctrl.query.id, 'csv', $ctrl.apiKey)}}" download="{{$ctrl.queryResult.getName($ctrl.query.name, 'csv')}}" target="_self"> | ||
<span class="fa fa-file-o"></span> Download as CSV File | ||
</a> | ||
</li> | ||
<li> | ||
<a ng-href="{{$ctrl.queryResult.getLink($ctrl.query.id, 'xlsx', $ctrl.apiKey)}}" download="{{$ctrl.queryResult.getName($ctrl.query.name, 'xlsx')}}" target="_self"> | ||
<span class="fa fa-file-excel-o"></span> Download as Excel File | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { find } from 'underscore'; | ||
import template from './visualization-embed.html'; | ||
import logoUrl from '../../assets/images/redash_icon_small.png'; | ||
|
||
const VisualizationEmbed = { | ||
template, | ||
bindings: { | ||
data: '<', | ||
}, | ||
controller($routeParams, Query, QueryResult) { | ||
document.querySelector('body').classList.add('headless'); | ||
const visualizationId = parseInt($routeParams.visualizationId, 10); | ||
this.showQueryDescription = $routeParams.showDescription; | ||
this.apiKey = $routeParams.api_key; | ||
this.logoUrl = logoUrl; | ||
this.query = new Query(this.data[0]); | ||
this.queryResult = new QueryResult(this.data[1]); | ||
this.visualization = | ||
find(this.query.visualizations, visualization => visualization.id === visualizationId); | ||
}, | ||
}; | ||
|
||
export default function (ngModule) { | ||
ngModule.component('visualizationEmbed', VisualizationEmbed); | ||
|
||
function session($http, $route, Auth) { | ||
const apiKey = $route.current.params.api_key; | ||
Auth.setApiKey(apiKey); | ||
return Auth.loadSession(); | ||
} | ||
|
||
function loadData($http, $route, $q, Auth) { | ||
return session($http, $route, Auth).then(() => { | ||
const queryId = $route.current.params.queryId; | ||
const query = $http.get(`/api/queries/${queryId}`).then(response => response.data); | ||
const queryResult = $http.get(`/api/queries/${queryId}/results.json`).then(response => response.data); | ||
return $q.all([query, queryResult]); | ||
}); | ||
} | ||
|
||
ngModule.config(($routeProvider) => { | ||
$routeProvider.when('/embed/query/:queryId/visualization/:visualizationId', { | ||
template: '<visualization-embed data="$resolve.data"></visualization-embed>', | ||
resolve: { | ||
data: loadData, | ||
}, | ||
}); | ||
}); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters