Commit 6a52bc3e authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Adapta a nueva API, consulta desde vista inicial

Cambia de filtro para hacer la consulta inicial de bienvenida: en lugar
de usar la instancia del widget de la barra de búsqueda, declara uno en
la vista inicial, para compartirlo más fácilmente entre los diferentes
widgets.

Adapta ciertos parámetros para permitir consultar a la API tras los
últimos cambios.
parent 5e675f43
Loading
Loading
Loading
Loading
+26 −2
Original line number Diff line number Diff line
define([
	"app/designs/details/Controller"
	, "app/designs/details/Layout"
	, 'app/redmicConfig'
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "redmic/modules/layout/templateDisplayer/TemplateDisplayer"
	, "templates/InitialInfo"
	, 'redmic/modules/base/_Filter'
	, "redmic/base/Credentials"
	, 'app/home/views/SearchBarWidget'
	, 'app/home/views/SearchFastFilterWidget'
@@ -16,10 +18,12 @@ define([
], function(
	Controller
	, Layout
	, redmicConfig
	, declare
	, lang
	, TemplateDisplayer
	, TemplateInfo
	, _Filter
	, Credentials
	, SearchBarWidget
	, SearchFastFilterWidget
@@ -30,13 +34,14 @@ define([
	, WidgetFavourites
) {

	return declare([Layout, Controller], {
	return declare([Layout, Controller, _Filter], {
		//	summary:
		//		Vista inicial de la aplicación.

		constructor: function(args) {

			this.config = {
				target: redmicConfig.services.activity,
				propsWidget: {
				}
			};
@@ -66,7 +71,19 @@ define([
					type: SearchFastFilterWidget,
					props: {
						windowTitle: 'fastFilters',
						omitTitleCloseButton: true
						omitTitleCloseButton: true,
						facetsSearchConfig: {
							query: {
								terms: {
									starred: true
								},
								size: 10,
								sorts: [{
									field: 'id',
									order: 'DESC'
								}]
							}
						}
					}
				},
				searchResults: {
@@ -132,6 +149,13 @@ define([
		_afterShow: function(request) {

			this._listenWidgets();

			var obj = {
				queryChannel: this.queryChannel
			};

			this._publish(this._getWidgetInstance('searchFastFilter').getChannel('SET_PROPS'), obj);
			this._publish(this._getWidgetInstance('searchFilter').getChannel('SET_PROPS'), obj);
		},

		_listenWidgets: function() {
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ define([
				queryChannel: this.queryChannel,
				highlightField: ['name'],
				suggestFields: ['name', 'code'],
				searchFields: ['name^3', 'code^3']
				searchFields: ['name', 'code']
			}, this.textSearchConfig || {}]);

			this.textSearch = new TextImpl(this.textSearchConfig);
+7 −0
Original line number Diff line number Diff line
@@ -54,6 +54,11 @@ define([
				return;
			}

			this._showFacets();
		},

		_showFacets: function() {

			this._publish(this.facetsSearch.getChannel('SHOW'), {
				node: this.domNode
			});
@@ -75,6 +80,8 @@ define([

			this.facetsSearchConfig[prop] = value;
			this.facetsSearch = new FacetsImpl(this.facetsSearchConfig);

			this._showFacets();
		}
	});
});