Files
redash/client/app/components/queries/embed-code-dialog.js
2017-10-25 23:34:51 +03:00

26 lines
678 B
JavaScript

import template from './embed-code-dialog.html';
const EmbedCodeDialog = {
controller(clientConfig) {
'ngInject';
this.query = this.resolve.query;
this.visualization = this.resolve.visualization;
this.embedUrl = `${clientConfig.basePath}embed/query/${this.query.id}/visualization/${this.visualization.id}?api_key=${this.query.api_key}`;
if (window.snapshotUrlBuilder) {
this.snapshotUrl = window.snapshotUrlBuilder(this.query, this.visualization);
}
},
bindings: {
resolve: '<',
close: '&',
dismiss: '&',
},
template,
};
export default function init(ngModule) {
ngModule.component('embedCodeDialog', EmbedCodeDialog);
}