Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(import-export) GUI add custom html for clarification #1095

Merged
merged 3 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/geo/src/lib/import-export/import-export.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { MatTooltipModule } from '@angular/material/tooltip';

import { IgoLanguageModule } from '@igo2/core';
import { IgoKeyValueModule, IgoDrapDropModule, IgoSpinnerModule } from '@igo2/common';
import { IgoKeyValueModule, IgoDrapDropModule, IgoSpinnerModule, IgoCustomHtmlModule } from '@igo2/common';

import { ExportButtonComponent } from './export-button/export-button.component';
import { ImportExportComponent } from './import-export/import-export.component';
Expand All @@ -40,6 +40,7 @@ import { IgoStyleListModule } from './style-list/style-list.module';
IgoSpinnerModule,
IgoKeyValueModule,
IgoDrapDropModule,
IgoCustomHtmlModule,
IgoStyleListModule.forRoot()
],
exports: [ImportExportComponent, DropGeoFileDirective, IgoStyleListModule, ExportButtonComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@
</div>
</form>
<section class="mat-typography" *ngIf="selectedMode === 'import'">
<h4>{{'igo.geo.importExportForm.importClarifications' | translate}}</h4>
<ul>
<li>{{'igo.geo.importExportForm.importSizeMax' | translate: {size: fileSizeMb} }}</li>
<li>{{'igo.geo.importExportForm.importFormatAuthorized' | translate}}</li>
<li>{{'igo.geo.importExportForm.importShpZip' | translate}}</li>
</ul>
<div *ngIf="importHtmlClarifications === ''">
<h4>{{'igo.geo.importExportForm.importClarifications' | translate}}</h4>
<ul>
<li>{{'igo.geo.importExportForm.importSizeMax' | translate: {size: fileSizeMb} }}</li>
<li>{{'igo.geo.importExportForm.importFormatAuthorized' | translate}}</li>
<li>{{'igo.geo.importExportForm.importShpZip' | translate}}</li>
</ul>
</div>
<igo-custom-html *ngIf="importHtmlClarifications !== ''" class="mat-typography"
[html]="importHtmlClarifications">
</igo-custom-html>
</section>

<section class="mat-typography" *ngIf="(exportableLayers$ | async).length === 0 && selectedMode === 'export'">
Expand Down Expand Up @@ -167,4 +172,8 @@ <h4>{{'igo.geo.importExportForm.exportNoLayersExportable' | translate}}</h4>
<igo-spinner [shown]="loading$ | async"></igo-spinner>
</div>

<igo-custom-html *ngIf="exportHtmlClarifications !== ''" class="mat-typography"
[html]="exportHtmlClarifications">
</igo-custom-html>

</form>
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export class ImportExportComponent implements OnDestroy, OnInit {
private formLayer$$: Subscription;
private exportOptions$$: Subscription;

public importHtmlClarifications: string;
public exportHtmlClarifications: string;

private espgCodeRegex = new RegExp('^\\d{4,6}');
private clientSideFileSizeMax: number;
Expand Down Expand Up @@ -167,6 +169,8 @@ export class ImportExportComponent implements OnDestroy, OnInit {
this.loadConfig();
this.buildForm();
this.computeProjections();
this.importHtmlClarifications = this.languageService.translate.instant('igo.geo.importExportForm.importHtmlClarifications');
this.exportHtmlClarifications = this.languageService.translate.instant('igo.geo.importExportForm.exportHtmlClarifications');
}

ngOnInit() {
Expand Down
2 changes: 2 additions & 0 deletions packages/geo/src/locale/en.geo.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
"importSizeMax": "The file size limit is {{size}} Mb",
"importFormatAuthorized": "Formats authorized: geojson, kml, gpx, gml, shapefile",
"importShpZip": "Shapefiles must be zipped AND geometries stored in Latitude Longitude coordinate (EPSG:4326/WGS:84)",
"importHtmlClarifications": "",
"exportHtmlClarifications": "",
"other": "other",
"others": "others",
"projections": {
Expand Down
2 changes: 2 additions & 0 deletions packages/geo/src/locale/fr.geo.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@
"importSizeMax": "La taille limite du fichier est de {{size}} Mo",
"importFormatAuthorized": "Formats autorisés: geojson, kml, gpx, gml, shapefile",
"importShpZip": "Les shapefiles doivent être compressés (zippés) ET leurs géométries doivent être en coordonnées Latitude Longitude (EPSG:4326/WGS84)",
"importHtmlClarifications": "",
"exportHtmlClarifications": "",
"other": "autre",
"others": "autres",
"projections": {
Expand Down