Commit 63f70df3 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Mueve widget de tracking, permite ajustar detalles

Comienza en modo tiempo para tracking integrado en vista detalle.

Mueve definición de widget para vista detalle al nuevo directorio,
eliminando vista detalle anidada innecesaria.
parent 39dada47
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'app/designs/details/main/ActivityTrackingMap'
	, 'src/detail/activity/widget/ActivityTrackingMap'
	, 'app/details/views/ActivityAreaMapBase'
	, 'app/details/views/ActivityCitationMapBase'
	, 'src/detail/activity/widget/ActivityFixedObservationSeriesList'
+96 −0
Original line number Diff line number Diff line
define([
	"app/designs/base/_Main"
	, "app/designs/details/Controller"
	, "app/designs/details/Layout"
	, "app/designs/mapWithSideContent/main/Tracking"
	"app/designs/mapWithSideContent/main/Tracking"
	, "app/designs/mapWithSideContent/main/_TrackingWithListByFilter"
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/base/_Store'
	, 'src/redmicConfig'
	, "dojo/_base/declare"
	, "dojo/_base/lang"
], function(
	_Main
	, Controller
	, Layout
	, Tracking
	Tracking
	, _TrackingWithListByFilter
	, _Module
	, _Show
	, _Store
	, redmicConfig
	, declare
	, lang
) {

	return declare([Layout, Controller, _Main], {
	return declare([_Module, _Show, _Store], {
		//	summary:
		//		Vista detalle de Activity tracking.
		//

		constructor: function(args) {

			this.config = {
				_titleRightButtonsList: [],
				noScroll: true,
				propsWidget: {
					omitTitleBar: true,
					resizable: false
				},

				baseTargetChildren: redmicConfig.services.elementsTrackingActivity,
				target: [redmicConfig.services.activity],
				activityCategory: ["at", "pt"]
				target: [redmicConfig.services.activity]
			};

			lang.mixin(this, this.config, args);

			if (this.usePrivateTarget) {
				this.baseTargetChildren = redmicConfig.services.privateElementsTrackingActivity;
			} else {
				this.baseTargetChildren = redmicConfig.services.elementsTrackingActivity;
			}
		},

		_setMainConfigurations: function() {
		_setOwnCallbacksForEvents: function() {

			this.widgetConfigs = this._merge([{
				tracking: {
					width: 6,
					height: 6,
					type: declare([Tracking, _TrackingWithListByFilter]),
					props: {
						classWindowContent: "view",
						usePrivateTarget: this.usePrivateTarget
					}
				}
			}, this.widgetConfigs || {}]);
			this._onEvt('ME_OR_ANCESTOR_SHOWN', lang.hitch(this, this._onMeOrAncestorShown));
			this._onEvt('ME_OR_ANCESTOR_HIDDEN', lang.hitch(this, this._onMeOrAncestorHidden));
		},

		_clearModules: function() {
		_initialize: function() {

			var widgetInstance = this._getWidgetInstance('tracking');
			this._publish(widgetInstance.getChannel("CLEAR"));
			this._trackingMap = new declare([Tracking, _TrackingWithListByFilter])({
				parentChannel: this.getChannel(),
				usePrivateTarget: this.usePrivateTarget,
				timeMode: true,
				defaultTrackingMode: 1
			});
		},

		_refreshModules: function() {
		getNodeToShow: function() {

			return this._trackingMap.getNodeToShow();
		},

		_onMeOrAncestorShown: function() {

			this._refreshCurrentData();
		},

		_onMeOrAncestorHidden: function() {

			this._publish(this._trackingMap.getChannel('CLEAR'));
		},

			this._checkPathVariableId();
		_refreshCurrentData: function() {

			var widgetInstance = this._getWidgetInstance('tracking');
			this._publish(widgetInstance.getChannel("SET_PROPS"), {
			this._publish(this._trackingMap.getChannel("SET_PROPS"), {
				pathVariableId: this.pathVariableId
			});

@@ -87,8 +87,7 @@ define([

			this.target[1] = target;

			var widgetInstance = this._getWidgetInstance('tracking');
			this._publish(widgetInstance.getChannel("UPDATE_TARGET"), {
			this._publish(this._trackingMap.getChannel("UPDATE_TARGET"), {
				target: target,
				refresh: true
			});
+11 −8
Original line number Diff line number Diff line
@@ -94,7 +94,9 @@ define([
				_layerIdPrefix: "tracking",
				layerIdSeparator: "_",
				_deltaProgress: 3600000,
				formTemplate: 'viewers/views/templates/forms/Tracking'
				formTemplate: 'viewers/views/templates/forms/Tracking',
				timeMode: false,
				defaultTrackingMode: 0
			};

			lang.mixin(this, this.config, args);
@@ -110,7 +112,8 @@ define([
				parentChannel: this.getChannel(),
				template: this.formTemplate,
				formContainerConfig: {
					loadInputs: lang.hitch(this, this._loadInputsFormAndShow)
					loadInputs: lang.hitch(this, this._loadInputsFormAndShow),
					defaultTrackingMode: this.defaultTrackingMode
				}
			}, this.formConfig || {}]);

@@ -465,7 +468,7 @@ define([
			var value = res.value,
				animate = false;

			if (this._timeMode) {
			if (this.timeMode) {
				if (!value._isAMomentObject) {
					value = moment(value);
				}
@@ -510,7 +513,7 @@ define([
				for (var lineId in layerItem) {
					var lineItem = layerItem[lineId];

					if (!this._timeMode) {
					if (!this.timeMode) {
						var count = lineItem.count;

						if (!Utilities.isValidNumber(max) || count > max) {
@@ -532,7 +535,7 @@ define([

			return {
				max: max || 0,
				min: !this._timeMode ? 0 : min || 0
				min: !this.timeMode ? 0 : min || 0
			};
		},

@@ -572,7 +575,7 @@ define([

			this._deltaProgress = value;

			if (this._timeMode) {
			if (this.timeMode) {
				this._emitEvt('SET_PROGRESS_DELTA', {
					value: this._deltaProgress
				});
@@ -589,11 +592,11 @@ define([
			});

			if (newMode === '0') {
				this._timeMode = false;
				this.timeMode = false;
				delta = 1;
				this._publish(this._buildChannel(this.inputsForm.interval.channel, this.actions.HIDE));
			} else {
				this._timeMode = true;
				this.timeMode = true;
				this._publish(this._buildChannel(this.inputsForm.interval.channel, this.actions.SHOW));
				delta = this._deltaProgress;
			}
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
				values: ['0', '1'],
				labels: ['stepByStepMode', 'timeMode'],
				descriptions: ['${i18n.stepByStepModeInfo}.', '${i18n.timeModeInfo}.'],
				checked: '0'
				checked: '${defaultTrackingMode}'
			"></div>
		</fieldset>