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

Aprovecha buscador de texto para búsqueda avanzada

En lugar de crear más botones en lo alto del listado, simplifica los
catálogos principales para que no aparezca el que lanzaba la búsqueda
avanzada en tooltip, para reutilizar el botón de expandir de la caja de
búsqueda de texto (TextImpl del módulo Search).

Actualiza submódulo.
parent 9b1a4d1d
Loading
Loading
Loading
Loading
+8 −18
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ define([
	, "dojo/_base/lang"
	, "dojo/aspect"
	, "put-selector/put"
	, "redmic/base/Credentials"
	, "redmic/modules/base/_ShowInTooltip"
	, "redmic/modules/base/_ShowOnEvt"
	, "redmic/modules/components/Keypad/IconKeypadImpl"
@@ -14,7 +13,6 @@ define([
	, lang
	, aspect
	, put
	, Credentials
	, _ShowInTooltip
	, _ShowOnEvt
	, IconKeypadImpl
@@ -44,14 +42,6 @@ define([
			lang.mixin(this, this.config, args);

			aspect.before(this, "_mixEventsAndActions", lang.hitch(this, this._mixCompositeEventsAndActions));
			aspect.before(this, "_mixEventsAndActions", lang.hitch(this, this._constructorComposite));
		},

		_constructorComposite: function(args) {

			if (this.blockCompositeToUser && Credentials.get("userRole") !== 'ROLE_ADMINISTRATOR')
				return;

			aspect.before(this, "_afterSetConfigurations", lang.hitch(this, this._setCompositeConfigurations));
			aspect.before(this, "_initialize", lang.hitch(this, this._initializeBeforeCompositeView));
			aspect.before(this, "_defineSubscriptions", lang.hitch(this, this._initializeAfterCompositeView));
@@ -74,14 +64,6 @@ define([
			}, this.compositeConfig || {}]);
		},

		_defineCompositeSubcriptions: function () {

			this.subscriptionsConfig.push({
				channel: this._buildChannel(this.iconKeypadChannel, this.actions.KEYPAD_INPUT),
				callback: "_subKeypadInputComposite"
			});
		},

		_initializeBeforeCompositeView: function() {

			this.compositeConfig.filterChannel = this.queryChannel;
@@ -102,6 +84,14 @@ define([
			}
		},

		_defineCompositeSubcriptions: function () {

			this.subscriptionsConfig.push({
				channel: this._buildChannel(this.iconKeypadChannel, this.actions.KEYPAD_INPUT),
				callback: "_subKeypadInputComposite"
			});
		},

		postCreate: function() {

			this.inherited(arguments);
+27 −9
Original line number Diff line number Diff line
@@ -15,13 +15,6 @@ define([

			this.inherited(arguments);

			this.buttonsComposite = this._merge([this.buttonsComposite || {}, {
				"filters": {
					className: "fa-binoculars",
					title: this.i18n.advancedSearch
				}
			}]);

			this.compositeConfig = this._merge([{
				formConfig: {
					dataTemplate: {
@@ -31,9 +24,34 @@ define([
			}, this.compositeConfig || {}]);
		},

		_getIconKeypadNode: function() {
		// TODO pisar/limpiar de manera más elegante
		_initializeAfterCompositeView: function() {},

		// TODO pisar/limpiar de manera más elegante
		_defineCompositeSubcriptions: function () {

			this.subscriptionsConfig.push({
				channel: this.textSearch.getChannel('EXPAND_SEARCH'),
				callback: "_subTextSearchExpand"
			});
		},

		_subTextSearchExpand: function(res) {

			if (this._initFilters) {
				return;
			}

			this._publish(this.composite.getChannel("ADD_EVT"), {
				sourceNode: res.node,
				initAction: 'hide'
			});

			this._publish(this.composite.getChannel("SHOW"), {
				node: res.node
			});

			return this.topNode;
			this._initFilters = true;
		}
	});
});
+1 −2
Original line number Diff line number Diff line
@@ -33,8 +33,7 @@ define([

			this.config = {
				browserExts: [_Select],
				title: this.i18n.programs,
				blockCompositeToUser: true
				title: this.i18n.programs
			};

			lang.mixin(this, this.config, args);
+1 −2
Original line number Diff line number Diff line
@@ -33,8 +33,7 @@ define([

			this.config = {
				browserExts: [_Select],
				title: this.i18n.projects,
				blockCompositeToUser: true
				title: this.i18n.projects
			};

			lang.mixin(this, this.config, args);
Compare 72d9904f to 4d503732
Original line number Diff line number Diff line
Subproject commit 72d9904fdb5db6d6c04a706861df87857be3c0b2
Subproject commit 4d50373264c98087117edf05f1332052a6750bb7