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

Trae widgets por activityCategory si no hay layout

Amplía la compatibilidad con la antigua construcción de vistas detalle
de actividad en función de su valor de activityCategory. Cuando la
actividad sí tiene definida en la config externa un valor de
detailsLayout, pero se trata de un valor que no corresponde con ninguno
de los casos contemplados, se emite un aviso y sesigue el camino legacy.
parent b83e2a52
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -25,9 +25,10 @@ define([
			// TODO medida temporal por retrocompatibilidad con activityCategory

			var currentElementId = this.pathVariableId,
				detailLayout = this.detailLayouts && this.detailLayouts[currentElementId];
				detailLayout = this.detailLayouts && this.detailLayouts[currentElementId],
				detailLayoutWidgetsCount = this._detailLayoutWidgets && this._detailLayoutWidgets.length;

			if (!detailLayout) {
			if (!detailLayout || !detailLayoutWidgetsCount) {
				this._prepareActivityCategoryCustomWidgets();
			}
		},
@@ -56,13 +57,16 @@ define([
				widgetKey = this._prepareEmbeddedContentsActivityWidgets();
			}

			if (widgetKey) {
			if (!widgetKey) {
				console.warn('Tried to get widgets for "%s" detail layout, but none found!', detailLayout);
				return;
			}

			if (widgetKey instanceof Array) {
				this._detailLayoutWidgets = this._detailLayoutWidgets.concat(widgetKey);
			} else {
				this._detailLayoutWidgets.push(widgetKey);
			}
			}
		},

		_prepareActivityCategoryCustomWidgets: function() {