Commit e57edcd0 authored by Moises Sacal's avatar Moises Sacal
Browse files

updating link with no permissions for issue #21

parent 1afe3e5e
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
"testTsconfig": "tsconfig.spec.json", "testTsconfig": "tsconfig.spec.json",
"prefix": "app", "prefix": "app",
"styles": [ "styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css" "styles.css"
], ],
"scripts": [], "scripts": [
"../node_modules/jquery/dist/jquery.min.js"
],
"environmentSource": "environments/environment.ts", "environmentSource": "environments/environment.ts",
"environments": { "environments": {
"dev": "environments/environment.ts", "dev": "environments/environment.ts",
......
...@@ -23,53 +23,6 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ...@@ -23,53 +23,6 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
cache-loader@1.2.5
MIT
Copyright JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@angular-devkit/build-optimizer@0.3.2
MIT
The MIT License
Copyright (c) 2017 Google, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
lodash@4.17.11 lodash@4.17.11
MIT MIT
Copyright JS Foundation and other contributors <https://js.foundation/> Copyright JS Foundation and other contributors <https://js.foundation/>
...@@ -1267,6 +1220,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ...@@ -1267,6 +1220,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
@types/leaflet@1.2.6
MIT
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
mobx-angular@2.1.1 mobx-angular@2.1.1
MIT MIT
The MIT License (MIT) The MIT License (MIT)
...@@ -1341,44 +1318,29 @@ maintained libraries used by this software which have their own ...@@ -1341,44 +1318,29 @@ maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the licenses; we recommend you read them, as their terms may differ from the
terms above. terms above.
jquery@3.3.1 @types/jquery@3.3.4
MIT MIT
Copyright JS Foundation and other contributors, https://js.foundation/ MIT License
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be Copyright (c) Microsoft Corporation. All rights reserved.
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Permission is hereby granted, free of charge, to any person obtaining a copy
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF of this software and associated documentation files (the "Software"), to deal
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND in the Software without restriction, including without limitation the rights
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION copies of the Software, and to permit persons to whom the Software is
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION furnished to do so, subject to the following conditions:
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==== The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
All files located in the node_modules and external directories are THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
externally maintained libraries used by this software which have their IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
own licenses; we recommend you read them, as their terms may differ from FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
the terms above. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
angular2-markdown@1.6.0 angular2-markdown@1.6.0
MIT MIT
...@@ -2171,35 +2133,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ...@@ -2171,35 +2133,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
zone.js@0.8.26 zone.js@0.8.14
MIT MIT
The MIT License The MIT License
Copyright (c) 2016-2018 Google, Inc. Copyright (c) 2016 Google, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
bootstrap@3.3.7
MIT
The MIT License (MIT)
Copyright (c) 2011-2016 Twitter, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Labarchives</title><base href="/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><link href="styles.bundle.css" rel="stylesheet"/></head><body><labarchives></labarchives><script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><title>Labarchives</title><base href="/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><link href="styles.bundle.css" rel="stylesheet"/></head><body><labarchives></labarchives><script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="scripts.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body></html>
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -12,20 +12,20 @@ ...@@ -12,20 +12,20 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^5.2.0", "@angular/animations": "5.2.11",
"@angular/common": "^5.2.0", "@angular/common": "5.2.11",
"@angular/compiler": "^5.2.0", "@angular/compiler": "5.2.11",
"@angular/core": "^5.2.0", "@angular/core": "5.2.11",
"@angular/forms": "^5.2.0", "@angular/forms": "5.2.11",
"@angular/http": "^5.2.0", "@angular/http": "5.2.11",
"@angular/platform-browser": "^5.2.0", "@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "^5.2.0", "@angular/platform-browser-dynamic": "5.2.11",
"@angular/router": "^5.2.0", "@angular/router": "5.2.11",
"angular-tree-component": "7.2.0",
"angular2-markdown": "1.6.0",
"@asymmetrik/ngx-leaflet": "2.5.3", "@asymmetrik/ngx-leaflet": "2.5.3",
"@asymmetrik/ngx-leaflet-draw": "2.6.1", "@asymmetrik/ngx-leaflet-draw": "2.6.1",
"bootstrap": "^3.3.7", "angular-tree-component": "7.2.0",
"angular2-markdown": "1.6.0",
"bootstrap": "3.3.7",
"classlist.js": "1.1.20150312", "classlist.js": "1.1.20150312",
"core-js": "2.4.1", "core-js": "2.4.1",
"jquery": "3.3.1", "jquery": "3.3.1",
...@@ -38,29 +38,32 @@ ...@@ -38,29 +38,32 @@
"ng2-datetime": "git+https://github.com/madwebs/ng2-datetime.git", "ng2-datetime": "git+https://github.com/madwebs/ng2-datetime.git",
"ngx-bootstrap": "2.0.3", "ngx-bootstrap": "2.0.3",
"ngx-i18next": "1.1.8", "ngx-i18next": "1.1.8",
"rxjs": "^5.5.6", "rxjs": "5.5.12",
"zone.js": "^0.8.19",
"ts-smart-logger": "0.0.4", "ts-smart-logger": "0.0.4",
"uppy": "0.23.3" "uppy": "0.23.3",
"zone.js": "0.8.14"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "1.7.4", "@angular/cli": "1.7.4",
"@angular/compiler-cli": "5.2.11", "@angular/compiler-cli": "5.2.11",
"@angular/language-service": "5.2.11", "@angular/language-service": "5.2.11",
"@types/jasmine": "~2.8.9", "@types/jasmine": "2.5.53",
"@types/jasminewd2": "~2.0.2", "@types/jasminewd2": "2.0.2",
"@types/node": "~6.0.60", "@types/jquery": "3.3.4",
"codelyzer": "^4.0.1", "@types/leaflet": "1.2.6",
"jasmine-core": "~2.8.0", "@types/leaflet-draw": "0.4.11",
"jasmine-spec-reporter": "~4.2.1", "@types/node": "6.0.60",
"karma": "~2.0.0", "codelyzer": "3.0.1",
"karma-chrome-launcher": "~2.2.0", "jasmine-core": "2.6.2",
"karma-coverage-istanbul-reporter": "^1.2.1", "jasmine-spec-reporter": "4.1.0",
"karma-jasmine": "~1.1.0", "karma": "1.7.0",
"karma-jasmine-html-reporter": "^0.2.2", "karma-chrome-launcher": "2.1.1",
"protractor": "~5.1.2", "karma-cli": "1.0.1",
"ts-node": "~4.1.0", "karma-jasmine": "1.1.0",
"tslint": "~5.9.1", "karma-jasmine-html-reporter": "0.2.2",
"typescript": "~2.5.3" "protractor": "5.1.2",
"ts-node": "3.0.4",
"tslint": "5.3.2",
"typescript": ">=2.4.2 <2.7.0"
} }
} }
...@@ -28,6 +28,7 @@ export class LabarchivesLinkField extends FieldBase<any> { ...@@ -28,6 +28,7 @@ export class LabarchivesLinkField extends FieldBase<any> {
processingSuccess: string; processingSuccess: string;
processingFail: string; processingFail: string;
processingStatus: string; processingStatus: string;
processingNoPermission: string;
checks: Checks; checks: Checks;
rdmp: string; rdmp: string;
...@@ -41,15 +42,16 @@ export class LabarchivesLinkField extends FieldBase<any> { ...@@ -41,15 +42,16 @@ export class LabarchivesLinkField extends FieldBase<any> {
this.labarchivesService = this.getFromInjector(LabarchivesService); this.labarchivesService = this.getFromInjector(LabarchivesService);
this.closeLabel = 'Close'; this.closeLabel = 'Close';
this.processing = false; this.processing = false;
this.workspaceDetailsTitle = 'Workspace Title'; this.workspaceDetailsTitle = 'Workspace';
this.workspaceDefinition = ''; this.workspaceDefinition = '';
this.currentWorkspace = {}; this.currentWorkspace = {};
this.processingLabel = 'Processing...'; this.processingLabel = options['processingLabel'] || 'Processing...';
this.processingMessage = 'processing message'; this.processingMessage = '';
this.checks = new Checks(); this.checks = new Checks();
this.processingSuccess = 'Success'; this.processingSuccess = options['processingSuccess'] || 'Success';
this.processingFail = 'Failed'; this.processingFail = options['processingFail'] || 'There was a problem linking your workspace, please try again later';
this.processingStatus = ''; this.processingStatus = '';
this.processingNoPermission = options['processingNoPermission'] || 'You are not allowed to modify this item'
} }
init() { init() {
...@@ -97,12 +99,13 @@ export class LabarchivesLinkField extends FieldBase<any> { ...@@ -97,12 +99,13 @@ export class LabarchivesLinkField extends FieldBase<any> {
this.checks.linkCreated = true; this.checks.linkCreated = true;
this.checks.master = true; this.checks.master = true;
this.processingFail = undefined; this.processingFail = undefined;
} else { } else if(link.message === 'cannot insert node'){
this.processingFail = this.processingNoPermission;
this.checks.linkWithOther = true this.checks.linkWithOther = true
} }
} catch (e) { } catch (e) {
this.processing = false; this.processing = false;
this.checks.linkWithOther = true this.checks.linkWithOther = true;
} }
} }
} }
...@@ -123,8 +126,8 @@ export class LabarchivesLinkField extends FieldBase<any> { ...@@ -123,8 +126,8 @@ export class LabarchivesLinkField extends FieldBase<any> {
<h5>{{ field.workspaceDetailsTitle }}</h5> <h5>{{ field.workspaceDetailsTitle }}</h5>
<p *ngFor="let item of field.workspaceDefinition">{{ item.label }} : <p *ngFor="let item of field.workspaceDefinition">{{ item.label }} :
{{ field.currentWorkspace[item.name]}}</p> {{ field.currentWorkspace[item.name]}}</p>
<h5>{{ field.processingLabel }}</h5> <h5 *ngIf="field.processing">{{ field.processingLabel }}</h5>
<p>{{ field.processingMessage }}&nbsp;</p> <p *ngIf="field.processing">{{ field.processingMessage }}&nbsp;</p>
<p class="alert alert-success" *ngIf="field.checks.linkCreated">{{ field.processingSuccess }}</p> <p class="alert alert-success" *ngIf="field.checks.linkCreated">{{ field.processingSuccess }}</p>
<p class="alert alert-danger" *ngIf="field.processingStatus === 'done' && field.processingFail"> <p class="alert alert-danger" *ngIf="field.processingStatus === 'done' && field.processingFail">
{{ field.processingFail }}</p> {{ field.processingFail }}</p>
......
...@@ -19,26 +19,26 @@ ...@@ -19,26 +19,26 @@
*/ */
/** IE9, IE10 and IE11 requires all of the following polyfills. **/ /** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol'; import 'core-js/es6/symbol';
// import 'core-js/es6/object'; import 'core-js/es6/object';
// import 'core-js/es6/function'; import 'core-js/es6/function';
// import 'core-js/es6/parse-int'; import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float'; import 'core-js/es6/parse-float';
// import 'core-js/es6/number'; import 'core-js/es6/number';
// import 'core-js/es6/math'; import 'core-js/es6/math';
// import 'core-js/es6/string'; import 'core-js/es6/string';
// import 'core-js/es6/date'; import 'core-js/es6/date';
// import 'core-js/es6/array'; import 'core-js/es6/array';
// import 'core-js/es6/regexp'; import 'core-js/es6/regexp';
// import 'core-js/es6/map'; import 'core-js/es6/map';
// import 'core-js/es6/weak-map'; import 'core-js/es6/weak-map';
// import 'core-js/es6/set'; import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */ /** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`. import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */ /** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect'; import 'core-js/es6/reflect';
/** Evergreen browsers require these. **/ /** Evergreen browsers require these. **/
...@@ -57,15 +57,18 @@ import 'core-js/es7/reflect'; ...@@ -57,15 +57,18 @@ import 'core-js/es7/reflect';
* user can disable parts of macroTask/DomEvents patch by setting following flags * user can disable parts of macroTask/DomEvents patch by setting following flags
*/ */
// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
/* /*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge * with the following flag, it will bypass `zone.js` patch for IE/Edge
*/ */
// (window as any).__Zone_enable_cross_context_check = true; //(window as any).__Zone_enable_cross_context_check = true;
if (document['documentMode'] || /Edge/.test(navigator.userAgent)) {
(window as any).__Zone_enable_cross_context_check = true;
}
/*************************************************************************************************** /***************************************************************************************************
* Zone JS is required by default for Angular itself. * Zone JS is required by default for Angular itself.
......
...@@ -27,5 +27,6 @@ ...@@ -27,5 +27,6 @@
"exclude": [ "exclude": [
"node_modules", "node_modules",
"**/*.spec.ts" "**/*.spec.ts"
] ],
"allowSyntheticDefaultImports": true
} }
This diff is collapsed.
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const Rx_1 = require("rxjs/Rx"); const rxjs_1 = require("rxjs");
require("rxjs/add/operator/map"); require("rxjs/add/operator/map");
const controller = require("../core/CoreController"); const controller = require("../core/CoreController");
const Config_1 = require("../Config"); const Config_1 = require("../Config");
...@@ -27,7 +27,7 @@ var Controllers; ...@@ -27,7 +27,7 @@ var Controllers;
const userId = req.user.id; const userId = req.user.id;
this.config.brandingAndPortalUrl = BrandingService.getFullPath(req); this.config.brandingAndPortalUrl = BrandingService.getFullPath(req);
const userInfo = LabarchivesService.login(this.config.key, user.username, user.password); const userInfo = LabarchivesService.login(this.config.key, user.username, user.password);
Rx_1.Observable.fromPromise(userInfo).flatMap(response => { rxjs_1.Observable.fromPromise(userInfo).flatMap(response => {
const userInfo = response['users']; const userInfo = response['users'];
if (userInfo) { if (userInfo) {
info = new UserInfo_1.UserInfo(userInfo['id'], userInfo['orcid'], userInfo['fullname'], userInfo['notebooks']); info = new UserInfo_1.UserInfo(userInfo['id'], userInfo['orcid'], userInfo['fullname'], userInfo['notebooks']);
...@@ -70,10 +70,10 @@ var Controllers; ...@@ -70,10 +70,10 @@ var Controllers;
const user = response['users'] || null; const user = response['users'] || null;
if (user) { if (user) {
const userInfo = LabarchivesService.userInfo(this.config.key, user['id']); const userInfo = LabarchivesService.userInfo(this.config.key, user['id']);
return Rx_1.Observable.fromPromise(userInfo); return rxjs_1.Observable.fromPromise(userInfo);
} }
else { else {
return Rx_1.Observable.throw(''); return rxjs_1.Observable.throw('');
} }
}) })
.subscribe(response => { .subscribe(response => {
...@@ -131,14 +131,15 @@ var Controllers; ...@@ -131,14 +131,15 @@ var Controllers;
.flatMap(response => { .flatMap(response => {
workspace = response; workspace = response;
const insertNode = LabarchivesService.insertNode(this.config.key, info['id'], nbId, 'stash.workspace', false); const insertNode = LabarchivesService.insertNode(this.config.key, info['id'], nbId, 'stash.workspace', false);
return Rx_1.Observable.fromPromise(insertNode); return rxjs_1.Observable.fromPromise(insertNode);
}) })
.flatMap(response => { .flatMap(response => {
sails.log.debug('insertNode'); sails.log.debug('insertNode');
sails.log.debug(response); sails.log.debug(response);
const tree = response['tree-tools']; if (response && response['tree-tools']) {
const node = tree['node']; const tree = response['tree-tools'];
metadataContent = ` const node = tree['node'];
metadataContent = `
<div id="${workspace.oid}"> <div id="${workspace.oid}">
<h1>UTS</h1> <h1>UTS</h1>
<h3>Workspace <strong>${nbName}</strong> is linked to:</h3> <h3>Workspace <strong>${nbName}</strong> is linked to:</h3>
...@@ -146,9 +147,12 @@ var Controllers; ...@@ -146,9 +147,12 @@ var Controllers;
<p>Stash Id: ${workspace.oid}</p> <p>Stash Id: ${workspace.oid}</p>
</div> </div>
`; `;
const partType = 'text entry';