Skip to content
Snippets Groups Projects
Commit d9a9100b authored by Callari, Roberto's avatar Callari, Roberto
Browse files

up

parent 4cbac914
No related branches found
No related tags found
No related merge requests found
...@@ -16838,8 +16838,7 @@ ...@@ -16838,8 +16838,7 @@
"querystringify": { "querystringify": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
"dev": true
}, },
"quick-lru": { "quick-lru": {
"version": "1.1.0", "version": "1.1.0",
...@@ -17392,8 +17391,7 @@ ...@@ -17392,8 +17391,7 @@
"requires-port": { "requires-port": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
"dev": true
}, },
"resolve": { "resolve": {
"version": "1.5.0", "version": "1.5.0",
...@@ -21140,10 +21138,9 @@ ...@@ -21140,10 +21138,9 @@
} }
}, },
"url-parse": { "url-parse": {
"version": "1.4.7", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
"integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", "integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
"dev": true,
"requires": { "requires": {
"querystringify": "^2.1.1", "querystringify": "^2.1.1",
"requires-port": "^1.0.0" "requires-port": "^1.0.0"
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
"tinymce": "4.5.7", "tinymce": "4.5.7",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"typeface-exo": "0.0.22", "typeface-exo": "0.0.22",
"url-parse": "^1.5.1",
"uuid": "^8.3.1", "uuid": "^8.3.1",
"web-animations-js": "^2.3.2", "web-animations-js": "^2.3.2",
"zone.js": "^0.10.3" "zone.js": "^0.10.3"
......
<nb-card> <nb-card>
<nb-card-body width="100%" height="100%"> <nb-card-body>
<iframe width="100%" height="850px" frameBorder="0" [src]="iframeUrl | safe"></iframe> <iframe class="responsive-iframe" frameBorder="0" [src]="iframeUrl | safe"></iframe>
</nb-card-body> </nb-card-body>
</nb-card> </nb-card>
\ No newline at end of file
...@@ -13,3 +13,21 @@ nb-card { ...@@ -13,3 +13,21 @@ nb-card {
max-height: 100vh; max-height: 100vh;
min-height: 95vh; min-height: 95vh;
} }
.container-iframe {
position: relative;
overflow: hidden;
width: 100%;
padding-top: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
}
/* Then style the iframe to fit in the container div with full height and width */
.responsive-iframe {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
}
\ No newline at end of file
...@@ -9,6 +9,7 @@ import { DCATDistribution } from '../model/dcatdistribution'; ...@@ -9,6 +9,7 @@ import { DCATDistribution } from '../model/dcatdistribution';
import { SKOSConcept } from '../model/skosconcept'; import { SKOSConcept } from '../model/skosconcept';
import { DataCataglogueAPIService } from '../services/data-cataglogue-api.service'; import { DataCataglogueAPIService } from '../services/data-cataglogue-api.service';
import { ShowDataletsComponent } from '../show-datalets/show-datalets.component'; import { ShowDataletsComponent } from '../show-datalets/show-datalets.component';
import * as URLParse from 'url-parse';
@Component({ @Component({
selector: 'ngx-dataset', selector: 'ngx-dataset',
...@@ -29,6 +30,8 @@ export class DatasetComponent implements OnInit { ...@@ -29,6 +30,8 @@ export class DatasetComponent implements OnInit {
dataletBaseUrl=undefined; dataletBaseUrl=undefined;
enableDatalet=false; enableDatalet=false;
samedomain=false;
constructor( constructor(
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
...@@ -44,6 +47,13 @@ export class DatasetComponent implements OnInit { ...@@ -44,6 +47,13 @@ export class DatasetComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
let dataletOrigin = new URLParse(this.dataletBaseUrl);
//console.log(dataletOrigin.origin)
if(location.origin==dataletOrigin.origin){
this.samedomain=true;
}
this.route.paramMap.subscribe(params => { this.route.paramMap.subscribe(params => {
this.id = params.get('id'); this.id = params.get('id');
if (this.id) { if (this.id) {
...@@ -146,7 +156,7 @@ export class DatasetComponent implements OnInit { ...@@ -146,7 +156,7 @@ export class DatasetComponent implements OnInit {
} }
this.loading = true; this.loading = true;
if (this.samedomain) {
this.restApi.downloadFromUri(distribution).subscribe( this.restApi.downloadFromUri(distribution).subscribe(
res => { res => {
this.loading = false; this.loading = false;
...@@ -173,6 +183,19 @@ export class DatasetComponent implements OnInit { ...@@ -173,6 +183,19 @@ export class DatasetComponent implements OnInit {
this.toastrService.danger("File with url " + distribution.downloadURL + " returned " + err.status + "!", "Unable to create Datalet"); this.toastrService.danger("File with url " + distribution.downloadURL + " returned " + err.status + "!", "Unable to create Datalet");
} }
) )
} else {
this.restApi.downloadFromUri(distribution).subscribe(
res => {
this.loading = false;
window.open(`${this.dataletBaseUrl}?ln=en&format=${parameter}&nodeID=${this.dataset.nodeID}&distributionID=${distribution.id}&datasetID=${this.dataset.id}&url=${encodeURIComponent(distribution.downloadURL)}`)
},
err => {
console.log(err)
this.loading = false;
this.toastrService.danger("File with url " + distribution.downloadURL + " returned " + err.status + "!", "Unable to create Datalet");
}
)
}
} }
openExistingDatalet(distribution:DCATDistribution){ openExistingDatalet(distribution:DCATDistribution){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment