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

Deshace prueba en home, retoca sintaxis

parent 707d5d9a
Loading
Loading
Loading
Loading
+16 −18
Original line number Diff line number Diff line
@@ -10,9 +10,7 @@ define([

	return declare([_Module, _RestManagerItfc], {
		// summary:
		//		Módulo encargado de la entrada/salida con respecto a servicios externos.
		//	description:
		//		Permite manejar las peticiones de datos y su respuesta, así como las operaciones de escritura y borrado.
		//   Componente encargado de la entrada/salida de datos, para consulta, escritura y borrado.

		postMixInProperties: function() {

@@ -58,7 +56,7 @@ define([
		_defineSubscriptions: function () {

			const options = {
				predicate: (req) => this._chkTargetIsValid(req)
				predicate: req => this._chkTargetIsValid(req)
			};

			this.subscriptionsConfig.push({
@@ -85,13 +83,13 @@ define([
				channel: this.getChannel('SAVE'),
				callback: '_subSave',
				options: {
					predicate: (req) => this._chkValidSaveRequest(req)
					predicate: req => this._chkValidSaveRequest(req)
				}
			},{
				channel: this.getChannel('REMOVE'),
				callback: '_subRemove',
				options: {
					predicate: (req) => this._chkValidRemoveRequest(req)
					predicate: req => this._chkValidRemoveRequest(req)
				}
			});
		},
@@ -121,7 +119,7 @@ define([
				channel: this.getChannel('TARGET_LOADED')
			},{
				event: 'ABORT_ALL_LOADING',
				channel: this._buildChannel(this.loadingChannel, this.actions.ABORT_ALL_LOADING)
				channel: this._buildChannel(this.loadingChannel, 'ABORT_ALL_LOADING')
			});
		},

@@ -138,8 +136,8 @@ define([
				notifyError = true;

			this._performGet(req, requesterChannel).then(
				(res) => this._handleSuccess({ evtName, notifySuccess }, req, res),
				(res) => this._handleError({ evtName, notifyError }, req, res));
				res => this._handleSuccess({ evtName, notifySuccess }, req, res),
				res => this._handleError({ evtName, notifyError }, req, res));
		},

		_subRequest: function(req, _mediatorChannel, componentInfo) {
@@ -155,15 +153,15 @@ define([
				notifyError = true;

			this._performRequest(req, requesterChannel).then(
				(res) => this._handleSuccess({ evtName, notifySuccess }, req, res),
				(res) => this._handleError({ evtName, notifyError }, req, res));
				res => this._handleSuccess({ evtName, notifySuccess }, req, res),
				res => this._handleError({ evtName, notifyError }, req, res));
		},

		_subInjectItem: function(req) {

			const res = {
				status: 200,
				data: req.data || {}
				data: req.data ?? {}
			};

			const evtName = 'GET',
@@ -176,7 +174,7 @@ define([

			const res = {
				status: 200,
				data: req.data || []
				data: req.data ?? []
			};

			// TODO esta variable no se usa, eliminarla o asignarla a req o res?
@@ -234,8 +232,8 @@ define([
				notifyError = true;

			this._performSave(req).then(
				(res) => this._handleSuccess({ evtName, notifySuccess }, req, res),
				(res) => this._handleError({ evtName, notifyError }, req, res));
				res => this._handleSuccess({ evtName, notifySuccess }, req, res),
				res => this._handleError({ evtName, notifyError }, req, res));
		},

		_chkValidRemoveRequest: function(req) {
@@ -262,8 +260,8 @@ define([
				notifyError = true;

			this._performRemove(req).then(
				(res) => this._handleSuccess({ evtName, notifySuccess }, req, res),
				(res) => this._handleError({ evtName, notifyError }, req, res));
				res => this._handleSuccess({ evtName, notifySuccess }, req, res),
				res => this._handleError({ evtName, notifyError }, req, res));
		},

		_emitLoading: function(req) {
+2 −9
Original line number Diff line number Diff line
@@ -20,14 +20,7 @@ define([

	return declare([RestManager, _Send, _Receive, _Auth, _Params], {
		// summary:
		//		Implementación del módulo RestManager, que provee métodos de comunicación mediante dojo/request/xhr.
		//	description:
		//		También maneja errores de permisos en peticiones y les añade cabeceras de autenticación.
		//		Importante: el campo 'options' recibido en las peticiones desde otros módulos, sobreescribe directamente
		//		las opciones que se usarán a su vez para realizar la petición HTTP.

		//	apiUrl: String
		//		Prefijo de rutas hacia el servidor.
		//   Implementación del componente RestManager, que provee comunicación mediante dojo/request/xhr.

		postCreate: function() {

+9 −9
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ define([
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/layout/dataDisplayer/DataDisplayer'
	, 'src/component/textSearch/TextSearchSuggestionsExpansionRequestImpl'
	, 'src/component/search/TextImpl'
], function(
	redmicConfig
	, declare
@@ -15,7 +15,7 @@ define([
	, _Module
	, _Show
	, DataDisplayer
	, TextSearchSuggestionsExpansionRequestImpl
	, TextImpl
) {

	return declare([_Module, _Show, _Filter], {
@@ -51,15 +51,15 @@ define([
			this.textSearchConfig = this._merge([{
				parentChannel: this.getChannel(),
				target: this.target,
				suggestionsRequestMethod: 'POST',
				suggestionsTarget: `${this.target}/_suggest`,
				getSuggestionsQueryParams: value => ({suggest: {text: value}})
				//queryChannel: this.queryChannel,
				//legacyMode: false,
				//showExpandIcon: true
				//suggestionsRequestMethod: 'POST',
				//suggestionsTarget: `${this.target}/_suggest`,
				//getSuggestionsQueryParams: value => ({suggest: {text: value}})
				queryChannel: this.queryChannel,
				legacyMode: false,
				showExpandIcon: true
			}, this.textSearchConfig || {}]);

			this.textSearch = new TextSearchSuggestionsExpansionRequestImpl(this.textSearchConfig);
			this.textSearch = new TextImpl(this.textSearchConfig);

			this._infoInstance = new DataDisplayer({
				parentChannel: this.getChannel(),