Commit 33739bbe authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'release-0.20.0' into 'master'

Release 0.20.0

Closes #50, #44, #46, #48, and #45

See merge request redmic-project/client/web!84
parents d0afc83d ff104ffa
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -109,21 +109,16 @@ prepare-built-version:
      - dist*.tar.gz

.deploy:
  script:
    - >
      deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE}
      PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} OAUTH_URL=${OAUTH_URL} OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
      API_URL=${API_URL} PRODUCTION=${PRODUCTION}
  environment:
    url: https://${PUBLIC_HOSTNAME}

.deploy-development:
  variables:
    PRODUCTION: 0
    DD_PRODUCTION: 0

.deploy-production:
  variables:
    PRODUCTION: 1
    DD_PRODUCTION: 1

run-functional-tests:
  stage: test-deploy
+3 −1
Original line number Diff line number Diff line
@@ -35,12 +35,14 @@ services:
        traefik.port: '${PORT}'
      restart_policy:
        delay: 10s
        window: 1m
      update_config:
        delay: 10s
      resources:
        limits:
          cpus: '1'
          memory: 128M
        reservations:
          cpus: '0.001'
          memory: 64M

networks:
+1 −1
Original line number Diff line number Diff line
{
  "name": "REDMIC",
  "version": "0.19.6",
  "version": "0.20.0",
  "author": "REDMIC",
  "homepage": "https://gitlab.com/redmic-project/client/web/blob/master/README.md",
  "description": "Integrated marine data repository of Canary Islands - Client",
+0 −76
Original line number Diff line number Diff line
define([
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'dojo/Deferred'
	, 'dojo/json'
	, 'dojo/request'
], function(
	redmicConfig
	, declare
	, lang
	, Deferred
	, JSON
	, request
){
	return declare(null, {
		//	summary:
		//		Funcionalidades de persistencia para el modelo.
		//	description:
		//		Proporciona método 'save' al modelo.

		constructor: function(args) {

			this.config = {
				headers: {
					'Content-Type': 'application/json',
					'Accept': 'application/javascript, application/json'
				},
				handleAs: 'json'
			};

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

		save: function() {

			if (!this.isValid) {
				console.error('Tried to save invalid model \'%s\' with this schema:', this.get('modelName'),
					this.get('schema'));

				return;
			}

			if (!this.hasChanged) {
				console.error('Tried to save unchanged model \'%s\' with this schema:', this.get('modelName'),
					this.get('schema'));

				return;
			}

			var envDfd = window.env,
				dfd = new Deferred();

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

					var id = this.getIdValue(),
						method = this.get('isNew') ? 'POST' : 'PUT',
						data = JSON.stringify(this.serialize()),
						target = redmicConfig.getServiceUrl(this.target, envData) + '/';

					var reqDfd = request(id ? target + id : target, {
						headers: this.headers,
						handleAs: this.handleAs,
						method: method,
						data: data
					});

					reqDfd.then(lang.hitch(retDfd, retDfd.resolve), lang.hitch(retDfd, retDfd.reject));
				}, dfd));
			}

			return dfd;
		}
	});
});
+78 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'dojo/aspect'
	, 'redmic/modules/base/_ListenQueryParams'
	, 'redmic/modules/base/_Selection'
], function(
	declare
	, lang
	, aspect
	, _ListenQueryParams
	, _Selection
) {

	return declare([_Selection, _ListenQueryParams], {
		//	summary:
		//		Reconoce un identificador de settings para aplicarlos a la vista actual.

		constructor: function(args) {

			this.config = {
				settingsHandlerActions: {
					CLONE_SELECTION: 'cloneSelection'
				},
				settingsHandlerEvents: {
					CLONE_SELECTION: 'cloneSelection'
				}
			};

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

			aspect.before(this, '_mixEventsAndActions', this._mixSettingsHandlerEventsAndActionsView);
			aspect.after(this, '_definePublications', this._defineSettingsHandlerPublications);
		},

		_mixSettingsHandlerEventsAndActionsView: function() {

			lang.mixin(this.events, this.settingsHandlerEvents);
			lang.mixin(this.actions, this.settingsHandlerActions);
			delete this.settingsHandlerEvents;
			delete this.settingsHandlerActions;
		},

		_defineSettingsHandlerPublications: function() {

			this.publicationsConfig.push({
				event: 'CLONE_SELECTION',
				channel: this._buildChannel(this.selectorChannel, this.actions.CLONE_SELECTION)
			});
		},

		postCreate: function() {

			this.inherited(arguments);

			this._emitEvt('GET_QUERY_PARAMS');
		},

		_gotQueryParam: function(param, value) {

			if (param === 'settings-id') {
				this._onSettingsIdReceived(value);
			}
		},

		_onSettingsIdReceived: function(settingsId) {

			this._emitEvt('CLEAR_SELECTION', {
				omitPersistence: true
			});

			this._emitEvt('CLONE_SELECTION', {
				target: this.selectionTarget || this.target,
				id: settingsId
			});
		}
	});
});
Loading