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

Merge branch 'development' of...

Merge branch 'development' of https://gitlab.alpha.grandlyon.com/refonte-data/portail-data into development
parents b0eb5f3d 9970a561
Branches
Tags
1 merge request!19Development
Pipeline #
<button tabindex="0" class="feedback-header" (click)="toogle()" [ngClass]="{'expended': isExpended, 'closed': shouldBeAnimated}">
<svg xmlns="http://www.w3.org/2000/svg" id="chevron" viewBox="0 0 15 9">
<path d="M7.5 7.5c-.1 0-.3-.1-.4-.1l-6-6C1 1.1 1 .8 1.1.6s.5-.2.7 0l5.6 5.6L13 .6c.2-.2.5-.2.7 0s.2.5 0 .7l-6 6c.1.1-.1.2-.2.2z"
class="brandcolor" />
<path d="M7.5 7.5c-.1 0-.3-.1-.4-.1l-6-6C1 1.1 1 .8 1.1.6s.5-.2.7 0l5.6 5.6L13 .6c.2-.2.5-.2.7 0s.2.5 0 .7l-6 6c.1.1-.1.2-.2.2z"
class="brandcolor" />
</svg>
<span i18n="@@feedback.giveYourFeedback">Gives us your opinion</span>
</button>
<form [formGroup]="feedbackForm" (ngSubmit)="sendFeedback()" [ngClass]="{'expended': isExpended, 'closed': shouldBeAnimated}">
<textarea id="message" formControlName="message" [placeholder]="feedback.placeholder"></textarea>
<div class="action">
<button type="submit" class="button" i18n="@@feedback.send" [disabled]="feedbackForm.invalid">
Send
</button>
</div>
</form>
<div class="feedback-container">
<button tabindex="0" class="feedback-header" (click)="toogle()" [ngClass]="{'expended': isExpended, 'closed': shouldBeAnimated}">
<svg xmlns="http://www.w3.org/2000/svg" id="chevron" viewBox="0 0 15 9">
<path d="M7.5 7.5c-.1 0-.3-.1-.4-.1l-6-6C1 1.1 1 .8 1.1.6s.5-.2.7 0l5.6 5.6L13 .6c.2-.2.5-.2.7 0s.2.5 0 .7l-6 6c.1.1-.1.2-.2.2z"
class="brandcolor" />
<path d="M7.5 7.5c-.1 0-.3-.1-.4-.1l-6-6C1 1.1 1 .8 1.1.6s.5-.2.7 0l5.6 5.6L13 .6c.2-.2.5-.2.7 0s.2.5 0 .7l-6 6c.1.1-.1.2-.2.2z"
class="brandcolor" />
</svg>
<span i18n="@@feedback.giveYourFeedback">Gives us your opinion</span>
</button>
<form [formGroup]="feedbackForm" (ngSubmit)="sendFeedback()" [ngClass]="{'expended': isExpended, 'closed': shouldBeAnimated}">
<textarea id="message" formControlName="message" [placeholder]="feedback.placeholder"></textarea>
<div class="action">
<button type="submit" class="button" i18n="@@feedback.send" [disabled]="feedbackForm.invalid">
Send
</button>
</div>
</form>
</div>
......@@ -4,7 +4,7 @@ $app-notification-width: 29rem;
.app-notifications {
position: fixed;
z-index: 1;
z-index: 10;
bottom: 0.5rem;
right: 0.5rem;
......
<div class="page-details-background-image"></div>
<div class="page-container has-white-background" *ngIf="metadata" [ngClass]="{'blury' : isLoading}">
<div class="details-header">
<app-page-header [pageInfo]="pageHeaderInfo"></app-page-header>
<app-page-header [pageInfo]="pageHeaderInfo" [customGoToPreviousPage]="goToPreviousPage"></app-page-header>
</div>
<div class="tabulations">
......
......@@ -21,8 +21,6 @@ export class ResultDatasetComponent implements OnInit {
constructor() { }
ngOnInit() {
console.log(this.dataset.metadata.type);
}
ngOnInit() {}
}
import { Injectable } from '@angular/core';
import { Observable, Subject, BehaviorSubject, of } from 'rxjs';
import { Observable, Subject, BehaviorSubject, of, fromEvent, Subscription } from 'rxjs';
import { Metadata, IMetadataLink } from '../../geosource/models';
import { Notification } from '../../core/models';
import * as mapboxgl from 'mapbox-gl';
import { map, catchError } from 'rxjs/operators';
import { map, catchError, debounceTime } from 'rxjs/operators';
import { ElasticsearchService } from '../../geosource/services/elasticsearch.service';
import { NotificationService } from '../../core/services';
import { notificationMessages } from '../../../i18n/traductions.fr';
......@@ -37,6 +37,7 @@ export class MapService {
private _mapSubject = new Subject<any>();
private _panelState = new BehaviorSubject<any>({ state: false });
private _errorSubscription: Subscription;
selectedFeature; // Contains the gid of the selected feature
......@@ -66,11 +67,20 @@ export class MapService {
this.selectedBaseLayer = baseLayer;
this.url = url;
this._map = new mapboxgl.Map(options).on('error', (error) => {
this._notificationService.notify(new Notification({
message: notificationMessages.geosource.mapError,
type: 'error',
}));
this._map = new mapboxgl.Map(options);
// Create an observable from the map error event and only emit after 1s in order
// to avoid to many error at the same time
const errorObservable = fromEvent(this._map, 'error').pipe(debounceTime(1000));
// Subscribe to the error observable and send a notification
this._errorSubscription = errorObservable.subscribe((v) => {
this._notificationService.notify(
new Notification({
message: notificationMessages.geosource.mapError,
type: 'error',
}),
);
});
if (addControls) {
......@@ -458,6 +468,7 @@ export class MapService {
destroyMap() {
this._map.remove();
this._errorSubscription.unsubscribe();
}
switch3DLayer() {
......
......@@ -17,19 +17,24 @@ export class PageHeaderComponent implements OnInit {
) { }
@Input() pageInfo: IPageHeaderInfo;
@Input() customGoToPreviousPage: any;
ngOnInit() {
}
goToPreviousPage() {
const index = 1; // Start to retrieve the previous element
let url = this._navigationHistoryService.getFromLast(index);
if (this.customGoToPreviousPage) {
this.customGoToPreviousPage();
} else {
const index = 1; // Start to retrieve the previous element
let url = this._navigationHistoryService.getFromLast(index);
// If url is null then redirect to home page
if (url == null) {
url = `/${AppRoutes.home.uri}`;
// If url is null then redirect to home page
if (url == null) {
url = `/${AppRoutes.home.uri}`;
}
this._router.navigateByUrl(url);
}
this._router.navigateByUrl(url);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment