- add bulma style

- add components: messages, locate-button
- move index.html into src folder
- move to angular build tools
- styles.css -> styles.scss
This commit is contained in:
Arno Kaimbacher 2021-09-07 08:36:17 +02:00
parent 220944b115
commit df3561235d
37 changed files with 12724 additions and 645 deletions

View file

@ -2,7 +2,7 @@
// https://github.com/52North/helgoland-toolbox/blob/495f75cadcc3e7232206db1cd5dd8bbf3a172c4b/libs/core/src/lib/abstract-services/api-interface.ts#L6
// https://github.com/52North/helgoland-toolbox/blob/495f75cadcc3e7232206db1cd5dd8bbf3a172c4b/libs/core/src/lib/api-communication/connectors/dataset-api-v3-connector/api-v3-interface.ts#L321
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Phenomenon } from '../../shared/models/phenomenon';
import { Station } from '../../shared/models/station';
@ -10,6 +10,7 @@ import { Station } from '../../shared/models/station';
import { HttpService } from './http.service';
import { HttpRequestOptions } from '../../shared/models/http-requests';
import { HttpParams } from '@angular/common/http';
import { MessageService } from './message.service';
// @Injectable({
@ -22,17 +23,20 @@ export class DatasetApiService {
// constructor() { }
constructor(
private httpClient: HttpClient,
protected httpService: HttpService,) {
protected httpService: HttpService,
private messageService: MessageService) {
}
public getPhenomena(apiUrl: string, params?, options?) {
const url = this.createRequestUrl(apiUrl, 'phenomena');
public getPhenomena(apiUrl: string, params?: any, options?: any) {
const url = this.createRequestUrl(apiUrl, 'phenomena');
return this.requestApi<Phenomenon[]>(url, params, options);
}
public getStations(apiUrl: string, params?, options?: HttpRequestOptions): Observable<Station[]> {
public getStations(apiUrl: string, params?: any, options?: HttpRequestOptions): Observable<Station[]> {
const url = this.createRequestUrl(apiUrl, 'features');
return this.requestApi<Station[]>(url, params, options);
let stations = this.requestApi<Station[]>(url, params, options);
this.messageService.add('StationService: fetched stations');
return stations;
}
@ -43,13 +47,12 @@ export class DatasetApiService {
return requestUrl;
}
protected requestApi<T>(
url: string, params: HttpParams = new HttpParams(), options: HttpRequestOptions = {}
protected requestApi<T>(url: string, params: HttpParams = new HttpParams(), options: HttpRequestOptions = {}
): Observable<T> {
return this.httpService.client(options).get<T>(url,
{
params,
headers: this.createBasicAuthHeader(options.basicAuthToken)
headers: this.createBasicAuthHeader(options.basicAuthToken as string)
}
);
}