Commit 3299affc authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige interferencias entre instancias

Reubica lugar de definición de constantes de config por defecto,
evitando así el uso compartido de estructuras complejas definidas dentro
de esta config. Al definir la constante en el ámbito del método que va a
realizar la mezcla de parámetros, ya no se comparten los diferentes
objects y arrays anidados.

Esto corrige, por ejemplo, el uso del componente de mapa cuando 2 o más
instancias eran creadas bajo la misma vista.
parent 064b36ff
Loading
Loading
Loading
Loading
+23 −23
Original line number Diff line number Diff line
@@ -14,6 +14,14 @@ define([
	, LoadingTemplate
) {

	return declare(_Module, {
		//	summary:
		//		Módulo para representar cuando otros módulos están esperando a que ocurra algo.
		//	description:
		//		Escucha las peticiones de 'cargando' y 'cargado' de todos los módulos.

		postMixInProperties: function() {

			const defaultConfig = {
				ownChannel: 'loading',
				events: {
@@ -37,14 +45,6 @@ define([
				loadingAttr: 'loading'
			};

	return declare(_Module, {
		//	summary:
		//		Módulo para representar cuando otros módulos están esperando a que ocurra algo.
		//	description:
		//		Escucha las peticiones de 'cargando' y 'cargado' de todos los módulos.

		postMixInProperties: function() {

			this._mergeOwnAttributes(defaultConfig);

			this.inherited(arguments);
+60 −60
Original line number Diff line number Diff line
@@ -34,66 +34,6 @@ define([
	, _ModuleItfc
) {

	const defaultConfig = {
		commonEvents: {
			CONNECT: "connect",
			DISCONNECT: "disconnect",
			STATUS: "status",
			TRACK: "track",
			GOT_PROPS: "gotProps",
			PROPS_SET: "propsSet",
			DESTROY: "destroy"
		},
		commonActions: {
			CONNECT: "connect",
			DISCONNECT: "disconnect",
			CONNECTED: "connected",
			DISCONNECTED: "disconnected",
			ERROR: "error",
			GETSTATUS: "getStatus",
			GOTSTATUS: "gotStatus",
			TRACK: "track",
			SET_PROPS: "setProps",
			GET_PROPS: "getProps",
			GOT_PROPS: "gotProps",
			DESTROY: "destroy",
			DESTROYED: "destroyed"
		},
		globalOwnChannels: {
			ROUTER: "router",
			STORE: "data",
			SELECTOR: "selection",
			CREDENTIALS: "credentials",
			EXTERNAL_CONFIG: "externalConfig",
			ANALYTICS: "analytics",
			MODULE_STORE: "moduleStore",
			TASK: "task",
			NOTIFICATION: "notification",
			SOCKET: "socket",
			META_TAGS: "metaTags",
			LOADING: "loading",
			ALERT: "alert",
			COMMUNICATION: "communicationCenter",
			AUTH: "auth"
		},

		rootChannel: "app",
		innerAppOwnChannel: 'innerApp',
		outerAppOwnChannel: 'outerApp',
		channelSeparator: Mediator.channelSeparator,

		i18n: i18n,

		ownChannel: "module",
		parentChannel: "",
		ownChannelSeparator: "-",
		childPathSeparator: ".",
		propSetSuffix: "Set",

		_childrenActionsAllowedToListen: ['CONNECTED', 'DISCONNECTED', 'DESTROYED'],
		_childrenActionDfdsNameSuffix: 'ChildrenActionDfds'
	};

	return declare([_WidgetBase, Evented, _ModuleItfc, _ChkCollection, _CommunicationCenter, _ManageClickEvent], {
		// summary:
		//   Base común para todos los componentes.
@@ -183,6 +123,66 @@ define([

		constructor: function() {

			const defaultConfig = {
				commonEvents: {
					CONNECT: "connect",
					DISCONNECT: "disconnect",
					STATUS: "status",
					TRACK: "track",
					GOT_PROPS: "gotProps",
					PROPS_SET: "propsSet",
					DESTROY: "destroy"
				},
				commonActions: {
					CONNECT: "connect",
					DISCONNECT: "disconnect",
					CONNECTED: "connected",
					DISCONNECTED: "disconnected",
					ERROR: "error",
					GETSTATUS: "getStatus",
					GOTSTATUS: "gotStatus",
					TRACK: "track",
					SET_PROPS: "setProps",
					GET_PROPS: "getProps",
					GOT_PROPS: "gotProps",
					DESTROY: "destroy",
					DESTROYED: "destroyed"
				},
				globalOwnChannels: {
					ROUTER: "router",
					STORE: "data",
					SELECTOR: "selection",
					CREDENTIALS: "credentials",
					EXTERNAL_CONFIG: "externalConfig",
					ANALYTICS: "analytics",
					MODULE_STORE: "moduleStore",
					TASK: "task",
					NOTIFICATION: "notification",
					SOCKET: "socket",
					META_TAGS: "metaTags",
					LOADING: "loading",
					ALERT: "alert",
					COMMUNICATION: "communicationCenter",
					AUTH: "auth"
				},

				rootChannel: "app",
				innerAppOwnChannel: 'innerApp',
				outerAppOwnChannel: 'outerApp',
				channelSeparator: Mediator.channelSeparator,

				i18n: i18n,

				ownChannel: "module",
				parentChannel: "",
				ownChannelSeparator: "-",
				childPathSeparator: ".",
				propSetSuffix: "Set",

				_childrenActionsAllowedToListen: ['CONNECTED', 'DISCONNECTED', 'DESTROYED'],
				_childrenActionDfdsNameSuffix: 'ChildrenActionDfds'
			};

			this._mergeOwnAttributes(defaultConfig);

			this._prepareComponentInternalStructures();
+17 −17
Original line number Diff line number Diff line
@@ -10,6 +10,12 @@ define([
	, _Show
) {

	return declare([_Module, _Show], {
		//	summary:
		//		Módulo que permite mostrar un contenido genérico que reciba, ya sea otro módulo o un nodo simple.

		postMixInProperties: function() {

			const defaultConfig = {
				ownChannel: 'genericDisplayer',
				events: {
@@ -27,12 +33,6 @@ define([
				additionalContentClasses: null
			};

	return declare([_Module, _Show], {
		//	summary:
		//		Módulo que permite mostrar un contenido genérico que reciba, ya sea otro módulo o un nodo simple.

		postMixInProperties: function() {

			this._mergeOwnAttributes(defaultConfig);

			// TODO por algún motivo, si el atributo content es una instancia de componente Browser, la mezcla de
+11 −11
Original line number Diff line number Diff line
@@ -8,6 +8,13 @@ define([
	, GenericDisplayer
) {

	return declare(GenericDisplayer, {
		//	summary:
		//		Implementación del módulo que permite mostrar un contenido genérico (módulo o no) junto con una barra
		//		superior.

		postMixInProperties: function() {

			const defaultConfig = {
				topbarClass: 'topZone',
				titleClass: 'titleZone',
@@ -19,13 +26,6 @@ define([
				_topbarContentNodes: {}
			};

	return declare(GenericDisplayer, {
		//	summary:
		//		Implementación del módulo que permite mostrar un contenido genérico (módulo o no) junto con una barra
		//		superior.

		postMixInProperties: function() {

			this._mergeOwnAttributes(defaultConfig);

			this.inherited(arguments);
+7 −7
Original line number Diff line number Diff line
@@ -28,13 +28,6 @@ define([
	, MapModule
) {

	const defaultConfig = {
		queryableClass: 'leaflet-queryable',
		omitContainerSizeCheck: false,
		_mapNodeValidSizeInterval: 100,
		_infoForAddedLayers: {}
	};

	return declare([MapModule, _LeafletImplItfc, _LeafletWidgetsManagement, _ListenContainers, _OverlayLayersManagement], {
		//	summary:
		//		Implementación de mapa Leaflet.
@@ -43,6 +36,13 @@ define([

		postMixInProperties: function() {

			const defaultConfig = {
				queryableClass: 'leaflet-queryable',
				omitContainerSizeCheck: false,
				_mapNodeValidSizeInterval: 100,
				_infoForAddedLayers: {}
			};

			this._mergeOwnAttributes(defaultConfig);

			this.inherited(arguments);
Loading