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

Revisa comprobaciones de recepción, corrige WoRMS

Actualiza muchas comprobaciones de target al recibir datos, ya que ahora
se recibe de manera diferente.

Recupera el módulo de carga de datos de especies desde WoRMS, que
actualmente no estaba funcionando.
parent 8d3318c7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -96,9 +96,9 @@ define([
			}
		},

		_itemAvailable: function(response) {
		_itemAvailable: function(response, resWrapper) {

			if (response.target == this.target) {
			if (resWrapper.target === this.target) {
				var item = lang.clone(response.data);

				if (this.type === "copy") {
+2 −2
Original line number Diff line number Diff line
@@ -57,9 +57,9 @@ define([
			this._emitGetActivity();
		},

		_itemGetActivityDataAvailable: function(res) {
		_itemGetActivityDataAvailable: function(res, resWrapper) {

			var target = res.target,
			var target = resWrapper.target,
				data = res.data;

			if (this.activityTarget === target) {
+2 −2
Original line number Diff line number Diff line
@@ -26,9 +26,9 @@ define([
			aspect.before(this, "_itemAvailable", lang.hitch(this, this._itemActivityAvailable));
		},

		_itemActivityAvailable: function(res) {
		_itemActivityAvailable: function(res, resWrapper) {

			var target = res.target,
			var target = resWrapper.target,
				data = res.data;

			if (this.activityTarget === target) {
+3 −4
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ define([

			/* Seteamos los documentos obtenidos a partir de la consulta en el grid de la derecha*/
			if (response && response.data) {
				var data = response.data.data;
				var data = response.data.data || response.data;
				for (var i = 0; i < data.length; i++) {
					var item = data[i].documents[0].document;
					if (item) {
@@ -405,13 +405,12 @@ define([
			}
		},

		_itemAvailable: function(response) {
		_itemAvailable: function(response, resWrapper) {

			this.inherited(arguments);

			if (response.target === this.target[1]){
			if (resWrapper.target === this.target[1]) {
				this._dataToDocuments(response);
				return;
			}
		},

+9 −27
Original line number Diff line number Diff line
@@ -2,21 +2,20 @@ define([
	"app/components/steps/MainDataStep"
	, "app/designs/externalTextSearchList/main/Worms"
	, "app/redmicConfig"
	, "dijit/layout/ContentPane"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "dojo/aspect"
	, "redmic/layout/DialogSimple"
	, "redmic/modules/base/_ShowInPopup"
], function(
	MainDataStep
	, Worms
	, redmicConfig
	, ContentPane
	, declare
	, lang
	, aspect
	, DialogSimple
	, _ShowInPopup
) {

	return declare(MainDataStep, {
		//	summary:
		//		Step de SpeciesMainData.
@@ -56,9 +55,9 @@ define([

		_initializeSpeciesMain: function() {

			this.worms = new Worms({
			this.worms = new declare([Worms]).extend(_ShowInPopup)({
				parentChannel: this.getChannel(),
				notificationSuccess: false
				title: this.i18n.worms
			});
		},

@@ -99,21 +98,6 @@ define([
				});
			}));

			this.wormsNode = new ContentPane({
				region: "center"
			});

			this.wormsDialog = new DialogSimple({
				title: this.i18n.worms,
				centerContent: this.wormsNode,
				width: 4,
				height: "md",
				reposition: "e",
				onHide: lang.hitch(this, this._hideWormsTool)
			});

			this.wormsDialog.own(this.domNode);

			this.inherited(arguments);
		},

@@ -150,7 +134,6 @@ define([
		_hideWormsTool: function() {

			this._publish(this.worms.getChannel("HIDE"));
			this.wormsDialog.hide();
		},

		_searchByScientificName: function() {
@@ -175,7 +158,7 @@ define([
				this._ownRequestWorms = false;

				var showInfo = {
					node: this.wormsNode.domNode
					//node: this.wormsNode.domNode
				};

				if (res.value) {
@@ -187,7 +170,6 @@ define([
				}

				this._publish(this.worms.getChannel("SHOW"), showInfo);
				this.wormsDialog.show();
			}
		}
	});
Loading