Commit 0076866a authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Implementa vista de dashboard para estaciones

Corrige detalles de dependencias de esta nueva vista, para que funcione
correctamente.
Actualiza submódulo.
parent 95c13c1d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ define([
			lang.mixin(this, this.configAddBasicTitle, args);

			aspect.before(this, "_afterSetConfigurations", lang.hitch(this, this._setAddBasicTitleConfigurations));
			aspect.before(this, "_refreshModules", lang.hitch(this, this._refreshModulesAddBasicTitle));
			aspect.before(this, "_refreshModules", lang.hitch(this, this._beforeRefreshModulesAddBasicTitle));
		},

		_setAddBasicTitleConfigurations: function() {
@@ -32,7 +32,12 @@ define([
			}, this.titleWidgetConfig || {}]);
		},

		_refreshModulesAddBasicTitle: function() {
		_beforeRefreshModulesAddBasicTitle: function() {

			this._updateTitle();
		},

		_updateTitle: function() {

			this._emitEvt('INJECT_ITEM', {
				data: {
+1 −0
Original line number Diff line number Diff line
@@ -881,6 +881,7 @@ define({

	, "real-time": "Datos en tiempo real"
	, "goToDashboard": "Visualizar datos"
	, "dashboard": "Dashboard"

	, "trash-collection": "Inventario de basura"
	, "collect": "Añadir nls clave: Collect"
+1 −0
Original line number Diff line number Diff line
@@ -887,6 +887,7 @@ define({

		, "real-time": "Real time data"
		, "goToDashboard": "Visualize data"
		, "dashboard": "Dashboard"

		, "trash-collection": "Trash survey"
		, "collect": "Collect"
+101 −0
Original line number Diff line number Diff line
define([
	"app/designs/base/_Main"
	, "app/designs/details/Controller"
	, "app/designs/details/Layout"
	, "app/designs/details/_AddBasicTitle"
	, "app/redmicConfig"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "redmic/modules/layout/templateDisplayer/TemplateDisplayer"
	, "templates/SurveyStationDashboard"
], function(
	_Main
	, Controller
	, Layout
	, _AddBasicTitle
	, redmicConfig
	, declare
	, lang
	, TemplateDisplayer
	, SurveyStationDashboardTemplate
){
	return declare([Layout, Controller, _Main, _AddBasicTitle], {
		//	summary:
		//		Vista detalle de datos en tiempo real, dashboards.

		constructor: function(args) {

			this.config = {
				title: ' ',
				noScroll: true,
				target: redmicConfig.services.timeSeriesStations,
				dashboardTarget: 'realTimeDashboard'
			};

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

		_setMainConfigurations: function() {

			this.widgetConfigs = this._merge([{
				dashboard: {
					width: 6,
					height: 6,
					type: TemplateDisplayer,
					props: {
						title: this.i18n.dashboard,
						template: SurveyStationDashboardTemplate,
						target: this.dashboardTarget
					}
				}
			}, this.widgetConfigs || {}]);
		},

		_refreshModules: function() {

			this._checkPathVariableId();

			this._emitEvt('GET', {
				target: this.target,
				requesterId: this.ownChannel,
				id: this.pathVariableId
			});

			this._refreshChildrenDataModules();
		},

		_refreshChildrenDataModules: function() {

			this._publish(this._widgets.dashboard.getChannel('CHANGE_TEMPLATE'), {
				template: SurveyStationDashboardTemplate
			});
		},

		_itemAvailable: function(res) {

			var itemData = res.data;

			if (!itemData || !itemData.properties) {
				return;
			}

			var siteData = itemData.properties.site;

			if (!siteData) {
				return;
			}

			this.title = siteData.name + ' (' + siteData.code + ')';
			this._updateTitle();

			this.dashboardUrl = siteData.dashboard;

			this._emitEvt('INJECT_ITEM', {
				data: {
					url: this.dashboardUrl
				},
				target: this.dashboardTarget
			});
		}
	});
});
Compare d3a8ff40 to 59f8d0cc
Original line number Diff line number Diff line
Subproject commit d3a8ff404340029b7d192069d3dd11357101a139
Subproject commit 59f8d0cc4a7dc55091906d58e78ca8aec1d09b18