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

Corrige funcionamiento de varios widgets de detail

Adapta sistema de petición de datos prescindiendo de la extensión
_Filter, manteniendo la funcionalidad a falta del filtrado por texto,
que se incorporará próximamente.
parent b774c5be
Loading
Loading
Loading
Loading
+13 −53
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/base/_Filter'
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
@@ -15,7 +14,6 @@ define([
], function(
	declare
	, lang
	, _Filter
	, _Module
	, _Show
	, _Store
@@ -28,23 +26,23 @@ define([
	, TemplateList
) {

	return declare([_Module, _Show, _Store, _Filter, _MapDesignWithContentLayout, _AddAtlasComponent,
		_AddBrowserComponent, _AddMapLayerComponent], {
	return declare([_Module, _Show, _Store, _MapDesignWithContentLayout, _AddAtlasComponent, _AddBrowserComponent,
		_AddMapLayerComponent], {
		//	summary:
		//		Widget para mostrar en un mapa las geometrías asociadas a una actividad.

		postMixInProperties: function() {

			this.inherited(arguments);

			const defaultConfig = {
				ownChannel: 'activityAreaMap',
				_dataTarget: redmicConfig.services.areasByActivity,
				target: redmicConfig.services.areasByActivity,
				mapLayerDefinition: 'geojson',
				mapLayerPopupTemplate: TemplatePopup
			};

			this._mergeOwnAttributes(defaultConfig);

			this.inherited(arguments);
		},

		_setOwnCallbacksForEvents: function() {
@@ -63,61 +61,23 @@ define([
			});
		},

		_beforeInitialize: function() {

			this.inherited(arguments);

			const queryChannel = this.queryChannel;

			this.mergeComponentAttribute('browserConfig', {
				queryChannel
			});

			this.mergeComponentAttribute('searchConfig', {
				queryChannel
			});
		},

		_onMeOrAncestorShown: function() {

			const replacedTarget = this._getTargetWithVariableReplaced();

			this._updateComponentTargetValues(replacedTarget);
			this._requestDataFromReplacedTarget(replacedTarget);
			this._requestData();
		},

		_getTargetWithVariableReplaced: function() {
		_requestData: function() {

			const replaceObj = {
			const path = {
				activityid: this.pathVariableId
			};

			return lang.replace(this._dataTarget, replaceObj);
		},

		_updateComponentTargetValues: function(replacedTarget) {

			const browserInstance = this.getComponentInstance('browser'),
				searchInstance = this.getComponentInstance('search'),
				mapLayerInstance = this.getComponentInstance('mapLayer');

			this._publish(mapLayerInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});

			this._publish(browserInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});

			this._publish(searchInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});
		},

		_requestDataFromReplacedTarget: function(replacedTarget) {
			const sharedParams = true;

			this._publish(this.getChannel('SET_PROPS'), {
				target: replacedTarget
			this._emitEvt('REQUEST', {
				method: 'POST',
				target: this.target,
				params: {path, sharedParams}
			});
		}
	});
+13 −53
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/base/_Filter'
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
@@ -15,7 +14,6 @@ define([
], function(
	declare
	, lang
	, _Filter
	, _Module
	, _Show
	, _Store
@@ -28,25 +26,25 @@ define([
	, TemplateList
) {

	return declare([_Module, _Show, _Store, _Filter, _MapDesignWithContentLayout, _AddAtlasComponent,
		_AddBrowserComponent, _AddMapLayerComponent], {
	return declare([_Module, _Show, _Store, _MapDesignWithContentLayout, _AddAtlasComponent, _AddBrowserComponent,
		_AddMapLayerComponent], {
		//	summary:
		//		Widget para mostrar en un mapa las ubicaciones de citas asociadas a una actividad.

		postMixInProperties: function() {

			this.inherited(arguments);

			const defaultConfig = {
				ownChannel: 'activityCitationMap',
				enabledMapLayerExtensions: {
					radius: true
				},
				_dataTarget: redmicConfig.services.citationByActivity,
				target: redmicConfig.services.citationByActivity,
				mapLayerPopupTemplate: TemplatePopup
			};

			this._mergeOwnAttributes(defaultConfig);

			this.inherited(arguments);
		},

		_setOwnCallbacksForEvents: function() {
@@ -65,61 +63,23 @@ define([
			});
		},

		_beforeInitialize: function() {

			this.inherited(arguments);

			const queryChannel = this.queryChannel;

			this.mergeComponentAttribute('browserConfig', {
				queryChannel
			});

			this.mergeComponentAttribute('searchConfig', {
				queryChannel
			});
		},

		_onMeOrAncestorShown: function() {

			const replacedTarget = this._getTargetWithVariableReplaced();

			this._updateComponentTargetValues(replacedTarget);
			this._requestDataFromReplacedTarget(replacedTarget);
			this._requestData();
		},

		_getTargetWithVariableReplaced: function() {
		_requestData: function() {

			const replaceObj = {
			const path = {
				id: this.pathVariableId
			};

			return lang.replace(this._dataTarget, replaceObj);
		},

		_updateComponentTargetValues: function(replacedTarget) {

			const browserInstance = this.getComponentInstance('browser'),
				searchInstance = this.getComponentInstance('search'),
				mapLayerInstance = this.getComponentInstance('mapLayer');

			this._publish(mapLayerInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});

			this._publish(browserInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});

			this._publish(searchInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});
		},

		_requestDataFromReplacedTarget: function(replacedTarget) {
			const sharedParams = true;

			this._publish(this.getChannel('SET_PROPS'), {
				target: replacedTarget
			this._emitEvt('REQUEST', {
				method: 'POST',
				target: this.target,
				params: {path, sharedParams}
			});
		}
	});
+23 −63
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@ define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'dojo/query'
	, 'src/component/base/_Filter'
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
@@ -17,7 +16,6 @@ define([
	declare
	, lang
	, query
	, _Filter
	, _Module
	, _Show
	, _Store
@@ -30,8 +28,8 @@ define([
	, TemplateList
) {

	return declare([_Module, _Show, _Store, _Filter, _MapDesignWithContentLayout, _AddAtlasComponent,
		_AddBrowserComponent, _AddMapLayerComponent], {
	return declare([_Module, _Show, _Store, _MapDesignWithContentLayout, _AddAtlasComponent, _AddBrowserComponent,
		_AddMapLayerComponent], {
		//	summary:
		//		Widget para mostrar un mapa de estaciones que producen series de datos temporales.

@@ -42,7 +40,7 @@ define([
				actions: {
					TIMESERIES_DATA: 'timeseriesData'
				},
				_dataTarget: redmicConfig.services.activityTimeSeriesStations,
				target: redmicConfig.services.activityTimeSeriesStations,
				mapLayerPopupTemplate: TemplatePopup,
				_showChartsButtonClass: 'showCharts'
			};
@@ -81,21 +79,6 @@ define([
			});
		},

		_beforeInitialize: function() {

			this.inherited(arguments);

			const queryChannel = this.queryChannel;

			this.mergeComponentAttribute('browserConfig', {
				queryChannel
			});

			this.mergeComponentAttribute('searchConfig', {
				queryChannel
			});
		},

		_defineSubscriptions: function() {

			this.inherited(arguments);
@@ -115,6 +98,26 @@ define([
			});
		},

		_onMeOrAncestorShown: function() {

			this._requestData();
		},

		_requestData: function() {

			const path = {
				activityid: this.pathVariableId
			};

			const sharedParams = true;

			this._emitEvt('REQUEST', {
				method: 'POST',
				target: this.target,
				params: {path, sharedParams}
			});
		},

		_subMapLayerStationPopupLoaded: function(res) {

			var popupNode = res?._contentNode,
@@ -141,49 +144,6 @@ define([
		_loadTimeseriesData: function(item) {

			this._publish(this.getChannel('TIMESERIES_DATA'), item);
		},

		_onMeOrAncestorShown: function() {

			const replacedTarget = this._getTargetWithVariableReplaced();

			this._updateComponentTargetValues(replacedTarget);
			this._requestDataFromReplacedTarget(replacedTarget);
		},

		_getTargetWithVariableReplaced: function() {

			const replaceObj = {
				activityid: this.pathVariableId
			};

			return lang.replace(this._dataTarget, replaceObj);
		},

		_updateComponentTargetValues: function(replacedTarget) {

			const browserInstance = this.getComponentInstance('browser'),
				searchInstance = this.getComponentInstance('search'),
				mapLayerInstance = this.getComponentInstance('mapLayer');

			this._publish(mapLayerInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});

			this._publish(browserInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});

			this._publish(searchInstance.getChannel('SET_PROPS'), {
				target: replacedTarget
			});
		},

		_requestDataFromReplacedTarget: function(replacedTarget) {

			this._publish(this.getChannel('SET_PROPS'), {
				target: replacedTarget
			});
		}
	});
});
+0 −1
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ define([
			this.inherited(arguments);

			this.mergeComponentAttribute('mapLayerConfig', {
				target: this.target,
				targetPathParams: {
					id: this.pathVariableId
				}
+3 −3
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ define([], function() {
		'citationByDocuments': baseUri + 'documents/{id}/citations',
		'calibrations': baseUri + 'calibrations',
		'citationAll': baseUri + 'citations',
		'citationByActivity': baseUri + 'activities/{id}/citations',
		'citationByActivity': baseUri + 'activities/{id}/citations/_search',
		'condition': baseUri + 'conditions',
		'confidence': baseUri + 'confidences',
		'contact': baseUri + 'contacts',
@@ -258,7 +258,7 @@ define([], function() {
		'vFlag': baseUri + 'vflags',

		'timeSeriesActivities': baseUri + 'timeseries/activities',
		'activityTimeSeriesStations': baseUri + 'activities/{activityid}/timeseriesstations',
		'activityTimeSeriesStations': baseUri + 'activities/{activityid}/timeseriesstations/_search',
		'acousticDetectionReceptors': baseUri + 'v1/acoustic-detection/activities/{id}/receptors',
		'acousticDetectionEvents': baseUri + 'v1/acoustic-detection/activities/{activityid}/receptors/{receptorid}/detections',
		'timeSeriesStations': baseUri + 'surveystations',
@@ -279,7 +279,7 @@ define([], function() {

		'attributesByInfrastructure': baseUri + 'activities/{activityid}/infrastructures/{id}/attributes',

		'areasByActivity': baseUri + 'activities/{activityid}/areas',
		'areasByActivity': baseUri + 'activities/{activityid}/areas/_search',
		'areasPropertiesByActivity': baseUri + 'activities/{activityid}/areas/properties',

		'areaClassifications': baseUri + 'areaclassifications',