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

Integra nuevo diseño browser y se aplica en atlas

Estrena nueva versión de diseño para componente Browser, con la
intención de sustituir a los antiguos 'list', 'textSearchList' y
TextSearchFacetsList'.

Aplica nuevo diseño al listado de temas seleccionados en el
componente Atlas, manteniendo su funcionalidad original.
parent c2e4c612
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ define([
				browserExts: [_HierarchicalSelect],
				selectionTarget: this.selectionTarget,
				target: this.target,
				classByList: '.borderList',
				browserConfig: {
					template: serviceOGCList,
					rowConfig: {
+35 −22
Original line number Diff line number Diff line
@@ -3,10 +3,11 @@ define([
	, 'dojo/_base/lang'
	, 'dojo/aspect'
	, 'dojo/dom-class'
	, 'app/designs/list/Controller'
	, 'app/designs/list/layout/Layout'
	, 'src/component/browser/_DragAndDrop'
	, 'src/component/browser/bars/Total'
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
	, 'src/design/browser/_AddTotalBarComponent'
	, 'src/design/browser/_BrowserWithTopbarDesignLayout'
	, 'src/redmicConfig'
	, 'templates/AtlasList'
], function(
@@ -14,10 +15,11 @@ define([
	, lang
	, aspect
	, domClass
	, Controller
	, Layout
	, _DragAndDrop
	, Total
	, _Module
	, _Show
	, _Store
	, _AddTotalBarComponent
	, _BrowserWithTopbarDesignLayout
	, redmicConfig
	, ListTemplate
) {
@@ -67,14 +69,13 @@ define([
		_themesBrowserAfterSetConfigurations: function() {

			this.themesBrowserConfig = this._merge([{
				ownChannel: 'themesBrowser',
				parentChannel: this.getChannel(),
				classByList: '.borderList',
				browserExts: [_DragAndDrop],
				enabledBrowserExtensions: {
					dragAndDrop: true
				},
				browserConfig: {
					template: ListTemplate,
					bars: [{
						instance: Total
					}],
					insertInFront: true,
					rowConfig: {
						buttonsConfig: {
@@ -120,17 +121,21 @@ define([

		_initializeThemesBrowser: function() {

			var ThemesBrowser = declare([Layout, Controller]);
			this._themesBrowser = new ThemesBrowser(this.themesBrowserConfig);
			const ThemesBrowserDefinition = declare([_Module, _Show, _Store, _BrowserWithTopbarDesignLayout,
				_AddTotalBarComponent]);

			this._themesBrowser = new ThemesBrowserDefinition(this.themesBrowserConfig);
		},

		_defineThemesBrowserSubscriptions: function() {

			const browserInstance = this._themesBrowser.getComponentInstance('browser');

			this.subscriptionsConfig.push({
				channel: this._themesBrowser.getChildChannel('browser', 'BUTTON_EVENT'),
				channel: browserInstance.getChannel('BUTTON_EVENT'),
				callback: '_subThemesBrowserButtonEvent'
			},{
				channel: this._themesBrowser.getChildChannel('browser', 'DRAG_AND_DROP'),
				channel: browserInstance.getChannel('DRAG_AND_DROP'),
				callback: '_subThemesBrowserDragAndDrop'
			});
		},
@@ -301,14 +306,18 @@ define([

		_themesBrowserReportDeselection: function(id) {

			this._publish(this._themesBrowser.getChildChannel('browser', 'REMOVE'), {
			const browserInstance = this._themesBrowser.getComponentInstance('browser');

			this._publish(browserInstance.getChannel('REMOVE'), {
				ids: [id]
			});
		},

		_themesBrowserReportClearSelection: function() {

			this._publish(this._themesBrowser.getChildChannel('browser', 'CLEAR'));
			const browserInstance = this._themesBrowser.getComponentInstance('browser');

			this._publish(browserInstance.getChannel('CLEAR'));
		},

		_cleanRowSecondaryContainer: function(layerId, container) {
@@ -329,12 +338,14 @@ define([

			this._activeLayers[mapLayerId] = true;

			this._publish(this._themesBrowser.getChildChannel('browser', 'UPDATE_DRAGGABLE_ITEM_ORDER'), {
			const browserInstance = this._themesBrowser.getComponentInstance('browser');

			this._publish(browserInstance.getChannel('UPDATE_DRAGGABLE_ITEM_ORDER'), {
				id: itemId,
				index: 0
			});

			this._publish(this._themesBrowser.getChildChannel('browser', 'ENABLE_DRAG_AND_DROP'), {
			this._publish(browserInstance.getChannel('ENABLE_DRAG_AND_DROP'), {
				id: itemId
			});
		},
@@ -352,7 +363,9 @@ define([

			this._activeLayers[mapLayerId] = false;

			this._publish(this._themesBrowser.getChildChannel('browser', 'DISABLE_DRAG_AND_DROP'), {
			const browserInstance = this._themesBrowser.getComponentInstance('browser');

			this._publish(browserInstance.getChannel('DISABLE_DRAG_AND_DROP'), {
				id: itemId
			});
		}
+45 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/search/FacetsImpl'
], function (
	declare
	, lang
	, FacetsImpl
) {

	return declare(null, {
		// summary:
		//   Lógica de diseño para añadir el componente de búsqueda Facets.
		// description:
		//   Debe asociarse como mixin a un componente al instanciarlo, junto con alguna maquetación de este diseño.

		_setConfigurations: function() {

			this.inherited(arguments);

			const parentChannel = this.getChannel();

			this.mergeComponentAttribute('facetConfig', {parentChannel});
		},

		createDesignControllerComponents: function() {

			let inheritedComponents = this.inherited(arguments);

			const facet = new FacetsImpl(this.facetConfig);

			return lang.mixin(inheritedComponents, {facet});
		},

		_onTargetPropSet: function(evt) {

			this.inherited(arguments);

			const instance = this.getComponentInstance('facet'),
				target = evt.value;

			this._publish(instance.getChannel('SET_PROPS'), {target});
		}
	});
});
+75 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/browser/bars/Order'
], function (
	declare
	, lang
	, OrderBar
) {

	return declare(null, {
		// summary:
		//   Lógica de diseño para añadir el componente de barra Order a Browser, para ampliar su funcionalidad.
		// description:
		//   Debe asociarse como mixin a un componente al instanciarlo, junto con alguna maquetación de este diseño.

		_setConfigurations: function() {

			this.inherited(arguments);

			const parentChannel = this.getChannel(),
				target = this._getTarget(),
				queryChannel = this.browserConfig.queryChannel;

			this.mergeComponentAttribute('orderBarConfig', {
				parentChannel, target, queryChannel
			});
		},

		createDesignControllerComponents: function() {

			let inheritedComponents = this.inherited(arguments);

			const orderBar = this._createDesignOrderBarComponent(inheritedComponents.browser);

			return lang.mixin(inheritedComponents, {orderBar});
		},

		_createDesignOrderBarComponent: function(browserInstance) {

			const browserChannel = browserInstance.getChannel();

			this.mergeComponentAttribute('orderBarConfig', {
				browserChannel
			});

			return new OrderBar(this.orderBarConfig);
		},

		populateDesignLayoutNodes: function() {

			this.inherited(arguments);

			this._addOrderBarToBrowser();
		},

		_addOrderBarToBrowser: function() {

			const browserInstance = this.getComponentInstance('browser'),
				instance = this.getComponentInstance('orderBar');

			this._publish(browserInstance.getChannel('ADD_TOOLBAR_IN_FRAMEWORK'), {instance});
		},

		_onTargetPropSet: function(evt) {

			this.inherited(arguments);

			const instance = this.getComponentInstance('orderBar'),
				target = evt.value;

			this._publish(instance.getChannel('SET_PROPS'), {target});
		}
	});
});
+75 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/browser/bars/Pagination'
], function (
	declare
	, lang
	, PaginationBar
) {

	return declare(null, {
		// summary:
		//   Lógica de diseño para añadir el componente de barra Pagination a Browser, para ampliar su funcionalidad.
		// description:
		//   Debe asociarse como mixin a un componente al instanciarlo, junto con alguna maquetación de este diseño.

		_setConfigurations: function() {

			this.inherited(arguments);

			const parentChannel = this.getChannel(),
				target = this._getTarget(),
				queryChannel = this.browserConfig.queryChannel;

			this.mergeComponentAttribute('paginationBarConfig', {
				parentChannel, target, queryChannel
			});
		},

		createDesignControllerComponents: function() {

			let inheritedComponents = this.inherited(arguments);

			const paginationBar = this._createDesignPaginationBarComponent(inheritedComponents.browser);

			return lang.mixin(inheritedComponents, {paginationBar});
		},

		_createDesignPaginationBarComponent: function(browserInstance) {

			const browserChannel = browserInstance.getChannel();

			this.mergeComponentAttribute('paginationBarConfig', {
				browserChannel
			});

			return new PaginationBar(this.paginationBarConfig);
		},

		populateDesignLayoutNodes: function() {

			this.inherited(arguments);

			this._addPaginationBarToBrowser();
		},

		_addPaginationBarToBrowser: function() {

			const browserInstance = this.getComponentInstance('browser'),
				instance = this.getComponentInstance('paginationBar');

			this._publish(browserInstance.getChannel('ADD_TOOLBAR_IN_FRAMEWORK'), {instance});
		},

		_onTargetPropSet: function(evt) {

			this.inherited(arguments);

			const instance = this.getComponentInstance('paginationBar'),
				target = evt.value;

			this._publish(instance.getChannel('SET_PROPS'), {target});
		}
	});
});
Loading