Commit 1f0cb5d9 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Recupera peticiones desde FacetsImpl, limpia

parent 9fe9374e
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -9,15 +9,13 @@ define([
){
	return declare(null, {
		//	summary:
		//		Extensión que genera callback para emitir refresh apartir de la
		//		primera vez mostrado.
		//		Extensión que genera callback para emitir refresh apartir de la primera vez mostrado.

		_setControllerOwnCallbacksForEvents: function() {

			this.inherited(arguments);

			this._onEvt('ME_OR_ANCESTOR_HIDDEN',
				lang.hitch(this, this._onControllerMeOrAncestorHidden));
			this._onEvt('ME_OR_ANCESTOR_HIDDEN', lang.hitch(this, this._onControllerMeOrAncestorHidden));
		},

		_onControllerMeOrAncestorHidden: function() {
@@ -25,25 +23,26 @@ define([
			this._getPreviouslyShown() && !this._existCallbackMeOrAncestorShown && this._onEvt('ME_OR_ANCESTOR_SHOWN',
				lang.hitch(this, this._onControllerMeOrAncestorShown));

			if (this.pathVariableId)
			if (this.pathVariableId) {
				this.oldPathVariableId = this.pathVariableId;
			}

			this._existCallbackMeOrAncestorShown = true;
		},

		_onControllerMeOrAncestorShown: function() {

			var isRefresh = this._getPreviouslyShown();
			var needToRefresh = this._getPreviouslyShown();

			if (this.pathVariableId && this.oldPathVariableId &&
				Utilities.isEqual(this.pathVariableId, this.oldPathVariableId)) {
				isRefresh = false;
				needToRefresh = false;
			}

			if (isRefresh) {
				var obj = {};
				if (this.initDataRefresh)
					obj.initData = true;
			if (needToRefresh) {
				var obj = {
					initData: !!this.initDataRefresh
				};

				this._emitEvt('REFRESH', obj);
			}
+3 −8
Original line number Diff line number Diff line
@@ -152,26 +152,22 @@ define([

		_showSearchResults: function(searchDefinition) {

			var obj = {
			this._publish(this._widgets.searchFastFilter.getChannel('SET_PROPS'), {
				target: searchDefinition.target,
				queryChannel: searchDefinition.queryChannel
			};

			this._publish(this._widgets.searchResults.getChannel('SET_PROPS'), obj);
			this._publish(this._widgets.searchFastFilter.getChannel('SET_PROPS'), obj);
			});

			this._showWidget('searchFastFilter');
			this._showWidget('searchResults');
			this._reloadInteractive();
			this._updateInteractive();

			this._publish(this._widgets.searchResults.getChannel('SEARCH_DATA'), searchDefinition);
		},

		_hideSearchResults: function(searchDefinition) {

			this._publish(this._widgets.searchResults.getChannel('CLEAR_DATA'), searchDefinition);

			this._hideWidget('searchFilter');
			this._hideWidget('searchFastFilter');
			this._hideWidget('searchResults');
			this._reloadInteractive();
@@ -194,7 +190,6 @@ define([
			} else {
				this._advancedSearchShown = false;
				this._hideWidget('searchFilter');
				//this._publish(this._widgets.searchFilter.getChannel('TOGGLE_SHOW'));
				this._reloadInteractive();
				this._updateInteractive();
			}
+0 −16
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ define([
			this.config = {
				ownChannel: 'searchResultsWidget',
				actions: {
					'SEARCH_DATA': 'searchData',
					'CLEAR_DATA': 'clearData'
				},
				target: redmicConfig.services.activity,
@@ -72,9 +71,6 @@ define([
		_defineSubscriptions: function() {

			this.subscriptionsConfig.push({
				channel: this.getChannel('SEARCH_DATA'),
				callback: '_subSearchData'
			},{
				channel: this.getChannel('CLEAR_DATA'),
				callback: '_subClearData'
			});
@@ -94,18 +90,6 @@ define([
			});
		},

		_subSearchData: function(req) {

			this._emitEvt('ADD_TO_QUERY', {
				query: {
					text: {
						text: req.searchText
					}
				},
				//requesterId: this.getOwnChannel()
			});
		},

		_subClearData: function(req) {

			this._publish(this.browser.getChannel("CLEAR"));
+0 −1
Original line number Diff line number Diff line
@@ -134,7 +134,6 @@ define([

		_onQueryChannelUpdated: function(obj) {

			console.log('entra', obj)
			this._disconnectFromFilter(obj.oldValue);
			this._connectToFilter(obj.value);
		},
+3 −3
Original line number Diff line number Diff line
@@ -105,9 +105,9 @@ define([

			if (!this._facetsCreate) {
				this._emitEvt('SEARCH', {
					aggs: this.aggs,
					size: 0,
					requesterId: this.queryChannel
					aggs: this.aggs//,
					//size: 0,
					//requesterId: this.queryChannel
				});
			}