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

Añade búsqueda de texto a listado de recepciones

Permite añadir un componente de búsqueda por texto con sugerencias a los
diseños de listado.

Aplica búsqueda a listado de recepciones captadas por estaciones de
seguimiento acústico, en vista detalle de actividad.
parent d190bd94
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'src/component/textSearch/_Request'
	, 'src/component/textSearch/TextSearchImpl'
], function(
	declare
	, _Request
	, TextSearchImpl
) {

	return declare([TextSearchImpl, _Request], {
		// summary:
		//   Implementación de buscador por texto con petición directa de datos.
	});
});
+68 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'src/component/textSearch/TextSearchSuggestionsRequestImpl'
], function (
	declare
	, lang
	, TextSearchSuggestionsRequestImpl
) {

	return declare(null, {
		// summary:
		//   Lógica de diseño para añadir el componente de búsqueda por texto 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.target;

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

		createDesignControllerComponents: function() {

			let inheritedComponents = this.inherited(arguments);

			const textSearch = this._createDesignTextSearchComponent(inheritedComponents.browser);

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

		_createDesignTextSearchComponent: function(browserInstance) {

			return new TextSearchSuggestionsRequestImpl(this.textSearchConfig);
		},

		populateDesignLayoutNodes: function() {

			this.inherited(arguments);

			this._addTextSearchToBrowser();
		},

		_addTextSearchToBrowser: function() {

			const instance = this.getComponentInstance('textSearch'),
				node = this.getLayoutNode('keypad');

			this._publish(instance.getChannel('SHOW'), {node});
		},

		_onTargetPropSet: function(changeObj) {

			this.inherited(arguments);

			const instance = this.getComponentInstance('textSearch'),
				target = changeObj.newValue;

			this._publish(instance.getChannel('SET_PROPS'), {target});
		}
	});
});
+10 −3
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ define([
	, 'src/design/browser/_AddFacetComponent'
	, 'src/design/browser/_AddOrderBarComponent'
	, 'src/design/browser/_AddPaginationBarComponent'
	, 'src/design/browser/_AddTextSearchComponent'
	, 'src/design/browser/_AddTotalBarComponent'
	, 'src/design/browser/_BrowserWithTopbarAndFilterPanelDesignLayout'
	, 'src/redmicConfig'
@@ -24,6 +25,7 @@ define([
	, _AddFacetComponent
	, _AddOrderBarComponent
	, _AddPaginationBarComponent
	, _AddTextSearchComponent
	, _AddTotalBarComponent
	, _BrowserWithTopbarAndFilterPanelDesignLayout
	, redmicConfig
@@ -33,7 +35,7 @@ define([
) {

	return declare([_Module, _Show, _Store, _BrowserWithTopbarAndFilterPanelDesignLayout, _AddTotalBarComponent,
		_AddOrderBarComponent, _AddPaginationBarComponent, _AddFacetComponent], {
		_AddOrderBarComponent, _AddPaginationBarComponent, _AddFacetComponent, _AddTextSearchComponent], {
		//	summary:
		//		Widget para mostrar un listado de las observaciones registradas en el punto seleccionado.

@@ -83,7 +85,10 @@ define([
			}]);

			this.textSearchConfig = this._merge([{
				showExpandIcon: true
				getSuggestionsPathParams: () => ({
					activityid: this.pathVariableId,
					receptorid: this._stationId
				}),
			}, this.textSearchConfig || {}]);

			this.compositeConfig = this._merge([this.compositeConfig || {}, {
@@ -126,9 +131,11 @@ define([

		_requestObservationEvents: function(stationData) {

			this._stationId = stationData.id;

			const path = {
				activityid: this.pathVariableId,
				receptorid: stationData.id
				receptorid: this._stationId
			};

			const dataDefinitionId = this._getDataDefinitionId(stationData);