Commit 9f759b27 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Elimina reemplazo redundante de variables en URLs

Se omite la espera por valores de entorno y el reemplazo de variables
presentes en las rutas a los servicios. Esta tarea recae sobre
RestManager en todos los casos en los que interviene.

Sin embargo, no todos los casos se reducen a esto, ya que hay algunas
funciones que no son responsabilidad de RestManager (Socket y Dropzone,
así como la vista de confirmar token que no es módulo aún). Estos
continuan tal y como estaban.

Fix #48.
parent 977332bb
Loading
Loading
Loading
Loading
+7 −16
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ define([
					_onSubmitResetting: lang.hitch(this, this._onSubmitResetting),
					_onCloseResetting: lang.hitch(this, this._onCloseResetting),
					_confirmValidator: lang.hitch(this, this._confirmValidator)
				}
				},
				target: redmicConfig.services.resettingSetPassword
			};

			lang.mixin(this, this.config, args);
@@ -79,21 +80,11 @@ define([
					token: this.token
				};

			var envDfd = window.env;
			if (!envDfd) {
				return;
			}

			envDfd.then(lang.hitch(this, function(data, envData) {

				this.target = redmicConfig.getServiceUrl(redmicConfig.services.resettingSetPassword, envData);

			this._emitEvt('REQUEST', {
				target: this.target,
				method: 'POST',
				query: data
			});
			}, data));
		},

		_dataAvailable: function(res, resWrapper) {
+7 −16
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ define([
					i18n: this.i18n,
					_onCloseResettingPassword: lang.hitch(this, this._onCloseResettingPassword),
					_onSubmitResettingPassword: lang.hitch(this, this._onSubmitResettingPassword)
				}
				},
				target: redmicConfig.services.resettingRequest
			};

			lang.mixin(this, this.config, args);
@@ -84,21 +85,11 @@ define([

			var value = form.get("value");

			var envDfd = window.env;
			if (!envDfd) {
				return;
			}

			envDfd.then(lang.hitch(this, function(value, envData) {

				this.target = redmicConfig.getServiceUrl(redmicConfig.services.resettingRequest, envData);

			this._emitEvt('REQUEST', {
				target: this.target,
				method: 'POST',
				query: value
			});
			}, value));
		},

		_dataAvailable: function(res, resWrapper) {
+4 −11
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ define([
					REQUEST_FAILED: 'requestFailed'
				},

				target: redmicConfig.services.profile,
				_loginPath: '/login'
			};

@@ -184,17 +185,9 @@ define([
			//	tags:
			//		private

			var envDfd = window.env;
			if (envDfd) {
				envDfd.then(lang.hitch(this, function(envData) {

					this.target = redmicConfig.getServiceUrl(redmicConfig.services.profile, envData) + '/';

			this._emitEvt('GET', {
				target: this.target
			});
				}));
			}
		},

		_itemAvailable: function(res) {
+1 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ define([
				'class': 'userArea',
				idProperty: 'id',
				profileTarget: redmicConfig.services.profile,
				_logoutTarget: redmicConfig.services.logout,
				repositoryUrl: 'https://gitlab.com/redmic-project/client/web'
			};

@@ -84,7 +85,6 @@ define([
				if (this._checkUserIsRegistered()) {
					this._initializeRegisteredUserArea(infoItem, versionItem);

					this._logoutTarget = redmicConfig.getServiceUrl(redmicConfig.services.logout, envData);
					this.target.push(this._logoutTarget);
					// TODO se reemplaza la terminación de la ruta al servidor porque las imágenes de los usuarios ya
					// la contienen. Cuando se corrija esta circunstancia, eliminar el reemplazo