Skip to content
Snippets Groups Projects
Commit fa0956e1 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Resource warning message is display in english or french depending on the...

Resource warning message is display in english or french depending on the language of the application
parent f763a4f5
No related branches found
No related tags found
1 merge request!48Version 2.3.0
Pipeline #1735 passed
......@@ -14,8 +14,8 @@
</div>
<span class="resource-description">{{ resource.description }}</span>
</div>
<span class="icon tooltip is-tooltip-multiline pirate-alert" [attr.data-tooltip]="resource.messageWarning"
*ngIf="resource.messageWarning">
<span class="icon tooltip is-tooltip-multiline pirate-alert" [attr.data-tooltip]="getMessageWarning(resource)"
*ngIf="getMessageWarning(resource)">
<i class="fas fa-exclamation-triangle fa-lg"></i>
</span>
<div class="resource-icon">
......
......@@ -2,6 +2,7 @@ import { Component, OnInit, Input } from '@angular/core';
import { Resource, Metadata } from '../../../../models';
import { ResourcesService } from '../../../../services';
import { Projection } from '../../../../models/projection.model';
import { environment } from '../../../../../../environments/environment';
@Component({
selector: 'app-resources-queryable',
......@@ -30,4 +31,10 @@ export class ResourcesQueryableComponent implements OnInit {
this.selectedResource = resource;
}
getMessageWarning(resource: Resource) {
return window.location.href.includes(environment.angularAppHost.en) ?
resource.messageWarningEn :
resource.messageWarningFr;
}
}
......@@ -35,7 +35,8 @@ export interface IResource {
isDownloadable: number;
isStandard: number;
parametersUrl: string;
messageWarning: string;
messageWarningFr: string;
messageWarningEn: string;
resourceFormats: IResourceFormat[];
}
......@@ -49,7 +50,8 @@ export class Resource {
isDownloadable: number;
isStandard: number;
parametersUrl: string;
messageWarning: string;
messageWarningFr: string;
messageWarningEn: string;
metadataLink: IMetadataLink;
formats: Format[];
......@@ -63,7 +65,8 @@ export class Resource {
this.isDownloadable = resource.isDownloadable;
this.isStandard = resource.isStandard;
this.parametersUrl = resource.parametersUrl;
this.messageWarning = resource.messageWarning;
this.messageWarningFr = resource.messageWarningFr;
this.messageWarningEn = resource.messageWarningEn;
if (resource.resourceFormats) {
this.formats = resource.resourceFormats.map((resourceFormat) => {
return new Format(resourceFormat);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment