Commit 5b7fc149 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Refactoriza y reubica widgets de detalle

parent 459bcf75
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ define([
	, 'src/detail/activity/widget/ActivityInfrastructureMap'
	, 'src/detail/activity/widget/ActivityLayerMap'
	, 'src/detail/activity/widget/ActivityTrackingMap'
	, 'src/detail/widget/AcousticDetectionMap'
	, 'src/detail/project/widget/ProjectAcousticDetectionMap'
	, 'src/component/layout/genericDisplayer/GenericDisplayer'
	, 'src/component/layout/SupersetDisplayer'
], function(
@@ -25,7 +25,7 @@ define([
	, ActivityInfrastructureMap
	, ActivityLayerMap
	, ActivityTrackingMap
	, AcousticDetectionMap
	, ProjectAcousticDetectionMap
	, GenericDisplayer
	, SupersetDisplayer
) {
@@ -178,7 +178,7 @@ define([
		_getAcousticDetectionMapConfig: function(config) {

			return {
				type: AcousticDetectionMap,
				type: ProjectAcousticDetectionMap,
				props: {
					title: 'acoustic-detection',
					activityIds: config.activityIds
+7 −26
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@ define([
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
	, 'src/component/layout/templateDisplayer/TemplateDisplayer'
	, 'src/component/map/_ImportWkt'
	, 'src/component/map/LeafletImpl'
	, 'src/design/browser/_AddTotalBarComponent'
	, 'src/design/browser/_BrowserFullSizeDesignLayout'
	, 'src/redmicConfig'
@@ -20,8 +18,6 @@ define([
	, _Show
	, _Store
	, TemplateDisplayer
	, _ImportWkt
	, LeafletImpl
	, _AddTotalBarComponent
	, _BrowserFullSizeDesignLayout
	, redmicConfig
@@ -32,6 +28,8 @@ define([
	, TemplatePlatform
) {

	const BrowserDesign = declare([_Module, _Show, _Store, _BrowserFullSizeDesignLayout, _AddTotalBarComponent]);

	return declare(null, {
		// summary:
		//   Métodos para obtener la configuración (definición y propiedades) de widgets básicos para vistas detalle.
@@ -51,7 +49,7 @@ define([
			};

			return {
				type: declare([_Module, _Show, _Store, _BrowserFullSizeDesignLayout, _AddTotalBarComponent]),
				type: BrowserDesign,
				props: {
					title: 'organisations',
					target: config.target,
@@ -78,7 +76,7 @@ define([
			};

			return {
				type: declare([_Module, _Show, _Store, _BrowserFullSizeDesignLayout, _AddTotalBarComponent]),
				type: BrowserDesign,
				props: {
					title: 'platforms',
					target: config.target,
@@ -105,7 +103,7 @@ define([
			};

			return {
				type: declare([_Module, _Show, _Store, _BrowserFullSizeDesignLayout, _AddTotalBarComponent]),
				type: BrowserDesign,
				props: {
					title: 'contacts',
					target: config.target,
@@ -131,7 +129,7 @@ define([
			};

			return {
				type: declare([_Module, _Show, _Store, _BrowserFullSizeDesignLayout, _AddTotalBarComponent]),
				type: BrowserDesign,
				props: {
					title: 'documents',
					target: config.target,
@@ -167,7 +165,7 @@ define([
			};

			return {
				type: declare([_Module, _Show, _Store, _BrowserFullSizeDesignLayout, _AddTotalBarComponent]),
				type: BrowserDesign,
				props: {
					title: config.title,
					target: config.target,
@@ -193,23 +191,6 @@ define([
					shownOption: config.shownOption
				}
			};
		},

		_getSpatialExtensionConfig: function(config) {

			return {
				type: declare([LeafletImpl, _ImportWkt]),
				props: {
					title: 'spatialExtension',
					omitContainerSizeCheck: true,
					maxZoom: 15,
					coordinatesViewer: false,
					navBar: false,
					miniMap: false,
					scaleBar: false,
					measureTools: false
				}
			};
		}
	});
});
+26 −11
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@ define([
	'src/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/map/_ImportWkt'
	, 'src/component/map/LeafletImpl'
	, 'src/detail/_CustomLayout'
	, 'src/detail/_DetailAdministrative'
	, 'src/detail/_GenerateReport'
@@ -10,6 +12,8 @@ define([
	redmicConfig
	, declare
	, lang
	, _ImportWkt
	, LeafletImpl
	, _CustomLayout
	, _DetailAdministrative
	, _GenerateReport
@@ -39,18 +43,29 @@ define([

			this.inherited(arguments);

			this._spatialExtensionPrepareDetailWidget();
			this.widgetConfigs = this._merge([{
				info: {},
				spatialExtension: {}
			},

		_spatialExtensionPrepareDetailWidget: function() {

			const spatialExtension = this._merge([this._getSpatialExtensionConfig(), {
			this.widgetConfigs ?? {},
			{
				spatialExtension: {
					width: 3,
					height: 2,
				hidden: true
					hidden: true,
					type: declare([LeafletImpl, _ImportWkt]),
					props: {
						title: 'spatialExtension',
						omitContainerSizeCheck: true,
						maxZoom: 15,
						coordinatesViewer: false,
						navBar: false,
						miniMap: false,
						scaleBar: false,
						measureTools: false
					}
				}
			}]);

			this.widgetConfigs = this._merge([this.widgetConfigs || {}, {spatialExtension}]);
		},

		_setOwnCallbacksForEvents: function() {
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ define([
	return declare([_Module, _Show, _Store, _MapDesignWithContentLayout, _AddAtlasComponent, _AddBrowserComponent,
		_AddMapLayerComponent], {
		// summary:
		//   Widget para mostrar en un mapa la distribución generalizada de detecciones acústicas.
		//   Widget para mostrar en un mapa la distribución generalizada de detecciones acústicas de un proyecto, en
		//   base a los datos registrados en sus actividades.

		postMixInProperties: function() {