Commit 07f2630c authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'feature-omitLoginRedirection' into 'dev'

Feature omit login redirection

See merge request redmic-project/client/web!36
parents 02f0a48d a1691bbd
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ define([
	, 'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'dojo/Deferred'
	, 'dojo/dom'
	, 'dojo/dom-attr'
	, 'dojo/has'
@@ -31,6 +32,7 @@ define([
	, redmicConfig
	, declare
	, lang
	, Deferred
	, dom
	, domAttr
	, has
@@ -72,6 +74,8 @@ define([
			}
		};

	getGlobalContext().env = new Deferred();

	if (!CheckBrowser.isSupported()) {
		hideNativeLoadingNode();
		getGlobalContext().location.href = '/noSupportBrowser';
@@ -273,16 +277,13 @@ define([
			var moduleUrl = location.href.split('\/' + getGlobalContext().location.hostname + '\/')[1],
				urlSplitted = moduleUrl.split('?'),
				route = urlSplitted[0],
				query = urlSplitted[1];

			if ((!route || (route === '') || (route === this.paths.ROOT)) && !this._userFound) {
				this._addHistory(this.paths.LOGIN);
				route = this.paths.LOGIN;
			} else if (!route || (route === '')  || (route === this.paths.ROOT) ||
				(route === this.paths.LOGIN && this._userFound)) {
				query = urlSplitted[1],
				routeIsEmpty = !route || route === '' || route === this.paths.ROOT,
				loginWasSuccessful = route === this.paths.LOGIN && this._userFound;

				this._addHistory(this.paths.HOME);
			if (routeIsEmpty || loginWasSuccessful) {
				route = this.paths.HOME;
				this._addHistory(route);
			}

			this._changeModule(route, query);
@@ -290,12 +291,19 @@ define([

		_getEnv: function() {

			!getGlobalContext().env && request('/env', {
			var envDfd = getGlobalContext().env;

			if (envDfd && !envDfd.isFulfilled()) {
				request('/env', {
					handleAs: 'json'
			}).then(lang.hitch(this, function(data) {
				}).then(lang.hitch(envDfd, function(data) {

				getGlobalContext().env = data;
					this.resolve(data);
				}),lang.hitch(envDfd, function(error) {

					this.reject(error);
				}));
			}
		},

		_subCredentialsRemoved: function() {
+9 −0
Original line number Diff line number Diff line
@@ -40,6 +40,15 @@ define([
					"'><img class='logo' src='/resources/images/logos/redmicSimple.png'></a>"
			});

			var envDfd = window.env;

			if (envDfd) {
				envDfd.then(lang.hitch(this, function(env) {

					put(this.domNode, 'div.versionNumber', env.version);
				}));
			}

			if (this.show.left) {
				this.leftNode = put(this.domNode, "div.manager");
			}
+11 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ define([
	, "templates/InitialTitle"
	, "templates/InitialInfo"
	, "redmic/base/Credentials"
	, "app/home/views/SocialWidget"
	, "app/home/views/WidgetLastActivity"
	, "app/home/views/WidgetFavourites"
], function(
@@ -22,6 +23,7 @@ define([
	, TemplateTitle
	, TemplateInfo
	, Credentials
	, SocialWidget
	, WidgetLastActivity
	, WidgetFavourites
){
@@ -67,7 +69,7 @@ define([
				},
				info: {
					width: 3,
					height: 2,
					height: 1,
					type: TemplateDisplayer,
					props: {
						title: this.i18n.info,
@@ -75,6 +77,14 @@ define([
						"class": "hardTexturedContainer.borderRadiusBottom",
						target: "initial_info"
					}
				},
				social: {
					width: 3,
					height: 1,
					type: SocialWidget,
					props: {
						title: this.i18n.followUs
					}
				}
			};

+76 −0
Original line number Diff line number Diff line
define([
	'app/home/views/_DashboardItem'
	, 'app/base/views/Module'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'put-selector/put'
], function(
	_DashboardItem
	, Module
	, declare
	, lang
	, put
) {

	return declare(_DashboardItem, {
		//	summary:
		//		Widget contenedor de enlaces sociales

		constructor: function(args) {

			this.config = {
				items: [{
					url: '/feedback',
					label: 'Feedback',
					icon: 'fa-envelope-o'
				},{
					url: 'https://twitter.com/redmic_oag',
					label: 'Twitter',
					icon: 'fa-twitter'
				},{
					url: 'https://www.linkedin.com/company/redmic',
					label: 'LinkedIn',
					icon: 'fa-linkedin'
				},{
					url: 'https://www.youtube.com/channel/UCLyTJ8ryUtq0A-kcxsg4InQ',
					label: 'YouTube',
					icon: 'fa-youtube'
				},{
					url: 'https://redmicdev.wordpress.com',
					label: 'WordPress',
					icon: 'fa-wordpress'
				},{
					url: 'https://docs.redmic.es',
					label: 'Docs',
					icon: 'fa-book'
				}],
				className: 'socialPanel'
			};

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

		postCreate: function() {

			this.inherited(arguments);

			this._createItems();
		},

		_createItems: function() {

			var parentNode = put(this.contentNode, 'div.' + this.className);

			for (var i = 0; i < this.items.length; i++) {
				this._createItem(parentNode, this.items[i]);
			}
		},

		_createItem: function(parentNode, item) {

			var node = put(parentNode, 'a[href=' + item.url + '][target=_blank]');

			put(node, 'i.fa.' + item.icon + '[title=' + item.label + ']');
		}
	});
});
+15 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ define([
	, 'redmic/modules/socket/_Worms'
	, 'redmic/modules/socket/Socket'
	, 'redmic/modules/socket/Task'
	, 'redmic/modules/user/LanguageSelector'
	, 'redmic/modules/user/UserArea'
], function(
	App
@@ -37,6 +38,7 @@ define([
	, _Worms
	, Socket
	, Task
	, LanguageSelector
	, UserArea
) {
	return declare([LayoutContainer, App], {
@@ -104,13 +106,19 @@ define([

			// TODO esto es un abuso, no deberíamos acceder a los nodos de un módulo desde fuera. Crear canal para
			// añadir hijos al topbar
			var topbarRightNode = this.topbar.domNode.children[1];
			//
			// TODO realmente, Topbar habría que replantearlo, ya que no es un módulo sino un ContentPane decorado.
			var topbarRightNode = this.topbar.domNode.lastChild;

			this._publish(this._buildChannel(this.notificationChannel, this.actions.SHOW), {
				node: topbarRightNode
			});

			this._publish(this._buildChannel(this.userAreaChannel, this.actions.SHOW), {
			this._publish(this.languageSelector.getChannel('SHOW'), {
				node: topbarRightNode
			});

			this._publish(this.userArea.getChannel('SHOW'), {
				node: topbarRightNode
			});
		},
@@ -166,7 +174,11 @@ define([
				parentChannel: this.ownChannel
			});

			new UserArea({
			this.userArea = new UserArea({
				parentChannel: this.ownChannel
			});

			this.languageSelector = new LanguageSelector({
				parentChannel: this.ownChannel
			});
		},
Loading