Commit 16f132fd authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Centraliza definición de agregaciones y otros

Mueve a redmicConfig todas las definiciones de agregaciones usadas en
consulta por Facets, para evitar la fragmentación y la repetición de
código.

Mueve algunas definiciones de campos a retornar, ya que también es algo
fuertemente ligado a los servicios, por lo que tiene sentido que se
encuentren centralizadas en redmicConfig también. Sólo se han movido las
localizadas mientras se centralizaban las aggs.

Abre por defecto los listados de Facets, para facilitar su lectura.
parent 8ae8bd5a
Loading
Loading
Loading
Loading
+2 −17
Original line number Diff line number Diff line
@@ -64,22 +64,7 @@ define([
			}, this.browserConfig || {}]);

			this.facetsConfig = this._merge([{
				aggs: {
					"sex": {
						'open': true,
						"terms": {
							"field": "sex.name",
							"size": 20
						}
					},
					"lifeStage": {
						'open': true,
						"terms": {
							"field": "lifeStage.name",
							"size": 20
						}
					}
				}
				aggs: redmicConfig.aggregations.animal
			}, this.facetsConfig || {}]);
		}
	});
+1 −16
Original line number Diff line number Diff line
@@ -65,22 +65,7 @@ define([
			}, this.browserConfig || {}]);

			this.facetsConfig = this._merge([{
				aggs:  {
					"organisation": {
						"terms": {
							"field": "affiliation.name",
							"size": 20
						}
					}
				},
				fieldFacet: {
					'organisation': {
						'open': true
					}
				},
				prefixFieldFacet: "",
				suffixFieldFacet: ".firstName",
				openFacets: true
				aggs: redmicConfig.aggregations.contact
			}, this.facetsConfig || {}]);
		}
	});
+4 −10
Original line number Diff line number Diff line
define([
	'app/designs/textSearchFacetsList/main/Administrative'
	, 'app/base/views/extensions/_EditionWizardView'
	, 'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'templates/DeviceList'
], function(
	AdministrativeMain
	, _EditionWizardView
	, redmicConfig
	, declare
	, lang
	, templateList
@@ -54,15 +56,7 @@ define([
			}, this.browserConfig || {}]);

			this.facetsConfig = this._merge([{
				aggs: {
					'deviceType': {
						'open': true,
						'terms': {
							'field': 'deviceType.name',
							'size': 20
						}
					}
				}
				aggs: redmicConfig.aggregations.device
			}, this.facetsConfig || {}]);
		}
	});
+4 −16
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ define([
	"app/designs/base/_Main"
	, "app/designs/textSearchFacetsList/Controller"
	, "app/designs/textSearchFacetsList/Layout"
	, 'app/redmicConfig'
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "templates/DocumentList"
@@ -13,6 +14,7 @@ define([
	_Main
	, Controller
	, Layout
	, redmicConfig
	, declare
	, lang
	, templateList
@@ -42,7 +44,7 @@ define([
		_setMainConfigurations: function() {

			this.filterConfig = this._merge([{
				returnFields: ['id', 'title', 'author', 'year', 'documentType', 'language', 'url']
				returnFields: redmicConfig.returnFields.document
			}, this.filterConfig || {}]);

			this.browserConfig = this._merge([{
@@ -67,21 +69,7 @@ define([
			}, this.browserConfig || {}]);

			this.facetsConfig = this._merge([{
				aggs:  {
					"documentType": {
						"terms": {
							"field": "documentType.name",
							"size": 100
						}
					},
	 				"language": {
	 					"terms": {
	 						"field": "language",
							"size": 20
	 					}
	 				}
				},
				openFacets: true
				aggs: redmicConfig.aggregations.document
			}, this.facetsConfig || {}]);
		}
	});
+4 −10
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ define([
	"app/designs/base/_Main"
	, "app/designs/textSearchFacetsList/Controller"
	, "app/designs/textSearchFacetsList/Layout"
	, 'app/redmicConfig'
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "templates/OrganisationList"
@@ -13,6 +14,7 @@ define([
	_Main
	, Controller
	, Layout
	, redmicConfig
	, declare
	, lang
	, templateList
@@ -40,7 +42,7 @@ define([
		_setMainConfigurations: function() {

			this.filterConfig = this._merge([{
				returnFields: ['id', 'name', 'acronym', 'logo', 'organisationType', 'webpage']
				returnFields: redmicConfig.returnFields.organisation
			}, this.filterConfig || {}]);

			this.browserConfig = this._merge([{
@@ -64,15 +66,7 @@ define([
			}, this.browserConfig || {}]);

			this.facetsConfig = this._merge([{
				aggs:  {
					"organisationType": {
						'open': true,
						"terms": {
							"field": "organisationType.name",
							"size": 20
						}
					}
				}
				aggs: redmicConfig.aggregations.organisation
			}, this.facetsConfig || {}]);
		}
	});
Loading