Commit e58670fc authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige Superset incrustado

Implementa por completo la integración de cuadros de mandos Superset
dentro de la aplicación.

Actualiza submódulos.

Fix #100.
parent ab6ab2cc
Loading
Loading
Loading
Loading
Compare fc5e2fd3 to 1743ee13
Original line number Diff line number Diff line
Subproject commit fc5e2fd3301d3c669844d4a6e95f1fef86c16ba9
Subproject commit 1743ee1309a5f5f5ca127cbe08913b00854ecbe7
+28 −23
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'dojo/Deferred'
	, 'dojo/dom-class'
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
@@ -11,6 +12,7 @@ define([
	declare
	, lang
	, Deferred
	, domClass
	, _Module
	, _Show
	, _Store
@@ -34,22 +36,13 @@ define([
				events: {
				},
				ownChannel: 'supersetDisplayer',
				target: redmicConfig.services.getSupersetToken
				target: redmicConfig.services.getSupersetToken,
				className: 'supersetDashboard'
			};

			lang.mixin(this, this.config, args);
		},

		_initialize: function() {

			if (!this.dashboardConfig) {
				console.error('Missing dashboard configuration for SupersetDisplayer!');
				return;
			}

			this._prepareDashboard();
		},

		_defineSubscriptions: function() {

			this.subscriptionsConfig.push({
@@ -61,17 +54,24 @@ define([
			});
		},

		postCreate: function() {

			if (!this.dashboardConfig) {
				console.error('Missing dashboard configuration for SupersetDisplayer!');
				return;
			}

			domClass.add(this.getNodeToShow(), this.className);

			this._prepareDashboard();
		},

		_prepareDashboard: function() {

			this._prepareDashboardConfig();

			var tokenDfd = this._getGuestToken();
			tokenDfd.then(lang.hitch(this, this._prepareDashboardInstance));

			setTimeout(lang.hitch(this, function() {

				this._guestToken.resolve('123');
			}), 5000);
		},

		_prepareDashboardConfig: function() {
@@ -126,16 +126,16 @@ define([
			return this._guestToken;
		},

		_onSupersetDashboardReady: function() {
		_onSupersetDashboardReady: function(evt) {

			console.log('dashboard ready', arguments);
			this._supersetUnmount = evt.unmount;
		},

		_clearDashboard: function() {

			var node = this.getNodeToShow();

			node.firstChild && node.firstChild.remove();
			if (this._supersetUnmount) {
				this._supersetUnmount();
			}
		},

		_subChangeDashboard: function(req) {
@@ -153,9 +153,14 @@ define([

		_itemAvailable: function(res) {

			var token = res.body ? res.body.token : res.token;
			var data = res && res.data || {},
				token = data.token;

			if (token) {
				this._guestToken.resolve(token);
			} else {
				this._guestToken.reject('No token available');
			}
		},

		getNodeToShow: function() {
+1 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ define([
				height: 6,
				type: SupersetDisplayer,
				props: {
					title: config.title || 'supersetDashboard',
					pathVariableId: this._activityData.id,
					dashboardConfig: config
				}
+2 −0
Original line number Diff line number Diff line
@@ -1174,6 +1174,8 @@ define({
	, "goToActivity": "Ir a actividad"
	, "goToPlatform": "Ir a plataforma"

	, "supersetDashboard": "Cuadro de mandos"

	, "windrose": "Rosa de los vientos"
	, "sliderSelector": "Selector desplazable"
	, "dateFilter": "Filtro por fecha"
+2 −0
Original line number Diff line number Diff line
@@ -1178,6 +1178,8 @@ define({
		, "goToActivity": "Go to activity"
		, "goToPlatform": "Go to platform"

		, "supersetDashboard": "Dashboard"

		, "windrose": "Wind rose"
		, "sliderSelector": "Slider selector"
		, "dateFilter": "Date filter"
Loading