Commit 88b50e6a authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

Mantis corrections

parent 14617bc1
......@@ -171,7 +171,6 @@ export class ResourceQueryableComponent implements OnInit {
}
initURLCustomization() {
console.log ('passage ici.');
this.projectionList = [];
this.csvFieldsSeparatorList = [',',';'];
......@@ -333,8 +332,6 @@ export class ResourceQueryableComponent implements OnInit {
// Number features WS
if (this.resource.type === this.linkFormats.ws) {
console.log ('padabam');
console.log(this.queryableParameters);
if (this.queryableParameters.numberFeatures) {
queryableUrlToDisplay += this.selectedFormat.isProjectable === 0 ?
`<span class="is-active-parameter">?maxfeatures=${this.numberFeatures}</span>` :
......@@ -411,7 +408,6 @@ export class ResourceQueryableComponent implements OnInit {
//this.setDecimalSeparator(this.selectedDecimalseparator);
}
else {
console.log(this.selectedFormat.name);
this.queryableParameters.baseUrl = this.resource.metadataLink.url.replace('/all.json', '');
this.queryableParameters.baseUrl += `/${this.resource.metadataLink.name}.shp?`;
if (this.selectedFormat.isProjectable) {
......
......@@ -174,8 +174,13 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
} else if (f === 'PDF' && link.name.includes('Licence')) { // Remove PDF because it's Licence
validFormat = false;
}
/*if (link.service === 'WFS') {
if (f === 'ShapeFile') {
validFormat = false;
}
}*/
if (link.service === 'WMS') {
if (link.service === 'WMS' || link.service === 'WCS') {
if (blockedFormat.includes(f)) {
validFormat = false;
}
......
......@@ -4,7 +4,7 @@
</div>
<div class="downloads" [ngClass]="{'blury': cguModalIsOpened}">
<div class="resources-downloadable" *ngIf="hasDownloadableResources || hasStaticResources">
<div *ngIf="hasStaticResources">
<div *ngIf="downloadableResources">
<div class="resource-download" *ngFor="let downloadable of downloadableResources | keyvalue" >
<div class="resource-description">
<span>{{downloadable.key}}</span>
......
......@@ -177,6 +177,8 @@ export class ResourceDownloadItemComponent implements OnInit {
} else if (this.resource.type === linkFormats.ws) {
if (this.format.name === 'JSON') {
queryableUrl += `/${this.resource.metadataLink.name}/all.json?maxfeatures=-1`;
} else if (this.format.name === 'CSV') {
queryableUrl += `/${this.resource.metadataLink.name}/all.csv?maxfeatures=-1`;
} else {
const projectionAndBbox = this.getProjectionAndBbox(this.format);
......
......@@ -98,22 +98,25 @@ export class ResourcesService {
&& f.name !== 'GIF' && f.name !== 'AAIGrid');
}
if (!downloadableResources[linkID]) {
downloadableResources[linkID] = [];
if (resourceCopy.formats.length > 0 ) {
if (!downloadableResources[linkID]) {
downloadableResources[linkID] = [];
}
// Instead of using the direct link to the files we go through the dedicated proxy
// that is adding credentials of a technical account if the user has access to the requested file/data
resourceCopy.metadataLink.url = resourceCopy.metadataLink.url.replace(
APP_CONFIG.backendUrls.backendDomain,
`${APP_CONFIG.backendUrls.proxyQuery}/download`,
);
resourceCopy.metadataLink.url = resourceCopy.metadataLink.url.replace(
'https://download.recette.data.grandlyon.com',
`${APP_CONFIG.backendUrls.proxyQuery}/download`,
);
downloadableResources[linkID].push(resourceCopy);
}
// Instead of using the direct link to the files we go through the dedicated proxy
// that is adding credentials of a technical account if the user has access to the requested file/data
resourceCopy.metadataLink.url = resourceCopy.metadataLink.url.replace(
APP_CONFIG.backendUrls.backendDomain,
`${APP_CONFIG.backendUrls.proxyQuery}/download`,
);
resourceCopy.metadataLink.url = resourceCopy.metadataLink.url.replace(
'https://download.recette.data.grandlyon.com',
`${APP_CONFIG.backendUrls.proxyQuery}/download`,
);
downloadableResources[linkID].push(resourceCopy);
}
});
} else if (link.service === undefined) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment