Update angular.
LocationBasedServices/mowesta/pipeline/head There was a failure building this commit

This commit is contained in:
Marcus Handte
2024-03-05 07:04:40 +01:00
parent fa88d592cb
commit 63b23ef902
52 changed files with 14353 additions and 19286 deletions
+1 -3
View File
@@ -1,3 +1 @@
export * from '../api/api/api';
export * from '../api/model/models';
export * from '../api/configuration';
export * from '../api';
+61 -64
View File
@@ -1,7 +1,5 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, LOCALE_ID } from '@angular/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { NgxGaugeModule } from 'ngx-gauge';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button';
@@ -85,7 +83,7 @@ import { ManageSystemComponent } from './views-manage/manage-system.component';
import { ManageUsersComponent } from './views-manage/manage-users.component';
import { ManageMeasurementsMapComponent } from './views-manage/manage-measurements-map.component';
import { AuthInterceptor } from './interceptors/auth.interceptor';
import { DefaultService, MoWeStaConfiguration } from './api';
import { DefaultService, MoWeStaApiModule, MoWeStaConfiguration } from './api';
import { MessageDialogComponent } from './dialogs/message-dialog.component';
import { ConfirmationDialogComponent } from './dialogs/confirmation-dialog.component';
import { LogDialogComponent } from './dialogs/log-dialog.component';
@@ -165,66 +163,65 @@ const apidomain = (): { http: string, ws: string } => {
registerLocaleData(LocaleDE);
@NgModule({
declarations: [
AppComponent, FooterComponent, LayoutDrawerComponent, LayoutPlainComponent, LayoutSingleComponent,
LayoutDoubleComponent,
ToolbarButtonComponent, ProfileButtonComponent, LanguageSelectComponent,
DrawerComponent, LoginFieldComponent, PasswordFieldComponent, EmailFieldComponent,
NameFieldComponent, DecisionPanelComponent, MessageDialogComponent, ConfirmationDialogComponent,
ConditionsDialogComponent, LogoPanelComponent,
LoginComponent, RegisterComponent, ActivateComponent, ResetComponent, ChangeComponent,
UserDevicesComponent, UserAccountComponent, ManageLogComponent, LogDialogComponent, ManageSystemComponent,
ManageUsersComponent, SearchFieldComponent, CityComponent, CountryComponent, StateComponent,
MapComponent, WeatherConditionComponent, CitiesListComponent, CitiesComponent, WeatherVideoListComponent,
WeatherVideoComponent, WeatherVideoBarComponent, VideosComponent,
WeatherStationsListComponent, StationsComponent, StationComponent, WeatherReportsListComponent,
WeatherReportComponent, WeatherSummaryComponent, UserFavoritesComponent, FavoriteButtonComponent,
LoadingComponent, UserDeviceComponent, WeatherDiagramComponent,
HumidityPipe, CloudPipe, PressurePipe, TemperaturePipe, SpeedPipe, SnowPipe, PrecipitationPipe,
WeatherPipe, DirectionPipe, SourcePipe, BingMapsPipe, GoogleMapsPipe, WikipediaPipe, LocalTimePipe,
LocalDatePipe, LocalNamePipe, LocationIconPipe, CityTypePipe, VideoSourcePipe, VideoTypePipe,
WeatherIconPipe, DirectionIconPipe, OsIconPipe, MeasurementTypePipe, MeasurementTypeIconPipe,
UseParentFormDirective, ClickButtonComponent, CodeDialogComponent, ConditionMapComponent, LocationAutocompleteComponent, ManageMeasurementsMapComponent,
],
imports: [
BrowserModule, BrowserAnimationsModule,
FormsModule, ReactiveFormsModule,
FlexLayoutModule, NgxGaugeModule,
HttpClientModule, MatProgressBarModule,
MatProgressSpinnerModule, MatPaginatorModule,
MatExpansionModule, MatTableModule,
MatButtonModule, MatInputModule,
MatFormFieldModule, MatListModule,
MatIconModule, MatCardModule,
MatSelectModule, MatSnackBarModule,
MatTooltipModule, MatToolbarModule,
MatSidenavModule, MatProgressBarModule,
MatDialogModule, MatCheckboxModule,
MatDatepickerModule, MatNativeDateModule,
MatTabsModule, MatGridListModule,
AppRoutingModule, MatAutocompleteModule
],
providers: [
// injection token for http client
{ provide: MoWeStaConfiguration, useValue: new MoWeStaConfiguration({ basePath: apidomain().http }) },
{ provide: 'wsdomain', useValue: apidomain().ws },
// location stategy for passing that with the router
{ provide: LocationStrategy, useClass: PathLocationStrategy },
// add two global interceptors (one two slow down the server and one for authentication)
// {provide: HTTP_INTERCEPTORS, useClass: DelayInterceptor, multi: true},
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true},
// change the locale to DE and add custom paginator provider for tables
{ provide: LOCALE_ID, useValue: 'de' },
{ provide: MatPaginatorIntl, useClass: GermanPaginatorProvider },
DatePipe, LocalNamePipe, LocalDatePipe, LocalTimePipe, HumidityPipe, PressurePipe, TemperaturePipe,
// add our application services (api access, logging, authentication)
DefaultService, ConsoleService, UserResolver, CityResolver, StateResolver, CountryResolver, StationResolver,
DeviceResolver, LanguageResolver, BootstrapResolver,
ResourceService, CredentialService, UserService, VersionService, DeviceService, MeasurementsService,
ManageLogService, ManageUserService, CitiesService, VideosService, StationsService, ReportsService,
SettingsService
],
entryComponents: [MessageDialogComponent, ConfirmationDialogComponent, LogDialogComponent, ConditionsDialogComponent],
bootstrap: [AppComponent]
declarations: [
AppComponent, FooterComponent, LayoutDrawerComponent, LayoutPlainComponent, LayoutSingleComponent,
LayoutDoubleComponent,
ToolbarButtonComponent, ProfileButtonComponent, LanguageSelectComponent,
DrawerComponent, LoginFieldComponent, PasswordFieldComponent, EmailFieldComponent,
NameFieldComponent, DecisionPanelComponent, MessageDialogComponent, ConfirmationDialogComponent,
ConditionsDialogComponent, LogoPanelComponent,
LoginComponent, RegisterComponent, ActivateComponent, ResetComponent, ChangeComponent,
UserDevicesComponent, UserAccountComponent, ManageLogComponent, LogDialogComponent, ManageSystemComponent,
ManageUsersComponent, SearchFieldComponent, CityComponent, CountryComponent, StateComponent,
MapComponent, WeatherConditionComponent, CitiesListComponent, CitiesComponent, WeatherVideoListComponent,
WeatherVideoComponent, WeatherVideoBarComponent, VideosComponent,
WeatherStationsListComponent, StationsComponent, StationComponent, WeatherReportsListComponent,
WeatherReportComponent, WeatherSummaryComponent, UserFavoritesComponent, FavoriteButtonComponent,
LoadingComponent, UserDeviceComponent, WeatherDiagramComponent,
HumidityPipe, CloudPipe, PressurePipe, TemperaturePipe, SpeedPipe, SnowPipe, PrecipitationPipe,
WeatherPipe, DirectionPipe, SourcePipe, BingMapsPipe, GoogleMapsPipe, WikipediaPipe, LocalTimePipe,
LocalDatePipe, LocalNamePipe, LocationIconPipe, CityTypePipe, VideoSourcePipe, VideoTypePipe,
WeatherIconPipe, DirectionIconPipe, OsIconPipe, MeasurementTypePipe, MeasurementTypeIconPipe,
UseParentFormDirective, ClickButtonComponent, CodeDialogComponent, ConditionMapComponent, LocationAutocompleteComponent, ManageMeasurementsMapComponent,
],
imports: [
BrowserModule, BrowserAnimationsModule,
FormsModule, ReactiveFormsModule,
MoWeStaApiModule,
HttpClientModule, MatProgressBarModule,
MatProgressSpinnerModule, MatPaginatorModule,
MatExpansionModule, MatTableModule,
MatButtonModule, MatInputModule,
MatFormFieldModule, MatListModule,
MatIconModule, MatCardModule,
MatSelectModule, MatSnackBarModule,
MatTooltipModule, MatToolbarModule,
MatSidenavModule, MatProgressBarModule,
MatDialogModule, MatCheckboxModule,
MatDatepickerModule, MatNativeDateModule,
MatTabsModule, MatGridListModule,
AppRoutingModule, MatAutocompleteModule
],
providers: [
// injection token for http client
{ provide: MoWeStaConfiguration, useValue: new MoWeStaConfiguration({ basePath: apidomain().http }) },
{ provide: 'wsdomain', useValue: apidomain().ws },
// location stategy for passing that with the router
{ provide: LocationStrategy, useClass: PathLocationStrategy },
// add two global interceptors (one two slow down the server and one for authentication)
// {provide: HTTP_INTERCEPTORS, useClass: DelayInterceptor, multi: true},
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
// change the locale to DE and add custom paginator provider for tables
{ provide: LOCALE_ID, useValue: 'de' },
{ provide: MatPaginatorIntl, useClass: GermanPaginatorProvider },
DatePipe, LocalNamePipe, LocalDatePipe, LocalTimePipe, HumidityPipe, PressurePipe, TemperaturePipe,
// add our application services (api access, logging, authentication)
DefaultService, ConsoleService, UserResolver, CityResolver, StateResolver, CountryResolver, StationResolver,
DeviceResolver, LanguageResolver, BootstrapResolver,
ResourceService, CredentialService, UserService, VersionService, DeviceService, MeasurementsService,
ManageLogService, ManageUserService, CitiesService, VideosService, StationsService, ReportsService,
SettingsService
],
bootstrap: [AppComponent]
})
export class AppModule { }
+1 -1
View File
@@ -98,7 +98,7 @@ export const routes: Routes = [
];
@NgModule({
imports: [ RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }) ],
imports: [ RouterModule.forRoot(routes, {}) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {}
@@ -13,22 +13,22 @@ import { City } from '../../api/model/city';
templateUrl: './code-dialog.component.html',
styles: [
`
ol li.bottom-gap { margin-bottom: 32px; }
.main-content { padding-left: 10px; padding-bottom: 20px; }
.code-box {
background: lightgrey;
margin: 10px;
padding: 20px;
border-radius: 5px;
overflow-y: hidden;
overflow-x: auto;
}
.code-snippet { white-space: nowrap; }
.tag { color: #9c27b0; }
.attr { color: #3b78e8; }
.attr-value { color: #0d904f; }
.comment { color: gray; }
`
ol li.bottom-gap { margin-bottom: 32px; }
.main-content { padding-left: 10px; padding-bottom: 20px; }
.code-box {
background: lightgrey;
margin: 10px;
padding: 20px;
border-radius: 5px;
overflow-y: hidden;
overflow-x: auto;
}
.code-snippet { white-space: nowrap; }
.tag { color: #9c27b0; }
.attr { color: #3b78e8; }
.attr-value { color: #0d904f; }
.comment { color: gray; }
`
]
})
export class CodeDialogComponent {
@@ -1,4 +1,4 @@
<mat-card class="mat-elevation-z0">
<mat-card appearance="outlined" class="mat-elevation-z0">
<mat-card-title><mat-icon style="font-size: 18px;">warning</mat-icon>{{title}}</mat-card-title>
<mat-card-content style="margin-left:10px">{{message}}</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
@@ -1,4 +1,4 @@
<mat-card class="mat-elevation-z0">
<mat-card appearance="outlined" class="mat-elevation-z0">
<mat-card-title><mat-icon style="font-size: 18px;">subject</mat-icon>{{res.strings('log_dialog_title')}}</mat-card-title>
<mat-card-content style="overflow: auto">
<div class="detail-row">
@@ -1,4 +1,4 @@
<mat-card class="mat-elevation-z0">
<mat-card appearance="outlined" class="mat-elevation-z0">
<mat-card-title>{{title}}</mat-card-title>
<mat-card-content>{{message}}</mat-card-content>
<mat-card-actions fxFlexLayout="row" fxLayoutAlign="space-around center">
@@ -1,5 +1,5 @@
import { HostListener, Injectable, Directive } from '@angular/core';
import { CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
import { Observable } from 'rxjs';
/**
@@ -24,7 +24,7 @@ export abstract class AbstractCanDeactivate {
* A generic Guard which resolves if the router navigation can proceed.
*/
@Injectable({ providedIn: 'root' })
export class CanDeactivateGuard implements CanDeactivate<AbstractCanDeactivate> {
export class CanDeactivateGuard {
canDeactivate(component: AbstractCanDeactivate, currentRoute: ActivatedRouteSnapshot,
currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot)
@@ -10,7 +10,7 @@ import { Router } from '@angular/router';
@Component({
selector: 'app-drawer',
templateUrl: './drawer.component.html',
styles: [`span.mat-button { padding: 0 16px !important; }`]
styles: [`span.mat-mdc-button { padding: 0 16px !important; }`]
})
export class DrawerComponent implements OnInit, OnDestroy {
@@ -1,11 +1,11 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router';
import { ActivatedRouteSnapshot, Router } from '@angular/router';
import { EMPTY } from 'rxjs';
import { ResourceService } from '../services/resource.service';
import { ConsoleService } from '../services/console.service';
@Injectable()
export class BootstrapResolver implements Resolve<string> {
export class BootstrapResolver {
constructor(private router: Router, private consoleService: ConsoleService, private res: ResourceService) {}
@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Subject } from 'rxjs';
import { DefaultService, City } from '../api';
@Injectable()
export class CityResolver implements Resolve<City> {
export class CityResolver {
constructor(private apiClientService: DefaultService) {}
@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Subject } from 'rxjs';
import { DefaultService, Country } from '../api';
@Injectable()
export class CountryResolver implements Resolve<Country> {
export class CountryResolver {
constructor(private apiClientService: DefaultService) {}
@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Subject } from 'rxjs';
import { DefaultService, Device } from '../api';
@Injectable()
export class DeviceResolver implements Resolve<Device> {
export class DeviceResolver {
constructor(private apiClientService: DefaultService) {}
@@ -1,11 +1,11 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, Router } from '@angular/router';
import { ActivatedRouteSnapshot, Router } from '@angular/router';
import { Subject, EMPTY } from 'rxjs';
import { ResourceService } from '../services/resource.service';
import { ConsoleService } from '../services/console.service';
@Injectable()
export class LanguageResolver implements Resolve<string> {
export class LanguageResolver {
constructor(private router: Router, private consoleService: ConsoleService, private res: ResourceService) {}
@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Subject } from 'rxjs';
import { DefaultService, State } from '../api';
@Injectable()
export class StateResolver implements Resolve<State> {
export class StateResolver {
constructor(private apiClientService: DefaultService) {}
@@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Subject } from 'rxjs';
import { DefaultService, WeatherStation } from '../api';
@Injectable()
export class StationResolver implements Resolve<WeatherStation> {
export class StationResolver {
constructor(private apiClientService: DefaultService) {}
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import { ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
import { User } from '../api';
import { UserService, UserRole, UserState } from '../services/user.service';
import { ConsoleService } from '../services/console.service';
@@ -8,7 +8,7 @@ import { Observable, Subject, EMPTY, Subscription } from 'rxjs';
@Injectable()
export class UserResolver implements Resolve<User> {
export class UserResolver {
constructor(private res: ResourceService, private userService: UserService, private consoleService: ConsoleService, private router: Router) {}
@@ -1,5 +1,5 @@
<div fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="center start" fxLayoutGap="10px" style="margin: 20px;" >
<mat-card *ngIf="showMessage" class="mat-typography" style="width:400px;min-height:230px">
<mat-card appearance="outlined" *ngIf="showMessage" class="mat-typography" style="width:400px;min-height:230px">
<mat-card-title-group>
<mat-card-title>{{ res.strings('activate_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('activate_subtitle') }}</mat-card-subtitle>
@@ -1,5 +1,5 @@
<div fxLayout.gt-sm="row" fxLayout.lt-md="column" fxLayoutAlign.gt-sm="center start" fxLayoutAlign.lt-md="center center" fxLayoutGap="10px" style="margin: 20px;" >
<mat-card class="mat-typography" style="width:400px">
<mat-card appearance="outlined" class="mat-typography" style="width:400px">
<mat-card-title-group>
<mat-card-title>{{ res.strings('change_reset_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('change_reset_subtitle') }}</mat-card-subtitle>
@@ -27,7 +27,7 @@
</div>
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card class="m-sm">
<mat-card appearance="outlined" class="m-sm">
<mat-card-title>{{res.strings('login_register_title')}}</mat-card-title>
<mat-card-subtitle>{{res.strings('login_register_subtitle')}}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
@@ -40,7 +40,7 @@
</button>
</mat-card-actions>
</mat-card>
<mat-card class="m-sm">
<mat-card appearance="outlined" class="m-sm">
<mat-card-content class="mat-typography">
<img mat-card-image src="assets/images/frontpage.png">
<mat-list>
@@ -39,7 +39,7 @@
</div>
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card class="m-sm">
<mat-card appearance="outlined" class="m-sm">
<mat-card-title>{{ res.strings('register_already_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('register_already_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption">
@@ -52,7 +52,7 @@
</button>
</mat-card-actions>
</mat-card>
<mat-card class="m-sm">
<mat-card appearance="outlined" class="m-sm">
<mat-card-title>{{ res.strings('register_why_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('register_why_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption">
@@ -34,7 +34,7 @@
<app-map #map [bounds]="initialBounds" [maxZoom]="16" draggable="true"></app-map>
<mat-card *ngIf="fetchInProgress || exportInProgress" class="bottom-overflow">
<mat-card appearance="outlined" *ngIf="fetchInProgress || exportInProgress" class="bottom-overflow">
<mat-label *ngIf="!indeterminate; else altLabel" class="fx-row fx-center progress-label" matLine>{{ res.strings('export_measurements_progress_label') }}: {{ progress }}%</mat-label>
<ng-template #altLabel>
<mat-label class="fx-row fx-center progress-label" matLine>{{ res.strings('export_measurements_alt_progress_label')}}</mat-label>
@@ -122,7 +122,7 @@
</div>
</div>
<div id='side' class="bg-default fx-column">
<mat-card class="mat-typography m-sm">
<mat-card appearance="outlined" class="mat-typography m-sm">
<mat-card-title-group>
<mat-card-title>{{ res.strings('manage_system_load_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('manage_system_load_subtitle') }}</mat-card-subtitle>
@@ -147,7 +147,7 @@
</mat-card-footer>
</mat-card-content>
</mat-card>
<mat-card class="mat-typography m-sm">
<mat-card appearance="outlined" class="mat-typography m-sm">
<mat-card-title>{{ res.strings('manage_system_memory_title') }}</mat-card-title>
<mat-card-subtitle>{{ res.strings('manage_system_memory_subtitle') }}</mat-card-subtitle>
<mat-card-content class="caption" style="flex:1">
@@ -12,7 +12,7 @@
</mat-toolbar>
<app-layout-double class="fx-fill fx-row fx-stretch">
<div id='main' class="fx-column">
<mat-card class="mat-elevation-z2 m-sm" *ngIf="measurements.length > 0">
<mat-card appearance="outlined" class="mat-elevation-z2 m-sm" *ngIf="measurements.length > 0">
<mat-card-content>
<app-weather-diagram style="height: 200px;" class="fx-fill" [data]="measurements" [startTime]="startTime" [endTime]="endTime" interactive="true" (selected)="onClick($event)"></app-weather-diagram>
</mat-card-content>
@@ -50,7 +50,7 @@
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<div *ngIf="measurement != null; else noSelection" class="m-sm fx-column fx-center">
<mat-card class="fx-fill" style="padding: 0;">
<mat-card appearance="outlined" class="fx-fill" style="padding: 0;">
<mat-card-header class="pt-md pl-sm pb-sm pr-sm">
<mat-icon mat-card-avatar class="fs-avatar">place</mat-icon>
<mat-card-title>{{ res.strings('user_device_position_title')}}</mat-card-title>
@@ -60,7 +60,7 @@
<app-map [coordinate]="measurement.coordinate" zoom="12" [markers]="markers" ></app-map>
</mat-card-content>
</mat-card>
<mat-card class="mt-sm fx-fill mat-elevation-z2">
<mat-card appearance="outlined" class="mt-sm fx-fill mat-elevation-z2">
<mat-card-header>
<i mat-card-avatar class="fs-avatar jam jam-ruler"></i>
<mat-card-title>{{ res.strings('user_device_measurement_title')}}</mat-card-title>
@@ -43,7 +43,7 @@
</div>
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card class="mat-elevation-z2 m-sm" >
<mat-card appearance="outlined" class="mat-elevation-z2 m-sm" >
<mat-card-header>
<mat-icon mat-card-avatar class="fs-avatar">help_outline</mat-icon>
<mat-card-title>{{ res.strings('user_devices_hint_title') }}</mat-card-title>
@@ -5,7 +5,7 @@
</mat-toolbar>
<app-layout-double class="fx-fill fx-row fx-stretch">
<div id='main' class="fx-row fx-wrap fx-stretch fx-even bg-world" *ngIf="!loading; else progressBar">
<mat-card class="mat-elevantion-z2 m-sm clickable hov-accent" style="width: 300px; height: 180px;" *ngFor="let location of locations" (click)="onClick(location)">
<mat-card appearance="outlined" class="mat-elevantion-z2 m-sm clickable hov-accent" style="width: 300px; height: 180px;" *ngFor="let location of locations" (click)="onClick(location)">
<mat-card-header>
<mat-icon mat-card-avatar class="fs-avatar">{{ location.type | locationIcon}}</mat-icon>
<mat-card-title class="ellipsis" style="width: 165px;" [ngClass]="{ 'pt-sm': !location.parent, 'pb-sm': !location.parent }">{{ location.names | localName }}</mat-card-title>
@@ -44,7 +44,7 @@
</div>
</ng-template>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card class="mat-elevation-z2 m-sm" >
<mat-card appearance="outlined" class="mat-elevation-z2 m-sm" >
<mat-card-header>
<mat-icon mat-card-avatar class="fs-avatar">help_outline</mat-icon>
<mat-card-title>{{ res.strings('user_favorites_hint_title') }}</mat-card-title>
@@ -10,7 +10,7 @@
</div>
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card class="mat-elevation-z2 m-sm" style="height: 300px; padding: 0">
<mat-card appearance="outlined" class="mat-elevation-z2 m-sm" style="height: 300px; padding: 0">
<mat-card-content class="fx-h100 fx-row">
<app-map class="fx-fill" [bounds]="bounds" [markers]="markers"></app-map>
</mat-card-content>
@@ -13,7 +13,7 @@
</mat-toolbar>
<app-layout-double class="fx-fill fx-row fx-stretch">
<div id='main' class="fx-column">
<mat-card class="m-sm mat-elevation-z2" style="padding: 0px;">
<mat-card appearance="outlined" class="m-sm mat-elevation-z2" style="padding: 0px;">
<mat-card-header class="pl-sm pr-sm pt-sm">
<div mat-card-avatar><mat-icon class="fs-avatar">place</mat-icon></div>
<mat-card-title>{{ city.names | localName }}</mat-card-title>
@@ -72,7 +72,7 @@
</ng-container>
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card *ngIf="condition | async as c" class="m-sm">
<mat-card appearance="outlined" *ngIf="condition | async as c" class="m-sm">
<mat-card-header>
<div mat-card-avatar style="font-size: 42px; width: 60px;"><i [class]="c.type | weatherIcon"></i></div>
<mat-card-title>{{ res.strings('city_info_title') }}</mat-card-title>
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild, AfterViewInit, ElementRef } from '@angular/core';
import { FormControl } from "@angular/forms";
import { UntypedFormControl } from "@angular/forms";
import { Router } from '@angular/router';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from "@angular/material/autocomplete";
import { Subscription } from 'rxjs';
@@ -102,7 +102,7 @@ export class ConditionMapComponent implements OnInit, AfterViewInit {
/**
* FormControl of the map's search bar.
*/
term: FormControl;
term: UntypedFormControl;
/**
* Reference of the MatAutocomplete element to connect to the search bar input.
*/
@@ -172,7 +172,7 @@ export class ConditionMapComponent implements OnInit, AfterViewInit {
) { }
ngOnInit(): void {
this.term = new FormControl('');
this.term = new UntypedFormControl('');
this.autocompIdle = true;
this.pendingMapTiles = new Map<string, MapTile>();
this.cachedMapTiles = new Map<string, MapTile>();
@@ -11,7 +11,7 @@
</mat-toolbar>
<app-layout-single class="fx-fill fx-row fx-stretch bg-white">
<div class="m-sm">
<mat-card style="padding: 0px;" class="fx-flex mat-elevation-z2">
<mat-card appearance="outlined" style="padding: 0px;" class="fx-flex mat-elevation-z2">
<mat-card-header class="pl-sm pr-sm pt-sm">
<div mat-card-avatar><mat-icon class="fs-avatar">public</mat-icon></div>
<mat-card-title class="p-sm">{{ country.names | localName }}</mat-card-title>
@@ -12,7 +12,7 @@
</mat-toolbar>
<app-layout-single class="fx-fill fx-row fx-stretch bg-white">
<div class="m-sm">
<mat-card style="padding: 0px;" class="fx-flex mat-elevation-z2">
<mat-card appearance="outlined" style="padding: 0px;" class="fx-flex mat-elevation-z2">
<mat-card-header class="pl-sm pr-sm pt-sm">
<div mat-card-avatar><mat-icon class="fs-avatar">map</mat-icon></div>
<mat-card-title>{{ state.names | localName }}</mat-card-title>
@@ -10,7 +10,7 @@
</mat-toolbar>
<app-layout-double class="fx-fill fx-row fx-stretch">
<div id='main' class="fx-column">
<mat-card style="padding: 0px;" class="fx-flex mat-elevation-z2 m-sm">
<mat-card appearance="outlined" style="padding: 0px;" class="fx-flex mat-elevation-z2 m-sm">
<mat-card-header class="pl-sm pr-sm pt-sm">
<div mat-card-avatar><mat-icon class="fs-avatar">toys</mat-icon></div>
<mat-card-title>{{ station.name }}</mat-card-title>
@@ -23,7 +23,7 @@
</div>
</mat-card-content>
</mat-card>
<mat-card class="mat-elevation-z2 m-sm" *ngIf="reports.length > 0">
<mat-card appearance="outlined" class="mat-elevation-z2 m-sm" *ngIf="reports.length > 0">
<mat-card-content>
<app-weather-diagram style="height: 200px;" class="fx-fill" [data]="reports" [startTime]="startTime" [endTime]="endTime"></app-weather-diagram>
</mat-card-content>
@@ -31,7 +31,7 @@
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<div *ngIf="report | async as r" >
<mat-card class="m-sm">
<mat-card appearance="outlined" class="m-sm">
<mat-card-header>
<div mat-card-avatar class="fs-avatar"><i class="jam jam-ruler"></i></div>
<mat-card-title>{{ res.strings('station_latest_report') }}</mat-card-title>
@@ -18,7 +18,7 @@
</div>
</div>
<div id='side' class="bg-gray fx-column mat-typography">
<mat-card class="mat-elevation-z2 m-sm" style="height: 300px; padding: 0">
<mat-card appearance="outlined" class="mat-elevation-z2 m-sm" style="height: 300px; padding: 0">
<mat-card-content class="fx-h100 fx-row">
<app-map class="fx-fill" [bounds]="bounds" [markers]="markers"></app-map>
</mat-card-content>
@@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
import { ResourceService } from '../services/resource.service';
import { StationsService } from '../services/stations.service';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { Subscription } from 'rxjs';
import { MapComponentMarker } from '../widgets-common/map.component';
import { Coordinate } from '../api';
@@ -14,7 +14,7 @@ import { Router } from '@angular/router';
})
export class StationsComponent implements OnInit, OnDestroy {
term = new FormControl();
term = new UntypedFormControl();
termSubscription: Subscription;
stationSubscription: Subscription;
markers: MapComponentMarker[] = [];
@@ -1,5 +1,5 @@
import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';
import { FormControl } from "@angular/forms";
import { UntypedFormControl } from "@angular/forms";
import { MatAutocomplete, MatAutocompleteSelectedEvent } from "@angular/material/autocomplete";
import { Subscription } from "rxjs";
import { ResourceService } from "../services/resource.service";
@@ -18,7 +18,7 @@ export class LocationAutocompleteComponent implements OnInit, AfterViewInit, OnD
/**
* Term which is detected for changes. Mandatory.
*/
@Input() term: FormControl;
@Input() term: UntypedFormControl;
/**
* Specifies the width of the drop down menu.
*/
@@ -1,4 +1,4 @@
<mat-card class="m-sm" style="padding-left: 0; padding-right: 0;">
<mat-card appearance="outlined" class="m-sm" style="padding-left: 0; padding-right: 0;">
<mat-card-header>
<mat-card-title>Networked Embedded Systems</mat-card-title>
<mat-card-subtitle>Universität Duisburg-Essen</mat-card-subtitle>
@@ -1,7 +1,7 @@
import { Component, OnInit, Input } from '@angular/core';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { Router } from '@angular/router';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { LocationHierarchy } from '../api';
import { ResourceService } from '../services/resource.service';
@@ -11,7 +11,7 @@ import { ResourceService } from '../services/resource.service';
@Component({
selector: 'app-search-field',
templateUrl: './search-field.component.html',
styles: [ '.mat-input-element::placeholder { color: white; opacity: 0.75; }']
styles: [ '.mat-mdc-input-element::placeholder { color: white; opacity: 0.75; }']
})
export class SearchFieldComponent implements OnInit {
/**
@@ -21,7 +21,7 @@ export class SearchFieldComponent implements OnInit {
@Input() navigateFn: (location: LocationHierarchy, url: string) => any;
autocomplete: MatAutocomplete;
term = new FormControl('');
term = new UntypedFormControl('');
idle = true;
onLocationSelected: (MatAutocompleteSelectedEvent) => void;
@@ -1,4 +1,4 @@
<mat-card style="width: 180px;" class="m-sm">
<mat-card appearance="outlined" style="width: 180px;" class="m-sm">
<div class="fx-column">
<div class="fx-row">
<div class="ta-c" style="margin-right: 5px; font-size: 42px; width: 65px; height: 50px;" [matTooltip]="condition.type | weather"><i [class]="condition.type | weatherIcon"></i></div>
@@ -1,4 +1,4 @@
<mat-card style="width: 300px;" *ngIf="hasCondition()" (click)="onClick()" class="clickable hov-accent"
<mat-card appearance="outlined" style="width: 300px;" *ngIf="hasCondition()" (click)="onClick()" class="clickable hov-accent"
[ngClass]="noMargin ? '' : 'mt-sm mb-sm'">
<div class="fx-column">
<div class="fx-row">
@@ -1,7 +1,7 @@
<!--<div [ngClass]="!dayTime ? 'mws-inline' : ''">-->
<div #outerContainer class="mws-outer-container">
<ng-template #errMsg>
<mat-card>
<mat-card appearance="outlined">
<mat-card-header>
<mat-card-title>{{ res.strings('web_comp_err_title') }}</mat-card-title>
</mat-card-header>
@@ -53,7 +53,7 @@ const apidomain = (): { http: string, ws: string } => {
imports: [
BrowserModule,
BrowserAnimationsModule,
RouterModule.forRoot([], { relativeLinkResolution: 'legacy' }),
RouterModule.forRoot([], {}),
HttpClientModule,
ReactiveFormsModule,
MatIconModule,
+1 -7
View File
@@ -1,12 +1,6 @@
/**
* Required to support Web Animations `@angular/platform-browser/animations`.
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
@@ -25,7 +19,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.
+24 -24
View File
@@ -1,10 +1,9 @@
// Import theming functions
@import '~@angular/material/theming';
@use '@angular/material' as mat;
@import 'theme.scss';
@import 'fonts.scss';
@import 'weather.scss';
@import 'jam.scss';
@import '~leaflet/dist/leaflet.css';
// sizes for paddings and margins
@@ -62,8 +61,8 @@ a {
.fx-h100 { height: 100%; }
.fx-w100 { width: 100%; }
.fx-center { justify-content: center; align-items: center; }
.fx-content { flex: 0 1 $size-content; justify-self: stretch; @include mat-elevation(2); z-index: 10; }
.fx-main { flex: 0 1 $size-main; @include mat-elevation(2); z-index: 10;}
.fx-content { flex: 0 1 $size-content; justify-self: stretch; @include mat.elevation(2); z-index: 10; }
.fx-main { flex: 0 1 $size-main; @include mat.elevation(2); z-index: 10;}
.fx-side { flex: 0 1 $size-side; }
.fx-compact { flex: 1 1 100%; align-self: stretch; justify-self: stretch;}
.fx-auto { flex: 1 1 auto; }
@@ -113,8 +112,8 @@ a {
.bg-default { background-color: $app-background-default; }
.bg-white { background-color: white; }
.bg-lighter { background:rgba(255,255,255,0.1); }
.bg-accent { background-color: mat-color($app-accent); }
.bg-primary { background-color: mat-color($app-primary); }
.bg-accent { background-color: mat.get-color-from-palette($app-accent); }
.bg-primary { background-color: mat.get-color-from-palette($app-primary); }
.bg-world {
background-image: url('assets/images/world.svg');
background-repeat: no-repeat;
@@ -128,8 +127,8 @@ a {
/* foreground colors */
.fg-white { color: white; }
.fg-gray { color: rgba($color: #000000, $alpha: 0.4) }
.fg-accent { color: mat-color($app-accent); }
.fg-primary { color: mat-color($app-primary); }
.fg-accent { color: mat.get-color-from-palette($app-accent); }
.fg-primary { color: mat.get-color-from-palette($app-primary); }
/* rotation for wind direction icons */
.rotate-45 { transform: rotate(45deg); }
@@ -144,21 +143,21 @@ a {
/* gradient in column layouts on the right */
.gradient-right {
background-color: mat-color($app-primary);
background-color: mat.get-color-from-palette($app-primary);
// background-image: radial-gradient(circle at top left, mat-color($app-primary) 10%, mat-color($app-primary-light) 75%, mat-color($app-primary) 100%);
align-self: stretch;
}
/* gradient in column layouts on the left */
.gradient-left {
background-color: mat-color($app-primary);
background-color: mat.get-color-from-palette($app-primary);
// background-image: radial-gradient(circle at bottom right, mat-color($app-primary) 10%, mat-color($app-primary-light) 75%, mat-color($app-primary) 100%);
align-self: stretch;
}
/* sets the cursor to indicate something clickable */
.clickable { cursor: pointer; }
.hov-accent:hover { background-color: mat-color($app-accent);}
.hov-accent:hover { background-color: mat.get-color-from-palette($app-accent);}
/* cuts of the text, for this to work, you need to set the width */
.ellipsis {
@@ -173,7 +172,7 @@ a {
/** green toolbar at the top */
.app-bar {
@include mat-elevation(4);
@include mat.elevation(4);
z-index: 100;
position:relative;
min-height: 64px;
@@ -181,10 +180,10 @@ a {
/* yellow toolbar at the top */
.view-bar {
@include mat-elevation(1);
@include mat.elevation(1);
z-index: 50;
position:relative;
background-color: mat-color($app-accent);
background-color: mat.get-color-from-palette($app-accent);
min-height: 64px;
}
@@ -197,41 +196,41 @@ a {
.icon-button { font-size: 18px; height: auto !important; vertical-align: text-bottom !important; }
/* bugfix for paginator in edge */
.mat-paginator-container .mat-icon-button {
.mat-mdc-paginator-container .mat-mdc-icon-button {
height: auto !important;
}
/* remove the padding around the conditions dialog */
.conditions-dialog .mat-dialog-container {
.conditions-dialog .mat-mdc-dialog-container {
padding: 0px;
}
.snackbar-accent {
background-color: mat-color($app-accent);
background-color: mat.get-color-from-palette($app-accent);
color: black;
}
.snackbar-primary {
background-color: mat-color($app-primary);
background-color: mat.get-color-from-palette($app-primary);
color: white;
}
.snackbar-primary > .mat-simple-snackbar {
.snackbar-primary > .mat-mdc-simple-snack-bar {
justify-content: space-around;
}
.snackbar-accent > .mat-simple-snackbar {
.snackbar-accent > .mat-mdc-simple-snack-bar {
justify-content: space-around;
}
.video-overlay {
background-color: rgba(mat-color($app-accent), 0.8);
background-color: rgba(mat.get-color-from-palette($app-accent), 0.8);
justify-content: center;
padding-top: 10px;
padding-bottom: 10px;
width: 110px;
box-sizing: border-box;
border-radius: round(5px);
border: 3px solid rgba(mat-color($app-primary), 0.8);
border: 3px solid rgba(mat.get-color-from-palette($app-primary), 0.8);
color: black;
}
@@ -310,7 +309,7 @@ a {
.register-link {
color: mat-color($app-accent-dark);
color: mat.get-color-from-palette($app-accent-dark);
font-weight: 600;
text-decoration: none;
}
@@ -320,6 +319,7 @@ a {
text-align: center;
}
/* TODO(mdc-migration): The following rule targets internal classes of checkbox that may no longer apply for the MDC version.*/
.long-checkbox .mat-checkbox-layout {
padding-top: 20px;
white-space: normal;
@@ -342,7 +342,7 @@ a {
div.forecast-tooltip {
font-family: Montserrat;
background-color: #FFFFFF;
border-color: mat-color($app-primary);
border-color: mat.get-color-from-palette($app-primary);
}
div.forecast-tooltip:hover {
z-index: 10000;
+4 -8
View File
@@ -1,20 +1,16 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
+30 -55
View File
@@ -1,69 +1,44 @@
@import '~@angular/material/theming';
// Custom Theming for Angular Material
// For more information: https://material.angular.io/guide/theming
@use '@angular/material' as mat;
// Plus imports for other components in your app.
// Include the common styles for Angular Material. We include this here so that you only
// have to load a single css file for Angular Material in your app.
// Be sure that you only ever include this mixin once!
@include mat-core();
$md-mowesta: (
50 : #f1f1f1,
100 : #dcdbdb,
200 : #c4c4c4,
300 : #acacac,
400 : #9b9a9a,
500 : #898888,
600 : #818080,
700 : #767575,
800 : #6c6b6b,
900 : #595858,
A100 : #facdcd,
A200 : #f59f9f,
A400 : #ff6262,
A700 : #ff4848,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #000000,
400 : #000000,
500 : #000000,
600 : #000000,
700 : #ffffff,
800 : #ffffff,
900 : #ffffff,
A100 : #000000,
A200 : #000000,
A400 : #000000,
A700 : #ffffff,
)
);
@include mat.core();
// Define the palettes for your theme using the Material Design palettes available in palette.scss
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://www.google.com/design/spec/style/color.html
$app-primary:mat-palette($mat-teal, 800);
$app-primary-light:mat-palette($mat-teal, 200);
$app-accent: mat-palette($mat-yellow, 800);
$app-accent-dark: mat-palette($mat-red, 800);
$app-background-default: #fafafa;
// hue. Available color palettes: https://material.io/design/color/
$app-primary:mat.define-palette(mat.$teal-palette, 800);
$app-accent: mat.define-palette(mat.$yellow-palette, 800);
$app-warn: mat.define-palette(mat.$red-palette);
// The warn palette is optional (defaults to red).
$app-warn: mat-palette($mat-red);
// Create the theme object (a Sass map containing all of the palettes).
$app-theme: mat-light-theme($app-primary, $app-accent, $app-warn);
// change the material typography font
$custom-typography: mat-typography-config(
$font-family: 'Montserrat'
);
@include angular-material-typography($custom-typography);
// Create the theme object. A theme consists of configurations for individual
// theming systems such as "color" or "typography".
$app-theme: mat.define-light-theme((
color: (
primary: $app-primary,
accent: $app-accent,
warn: $app-warn,
)
));
// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include angular-material-theme($app-theme);
@include mat.all-component-themes($app-theme);
// Change the fonts
$app-typography: mat.define-typography-config(
$font-family: 'Montserrat'
);
@include mat.typography-hierarchy($app-typography);
$app-accent-dark: mat.define-palette(mat.$red-palette, 800);
$app-background-default: #fafafa;