Commit 25e2a0c6 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Refactoriza y desglosa cajas de vistas detalle

Elimina las cajas de pestañas que quedaban, sustituyéndolas por cajas
independientes.

Aprovecha la base de las vistas detalle para heredar elementos comunes.

Corrige ciertos problemas detectados en vistas detalle.
parent 0c1d7e64
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -25,13 +25,7 @@ define([

			this.configTitle = {
				_titleLeftButtonsList: [],

				_titleRightButtonsList: [{
					icon: "fa-print",
					btnId: "report",
					title: this.i18n.printToPdf
				}],

				_titleRightButtonsList: [],
				tabs: [],
				centerTitle: false,
				pathParent: null,
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ define([
){
	return declare([Layout, Controller, _Main, _AddTitle, _TitleSelection], {
		//	summary:
		//		Vista detalle de Document.
		//		Vista detalle de documento PDF.

		constructor: function(args) {

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ define([
){
	return declare([_DetailsBase], {
		//	summary:
		//		Vista detalle de Organisation.
		//		Vista detalle de organizaciones.


		constructor: function(args) {
+20 −21
Original line number Diff line number Diff line
@@ -21,8 +21,7 @@ define([
){
	return declare([_DetailsBase], {
		//	summary:
		//		Vista detalle de Organisation.

		//		Vista detalle de plataformas.

		constructor: function(args) {

@@ -39,34 +38,34 @@ define([
		_setMainConfigurations: function() {

			this.widgetConfigs = this._merge([{
				additionalInfo: {
					props: {
						childTabs: [
							this._configAdditionalInfoActivity(),
							{
								title: this.i18n.contacts,
				contactList: this._contactsConfig()
			}, this.widgetConfigs || {}]);

			this.inherited(arguments);
		},

		_contactsConfig: function() {

			return {
				width: 3,
				height: 2,
				type: declare([ListImpl, _Framework]),
				props: {
					title: this.i18n.contacts,
					target: this.contactTarget,
					template: TemplateContacts,
					bars: [{
						instance: Total
					}]
				}
							}
						]
					}
				}
			}, this.widgetConfigs || {}]);

			this.inherited(arguments);
			};
		},

		_clearModules: function() {

			this.inherited(arguments);

			this._publish(this._widgets.additionalInfo.getChildChannel("childInstances.1", "CLEAR"));
			this._publish(this._getWidgetInstance('contactList').getChannel('CLEAR'));
		},

		_itemAvailable: function(res, resWrapper) {
+57 −93
Original line number Diff line number Diff line
define([
	"app/designs/base/_Main"
	, "app/designs/details/Controller"
	, "app/designs/details/Layout"
	, "app/designs/details/_AddTitle"
	, "app/designs/details/_TitleSelection"
	, "app/redmicConfig"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "redmic/map/OpenLayers"
	, "redmic/modules/browser/_ButtonsInRow"
	, "redmic/modules/browser/_Framework"
	, "redmic/modules/browser/ListImpl"
	, "redmic/modules/browser/bars/Total"
	, "redmic/modules/map/LeafletImpl"
	, "redmic/modules/map/Map"
	, "redmic/modules/map/layer/WmsLayerImpl"
	, "redmic/modules/layout/TabsDisplayer"
	, "redmic/modules/layout/templateDisplayer/TemplateDisplayer"
	, "RWidgets/RedmicUtilities"
	, "templates/ServiceOGCTitle"
	, "templates/ServiceOGCInfo"
	, "templates/ServiceOGCImage"
	, "templates/ServiceOGCActivityList"
	, "./_DetailsBase"
], function(
	_Main
	, Controller
	, Layout
	, _AddTitle
	, _TitleSelection
	, redmicConfig
	, declare
	, lang
	, OpenLayers
	, _ButtonsInRow
	, _Framework
	, ListImpl
	, Total
	, LeafletImpl
	, Map
	, WmsLayerImpl
	, TabsDisplayer
	, TemplateDisplayer
	, RedmicUtilities
	, TemplateTitle
	, TemplateInfo
	, TemplateImage
	, TemplateActivities
	, _DetailsBase
) {
	return declare([Layout, Controller, _Main, _AddTitle, _TitleSelection], {

	return declare([_DetailsBase], {
		//	summary:
		//		Vista detalle de Activity.
		//		Vista detalle de servicios OGC.

		constructor: function(args) {

			this.atlasTarget = redmicConfig.services.atlasLayer;
			this.activityTarget = redmicConfig.services.activity;
			this.target = [this.atlasTarget, this.activityTarget];
			this.target = this.atlasTarget;
			this.selectionTarget = redmicConfig.services.atlasLayerSelection;

			this.activityLocalTarget = "activitiesLayer";
			this.infoLayerTarget = 'infoLayerTarget';

			this.config = {
				noScroll: true,
				_titleRightButtonsList: []
				templateTitle: TemplateTitle,
				templateInfo: TemplateInfo
			};

			this.titleRightButtonsList = [];

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

		_setMainConfigurations: function() {

			this.titleWidgetConfig = this._merge([{
				template: TemplateTitle
			}, this.titleWidgetConfig || {}]);
			this.inherited(arguments);

			this.target.push(this.activityTarget);

			this.widgetConfigs = this._merge([{
			this.widgetConfigs = this._merge([
				this.widgetConfigs || {},
				{
				info: {
					width: 3,
					height: 6,
					type: TemplateDisplayer,
					props: {
						title: this.i18n.info,
						template: TemplateInfo,
						"class": "containerDetails",
						classEmptyTemplate: "contentListNoData",
						target: this.infoLayerTarget,
						associatedIds: [this.ownChannel]
						target: this.infoLayerTarget
					}
				},
				additionalInfo: {
					width: 3,
					height: 6,
					type: TabsDisplayer,
				activityList: {
					height: 3,
					props: {
						title: this.i18n.additionalInfo,
						childTabs: [{
						title: this.i18n.dataSource,
							type: declare([ListImpl, _Framework, _ButtonsInRow]),
							props: {
								target: this.activityLocalTarget,
								template: TemplateActivities,
								bars: [{
									instance: Total
								}],
								rowConfig: {
									buttonsConfig: {
										listButton: [{
											icon: "fa-info-circle",
											btnId: "details",
											title: this.i18n.info,
											href: this.viewPathsWidgets.activities
										}]
									}
								}
						target: this.activityLocalTarget
					}
						},/*{
							title: this.i18n.legend,
				},
				spatialExtensionMap: {
					width: 3,
					height: 3,
					type: declare([LeafletImpl, Map]),
					props: {
						title: this.i18n.geograficFrame,
						omitContainerSizeCheck: true,
						maxZoom: 15,
						coordinatesViewer: false,
						navBar: false,
						miniMap: false,
						scaleBar: false,
						measureTools: false
					}
				}/*,
				legend: {
					width: 3,
					height: 6,
					type: TemplateDisplayer,
					props: {
						title: this.i18n.legend,
						template: TemplateImage,
						"class": "imageContainer",
						target: this.atlasTarget,
						associatedIds: [this.ownChannel]
					}
						},*/
						{
							title: this.i18n.geograficFrame,
							type: declare([LeafletImpl, Map]),
							props: {
								zoom: 5,
								extent: [28.5, -17.0]
							}
						}]
					}
				}
			}, this.widgetConfigs || {}]);
				}*/
			}]);
		},

		_publishMapBox: function(action, obj) {

			this._publish(this._widgets.additionalInfo.getChildChannel("childInstances.1", action), obj);
			this._publish(this._getWidgetInstance('spatialExtensionMap').getChannel(action), obj);
		},

		_clearModules: function() {

			this._publish(this._widgets.info.getChannel("CLEAR"));
			this._publish(this._widgets.additionalInfo.getChildChannel("childInstances.0", "CLEAR"));
			this.inherited(arguments);

			this._publish(this._getWidgetInstance('activityList').getChannel("CLEAR"));

			if (this.layerPolygon) {
				this._publishMapBox("REMOVE_LAYER", {
@@ -161,9 +123,7 @@ define([
					layer: this.layer
				});

				this._publish(this.layer.getChannel("DISCONNECT"));

				this.layer.destroy();
				this._publish(this.layer.getChannel("DESTROY"));
			}
		},

@@ -224,6 +184,10 @@ define([
				layerLabel: this.i18n.boundingBox,
				optional: true
			});

			this._publishMapBox('FIT_BOUNDS', {
				bounds: this.layerPolygon.getBounds()
			});
		},

		_retrieveLayerActivities: function(data) {
@@ -251,7 +215,7 @@ define([

			this.layer = new WmsLayerImpl({
				parentChannel: this.getChannel(),
				mapChannel: this._widgets.additionalInfo.getChildChannel("childInstances.1"),
				mapChannel: this._getWidgetInstance('spatialExtensionMap').getChannel(),
				layer: OpenLayers.build({
					type: "wms",
					url: data.urlSource,
Loading