diff --git a/web-angular/angular.json b/web-angular/angular.json index 0a3efb9..6e3d545 100644 --- a/web-angular/angular.json +++ b/web-angular/angular.json @@ -87,7 +87,7 @@ "src/tsconfig.spec.json" ], "exclude": [ - "**/node_modules/**" + "**/node_modules/**", "src/api/**" ] } } @@ -129,4 +129,4 @@ "prefix": "app" } } -} \ No newline at end of file +} diff --git a/web-angular/src/app/app.component.ts b/web-angular/src/app/app.component.ts index 9a7c2a4..407dc6c 100644 --- a/web-angular/src/app/app.component.ts +++ b/web-angular/src/app/app.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; @Component({ - selector: 'app', + selector: 'app-app', templateUrl: './app.component.html' }) export class AppComponent { diff --git a/web-angular/src/app/app.module.ts b/web-angular/src/app/app.module.ts index c6bfa7d..20cb0df 100644 --- a/web-angular/src/app/app.module.ts +++ b/web-angular/src/app/app.module.ts @@ -5,10 +5,19 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { NgxGaugeModule } from 'ngx-gauge'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import {MatButtonModule, MatIconModule, MatCheckboxModule, MatSidenavModule, MatToolbarModule, MatTooltipModule, MatCardModule, MatInputModule, MatFormFieldModule, MatProgressBarModule, MatProgressSpinnerModule, MatSnackBarModule, MatDialogContent, MatDialogModule, MatListModule, MatPaginatorModule, MatTableModule, MAT_PAGINATOR_INTL_PROVIDER, MatPaginatorIntl, MatExpansionModule, MatSelectModule, MatDatepickerModule, MatNativeDateModule, MatTabsModule, MatGridListModule} from '@angular/material'; +import { MatButtonModule, MatIconModule, + MatCheckboxModule, MatSidenavModule, + MatToolbarModule, MatTooltipModule, MatCardModule, + MatInputModule, MatFormFieldModule, + MatProgressBarModule, MatProgressSpinnerModule, + MatSnackBarModule, MatDialogModule, + MatListModule, MatPaginatorModule, MatTableModule, + MatPaginatorIntl, MatExpansionModule, MatSelectModule, + MatDatepickerModule, MatNativeDateModule, + MatTabsModule, MatGridListModule } from '@angular/material'; import { LocationStrategy, PathLocationStrategy, registerLocaleData, DatePipe } from '@angular/common'; -import LocaleDE from '@angular/common/locales/de' +import LocaleDE from '@angular/common/locales/de'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; @@ -19,7 +28,7 @@ import { InsideComponent } from './layouts/inside.component'; import { OutsideComponent } from './layouts/outside.component'; import { FooterComponent } from './layouts/footer.component'; -import { ToolbarButtonComponent } from './widgets/toolbar-button.component' +import { ToolbarButtonComponent } from './widgets/toolbar-button.component'; import { LoginComponent } from './views/login.component'; import { DelayInterceptor } from './interceptors/delay.interceptor'; import { AuthInterceptor } from './interceptors/auth.interceptor'; @@ -80,18 +89,18 @@ import { ResourceService } from './services/resource.service'; /** * Computes the api domain from the browser location. */ -const apidomain = ():{ http: string, ws: string } => { - let host = document.location.hostname; - let port = document.location.port; - let protocol = document.location.protocol; - var hostportpath = ""; +const apidomain = (): { http: string, ws: string } => { + const host = document.location.hostname; + const port = document.location.port; + const protocol = document.location.protocol; + let hostportpath = ''; if (port.length > 0) { - hostportpath = "://" + host + ":" + port + "/api"; + hostportpath = '://' + host + ':' + port + '/api'; } else { - hostportpath = "://" + host + "/api" + hostportpath = '://' + host + '/api'; } - let secure = (protocol != "http:")?"s":""; - return { http: "http" + secure + hostportpath, ws: "ws" + secure + hostportpath }; + const secure = (protocol !== 'http:') ? 's' : ''; + return { http: 'http' + secure + hostportpath, ws: 'ws' + secure + hostportpath }; }; /** @@ -108,14 +117,14 @@ registerLocaleData(LocaleDE); ToolbarButtonComponent, ProfileButtonComponent, LanguageSelectComponent, - DrawerComponent, + DrawerComponent, LoginFieldComponent, PasswordFieldComponent, EmailFieldComponent, NameFieldComponent, DecisionPanelComponent, MessageDialogComponent, - ConfirmationDialogComponent, + ConfirmationDialogComponent, TileMapComponent, MarkerMapComponent, LoginComponent, @@ -123,7 +132,7 @@ registerLocaleData(LocaleDE); ShareComponent, ActivateComponent, ResetComponent, - ChangeComponent, + ChangeComponent, DevicesComponent, DeviceLocationComponent, PrivilegesComponent, @@ -147,7 +156,7 @@ registerLocaleData(LocaleDE); BrowserModule, BrowserAnimationsModule, FormsModule, - FlexLayoutModule, + FlexLayoutModule, NgxGaugeModule, HttpClientModule, MatProgressBarModule, @@ -155,7 +164,7 @@ registerLocaleData(LocaleDE); MatPaginatorModule, MatExpansionModule, MatTableModule, - MatButtonModule, + MatButtonModule, MatInputModule, MatFormFieldModule, MatListModule, @@ -177,8 +186,8 @@ registerLocaleData(LocaleDE); ], providers: [ // injection token for http client - { provide: "domain", useValue: apidomain().http }, - { provide: "wsdomain", useValue: apidomain().ws }, + { provide: 'domain', useValue: 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) diff --git a/web-angular/src/app/app.routing.ts b/web-angular/src/app/app.routing.ts index cebb5ce..8673ea4 100644 --- a/web-angular/src/app/app.routing.ts +++ b/web-angular/src/app/app.routing.ts @@ -26,48 +26,48 @@ import { ManageNoticesComponent } from './views/manage-notices.component'; import { EditNoticeComponent } from './views/edit-notice.component'; export const routes: Routes = [ - { path: "", canActivate: [AuthGuard], canActivateChild:[AuthGuard], children: [ + { path: '', canActivate: [AuthGuard], canActivateChild: [AuthGuard], children: [ // inside (logged in) { path: 'devices', component: InsideComponent, children: [ - { path:'', component: DevicesComponent }, - { path:':id', children: [ + { path: '', component: DevicesComponent }, + { path: ':id', children: [ { path: 'location', component: DeviceLocationComponent }, { path: 'visits', component: DeviceVisitsComponent } ] }, ]}, - { path: 'notices', component: InsideComponent, children: [{ path:'', component: NoticesComponent }] }, + { path: 'notices', component: InsideComponent, children: [{ path: '', component: NoticesComponent }] }, { path: 'places', component: InsideComponent, children: [ - { path:'', component: PlacesComponent }, - { path:':id', component: PlaceVisitsComponent } + { path: '', component: PlacesComponent }, + { path: ':id', component: PlaceVisitsComponent } ] }, - { path: 'privileges', component: InsideComponent, children: [ - { path:'', component: PrivilegesComponent }, - { path:':token', component: ShareComponent } + { path: 'privileges', component: InsideComponent, children: [ + { path: '', component: PrivilegesComponent }, + { path: ':token', component: ShareComponent } ] }, { path: 'profile', component: InsideComponent, children: [ - { path:'', component: UserComponent } + { path: '', component: UserComponent } ]}, /// inside (admin) { path: 'manage', component: InsideComponent, children: [ { path: 'logs', component: ManageLogComponent }, { path: 'system', component: ManageSystemComponent }, { path: 'users', component: ManageUsersComponent }, - { path: 'notices', children:[ + { path: 'notices', children: [ { path: '', component: ManageNoticesComponent }, { path: ':id', component: EditNoticeComponent } ]} ]}, // outside (logged out) - { path: 'login', component: OutsideComponent, children: [{ path:'', component: LoginComponent }] }, - { path: 'register', component: OutsideComponent, children: [{ path:'', component: RegisterComponent }] }, - { path: 'reset', component: OutsideComponent, children: [ - { path:'', component: ResetComponent }, - { path:':token', component: ChangeComponent } + { path: 'login', component: OutsideComponent, children: [{ path: '', component: LoginComponent }] }, + { path: 'register', component: OutsideComponent, children: [{ path: '', component: RegisterComponent }] }, + { path: 'reset', component: OutsideComponent, children: [ + { path: '', component: ResetComponent }, + { path: ':token', component: ChangeComponent } ] }, - { path: 'activate', component: OutsideComponent, children: [{ path:':token', component: ActivateComponent }] }, - { path: 'shares', component: OutsideComponent, children: [{ path:':token', component: ShareComponent }] }, + { path: 'activate', component: OutsideComponent, children: [{ path: ':token', component: ActivateComponent }] }, + { path: 'shares', component: OutsideComponent, children: [{ path: ':token', component: ShareComponent }] }, // catch all - { path: '**', redirectTo: '/login' } + { path: '**', redirectTo: '/login' } ]} ]; diff --git a/web-angular/src/app/directives/use-parent-form.directive.ts b/web-angular/src/app/directives/use-parent-form.directive.ts index a445ceb..8fc4cf3 100644 --- a/web-angular/src/app/directives/use-parent-form.directive.ts +++ b/web-angular/src/app/directives/use-parent-form.directive.ts @@ -1,32 +1,32 @@ -import { Directive } from "@angular/core"; -import { NgForm, ControlContainer } from "@angular/forms"; +import { Directive } from '@angular/core'; +import { NgForm, ControlContainer } from '@angular/forms'; -/** +/** * Angular's template driven forms do not allow composition - * and the fallback of going to reactive froms is too + * and the fallback of going to reactive froms is too * complicated for enabling trivial form reuse of validation - * logic. - * + * logic. + * * This directive, taken from the github page at * https://github.com/angular/angular/issues/9600 * provides a clean and simple solution. - * - * The only thing that is required is to add - * use-parent-form to our children and they will + * + * The only thing that is required is to add + * useParentForm to our children and they will * properly attach to any enclosing ng form. - * + * * @author Marcus */ @Directive({ - selector: '[use-parent-form]', + selector: '[appUseParentForm]', providers: [ { provide: ControlContainer, - useFactory: function(form: NgForm):NgForm { + useFactory: function(form: NgForm): NgForm { return form; }, deps: [NgForm] } ] }) -export class UseParentFormDirective {} \ No newline at end of file +export class UseParentFormDirective {} diff --git a/web-angular/src/app/guards/auth.guard.ts b/web-angular/src/app/guards/auth.guard.ts index 938ab46..bd370a8 100644 --- a/web-angular/src/app/guards/auth.guard.ts +++ b/web-angular/src/app/guards/auth.guard.ts @@ -8,38 +8,38 @@ import { ConsoleService } from '../services/console.service'; export class AuthGuard implements CanActivate, CanActivateChild { private static readonly OUTSIDE: string[] = [ - "/login", "/register", "/shares", "/activate", "/reset" + '/login', '/register', '/shares', '/activate', '/reset' ]; private static readonly USER: string[] = [ - "/devices", "/notices", "/privileges", "/profile", "/places" + '/devices', '/notices', '/privileges', '/profile', '/places' ]; private static readonly ADMIN: string[] = [ - "/manage" + '/manage' ]; - private static readonly NO_USER = "/login"; - private static readonly NO_ADMIN = "/notices"; + private static readonly NO_USER = '/login'; + private static readonly NO_ADMIN = '/notices'; - constructor(private userService: UserService, private consoleService:ConsoleService, private router: Router) { } + constructor(private userService: UserService, private consoleService: ConsoleService, private router: Router) { } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable|boolean { - let url: string = state.url; + const url: string = state.url; // known outside stuff is ok for everyone - let outside = this.isOutside(url); - this.consoleService.log("Guard: Accepting outside route: " + url); - if (outside) return true; + const outside = this.isOutside(url); + this.consoleService.log('Guard: Accepting outside route: ' + url); + if (outside) { return true; } // handle known user and admin routes - let admin = this.isAdmin(url); - let user = this.isUser(url); - this.consoleService.log("Guard: Checking route: " + (admin?"admin":"not admin") + " " + (user?"user":"not user")); + const admin = this.isAdmin(url); + const user = this.isUser(url); + this.consoleService.log('Guard: Checking route: ' + (admin ? 'admin' : 'not admin') + ' ' + (user ? 'user' : 'not user')); - if (admin || user) return this.allow(url, admin); + if (admin || user) { return this.allow(url, admin); } // unknown route, go to default page - if (this.userService.state.getValue() == UserState.Available) { + if (this.userService.state.getValue() === UserState.Available) { this.router.navigate([AuthGuard.NO_ADMIN]); } else { this.router.navigate([AuthGuard.NO_USER]); @@ -51,22 +51,22 @@ export class AuthGuard implements CanActivate, CanActivateChild { return this.canActivate(route, state); } - private allow(url:string, onlyAdmin:boolean): Observable|boolean { - if (this.userService.state.getValue() == UserState.Available) { + private allow(url: string, onlyAdmin: boolean): Observable|boolean { + if (this.userService.state.getValue() === UserState.Available) { if (!onlyAdmin || this.userService.hasRole(UserRole.Admin)) { return true; } else { this.router.navigate([AuthGuard.NO_ADMIN]); return false; } - } else if (this.userService.state.getValue() == UserState.Unavailable) { + } else if (this.userService.state.getValue() === UserState.Unavailable) { this.userService.redirectUrl = url; this.router.navigate([AuthGuard.NO_USER]); return false; } else { - let result = new Subject(); - let subscription = this.userService.state.subscribe((state)=> { - if (state == UserState.Available) { + const result = new Subject(); + const subscription = this.userService.state.subscribe((state) => { + if (state === UserState.Available) { if (!onlyAdmin || this.userService.hasRole(UserRole.Admin)) { result.next(true); } else { @@ -79,7 +79,7 @@ export class AuthGuard implements CanActivate, CanActivateChild { result.next(false); } }); - result.subscribe((e)=>{ + result.subscribe((e) => { subscription.unsubscribe(); }); return result; @@ -87,24 +87,24 @@ export class AuthGuard implements CanActivate, CanActivateChild { } private isOutside(url: string): boolean { - for (let out of AuthGuard.OUTSIDE) { - if (url.startsWith(out)) return true; + for (const out of AuthGuard.OUTSIDE) { + if (url.startsWith(out)) { return true; } } return false; } private isUser(url: string): boolean { - for (let user of AuthGuard.USER) { - if (url.startsWith(user)) return true; + for (const user of AuthGuard.USER) { + if (url.startsWith(user)) { return true; } } return false; } private isAdmin(url: string): boolean { - for (let admin of AuthGuard.ADMIN) { - if (url.startsWith(admin)) return true; + for (const admin of AuthGuard.ADMIN) { + if (url.startsWith(admin)) { return true; } } return false; } -} \ No newline at end of file +} diff --git a/web-angular/src/app/interceptors/auth.interceptor.ts b/web-angular/src/app/interceptors/auth.interceptor.ts index 0f209f9..562ff16 100644 --- a/web-angular/src/app/interceptors/auth.interceptor.ts +++ b/web-angular/src/app/interceptors/auth.interceptor.ts @@ -17,28 +17,28 @@ export class AuthInterceptor implements HttpInterceptor { /** * Creates a new interceptor with the injected console service * and credentials service. - * + * * @param consoleService The console service for logging. * @param credentialService The credential service to create auth headers. - */ + */ constructor(private consoleService: ConsoleService, private credentialService: CredentialService) { } /** * Intercepts the requests and possibly attaches an auth header. - * + * * @param req The request that is intercepted. * @param next The handler to continue the request. */ intercept(req: HttpRequest, next: HttpHandler): Observable> { - let authHeader = this.credentialService.createHeader(); + const authHeader = this.credentialService.createHeader(); let clone = req; if (authHeader != null) { - this.consoleService.log("Attaching Authorization header."); - clone = req.clone({ headers: req.headers.set("Authorization", authHeader)}); + this.consoleService.log('Attaching Authorization header.'); + clone = req.clone({ headers: req.headers.set('Authorization', authHeader)}); } else { - this.consoleService.log("Skipping Authorization header."); + this.consoleService.log('Skipping Authorization header.'); } return next.handle(clone); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/interceptors/delay.interceptor.ts b/web-angular/src/app/interceptors/delay.interceptor.ts index 2a591c6..8ff01f7 100644 --- a/web-angular/src/app/interceptors/delay.interceptor.ts +++ b/web-angular/src/app/interceptors/delay.interceptor.ts @@ -15,7 +15,7 @@ export class DelayInterceptor implements HttpInterceptor { /** * The delay to slow down requests. */ - private delay: number = 500; + private delay = 500; /** * Creates a new interceptor with the injected console service @@ -24,8 +24,8 @@ export class DelayInterceptor implements HttpInterceptor { * @param consoleService The console service for logging. * @param delay The configurable delay. */ - constructor(private consoleService: ConsoleService, @Optional() @Inject('delayRequest') delay:number) { - if (delay) this.delay = delay; + constructor(private consoleService: ConsoleService, @Optional() @Inject('delayRequest') delay: number) { + if (delay) { this.delay = delay; } } /** @@ -43,18 +43,18 @@ export class DelayInterceptor implements HttpInterceptor { // // but we also want to delay errors, so we need to fully specify it const started = Date.now(); - var delayedRequest: Subject> = new Subject>(); + const delayedRequest: Subject> = new Subject>(); next.handle(req).subscribe(event => { - this.consoleService.log("Scheduling result for " + req.urlWithParams); - this.schedule(started, ()=> delayedRequest.next(event) ); + this.consoleService.log('Scheduling result for ' + req.urlWithParams); + this.schedule(started, () => delayedRequest.next(event) ); }, error => { - this.consoleService.log("Scheduling error for " + req.urlWithParams); + this.consoleService.log('Scheduling error for ' + req.urlWithParams); // hacky: +1 to ensure that error is sent after result - this.schedule(started + 100, ()=> delayedRequest.error(error) ); + this.schedule(started + 100, () => delayedRequest.error(error) ); }, () => { - this.consoleService.log("Scheduling completion for " + req.urlWithParams); + this.consoleService.log('Scheduling completion for ' + req.urlWithParams); // hacky: +2 to ensure that completion is sent last - this.schedule(started + 200, ()=> delayedRequest.complete() ); + this.schedule(started + 200, () => delayedRequest.complete() ); }); return delayedRequest; } @@ -68,18 +68,18 @@ export class DelayInterceptor implements HttpInterceptor { * @param completion The completion method to be called when the result * should be forwarded. */ - schedule(started: number, completion: ()=>void): void { + schedule(started: number, completion: () => void): void { const elapsed = Date.now() - started; - this.consoleService.log("Data received after " + elapsed + "ms."); + this.consoleService.log('Data received after ' + elapsed + 'ms.'); if (elapsed >= this.delay) { - this.consoleService.log("Forwarding data without delay."); + this.consoleService.log('Forwarding data without delay.'); completion(); } else { - var slowdown = this.delay - elapsed; - this.consoleService.log("Delaying data for " + slowdown + "ms."); - var delayedRequest: Subject> = new Subject>(); + const slowdown = this.delay - elapsed; + this.consoleService.log('Delaying data for ' + slowdown + 'ms.'); + const delayedRequest: Subject> = new Subject>(); setTimeout(() => { - this.consoleService.log("Forwarding delayed data."); + this.consoleService.log('Forwarding delayed data.'); completion(); }, slowdown); } diff --git a/web-angular/src/app/layouts/drawer.component.ts b/web-angular/src/app/layouts/drawer.component.ts index 15d6140..ea41485 100644 --- a/web-angular/src/app/layouts/drawer.component.ts +++ b/web-angular/src/app/layouts/drawer.component.ts @@ -4,30 +4,30 @@ import { Subscription } from 'rxjs'; import { UserService, UserRole } from '../services/user.service'; import { ResourceService } from '../services/resource.service'; -/** +/** * Shows the contents of the navigation drawer. */ @Component({ - selector: 'drawer', + selector: 'app-drawer', templateUrl: './drawer.component.html' }) -export class DrawerComponent implements OnInit, OnDestroy{ +export class DrawerComponent implements OnInit, OnDestroy { - admin:boolean = false; + admin = false; private subscription: Subscription; constructor(public res: ResourceService, private userService: UserService) { } - ngOnInit():void { - this.subscription = this.userService.state.subscribe((state)=> { + ngOnInit(): void { + this.subscription = this.userService.state.subscribe((state) => { this.admin = this.userService.hasRole(UserRole.Admin); }); } - ngOnDestroy():void { + ngOnDestroy(): void { this.subscription.unsubscribe(); } } - \ No newline at end of file + diff --git a/web-angular/src/app/layouts/footer.component.ts b/web-angular/src/app/layouts/footer.component.ts index 65a8470..1b5cfb8 100644 --- a/web-angular/src/app/layouts/footer.component.ts +++ b/web-angular/src/app/layouts/footer.component.ts @@ -1,18 +1,18 @@ import { Component } from '@angular/core'; import { ResourceService } from '../services/resource.service'; -/** +/** * The responsive footer of the web application * that contains a couple of links. */ @Component({ - selector: 'footer', + selector: 'app-footer', templateUrl: './footer.component.html' }) export class FooterComponent { constructor(public res: ResourceService) { - + } } diff --git a/web-angular/src/app/layouts/inside.component.html b/web-angular/src/app/layouts/inside.component.html index 0610990..dc035cf 100644 --- a/web-angular/src/app/layouts/inside.component.html +++ b/web-angular/src/app/layouts/inside.component.html @@ -7,20 +7,20 @@ Maptology
- - + +
- + -
+ \ No newline at end of file diff --git a/web-angular/src/app/layouts/inside.component.ts b/web-angular/src/app/layouts/inside.component.ts index 1286e54..0f89afc 100644 --- a/web-angular/src/app/layouts/inside.component.ts +++ b/web-angular/src/app/layouts/inside.component.ts @@ -6,7 +6,7 @@ import { MatSidenavContainer, MatSidenav } from '@angular/material'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'inside', + selector: 'app-inside', templateUrl: './inside.component.html' }) export class InsideComponent implements OnInit, OnDestroy { @@ -18,60 +18,59 @@ export class InsideComponent implements OnInit, OnDestroy { @ViewChild(MatSidenav, { static: true }) drawer: MatSidenav; - compact: boolean = false; - opened: boolean = true; + compact = false; + opened = true; - constructor(private userService: UserService, private router: Router, public res:ResourceService) { } + constructor(private userService: UserService, private router: Router, public res: ResourceService) { } - ngOnInit():void { + ngOnInit(): void { this.updateDrawer(window.innerWidth); this.opened = this.drawer.opened; - this.drawerSubscription = this.drawer.openedChange.subscribe((state)=>{ + this.drawerSubscription = this.drawer.openedChange.subscribe((state) => { this.opened = state; }); - this.routerSubscription = this.router.events.subscribe((event)=> { - if (this.compact) this.drawer.close(); + this.routerSubscription = this.router.events.subscribe((event) => { + if (this.compact) { this.drawer.close(); } }); } @HostListener('window:resize', ['$event']) - onResize(event:Event) { + onResize(event: Event) { this.updateDrawer((event.target as Window).innerWidth); - + } - toggleDrawer():void { + toggleDrawer(): void { this.drawer.toggle(); this.opened = this.drawer.opened; } updateDrawer(width: number): void { if (width < InsideComponent.DRAWER_BREAKPOINT && !this.compact) { - this.drawer.mode = "over"; + this.drawer.mode = 'over'; this.drawer.close(); this.compact = true; this.opened = false; } else if (width >= InsideComponent.DRAWER_BREAKPOINT && this.compact) { this.compact = false; - this.drawer.mode = "side" + this.drawer.mode = 'side'; this.drawer.open(); this.opened = true; } - if (this.drawer.opened != this.opened) { - if (this.opened) this.drawer.open(); - else this.drawer.close(); + if (this.drawer.opened !== this.opened) { + if (this.opened) { this.drawer.open(); } else { this.drawer.close(); } } } - ngOnDestroy():void { + ngOnDestroy(): void { this.drawerSubscription.unsubscribe(); this.routerSubscription.unsubscribe(); } - onLogout():void { + onLogout(): void { this.userService.logout(); - this.router.navigate(["/"]); + this.router.navigate(['/']); } } diff --git a/web-angular/src/app/layouts/outside.component.html b/web-angular/src/app/layouts/outside.component.html index a86fdf4..f420180 100644 --- a/web-angular/src/app/layouts/outside.component.html +++ b/web-angular/src/app/layouts/outside.component.html @@ -4,8 +4,8 @@ Maptology
- - + +
@@ -13,6 +13,6 @@ -
+ \ No newline at end of file diff --git a/web-angular/src/app/layouts/outside.component.ts b/web-angular/src/app/layouts/outside.component.ts index e9558a0..bb3f2cd 100644 --- a/web-angular/src/app/layouts/outside.component.ts +++ b/web-angular/src/app/layouts/outside.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'outside', + selector: 'app-outside', templateUrl: './outside.component.html' }) export class OutsideComponent { diff --git a/web-angular/src/app/providers/paginator.provider.ts b/web-angular/src/app/providers/paginator.provider.ts index df80927..39b63be 100644 --- a/web-angular/src/app/providers/paginator.provider.ts +++ b/web-angular/src/app/providers/paginator.provider.ts @@ -1,24 +1,24 @@ -import { MatPaginatorIntl } from "@angular/material"; -import { ResourceService } from "../services/resource.service"; -import { Inject } from "@angular/core"; +import { MatPaginatorIntl } from '@angular/material'; +import { ResourceService } from '../services/resource.service'; +import { Inject } from '@angular/core'; export class GermanPaginatorProvider extends MatPaginatorIntl { constructor(@Inject(ResourceService) public res: ResourceService) { super(); - this.firstPageLabel = res.strings("pagination_first_page"); - this.lastPageLabel = res.strings("pagination_last_page"); - this.nextPageLabel = res.strings("pagination_next_page"); - this.previousPageLabel = res.strings("pagination_previous_page"); - this.itemsPerPageLabel = res.strings("pagination_items_per_page"); + this.firstPageLabel = res.strings('pagination_first_page'); + this.lastPageLabel = res.strings('pagination_last_page'); + this.nextPageLabel = res.strings('pagination_next_page'); + this.previousPageLabel = res.strings('pagination_previous_page'); + this.itemsPerPageLabel = res.strings('pagination_items_per_page'); } - getRangeLabel = (page: number, pageSize: number, length: number):string => { - const labelOf = this.res.strings("pagination_of"); + getRangeLabel = (page: number, pageSize: number, length: number): string => { + const labelOf = this.res.strings('pagination_of'); if (length === 0 || pageSize === 0) { return '0 ' + labelOf + ' ' + length; } length = Math.max(length, 0); const startIndex = page * pageSize; const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize; return startIndex + 1 + ' - ' + endIndex + ' ' + labelOf + ' ' + length; } -} \ No newline at end of file +} diff --git a/web-angular/src/app/services/console.service.ts b/web-angular/src/app/services/console.service.ts index 496326b..8567722 100644 --- a/web-angular/src/app/services/console.service.ts +++ b/web-angular/src/app/services/console.service.ts @@ -8,7 +8,7 @@ import { Subject } from 'rxjs'; @Injectable() export class ConsoleService { - private static LOG:boolean = false; + private static LOG = false; private data: string[] = []; public messages: Subject = new Subject(); @@ -16,9 +16,9 @@ export class ConsoleService { constructor() { } log(message: string) { - if (!ConsoleService.LOG) return; - var date: Date = new Date(); - message = date.toISOString() + " " + message; + if (!ConsoleService.LOG) { return; } + const date: Date = new Date(); + message = date.toISOString() + ' ' + message; console.log(message); this.data.push(message); this.messages.next(this.data); diff --git a/web-angular/src/app/services/credential.service.ts b/web-angular/src/app/services/credential.service.ts index 9b0b461..1253f7e 100644 --- a/web-angular/src/app/services/credential.service.ts +++ b/web-angular/src/app/services/credential.service.ts @@ -10,7 +10,7 @@ import { HttpErrorResponse } from '@angular/common/http'; * the UserService. Application components should not use this * service, instead they should rely on the functions of the * UserService. - * + * * To let the stored credentials survive a page reload (without * actually having a session on the server), the credentials are * stored in the browser's session storage (if available). According @@ -24,17 +24,17 @@ export class CredentialService { /** * The key to store the password in the session store. */ - private static KEY_PASSWORD = "password"; + private static KEY_PASSWORD = 'password'; /** * The key to store the login in the session store. */ - private static KEY_LOGIN = "login"; + private static KEY_LOGIN = 'login'; /** * The login name. */ private login: string; - + /** * The password. */ @@ -80,7 +80,7 @@ export class CredentialService { /** * Sets the credentials contained in the * service to the specified login and password. - * + * * @param login The login. * @param password The password. */ @@ -90,7 +90,7 @@ export class CredentialService { this.saveCredentials(); } - /** + /** * Clears the credentials stored in the service */ clearCredential(): void { @@ -100,8 +100,8 @@ export class CredentialService { /** * Determines whether the specified password * matches the stored password. - * - * @param password The password to check. + * + * @param password The password to check. * @returns True if the password matches. */ hasPassword(password: string): boolean { @@ -109,7 +109,7 @@ export class CredentialService { } /** Determines whether the password and login name are set. - * + * * @returns True if the password and the username are set. */ hasCredential() { @@ -125,7 +125,7 @@ export class CredentialService { */ createHeader(): string { if (this.hasCredential()) { - return "Basic " + btoa(this.login + ":" + this.password); + return 'Basic ' + btoa(this.login + ':' + this.password); } else { return null; } diff --git a/web-angular/src/app/services/device-visit.service.ts b/web-angular/src/app/services/device-visit.service.ts index 6a74bcb..99d7e0d 100644 --- a/web-angular/src/app/services/device-visit.service.ts +++ b/web-angular/src/app/services/device-visit.service.ts @@ -9,7 +9,7 @@ import { AbstractPageService } from '../utils/pagination'; import { HttpResponse } from '@angular/common/http'; /** - * A service that handles visits for a particular device and time. + * A service that handles visits for a particular device and time. */ @Injectable() export class DeviceVisitService implements DataSource { @@ -19,45 +19,45 @@ export class DeviceVisitService implements DataSource { readonly date = new BehaviorSubject(new Date()); private elements = new BehaviorSubject([]); private places: Map = new Map(); - private loaders:number = 0; + private loaders = 0; private id: number; private subscriptions = 0; - constructor(private apiClientService:ApiClientService) { + constructor(private apiClientService: ApiClientService) { } - getVisits():Visit[] { + getVisits(): Visit[] { return this.elements.getValue(); } - setDevice(id:number) { - if (this.loading.getValue()) return; + setDevice(id: number) { + if (this.loading.getValue()) { return; } this.loading.next(true); this.device.next(null); this.elements.next([]); this.id = id; if (id != null) { - this.apiClientService.getDevice(id).subscribe((result)=>{ + this.apiClientService.getDevice(id).subscribe((result) => { this.device.next(result.body); this.loading.next(false); this.setDate(this.date.getValue()); - }, (error)=> { + }, (error) => { this.id = null; this.loading.next(false); }); - } + } } - setDate(date:Date) { - if (this.loading.getValue()) return; + setDate(date: Date) { + if (this.loading.getValue()) { return; } this.loading.next(true); - let d = (date==null)?new Date():new Date(date); + const d = (date == null) ? new Date() : new Date(date); d.setHours(0, 0, 0, 0); - let millis = d.getTime(); + const millis = d.getTime(); this.date.next(d); this.elements.next([]); - this.apiClientService.getDeviceVisits(this.id, millis, 24 * 60 * 60 * 1000).subscribe((result)=>{ + this.apiClientService.getDeviceVisits(this.id, millis, 24 * 60 * 60 * 1000).subscribe((result) => { this.elements.next(result.body); this.loadPlaces(); }, (error) => { @@ -66,36 +66,36 @@ export class DeviceVisitService implements DataSource { }); } - getPlace(id:number):Place { + getPlace(id: number): Place { return this.places.get(id); } private loadPlaces() { - var ids: number[] = new Array(); - for (let v of this.elements.getValue()) { + const ids: number[] = new Array(); + for (const v of this.elements.getValue()) { if (this.getPlace(v.place) == null) { ids.push(v.place); } } - if (ids.length == 0) { + if (ids.length === 0) { this.loading.next(false); } else { this.loaders = ids.length; - for (let v of ids) { - this.apiClientService.getPlace(v).subscribe((result)=> { + for (const v of ids) { + this.apiClientService.getPlace(v).subscribe((result) => { this.finishLoading(v, result.body); - }, (error)=>{ + }, (error) => { this.finishLoading(v, null); - }) - } + }); + } } } - private finishLoading(id:number, place: Place) { - if (place) this.places.set(id, place); + private finishLoading(id: number, place: Place) { + if (place) { this.places.set(id, place); } this.loaders -= 1; - if (this.loaders == 0) { + if (this.loaders === 0) { this.loading.next(false); } } diff --git a/web-angular/src/app/services/device.service.ts b/web-angular/src/app/services/device.service.ts index 314ea29..1aa351b 100644 --- a/web-angular/src/app/services/device.service.ts +++ b/web-angular/src/app/services/device.service.ts @@ -14,7 +14,7 @@ import { HttpResponse } from '@angular/common/http'; @Injectable() export class DeviceService extends AbstractPageService { - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } diff --git a/web-angular/src/app/services/manage-log.service.ts b/web-angular/src/app/services/manage-log.service.ts index 0c929c0..ddf1868 100644 --- a/web-angular/src/app/services/manage-log.service.ts +++ b/web-angular/src/app/services/manage-log.service.ts @@ -1,10 +1,10 @@ -import { Inject, Injectable } from "@angular/core"; -import { ConsoleService } from "./console.service"; -import { BehaviorSubject, Observable } from "rxjs"; -import { DataSource } from "@angular/cdk/table"; -import { LogMessage } from "../../api/models"; -import { CollectionViewer } from "@angular/cdk/collections"; -import { CredentialService } from "./credential.service"; +import { Inject, Injectable } from '@angular/core'; +import { ConsoleService } from './console.service'; +import { BehaviorSubject, Observable } from 'rxjs'; +import { DataSource } from '@angular/cdk/table'; +import { LogMessage } from '../../api/models'; +import { CollectionViewer } from '@angular/cdk/collections'; +import { CredentialService } from './credential.service'; @Injectable() export class ManageLogService implements DataSource { @@ -14,7 +14,7 @@ export class ManageLogService implements DataSource { readonly connecting: BehaviorSubject = new BehaviorSubject(false); private messages: BehaviorSubject = new BehaviorSubject([]); - private subscriptions: number = 0; + private subscriptions = 0; private socket: WebSocket; private timeout = null; private buffered: LogMessage[] = []; @@ -30,7 +30,7 @@ export class ManageLogService implements DataSource { this.buffered = []; if (this.timeout != null) { clearTimeout(this.timeout); - this.timeout = null; + this.timeout = null; } } @@ -44,32 +44,32 @@ export class ManageLogService implements DataSource { open(): void { - if (this.connecting.getValue() || this.socket) return; + if (this.connecting.getValue() || this.socket) { return; } this.clear(); - this.consoleService.log("Connecting to server."); + this.consoleService.log('Connecting to server.'); this.connecting.next(true); - this.socket = new WebSocket(this.domain + "/log/stream"); - this.socket.addEventListener<"open">("open", (event) => { - this.create("Websocket connection opened."); + this.socket = new WebSocket(this.domain + '/log/stream'); + this.socket.addEventListener<'open'>('open', (event) => { + this.create('Websocket connection opened.'); this.socket.send(this.credentialService.createHeader()); }); - this.socket.addEventListener<"message">("message", (message) => { - if (this.connecting.getValue()) this.connecting.next(false); - let logMessage: LogMessage = JSON.parse(message.data); + this.socket.addEventListener<'message'>('message', (message) => { + if (this.connecting.getValue()) { this.connecting.next(false); } + const logMessage: LogMessage = JSON.parse(message.data); // send to console, if setup - if (ManageLogService.CONSOLE_OUTPUT) this.print(logMessage); + if (ManageLogService.CONSOLE_OUTPUT) { this.print(logMessage); } this.add(logMessage); }); - this.socket.addEventListener<"close">("close", (close) => { + this.socket.addEventListener<'close'>('close', (close) => { this.connecting.next(false); - this.create("Websocket connection closed."); - }) + this.create('Websocket connection closed.'); + }); } private create(message: string) { this.add({ - id: 0, className: "LogService", methodName: "", - loggerName: "", level: "INFO", thread: 0, + id: 0, className: 'LogService', methodName: '', + loggerName: '', level: 'INFO', thread: 0, time: new Date().getTime(), trace: null, message: message }); @@ -78,33 +78,36 @@ export class ManageLogService implements DataSource { private add(logMessage: LogMessage): void { this.buffered.push(logMessage); if (this.timeout == null) { - this.timeout = setTimeout(()=>{ this.submit() }, 500); - } + this.timeout = setTimeout(() => { this.submit(); }, 500); + } } private submit(): void { // create new array and announce - let end = this.messages.getValue().length; - var start = 0; - if (end >= ManageLogService.MAXIMUM_MESSAGES - this.buffered.length) + const end = this.messages.getValue().length; + let start = 0; + if (end >= ManageLogService.MAXIMUM_MESSAGES - this.buffered.length) { start = end - ManageLogService.MAXIMUM_MESSAGES + this.buffered.length; - var newMessages = this.messages.getValue().slice(start, end).concat(this.buffered); + } + const newMessages = this.messages.getValue().slice(start, end).concat(this.buffered); this.buffered = []; this.messages.next(newMessages); this.timeout = null; } private print(logMessage: LogMessage): void { - var text = "[" + logMessage.id + "@" + logMessage.time + " (TRD-" + logMessage.thread + ") " + logMessage.className + "." + logMessage.methodName + "] " + logMessage.message; + let text = '[' + logMessage.id + '@' + logMessage.time + + ' (TRD-' + logMessage.thread + ') ' + logMessage.className + + '.' + logMessage.methodName + '] ' + logMessage.message; if (logMessage.trace != null) { - text += "\n" + logMessage.trace; + text += '\n' + logMessage.trace; } this.consoleService.log(text); } close(): void { if (this.socket != null) { - this.consoleService.log("Disconnecting from server."); + this.consoleService.log('Disconnecting from server.'); this.socket.close(); this.connecting.next(false); this.socket = null; diff --git a/web-angular/src/app/services/manage-notice.service.ts b/web-angular/src/app/services/manage-notice.service.ts index 014e725..0315171 100644 --- a/web-angular/src/app/services/manage-notice.service.ts +++ b/web-angular/src/app/services/manage-notice.service.ts @@ -1,9 +1,9 @@ -import { Injectable } from "@angular/core"; -import { AbstractPageService } from "../utils/pagination"; -import { NoticePage, Notice } from "../../api/models"; -import { ApiClientService } from "../../api"; -import { Observable, BehaviorSubject, Subject } from "rxjs"; -import { HttpResponse } from "@angular/common/http"; +import { Injectable } from '@angular/core'; +import { AbstractPageService } from '../utils/pagination'; +import { NoticePage, Notice } from '../../api/models'; +import { ApiClientService } from '../../api'; +import { Observable, BehaviorSubject, Subject } from 'rxjs'; +import { HttpResponse } from '@angular/common/http'; /** * A service that handles notices for admins. @@ -11,7 +11,7 @@ import { HttpResponse } from "@angular/common/http"; @Injectable() export class ManageNoticeService extends AbstractPageService { - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } @@ -20,20 +20,20 @@ export class ManageNoticeService extends AbstractPageService } setNotice(notice: Notice): Observable { - if (this.loading.getValue()) return new BehaviorSubject(null); + if (this.loading.getValue()) { return new BehaviorSubject(null); } this.loading.next(true); - var call: Observable>; - if (notice.id == 0) { + let call: Observable>; + if (notice.id === 0) { call = this.apiClientService.addNotice(notice); } else { call = this.apiClientService.setNotice(notice.id, notice); } - let result = new Subject(); - call.subscribe((response)=>{ + const result = new Subject(); + call.subscribe((response) => { this.loading.next(false); result.next(response.body); this.reload(); - }, (error)=> { + }, (error) => { this.loading.next(false); result.next(null); this.reload(); @@ -42,16 +42,16 @@ export class ManageNoticeService extends AbstractPageService } getNotice(id: number): Observable { - if (this.loading.getValue()) return new BehaviorSubject(null); + if (this.loading.getValue()) { return new BehaviorSubject(null); } this.loading.next(true); - let result = new Subject(); - this.apiClientService.getNotice(id).subscribe((response)=>{ + const result = new Subject(); + this.apiClientService.getNotice(id).subscribe((response) => { result.next(response.body); this.loading.next(false); - }, (error)=> { + }, (error) => { result.next(null); this.loading.next(false); }); return result; } -} \ No newline at end of file +} diff --git a/web-angular/src/app/services/manage-user.service.ts b/web-angular/src/app/services/manage-user.service.ts index 145ac34..0898702 100644 --- a/web-angular/src/app/services/manage-user.service.ts +++ b/web-angular/src/app/services/manage-user.service.ts @@ -1,9 +1,9 @@ -import { Injectable } from "@angular/core"; -import { AbstractPageService } from "../utils/pagination"; -import { User, UserPage } from "../../api/models"; -import { ApiClientService } from "../../api"; -import { Observable, BehaviorSubject, Subject } from "rxjs"; -import { HttpResponse } from "@angular/common/http"; +import { Injectable } from '@angular/core'; +import { AbstractPageService } from '../utils/pagination'; +import { User, UserPage } from '../../api/models'; +import { ApiClientService } from '../../api'; +import { Observable, BehaviorSubject, Subject } from 'rxjs'; +import { HttpResponse } from '@angular/common/http'; /** * A service that handles users for admins. @@ -17,7 +17,7 @@ export class ManageUserService extends AbstractPageService { */ private term: string = null; - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } @@ -29,8 +29,8 @@ export class ManageUserService extends AbstractPageService { } } - setTerm(term: string):boolean { - if (this.loading.getValue()) return false; + setTerm(term: string): boolean { + if (this.loading.getValue()) { return false; } if (term != null && term.trim().length > 0) { this.term = term.trim(); } else { @@ -46,14 +46,14 @@ export class ManageUserService extends AbstractPageService { setUser(user: User): Observable { - if (this.loading.getValue()) return new BehaviorSubject(false); + if (this.loading.getValue()) { return new BehaviorSubject(false); } this.loading.next(true); - let result = new Subject(); - this.apiClientService.setUser(user.id, user).subscribe((response)=>{ + const result = new Subject(); + this.apiClientService.setUser(user.id, user).subscribe((response) => { result.next(true); this.loading.next(false); this.reload(); - }, (error)=> { + }, (error) => { result.next(false); this.loading.next(false); this.reload(); diff --git a/web-angular/src/app/services/notice.service.ts b/web-angular/src/app/services/notice.service.ts index b9679f7..d4c731b 100644 --- a/web-angular/src/app/services/notice.service.ts +++ b/web-angular/src/app/services/notice.service.ts @@ -9,12 +9,12 @@ import { AbstractPageService } from '../utils/pagination'; import { HttpResponse } from '@angular/common/http'; /** - * A service that handles notices. + * A service that handles notices. */ @Injectable() export class NoticeService extends AbstractPageService { - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } diff --git a/web-angular/src/app/services/place-visit.service.ts b/web-angular/src/app/services/place-visit.service.ts index 40e4cb0..42b9736 100644 --- a/web-angular/src/app/services/place-visit.service.ts +++ b/web-angular/src/app/services/place-visit.service.ts @@ -9,7 +9,7 @@ import { AbstractPageService } from '../utils/pagination'; import { HttpResponse } from '@angular/common/http'; /** - * A service that handles visiss for a particular place. + * A service that handles visiss for a particular place. */ @Injectable() export class PlaceVisitService extends AbstractPageService { @@ -17,34 +17,33 @@ export class PlaceVisitService extends AbstractPageService { readonly place = new BehaviorSubject(null); private id: number; - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } - setPlace(id:number) { - if (this.id == id || this.loading.getValue()) return; + setPlace(id: number) { + if (this.id === id || this.loading.getValue()) { return; } this.id = null; this.place.next(null); this.reload(); if (id != null) { this.id = id; this.loading.next(true); - this.apiClientService.getPlace(id).subscribe((result)=>{ + this.apiClientService.getPlace(id).subscribe((result) => { this.place.next(result.body); this.loading.next(false); this.reload(); - }, (error)=> { + }, (error) => { this.id = null; this.loading.next(false); this.reload(); - }) + }); } } getPage(offset: number, size: number) { - if (this.loading.getValue()) return; - if (this.id == null) this.page.next(this.emptyPage()); - else super.getPage(offset, size); + if (this.loading.getValue()) { return; } + if (this.id == null) { this.page.next(this.emptyPage()); } else { super.getPage(offset, size); } } protected loadPage(offset: number, size: number): Observable> { diff --git a/web-angular/src/app/services/place.service.ts b/web-angular/src/app/services/place.service.ts index b0d372d..0fae1af 100644 --- a/web-angular/src/app/services/place.service.ts +++ b/web-angular/src/app/services/place.service.ts @@ -9,12 +9,12 @@ import { AbstractPageService } from '../utils/pagination'; import { HttpResponse } from '@angular/common/http'; /** - * A service that handles privileges. + * A service that handles privileges. */ @Injectable() export class PlaceService extends AbstractPageService { - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } diff --git a/web-angular/src/app/services/privilege.service.ts b/web-angular/src/app/services/privilege.service.ts index e3d89d6..1a585d0 100644 --- a/web-angular/src/app/services/privilege.service.ts +++ b/web-angular/src/app/services/privilege.service.ts @@ -9,12 +9,12 @@ import { AbstractPageService } from '../utils/pagination'; import { HttpResponse } from '@angular/common/http'; /** - * A service that handles privileges. + * A service that handles privileges. */ @Injectable() export class PrivilegeService extends AbstractPageService { - constructor(apiClientService:ApiClientService) { + constructor(apiClientService: ApiClientService) { super(apiClientService); } diff --git a/web-angular/src/app/services/resource.service.ts b/web-angular/src/app/services/resource.service.ts index f5abc35..85acf45 100644 --- a/web-angular/src/app/services/resource.service.ts +++ b/web-angular/src/app/services/resource.service.ts @@ -20,797 +20,826 @@ export interface Language { export class ResourceService { private values_de = { - "language":"de", + 'language': 'de', // buttons - "button_save" : "Speichern", - "button_change" : "Ändern", - "button_add": "Hinzufügen", - "button_update":"Aktualisieren", - "button_gotit": "Verstanden", - "button_reset": "Zurücksetzen", - "button_register" : "Registrieren", - "button_login" : "Anmelden", - "button_yes" : "Ja", - "button_no" : "Nein", - "button_ok" : "OK", - "button_cancel" : "Abbrechen", - "button_close": "Schließen", - "button_logout": "Abmelden", + 'button_save' : 'Speichern', + 'button_change' : 'Ändern', + 'button_add': 'Hinzufügen', + 'button_update': 'Aktualisieren', + 'button_gotit': 'Verstanden', + 'button_reset': 'Zurücksetzen', + 'button_register' : 'Registrieren', + 'button_login' : 'Anmelden', + 'button_yes' : 'Ja', + 'button_no' : 'Nein', + 'button_ok' : 'OK', + 'button_cancel' : 'Abbrechen', + 'button_close': 'Schließen', + 'button_logout': 'Abmelden', // components - "email_field_hint":"Emailadresse eingeben", - "email_field_placeholder":"Emailadresse", - "email_field_required":"Deine Emailadresse ist erforderlich.", - "email_field_pattern":"Deine Emailadresse ist ungültig.", - "language_select_placeholder":"Sprache", - "log_dialog_title":"Logeintrag", - "log_dialog_id":"ID", - "log_dialog_thread":"Thread", - "log_dialog_time":"Zeit", - "log_dialog_level":"Level", - "log_dialog_logger":"Logger", - "log_dialog_class":"Klasse", - "log_dialog_method":"Methode", - "log_dialog_message":"Nachricht", - "log_dialog_trace":"Trace", - "login_field_hint":"Kontoname eingeben", - "login_field_placeholder":"Kontoname", - "login_field_required":"Der Kontoname ist erforderlich.", - "login_field_pattern":"Der Kontoname enthält ein ungültiges Zeichen.", - "login_field_minlength":"Der Kontoname ist zu kurz.", - "name_field_hint":"Name eingeben", - "name_field_placeholder":"Name", - "name_field_required":"Dein Name ist erforderlich.", - "name_field_pattern":"Dein Name enthält ein ungültiges Zeichen.", - "nickname_dialog_title":"Ort benennen", - "nickname_dialog_subtitle":"Gib einen Namen für den Ort ein.", - "nickname_dialog_hint":"Name eingeben", - "nickname_dialog_placeholder":"Name", - "nickname_dialog_pattern":"Dein Name enthält ein ungültiges Zeichen.", - "nickname_dialog_success":"Der Ort wurde erfolgreich umbenannt.", - "nickname_dialog_conflict":"Der Ort wurde bereits verändert. Falls du die Änderung überschreiben möchtest, gib den Namen nochmal ein.", - "nickname_dialog_failure":"Der Ort konnte nicht umbennant werden.", - "notice_card_creation":"Veröffentlicht am", - "notice_card_modification":"Aktualisiert am", - "password_field_hint":"Passwort eingeben", - "password_field_placeholder":"Passwort", - "password_field_required":"Das Passwort ist erforderlich.", - "password_field_minlength":"Das Passwort ist zu kurz.", - "password_field_show": "Passwort anzeigen", - "password_field_hide": "Passwort verbergen", - "share_dialog_required":"Ein Freigabelink ist erforderlich.", - "share_dialog_pattern":"Der Freigabelink ist ungültig.", - "share_dialog_title":"Freigabe hinzufügen", - "share_dialog_subtitle":"Kopiere einen Freigabelink in das Feld um ihn zu speichern.", - "share_dialog_hint":"Freigabelink eingeben", - "share_dialog_placeholder":"Freigabelink", - "share_dialog_success":"Die Freigabe wurde erfolgreich hinzugefügt.", - "share_dialog_error":"Die Freigabe konnte nicht erstellt werden. Hast Du den Freigabelink vollständig eingegeben?", - "tile_map_attribution":"Maptology", + 'email_field_hint': 'Emailadresse eingeben', + 'email_field_placeholder': 'Emailadresse', + 'email_field_required': 'Deine Emailadresse ist erforderlich.', + 'email_field_pattern': 'Deine Emailadresse ist ungültig.', + 'language_select_placeholder': 'Sprache', + 'log_dialog_title': 'Logeintrag', + 'log_dialog_id': 'ID', + 'log_dialog_thread': 'Thread', + 'log_dialog_time': 'Zeit', + 'log_dialog_level': 'Level', + 'log_dialog_logger': 'Logger', + 'log_dialog_class': 'Klasse', + 'log_dialog_method': 'Methode', + 'log_dialog_message': 'Nachricht', + 'log_dialog_trace': 'Trace', + 'login_field_hint': 'Kontoname eingeben', + 'login_field_placeholder': 'Kontoname', + 'login_field_required': 'Der Kontoname ist erforderlich.', + 'login_field_pattern': 'Der Kontoname enthält ein ungültiges Zeichen.', + 'login_field_minlength': 'Der Kontoname ist zu kurz.', + 'name_field_hint': 'Name eingeben', + 'name_field_placeholder': 'Name', + 'name_field_required': 'Dein Name ist erforderlich.', + 'name_field_pattern': 'Dein Name enthält ein ungültiges Zeichen.', + 'nickname_dialog_title': 'Ort benennen', + 'nickname_dialog_subtitle': 'Gib einen Namen für den Ort ein.', + 'nickname_dialog_hint': 'Name eingeben', + 'nickname_dialog_placeholder': 'Name', + 'nickname_dialog_pattern': 'Dein Name enthält ein ungültiges Zeichen.', + 'nickname_dialog_success': 'Der Ort wurde erfolgreich umbenannt.', + 'nickname_dialog_conflict': 'Der Ort wurde bereits verändert. Falls Du die Änderung überschreiben möchtest, gib den Namen nochmal ein.', + 'nickname_dialog_failure': 'Der Ort konnte nicht umbennant werden.', + 'notice_card_creation': 'Veröffentlicht am', + 'notice_card_modification': 'Aktualisiert am', + 'password_field_hint': 'Passwort eingeben', + 'password_field_placeholder': 'Passwort', + 'password_field_required': 'Das Passwort ist erforderlich.', + 'password_field_minlength': 'Das Passwort ist zu kurz.', + 'password_field_show': 'Passwort anzeigen', + 'password_field_hide': 'Passwort verbergen', + 'share_dialog_required': 'Ein Freigabelink ist erforderlich.', + 'share_dialog_pattern': 'Der Freigabelink ist ungültig.', + 'share_dialog_title': 'Freigabe hinzufügen', + 'share_dialog_subtitle': 'Kopiere einen Freigabelink in das Feld um ihn zu speichern.', + 'share_dialog_hint': 'Freigabelink eingeben', + 'share_dialog_placeholder': 'Freigabelink', + 'share_dialog_success': 'Die Freigabe wurde erfolgreich hinzugefügt.', + 'share_dialog_error': 'Die Freigabe konnte nicht erstellt werden. Hast Du den Freigabelink vollständig eingegeben?', + 'tile_map_attribution': 'Maptology', // views - "user_title": "Konto", - "user_change_title" : "Informationen ändern", - "user_change_subtitle" : "Hier kannst Du Deine Kontaktinformationen ändern.", - "user_change_primary" : "Primäre Emailadresse", - "user_password_title" : "Passwort ändern", - "user_password_subtitle" : "Hier kannst Du Dein Passwort ändern.", - "user_password_old" : "Altes Passwort", - "user_password_old_hint" : "Altes Passwort eingeben", - "user_password_new" : "Neues Passwort", - "user_password_new_hint" : "Neues Passwort eingeben", - "user_add_email_title" : "Emailadresse hinzufügen", - "user_add_email_subtitle" : "Hier kannst Du eine neue Emailadresse registrieren.", - "user_del_email_title" : "Emailadresse löschen", - "user_del_email_subtitle" : "Hier kannst Du ungenutze Emailadressen löschen.", - "user_del_email_tooltip" : "Emailadresse löschen", - "user_email_registered_already" : "Die Emailadresse ist bereits registriert.", - "user_password_wrong_title" : "Passwort falsch", - "user_password_wrong_message" : "Dein derzeitiges Passwort stimmt nicht mit Deiner Eingabe überein. Bitte prüfe deine Eingabe und versuchs nochmal.", - "share_title" : "Freigabe", - "share_no_update_info" : "Die Freigabe konnte nicht abgerufen werden.", - "share_no_update_location" : "Der Standort konte nicht abgerufen werden.", - "share_token" : "Schlüssel", - "share_message" : "Nachricht", - "share_destination" : "Ziel", - "share_expiration" : "Ablauf", - "share_location" : "Standort", - "share_time" : "Zeit", - "share_availability" : "Status", - "share_longitude" : "Längengrad", - "share_latitude" : "Breitengrad", - "share_add_tooltip" : "Zu Konto hinzufügen", - "reset_confirm_title" : "Passwort zurückgesetzt", - "reset_confirm_message" : "Wir haben Dir einen Link an Deine Kontaktemailadresse versandt, mit dem Du Dein Passwort ändern kannst. Falls Dir Dein Passwort wieder einfällt, kannst Du die Email einfach löschen.", - "reset_account_error" : "Konto nicht gefunden. Bitte prüfe Deinen Kontonamen und versuchs nochmal.", - "reset_network_error" : "Fehler beim Zurücksetzen. Hast Du gerade kein Netz?", - "reset_title" : "Passwort zurücksetzen", - "reset_subtitle" : "Gib Deinen Kontonamen an um Dein Passwort zurückzusetzen.", - "register_accept_terms_title" : "Nutzungsbedingungen", - "register_accept_terms_message" : "Um Dein Konto zu beantragen musst du zuerst den Nutzungsbedingungen zustimmen.", - "register_success_title" : "Einrichtung erfolgreich", - "register_success_message" : "Das Konto wurde eingerichtet. Bevor Du Dein Konto nutzen kannst, musst Du es aktivieren. Wir haben Dir eine Email mit einem Aktivierungslink zugeschickt. Bitte sieh in Deinem Postfach nach. Falls die Email lange nicht ankommt, schau auch mal in Deinen Spamordner!", - "register_conflict_error" : "Der Kontoname ist bereits vergeben. Such Dir bitte einen anderen aus.", - "register_network_error" : "Fehler bei der Registrierung. Hast du gerade kein Netz?", - "register_title" : "Registrieren", - "register_subtitle" : "Gib Deine Daten ein und lege ein neues Konto an.", - "register_terms_pre" : "Ich bin volljährig, habe die", - "register_terms_mid" : "gelesen und stimme den", - "register_terms_end" : "zu.", - "register_terms_service" : "Nutzungsbedingungen", - "register_terms_policy" : "Datenschutzerklärung", - "register_already_title" : "Du hast bereits ein Konto?", - "register_already_subtitle" : "Kein Problem!", - "register_already_paragraph" : "Geh einfach zur Anmeldung und gib Deinen Kontonamen und dein Passwort ein. Dann kannst Du sofort auf Deinen Standort und Deine besuchten Orte zugreifen!", - "register_why_title":"Warum registrieren?", - "register_why_subtitle":"Du musst nicht!", - "register_why_paragraph":"Viele Funktionen von Maptology lassen sich auch ohne Registrierung nutzen. Falls Du zum Beispiel Deinen Standort teilen möchtest, brauchst Du nur die mobile Anwendung. Zum Ansehen von Freigaben genügt sogar Dein Webbrowser.", - "register_why_moreinfo":"Mehr Infos", - "privileges_delete_confirm_title":"Freigabe löschen?", - "privileges_delete_confirm_message":"Möchtest Du die Freigabe wirklich löschen? Diesen Vorgang kannst Du nicht mehr rückgängig machen.", - "privileges_delete_success":"Die Freigabe wurde erfolgreich gelöscht.", - "privileges_delete_error":"Die Freigabe konnte nicht gelöscht werden. Hast Du gerade kein Netz?", - "privileges_title":"Freigaben", - "privileges_add_tooltip":"Freigabe hinzufügen", - "privileges_id":"ID", - "privileges_token":"Schlüssel", - "privileges_creation": "Erstellung", - "privileges_message": "Nachricht", - "privileges_destination": "Ziel", - "privileges_expiration": "Ablauf", - "privileges_actions" : "Aktionen", - "privileges_show_tooltip" : "Freigabe anzeigen", - "privileges_delete_tooltip" : "Freigabe löschen", - "places_delete_confirm_title":"Ort löschen?", - "places_delete_confirm_messages":"Möchtest Du den Ort wirklich löschen? Dieser Vorgang löscht auch alle Besuche an diesem Ort und Du kannst ihn nicht mehr rückgängig machen.", - "places_delete_success":"Der Ort wurde erfolgreich gelöscht.", - "places_delete_error":"Der Ort konnte nicht gelöscht werden. Hast Du gerade kein Netz?", - "places_title":"Orte", - "places_id":"ID", - "places_address":"Adresse", - "places_name":"Name", - "places_nickname":"Name", - "places_longitude":"Längengrad", - "places_latitude":"Breitengrad", - "places_creation":"Erstellung", - "places_modification":"Änderung", - "places_actions":"Aktionen", - "places_rename_tooltip":"Ort benennen", - "places_visits_tooltip":"Besuche anzeigen", - "places_delete_tooltip":"Ort löschen", - "visits_delete_confirm_title" : "Besuch löschen?", - "visits_delete_confirm_message" : "Möchtest Du den Besuch wirklich löschen? Diesen Vorgang kannst Du nicht mehr rückgängig machen.", - "visits_delete_success" : "Der Besuch wurde erfolgreich gelöscht.", - "visits_delete_error": "Der Besuch konnte nicht gelöscht werden. Hast Du gerade kein Netz?", - "visits_place_load_error": "Der Ort konnte nicht geladen werden.", - "visits_place": "Ort", - "visits_id": "ID", - "visits_manufacturer":"Hersteller", - "visits_model":"Modell", - "visits_os":"Betriebssystem", - "visits_creation":"Registrierung", - "visits_modification":"Aktualisierung", - "visits_nickname" : "Name", - "visits_address" : "Adresse", - "visits_longitude" : "Längengrad", - "visits_latitude" : "Breitengrad", - "visits_visits" : "Besuche", - "visits_begin" : "Beginn", - "visits_end" : "Ende", - "visits_device" : "Gerät", - "visits_visit" : "Besuch", - "visits_from" : "Von", - "visits_to" : "Bis", - "visits_actions" : "Aktionen", - "visits_device_tooltip" : "Gerät anzeigen", - "visits_delete_tooltip" : "Besuch löschen", - "visits_map_tooltip" : "Ort auf Karte zentrieren", - "visits_place_tooltip": "Besuche für Ort anzeigen", - "visits_previous_tooltip":"Vorheriger Tag", - "visits_next_tooltip": "Nächster Tag", - "visits_day_placeholder": "Tag auswählen", - "notices_title" : "Neues", - "manage_users_success" : "Die Kontoänderung wurde erfolgreich durchgeführt.", - "manage_users_error" : "Die Kontoänderung konnte nicht durchgeführt werden.", - "manage_users_title" : "Nutzer", - "manage_users_term_placeholder" : "Suchbegriff", - "manage_users_term_required" : "Ein Suchbegriff ist erforderlich.", - "manage_users_term_pattern" : "Dein Suchbegriff enthält ein ungültiges Zeichen.", - "manage_users_search_tooltip" : "Nutzer suchen", - "manage_users_id" : "ID", - "manage_users_type" : "Typ", - "manage_users_login": "Kontoname", - "manage_users_email" : "Emailadresse", - "manage_users_name" : "Nutzername", - "manage_users_creation" : "Registrierung", - "manage_users_modification" : "Aktualisierung", - "manage_users_actions" : "Aktionen", - "manage_users_restore_tooltip" : "Konto wiederherstellen", - "manage_users_delete_tooltip" : "Konto löschen", - "manage_users_user_tooltip" : "Zum Nutzer machen", - "manage_users_admin_tooltip" : "Zum Administrator machen", - "manage_users_user": "Nutzer", - "manage_users_admin": "Administrator", - "manage_system_title":"System", - "manage_system_gbs" : "Gigabytes", - "manage_system_gb" : "Gigabyte", - "manage_system_mbs" : "Megabytes", - "manage_system_mb" : "Megabyte", - "manage_system_days" : "Tage", - "manage_system_day" : "Tag", - "manage_system_hours" : "Stunden", - "manage_system_hour" : "Stunde", - "manage_system_minutes" : "Minuten", - "manage_system_minute" : "Mintue", - "manage_system_seconds" : "Sekunden", - "manage_system_second" : "Sekunde", - "manage_system_load_title" : "Auslastung", - "manage_system_load_subtitle" : "Zeigt die durchschnittliche CPU-Auslastung der letzten Minute an.", - "manage_system_uptime" : "Betriebszeit", - "manage_system_memory_title":"Speicher", - "manage_system_memory_subtitle":"Zeigt den genutzen Haldenspeicher zum Zeitpunkt der Anfrage an.", - "manage_system_max_heap":"Maximale Haldengröße", - "manage_system_equipment_title":"Ausstattung", - "manage_system_equipment_subtitle":"Zeigt die Hardware- und Softwareausstattung des Rechners an.", - "manage_system_os":"Betriebssystem", - "manage_system_os_name":"Name", - "manage_system_os_architecture":"Architektur", - "manage_system_os_version":"Version", - "manage_system_jvm":"Java Virtual Machine", - "manage_system_jvm_name":"Name", - "manage_system_jvm_specification":"Spezifikation", - "manage_system_jvm_vendor":"Hersteller", - "manage_system_jvm_version":"Version", - "manage_system_gc": "Garbage Collector", - "manage_system_gc_count" : "Ausführungen", - "manage_system_gc_duration": "Dauer", - "manage_system_power": "Rechenleistung", - "manage_system_processors": "Prozessoren", - "manage_system_data_title": "Datenbestand", - "manage_system_data_subtitle":"Zeigt die vorhandenen Datenbankeinträge für alle Entitäten an.", - "manage_system_data_entity":"Entität", - "manage_system_data_sum":"Summe", - "manage_system_data_active": "Aktiv", - "manage_system_data_deleted":"Gelöscht", - "manage_notices_change_success":"Die Änderung wurde erfolgreich durchgeführt.", - "manage_notices_change_error":"Die Änderung konnte nicht durchgeführt werden.", - "manage_notices_title":"Hinweise", - "manage_notices_id":"ID", - "manage_notices_languages":"Sprachen", - "manage_notices_creation":"Erstellung", - "manage_notices_modification":"Aktualisierung", - "manage_notices_expiration":"Ablauf", - "manage_notices_header":"Titel", - "manage_notices_published":"Veröff.", - "manage_notices_announced":"Ank. (Min/Max)", - "manage_notices_actions":"Aktionen", - "manage_notices_restore_tooltip":"Hinweis wiederherstellen", - "manage_notices_delete_tooltip":"Hinweis löschen", - "manage_notices_edit_tooltip":"Hinweis bearbeiten", - "manage_logs_title":"Logs", - "manage_logs_connect_tooltip":"Verbindung herstellen", - "manage_logs_disconnect_tooltip":"Verbindung beenden", - "manage_logs_clear_tooltip":"Einträge löschen", - "manage_logs_id":"ID", - "manage_logs_time":"Zeit", - "manage_logs_thread":"Thread", - "manage_logs_level":"Stufe", - "manage_logs_class":"Klasse", - "manage_logs_method":"Methode", - "manage_logs_message":"Nachricht", - "manage_logs_trace":"Trace", - "manage_logs_trace_tooltip":"Stacktrace vorhanden", - "manage_logs_actions":"Aktionen", - "manage_logs_details_tooltip":"Details anzeigen", - "login_login_title":"Anmelden", - "login_login_subtitle":"Mit Deinem Konto kannst Du hier auf Deine Daten zugreifen.", - "login_login_reset":"Passwort vergessen?", - "login_build_version":"Buildversion", - "login_build_time":"Buildzeit", - "login_register_title":"Noch kein Konto?", - "login_register_subtitle":"Kein Problem!", - "login_register_paragraph":"Hol Dir einfach ein Konto und registriere Dein Gerät. Dann kannst Du von überall aus auf Deinen Standort und Deine besuchten Orte zugreifen!", - "edit_notice_load_error":"Der Hinweis konnte nicht geladen werden.", - "edit_notice_save_success":"Der Hinweis wurde erfolgreich gespeichert.", - "edit_notice_save_error":"Der Hinweis konnte nicht gespeicher werden.", - "edit_notice_title_new":"Erstellen", - "edit_notice_title_edit":"Bearbeiten", - "edit_notice_save_tooltip":"Hinweis speichern", - "edit_notice_close_tooltip":"Hinweis schließen", - "edit_notice_content_title":"Inhalt", - "edit_notice_content_subtitle":"Hier kannst Du den Inhalt des Hinweises ändern.", - "edit_notice_title_placeholder":"Titel eingeben", - "edit_notice_body_placeholder":"Inhalt eingeben", - "edit_notice_add_language_tooltip":"Sprache hinzufügen", - "edit_notice_settings_title":"Einstellungen", - "edit_notice_settings_subtitle":"Hier kannst Du die Art der Veröffentlichung einstellen.", - "edit_notice_settings_time_placeholder":"Ablaufzeit festlegen", - "edit_notice_settings_date_placeholder":"Ablaufdatum auswählen", - "edit_notice_settings_publish":"Veröffentlichen", - "edit_notice_settings_announce":"Ankündigen", - "edit_notice_settings_min_version":"Minimale Version", - "edit_notice_settings_max_version":"Maximale Version", - "edit_notice_creation":"Erstellung", - "edit_notice_modification":"Aktualisierung", - "devices_delete_confirm_title":"Gerät löschen?", - "devices_delete_confirm_message":"Möchtest Du das Gerät wirklich löschen? Dieser Vorgang löscht auch die Besuche des Geräts und Du kannst ihn nicht mehr rückgängig machen.", - "devices_delete_success":"Das Gerät wurde erfolgreich gelöscht.", - "devices_delete_error":"Das Gerät konnte nicht gelöscht werden. Hast Du gerade kein Netz?", - "devices_title":"Geräte", - "devices_id":"ID", - "devices_os":"OS", - "devices_manufacturer":"Hersteller", - "devices_model":"Model", - "devices_creation":"Registrierung", - "devices_modification":"Aktualisierung", - "devices_actions":"Aktionen", - "devices_location_tooltip":"Standort anzeigen", - "devices_history_tooltip":"Verlauf anzeigen", - "devices_delete_tooltip":"Gerät löschen", - "device_location_device_error":"Die Geräteinformationen konnten nicht geladen werden.", - "device_location_location_error":"Der Standort konte nicht abgerufen werden.", - "device_location_device": "Gerät", - "device_location_id" : "ID", - "device_location_manufacturer": "Hersteller", - "device_location_model": "Model", - "device_location_os": "Betriebssystem", - "device_location_creation": "Registrierung", - "device_location_modification": "Aktualisierung", - "device_location_time": "Zeit", - "device_location_availability": "Status", - "device_location_longitude": "Längengrad", - "device_location_latitude": "Breitengrad", - "device_location_location": "Standort", - "change_reset_success_title": "Änderung erfolgreich", - "change_reset_success_message": "Dein Passwort wurde erfolgreich geändert. Du musst ab sofort immer Dein neues Passwort zur Anmeldung verwenden.", - "change_reset_error_title": "Änderung fehlgeschlagen", - "change_reset_error_message": "Die Passwortänderung konnte nicht abeschlossen werden. Hast Du gerade kein Netz?", - "change_reset_error_badlink":"Der Link zum Zurücksetzen ist ungültig. Falls Du ihn aus deinem Emailprogramm in die Adressleiste Deines Browsers kopiert hast, stell sicher, dass der Link vollständig ist.", - "change_reset_error_expiredlink":"Der Link zum Zurücksetzen ist nicht mehr gültig. Entweder wurder er schon benutzt oder er ist abgelaufen.", - "change_reset_title":"Passwort ändern", - "change_reset_subtitle":"Gib einfach Dein neues Passwort ein.", - "activate_title":"Aktivierung", - "activate_subtitle":"Die Aktivierung wird abgeschlossen.", - "activate_success_title":"Aktivierung erfolgreich", - "activate_success_message":"Die Emailadresse wurde für Dein Konto aktiviert. Falls das die Emailadresse mit einem neuen Konto verbunden wurde, kannst du das Konto ab sofort nutzen. Falls du eine weitere Emailadresse für dein Konto freigeschaltet hast, kannst Du sie jetzt in den Kontoeinstellungen als Kontaktemailadresse setzen.", - "activate_error_title":"Aktivierung fehlgeschlagen", - "activate_error_message":"Die Aktivierung konnte nicht abeschlossen werden. Hast Du gerade kein Netz?", - "activate_error_badlink":"Der Aktivierungslink ist ungültig. Falls Du ihn aus deinem Emailprogramm in die Adressleiste Deines Browsers kopiert hast, stell sicher, dass der Link vollständig ist.", - "activate_error_expiredlink":"Der Aktivierungslink ist nicht mehr gültig. Entweder wurder er schon benutzt oder er ist abgelaufen.", + 'user_title': 'Konto', + 'user_change_title' : 'Informationen ändern', + 'user_change_subtitle' : 'Hier kannst Du Deine Kontaktinformationen ändern.', + 'user_change_primary' : 'Primäre Emailadresse', + 'user_password_title' : 'Passwort ändern', + 'user_password_subtitle' : 'Hier kannst Du Dein Passwort ändern.', + 'user_password_old' : 'Altes Passwort', + 'user_password_old_hint' : 'Altes Passwort eingeben', + 'user_password_new' : 'Neues Passwort', + 'user_password_new_hint' : 'Neues Passwort eingeben', + 'user_add_email_title' : 'Emailadresse hinzufügen', + 'user_add_email_subtitle' : 'Hier kannst Du eine neue Emailadresse registrieren.', + 'user_del_email_title' : 'Emailadresse löschen', + 'user_del_email_subtitle' : 'Hier kannst Du ungenutze Emailadressen löschen.', + 'user_del_email_tooltip' : 'Emailadresse löschen', + 'user_email_registered_already' : 'Die Emailadresse ist bereits registriert.', + 'user_password_wrong_title' : 'Passwort falsch', + 'user_password_wrong_message' : 'Dein derzeitiges Passwort stimmt nicht mit Deiner Eingabe überein.' + + ' Bitte prüfe Deine Eingabe und versuchs nochmal.', + 'share_title' : 'Freigabe', + 'share_no_update_info' : 'Die Freigabe konnte nicht abgerufen werden.', + 'share_no_update_location' : 'Der Standort konte nicht abgerufen werden.', + 'share_token' : 'Schlüssel', + 'share_message' : 'Nachricht', + 'share_destination' : 'Ziel', + 'share_expiration' : 'Ablauf', + 'share_location' : 'Standort', + 'share_time' : 'Zeit', + 'share_availability' : 'Status', + 'share_longitude' : 'Längengrad', + 'share_latitude' : 'Breitengrad', + 'share_add_tooltip' : 'Zu Konto hinzufügen', + 'reset_confirm_title' : 'Passwort zurückgesetzt', + 'reset_confirm_message' : 'Wir haben Dir einen Link an Deine Kontaktemailadresse versandt, ' + + 'mit dem Du Dein Passwort ändern kannst. Falls Dir Dein Passwort wieder einfällt, kannst Du die Email einfach löschen.', + 'reset_account_error' : 'Konto nicht gefunden. Bitte prüfe Deinen Kontonamen und versuchs nochmal.', + 'reset_network_error' : 'Fehler beim Zurücksetzen. Hast Du gerade kein Netz?', + 'reset_title' : 'Passwort zurücksetzen', + 'reset_subtitle' : 'Gib Deinen Kontonamen an um Dein Passwort zurückzusetzen.', + 'register_accept_terms_title' : 'Nutzungsbedingungen', + 'register_accept_terms_message' : 'Um Dein Konto zu beantragen musst Du zuerst den Nutzungsbedingungen zustimmen.', + 'register_success_title' : 'Einrichtung erfolgreich', + 'register_success_message' : 'Das Konto wurde eingerichtet. Bevor Du Dein Konto nutzen kannst, musst Du es aktivieren. ' + + 'Wir haben Dir eine Email mit einem Aktivierungslink zugeschickt. Bitte sieh in Deinem Postfach nach. ' + + 'Falls die Email lange nicht ankommt, schau auch mal in Deinen Spamordner!', + 'register_conflict_error' : 'Der Kontoname ist bereits vergeben. Such Dir bitte einen anderen aus.', + 'register_network_error' : 'Fehler bei der Registrierung. Hast Du gerade kein Netz?', + 'register_title' : 'Registrieren', + 'register_subtitle' : 'Gib Deine Daten ein und lege ein neues Konto an.', + 'register_terms_pre' : 'Ich bin volljährig, habe die', + 'register_terms_mid' : 'gelesen und stimme den', + 'register_terms_end' : 'zu.', + 'register_terms_service' : 'Nutzungsbedingungen', + 'register_terms_policy' : 'Datenschutzerklärung', + 'register_already_title' : 'Du hast bereits ein Konto?', + 'register_already_subtitle' : 'Kein Problem!', + 'register_already_paragraph' : 'Geh einfach zur Anmeldung und gib Deinen Kontonamen und Dein Passwort ein. ' + + 'Dann kannst Du sofort auf Deinen Standort und Deine besuchten Orte zugreifen!', + 'register_why_title': 'Warum registrieren?', + 'register_why_subtitle': 'Du musst nicht!', + 'register_why_paragraph': 'Viele Funktionen von Maptology lassen sich auch ohne Registrierung nutzen. ' + + 'Falls Du zum Beispiel Deinen Standort teilen möchtest, brauchst Du nur die mobile Anwendung. ' + + 'Zum Ansehen von Freigaben genügt sogar Dein Webbrowser.', + 'register_why_moreinfo': 'Mehr Infos', + 'privileges_delete_confirm_title': 'Freigabe löschen?', + 'privileges_delete_confirm_message': 'Möchtest Du die Freigabe wirklich löschen? ' + + 'Diesen Vorgang kannst Du nicht mehr rückgängig machen.', + 'privileges_delete_success': 'Die Freigabe wurde erfolgreich gelöscht.', + 'privileges_delete_error': 'Die Freigabe konnte nicht gelöscht werden. Hast Du gerade kein Netz?', + 'privileges_title': 'Freigaben', + 'privileges_add_tooltip': 'Freigabe hinzufügen', + 'privileges_id': 'ID', + 'privileges_token': 'Schlüssel', + 'privileges_creation': 'Erstellung', + 'privileges_message': 'Nachricht', + 'privileges_destination': 'Ziel', + 'privileges_expiration': 'Ablauf', + 'privileges_actions' : 'Aktionen', + 'privileges_show_tooltip' : 'Freigabe anzeigen', + 'privileges_delete_tooltip' : 'Freigabe löschen', + 'places_delete_confirm_title': 'Ort löschen?', + 'places_delete_confirm_messages': 'Möchtest Du den Ort wirklich löschen? Dieser Vorgang löscht auch alle Besuche an diesem Ort ' + + 'und Du kannst ihn nicht mehr rückgängig machen.', + 'places_delete_success': 'Der Ort wurde erfolgreich gelöscht.', + 'places_delete_error': 'Der Ort konnte nicht gelöscht werden. Hast Du gerade kein Netz?', + 'places_title': 'Orte', + 'places_id': 'ID', + 'places_address': 'Adresse', + 'places_name': 'Name', + 'places_nickname': 'Name', + 'places_longitude': 'Längengrad', + 'places_latitude': 'Breitengrad', + 'places_creation': 'Erstellung', + 'places_modification': 'Änderung', + 'places_actions': 'Aktionen', + 'places_rename_tooltip': 'Ort benennen', + 'places_visits_tooltip': 'Besuche anzeigen', + 'places_delete_tooltip': 'Ort löschen', + 'visits_delete_confirm_title' : 'Besuch löschen?', + 'visits_delete_confirm_message' : 'Möchtest Du den Besuch wirklich löschen? Diesen Vorgang kannst Du nicht mehr rückgängig machen.', + 'visits_delete_success' : 'Der Besuch wurde erfolgreich gelöscht.', + 'visits_delete_error': 'Der Besuch konnte nicht gelöscht werden. Hast Du gerade kein Netz?', + 'visits_place_load_error': 'Der Ort konnte nicht geladen werden.', + 'visits_place': 'Ort', + 'visits_id': 'ID', + 'visits_manufacturer': 'Hersteller', + 'visits_model': 'Modell', + 'visits_os': 'Betriebssystem', + 'visits_creation': 'Registrierung', + 'visits_modification': 'Aktualisierung', + 'visits_nickname' : 'Name', + 'visits_address' : 'Adresse', + 'visits_longitude' : 'Längengrad', + 'visits_latitude' : 'Breitengrad', + 'visits_visits' : 'Besuche', + 'visits_begin' : 'Beginn', + 'visits_end' : 'Ende', + 'visits_device' : 'Gerät', + 'visits_visit' : 'Besuch', + 'visits_from' : 'Von', + 'visits_to' : 'Bis', + 'visits_actions' : 'Aktionen', + 'visits_device_tooltip' : 'Gerät anzeigen', + 'visits_delete_tooltip' : 'Besuch löschen', + 'visits_map_tooltip' : 'Ort auf Karte zentrieren', + 'visits_place_tooltip': 'Besuche für Ort anzeigen', + 'visits_previous_tooltip': 'Vorheriger Tag', + 'visits_next_tooltip': 'Nächster Tag', + 'visits_day_placeholder': 'Tag auswählen', + 'notices_title' : 'Neues', + 'manage_users_success' : 'Die Kontoänderung wurde erfolgreich durchgeführt.', + 'manage_users_error' : 'Die Kontoänderung konnte nicht durchgeführt werden.', + 'manage_users_title' : 'Nutzer', + 'manage_users_term_placeholder' : 'Suchbegriff', + 'manage_users_term_required' : 'Ein Suchbegriff ist erforderlich.', + 'manage_users_term_pattern' : 'Dein Suchbegriff enthält ein ungültiges Zeichen.', + 'manage_users_search_tooltip' : 'Nutzer suchen', + 'manage_users_id' : 'ID', + 'manage_users_type' : 'Typ', + 'manage_users_login': 'Kontoname', + 'manage_users_email' : 'Emailadresse', + 'manage_users_name' : 'Nutzername', + 'manage_users_creation' : 'Registrierung', + 'manage_users_modification' : 'Aktualisierung', + 'manage_users_actions' : 'Aktionen', + 'manage_users_restore_tooltip' : 'Konto wiederherstellen', + 'manage_users_delete_tooltip' : 'Konto löschen', + 'manage_users_user_tooltip' : 'Zum Nutzer machen', + 'manage_users_admin_tooltip' : 'Zum Administrator machen', + 'manage_users_user': 'Nutzer', + 'manage_users_admin': 'Administrator', + 'manage_system_title': 'System', + 'manage_system_gbs' : 'Gigabytes', + 'manage_system_gb' : 'Gigabyte', + 'manage_system_mbs' : 'Megabytes', + 'manage_system_mb' : 'Megabyte', + 'manage_system_days' : 'Tage', + 'manage_system_day' : 'Tag', + 'manage_system_hours' : 'Stunden', + 'manage_system_hour' : 'Stunde', + 'manage_system_minutes' : 'Minuten', + 'manage_system_minute' : 'Mintue', + 'manage_system_seconds' : 'Sekunden', + 'manage_system_second' : 'Sekunde', + 'manage_system_load_title' : 'Auslastung', + 'manage_system_load_subtitle' : 'Zeigt die durchschnittliche CPU-Auslastung der letzten Minute an.', + 'manage_system_uptime' : 'Betriebszeit', + 'manage_system_memory_title': 'Speicher', + 'manage_system_memory_subtitle': 'Zeigt den genutzen Haldenspeicher zum Zeitpunkt der Anfrage an.', + 'manage_system_max_heap': 'Maximale Haldengröße', + 'manage_system_equipment_title': 'Ausstattung', + 'manage_system_equipment_subtitle': 'Zeigt die Hardware- und Softwareausstattung des Rechners an.', + 'manage_system_os': 'Betriebssystem', + 'manage_system_os_name': 'Name', + 'manage_system_os_architecture': 'Architektur', + 'manage_system_os_version': 'Version', + 'manage_system_jvm': 'Java Virtual Machine', + 'manage_system_jvm_name': 'Name', + 'manage_system_jvm_specification': 'Spezifikation', + 'manage_system_jvm_vendor': 'Hersteller', + 'manage_system_jvm_version': 'Version', + 'manage_system_gc': 'Garbage Collector', + 'manage_system_gc_count' : 'Ausführungen', + 'manage_system_gc_duration': 'Dauer', + 'manage_system_power': 'Rechenleistung', + 'manage_system_processors': 'Prozessoren', + 'manage_system_data_title': 'Datenbestand', + 'manage_system_data_subtitle': 'Zeigt die vorhandenen Datenbankeinträge für alle Entitäten an.', + 'manage_system_data_entity': 'Entität', + 'manage_system_data_sum': 'Summe', + 'manage_system_data_active': 'Aktiv', + 'manage_system_data_deleted': 'Gelöscht', + 'manage_notices_change_success': 'Die Änderung wurde erfolgreich durchgeführt.', + 'manage_notices_change_error': 'Die Änderung konnte nicht durchgeführt werden.', + 'manage_notices_title': 'Hinweise', + 'manage_notices_id': 'ID', + 'manage_notices_languages': 'Sprachen', + 'manage_notices_creation': 'Erstellung', + 'manage_notices_modification': 'Aktualisierung', + 'manage_notices_expiration': 'Ablauf', + 'manage_notices_header': 'Titel', + 'manage_notices_published': 'Veröff.', + 'manage_notices_announced': 'Ank. (Min/Max)', + 'manage_notices_actions': 'Aktionen', + 'manage_notices_restore_tooltip': 'Hinweis wiederherstellen', + 'manage_notices_delete_tooltip': 'Hinweis löschen', + 'manage_notices_edit_tooltip': 'Hinweis bearbeiten', + 'manage_logs_title': 'Logs', + 'manage_logs_connect_tooltip': 'Verbindung herstellen', + 'manage_logs_disconnect_tooltip': 'Verbindung beenden', + 'manage_logs_clear_tooltip': 'Einträge löschen', + 'manage_logs_id': 'ID', + 'manage_logs_time': 'Zeit', + 'manage_logs_thread': 'Thread', + 'manage_logs_level': 'Stufe', + 'manage_logs_class': 'Klasse', + 'manage_logs_method': 'Methode', + 'manage_logs_message': 'Nachricht', + 'manage_logs_trace': 'Trace', + 'manage_logs_trace_tooltip': 'Stacktrace vorhanden', + 'manage_logs_actions': 'Aktionen', + 'manage_logs_details_tooltip': 'Details anzeigen', + 'login_login_title': 'Anmelden', + 'login_login_subtitle': 'Mit Deinem Konto kannst Du hier auf Deine Daten zugreifen.', + 'login_login_reset': 'Passwort vergessen?', + 'login_build_version': 'Buildversion', + 'login_build_time': 'Buildzeit', + 'login_register_title': 'Noch kein Konto?', + 'login_register_subtitle': 'Kein Problem!', + 'login_register_paragraph': 'Hol Dir einfach ein Konto und registriere Dein Gerät. ' + + 'Dann kannst Du von überall aus auf Deinen Standort und Deine besuchten Orte zugreifen!', + 'edit_notice_load_error': 'Der Hinweis konnte nicht geladen werden.', + 'edit_notice_save_success': 'Der Hinweis wurde erfolgreich gespeichert.', + 'edit_notice_save_error': 'Der Hinweis konnte nicht gespeicher werden.', + 'edit_notice_title_new': 'Erstellen', + 'edit_notice_title_edit': 'Bearbeiten', + 'edit_notice_save_tooltip': 'Hinweis speichern', + 'edit_notice_close_tooltip': 'Hinweis schließen', + 'edit_notice_content_title': 'Inhalt', + 'edit_notice_content_subtitle': 'Hier kannst Du den Inhalt des Hinweises ändern.', + 'edit_notice_title_placeholder': 'Titel eingeben', + 'edit_notice_body_placeholder': 'Inhalt eingeben', + 'edit_notice_add_language_tooltip': 'Sprache hinzufügen', + 'edit_notice_settings_title': 'Einstellungen', + 'edit_notice_settings_subtitle': 'Hier kannst Du die Art der Veröffentlichung einstellen.', + 'edit_notice_settings_time_placeholder': 'Ablaufzeit festlegen', + 'edit_notice_settings_date_placeholder': 'Ablaufdatum auswählen', + 'edit_notice_settings_publish': 'Veröffentlichen', + 'edit_notice_settings_announce': 'Ankündigen', + 'edit_notice_settings_min_version': 'Minimale Version', + 'edit_notice_settings_max_version': 'Maximale Version', + 'edit_notice_creation': 'Erstellung', + 'edit_notice_modification': 'Aktualisierung', + 'devices_delete_confirm_title': 'Gerät löschen?', + 'devices_delete_confirm_message': 'Möchtest Du das Gerät wirklich löschen? Dieser Vorgang löscht auch die Besuche des Geräts ' + + 'und Du kannst ihn nicht mehr rückgängig machen.', + 'devices_delete_success': 'Das Gerät wurde erfolgreich gelöscht.', + 'devices_delete_error': 'Das Gerät konnte nicht gelöscht werden. Hast Du gerade kein Netz?', + 'devices_title': 'Geräte', + 'devices_id': 'ID', + 'devices_os': 'OS', + 'devices_manufacturer': 'Hersteller', + 'devices_model': 'Model', + 'devices_creation': 'Registrierung', + 'devices_modification': 'Aktualisierung', + 'devices_actions': 'Aktionen', + 'devices_location_tooltip': 'Standort anzeigen', + 'devices_history_tooltip': 'Verlauf anzeigen', + 'devices_delete_tooltip': 'Gerät löschen', + 'device_location_device_error': 'Die Geräteinformationen konnten nicht geladen werden.', + 'device_location_location_error': 'Der Standort konte nicht abgerufen werden.', + 'device_location_device': 'Gerät', + 'device_location_id' : 'ID', + 'device_location_manufacturer': 'Hersteller', + 'device_location_model': 'Model', + 'device_location_os': 'Betriebssystem', + 'device_location_creation': 'Registrierung', + 'device_location_modification': 'Aktualisierung', + 'device_location_time': 'Zeit', + 'device_location_availability': 'Status', + 'device_location_longitude': 'Längengrad', + 'device_location_latitude': 'Breitengrad', + 'device_location_location': 'Standort', + 'change_reset_success_title': 'Änderung erfolgreich', + 'change_reset_success_message': 'Dein Passwort wurde erfolgreich geändert. ' + + 'Du musst ab sofort immer Dein neues Passwort zur Anmeldung verwenden.', + 'change_reset_error_title': 'Änderung fehlgeschlagen', + 'change_reset_error_message': 'Die Passwortänderung konnte nicht abeschlossen werden. Hast Du gerade kein Netz?', + 'change_reset_error_badlink': 'Der Link zum Zurücksetzen ist ungültig. Falls Du ihn aus Deinem Emailprogramm ' + + 'in die Adressleiste Deines Browsers kopiert hast, stell sicher, dass der Link vollständig ist.', + 'change_reset_error_expiredlink': 'Der Link zum Zurücksetzen ist nicht mehr gültig. ' + + 'Entweder wurder er schon benutzt oder er ist abgelaufen.', + 'change_reset_title': 'Passwort ändern', + 'change_reset_subtitle': 'Gib einfach Dein neues Passwort ein.', + 'activate_title': 'Aktivierung', + 'activate_subtitle': 'Die Aktivierung wird abgeschlossen.', + 'activate_success_title': 'Aktivierung erfolgreich', + 'activate_success_message': 'Die Emailadresse wurde für Dein Konto aktiviert. Falls das die Emailadresse ' + + 'mit einem neuen Konto verbunden wurde, kannst Du das Konto ab sofort nutzen. Falls Du eine weitere ' + + 'Emailadresse für Dein Konto freigeschaltet hast, kannst Du sie jetzt in den Kontoeinstellungen als Kontaktadresse setzen.', + 'activate_error_title': 'Aktivierung fehlgeschlagen', + 'activate_error_message': 'Die Aktivierung konnte nicht abeschlossen werden. Hast Du gerade kein Netz?', + 'activate_error_badlink': 'Der Aktivierungslink ist ungültig. Falls Du ihn aus Deinem Emailprogramm in die ' + + 'Adressleiste Deines Browsers kopiert hast, stell sicher, dass der Link vollständig ist.', + 'activate_error_expiredlink': 'Der Aktivierungslink ist nicht mehr gültig. Entweder wurder er schon benutzt oder er ist abgelaufen.', // layouts - "drawer_navigation":"Navigation", - "drawer_settings":"Einstellungen", - "drawer_management":"Verwaltung", - "footer_rights_reserved":"Alle Rechte vorbehalten", - "footer_imprint":"Impressum", + 'drawer_navigation': 'Navigation', + 'drawer_settings': 'Einstellungen', + 'drawer_management': 'Verwaltung', + 'footer_rights_reserved': 'Alle Rechte vorbehalten', + 'footer_imprint': 'Impressum', // pagination provider - "pagination_first_page":"Erste Seite", - "pagination_last_page":"Letzte Seite", - "pagination_next_page":"Nächste Seite", - "pagination_previous_page":"Vorherige Seite", - "pagination_items_per_page":"Einträge pro Seite", - "pagination_of": "von", + 'pagination_first_page': 'Erste Seite', + 'pagination_last_page': 'Letzte Seite', + 'pagination_next_page': 'Nächste Seite', + 'pagination_previous_page': 'Vorherige Seite', + 'pagination_items_per_page': 'Einträge pro Seite', + 'pagination_of': 'von', // language titles - "lang_de":"Deutsch", - "lang_en":"Englisch", - "lang_fr":"Französisch", - "lang_it":"Italienisch", - "lang_es":"Spanisch", - } + 'lang_de': 'Deutsch', + 'lang_en': 'Englisch', + 'lang_fr': 'Französisch', + 'lang_it': 'Italienisch', + 'lang_es': 'Spanisch', + }; private values_en = { - "language":"en", + 'language': 'en', // buttons - "button_save" : "Save", - "button_change" : "Change", - "button_add": "Add", - "button_update":"Update", - "button_gotit": "Got it", - "button_reset": "Reset", - "button_register" : "Register", - "button_login" : "Login", - "button_yes" : "Yes", - "button_no" : "No", - "button_ok" : "OK", - "button_cancel" : "Cancel", - "button_close": "Close", - "button_logout": "Logout", + 'button_save' : 'Save', + 'button_change' : 'Change', + 'button_add': 'Add', + 'button_update': 'Update', + 'button_gotit': 'Got it', + 'button_reset': 'Reset', + 'button_register' : 'Register', + 'button_login' : 'Login', + 'button_yes' : 'Yes', + 'button_no' : 'No', + 'button_ok' : 'OK', + 'button_cancel' : 'Cancel', + 'button_close': 'Close', + 'button_logout': 'Logout', // components - "email_field_hint":"Enter email address", - "email_field_placeholder":"Email address", - "email_field_required":"Your email address is required.", - "email_field_pattern":"Your email address is invalid.", - "language_select_placeholder":"Language", - "log_dialog_title":"Log entry", - "log_dialog_id":"ID", - "log_dialog_thread":"Thread", - "log_dialog_time":"Time", - "log_dialog_level":"Level", - "log_dialog_logger":"Logger", - "log_dialog_class":"Class", - "log_dialog_method":"Method", - "log_dialog_message":"Message", - "log_dialog_trace":"Trace", - "login_field_hint":"Enter account name", - "login_field_placeholder":"Account name", - "login_field_required":"The account name is required.", - "login_field_pattern":"The account name contains an invalid character.", - "login_field_minlength":"The account name is too short.", - "name_field_hint":"Enter your name", - "name_field_placeholder":"Your name", - "name_field_required":"Your name is required.", - "name_field_pattern":"Your name contains an invalid character.", - "nickname_dialog_title":"Rename place", - "nickname_dialog_subtitle":"Enter a name for the place.", - "nickname_dialog_hint":"Enter name", - "nickname_dialog_placeholder":"Name", - "nickname_dialog_pattern":"The name contains an invalid character.", - "nickname_dialog_success":"The place was renamed successfully.", - "nickname_dialog_conflict":"The place was renamed already, to overwrite, rename the place again.", - "nickname_dialog_failure":"Failed to rename the place.", - "notice_card_creation":"Published on", - "notice_card_modification":"Modified on", - "password_field_hint":"Enter password", - "password_field_placeholder":"Password", - "password_field_required":"The password is required.", - "password_field_minlength":"The password is too short.", - "password_field_show": "Show password", - "password_field_hide": "Hide password", - "share_dialog_required":"A sharing link is required.", - "share_dialog_pattern":"The sharing link is invalid.", - "share_dialog_title":"Add share", - "share_dialog_subtitle":"Copy a sharing link into the field below to save it.", - "share_dialog_hint":"Enter sharing link", - "share_dialog_placeholder":"Sharing link", - "share_dialog_success":"The share was added successfully.", - "share_dialog_error":"Unable to add the sharing link. Did you type it in correctly?", - "tile_map_attribution":"Maptology", + 'email_field_hint': 'Enter email address', + 'email_field_placeholder': 'Email address', + 'email_field_required': 'Your email address is required.', + 'email_field_pattern': 'Your email address is invalid.', + 'language_select_placeholder': 'Language', + 'log_dialog_title': 'Log entry', + 'log_dialog_id': 'ID', + 'log_dialog_thread': 'Thread', + 'log_dialog_time': 'Time', + 'log_dialog_level': 'Level', + 'log_dialog_logger': 'Logger', + 'log_dialog_class': 'Class', + 'log_dialog_method': 'Method', + 'log_dialog_message': 'Message', + 'log_dialog_trace': 'Trace', + 'login_field_hint': 'Enter account name', + 'login_field_placeholder': 'Account name', + 'login_field_required': 'The account name is required.', + 'login_field_pattern': 'The account name contains an invalid character.', + 'login_field_minlength': 'The account name is too short.', + 'name_field_hint': 'Enter your name', + 'name_field_placeholder': 'Your name', + 'name_field_required': 'Your name is required.', + 'name_field_pattern': 'Your name contains an invalid character.', + 'nickname_dialog_title': 'Rename place', + 'nickname_dialog_subtitle': 'Enter a name for the place.', + 'nickname_dialog_hint': 'Enter name', + 'nickname_dialog_placeholder': 'Name', + 'nickname_dialog_pattern': 'The name contains an invalid character.', + 'nickname_dialog_success': 'The place was renamed successfully.', + 'nickname_dialog_conflict': 'The place was renamed already, to overwrite, rename the place again.', + 'nickname_dialog_failure': 'Failed to rename the place.', + 'notice_card_creation': 'Published on', + 'notice_card_modification': 'Modified on', + 'password_field_hint': 'Enter password', + 'password_field_placeholder': 'Password', + 'password_field_required': 'The password is required.', + 'password_field_minlength': 'The password is too short.', + 'password_field_show': 'Show password', + 'password_field_hide': 'Hide password', + 'share_dialog_required': 'A sharing link is required.', + 'share_dialog_pattern': 'The sharing link is invalid.', + 'share_dialog_title': 'Add share', + 'share_dialog_subtitle': 'Copy a sharing link into the field below to save it.', + 'share_dialog_hint': 'Enter sharing link', + 'share_dialog_placeholder': 'Sharing link', + 'share_dialog_success': 'The share was added successfully.', + 'share_dialog_error': 'Unable to add the sharing link. Did you type it in correctly?', + 'tile_map_attribution': 'Maptology', // views - "user_title": "Account", - "user_change_title" : "Change information", - "user_change_subtitle" : "Here you can change your contact information.", - "user_change_primary" : "Primary email address", - "user_password_title" : "Change password", - "user_password_subtitle" : "Here you can change your password.", - "user_password_old" : "Current password", - "user_password_old_hint" : "Enter current password", - "user_password_new" : "New password", - "user_password_new_hint" : "Enter new password", - "user_add_email_title" : "Add email address", - "user_add_email_subtitle" : "Here you can register a new email address.", - "user_del_email_title" : "Delete email address", - "user_del_email_subtitle" : "Here you can delete unused email addresses.", - "user_del_email_tooltip" : "Delete email address", - "user_email_registered_already" : "The email address is registered already.", - "user_password_wrong_title" : "Password invalid", - "user_password_wrong_message" : "Your current password does not match the one you provided. Please validate your input and try again.", - "share_title" : "Share", - "share_no_update_info" : "The share information could not be retrieved.", - "share_no_update_location" : "The location could not be retrieved.", - "share_token" : "Key", - "share_message" : "Message", - "share_destination" : "Destination", - "share_expiration" : "Expiration", - "share_location" : "Location", - "share_time" : "Time", - "share_availability" : "Status", - "share_longitude" : "Longitude", - "share_latitude" : "Latitude", - "share_add_tooltip" : "Add to account", - "reset_confirm_title" : "Password reset", - "reset_confirm_message" : "We just sent an email to your primary email address that contains a password reset link. If you remember your password again, you can simply delete the email.", "reset_account_error" : "Konto nicht gefunden. Bitte prüfe Deinen Kontonamen und versuchs nochmal.", - "reset_network_error" : "Reset failed. Are you connected to the Internet?", - "reset_title" : "Reset password", - "reset_subtitle" : "Enter your account name to reset your password", - "register_accept_terms_title" : "Terms of service", - "register_accept_terms_message" : "To register your account, you must accept the terms of service.", - "register_success_title" : "Registration successful", - "register_success_message" : "Your account has been created. Before you can use it, you have to activate it. To do this, we just sent you an email with an activation link. Please check your inbox. If the email takes a long time to reach you, make sure to check your spam folder!", - "register_conflict_error" : "Your account name is already registered, plase select another one.", - "register_network_error" : "Registration failed. Are you connected to the Internet?", - "register_title" : "Register", - "register_subtitle" : "Enter your data and create a new account.", - "register_terms_pre" : "I am 18 years old, I have read the", - "register_terms_mid" : "and I accept the", - "register_terms_end" : ".", - "register_terms_service" : "terms of service", - "register_terms_policy" : "privacy policy", - "register_already_title" : "Do you have an account already?", - "register_already_subtitle" : "No problem!", - "register_already_paragraph" : "Go to the login page and enter your account name and password. Then you will be able to access all your data immediately.", - "register_why_title":"Why should I register?", - "register_why_subtitle":"Well, you don't have to!", - "register_why_paragraph":"Many Maptology features can be used without an account. For example, to share your location with your friends, you only need the mobile app. In order to view shares you only need a web browser.", - "register_why_moreinfo":"More Information", - "privileges_delete_confirm_title":"Delete share?", - "privileges_delete_confirm_message":"Do you really want to delete the share? This action cannot be undone later on.", - "privileges_delete_success":"The share has been deleted successfully.", - "privileges_delete_error":"The deletion of the share failed. Are you connected to the Internet?", - "privileges_title":"Shares", - "privileges_add_tooltip":"Add share", - "privileges_id":"ID", - "privileges_token":"Key", - "privileges_creation": "Creation", - "privileges_message": "Message", - "privileges_destination": "Destination", - "privileges_expiration": "Expiration", - "privileges_actions" : "Actions", - "privileges_show_tooltip" : "Show share", - "privileges_delete_tooltip" : "Delete share", - "places_delete_confirm_title":"Delete place?", - "places_delete_confirm_messages":"Do you really want to delete the place? This will also delete all visits made at the place and you will not be able to undo the deletion later on.", - "places_delete_success":"The place has been deleted successfully.", - "places_delete_error":"The deletion of the place failed. Are you connected to the Internet?", - "places_title":"Places", - "places_id":"ID", - "places_address":"Address", - "places_name":"Name", - "places_nickname":"Name", - "places_longitude":"Longitude", - "places_latitude":"Latitude", - "places_creation":"Creation", - "places_modification":"Modification", - "places_actions":"Actions", - "places_rename_tooltip":"Rename place", - "places_visits_tooltip":"Show visits", - "places_delete_tooltip":"Delete place", - "visits_delete_confirm_title" : "Delete visit?", - "visits_delete_confirm_message" : "Do you really want to delete the visit? This cannot be undone later on.", - "visits_delete_success" : "The visit has been deleted successfully.", - "visits_delete_error": "Failed to delete the vist. Are you connected to the Internet?", - "visits_place_load_error": "Failed to load the place.", - "visits_place": "Place", - "visits_id": "ID", - "visits_manufacturer":"Manufacturer", - "visits_model":"Model", - "visits_os":"OS", - "visits_creation":"Registration", - "visits_modification":"Modification", - "visits_nickname" : "Name", - "visits_address" : "Address", - "visits_longitude" : "Longitude", - "visits_latitude" : "Latitude", - "visits_visits" : "Visits", - "visits_begin" : "Begin", - "visits_end" : "End", - "visits_device" : "Device", - "visits_visit" : "Visits", - "visits_from" : "From", - "visits_to" : "Until", - "visits_actions" : "Actions", - "visits_device_tooltip" : "Show device", - "visits_delete_tooltip" : "Delete visit", - "visits_map_tooltip" : "Center map on place", - "visits_place_tooltip": "Show visits for place", - "visits_previous_tooltip":"Previous day", - "visits_next_tooltip": "Next day", - "visits_day_placeholder": "Select day", - "notices_title" : "News", - "manage_users_success" : "The account has been modified successfully.", - "manage_users_error" : "The account modification failed.", - "manage_users_title" : "Users", - "manage_users_term_placeholder" : "Search term", - "manage_users_term_required" : "The search term is required.", - "manage_users_term_pattern" : "The search term contains an invalid character.", - "manage_users_search_tooltip" : "Search users", - "manage_users_id" : "ID", - "manage_users_type" : "Type", - "manage_users_login": "Account name", - "manage_users_email" : "Email address", - "manage_users_name" : "User name", - "manage_users_creation" : "Registration", - "manage_users_modification" : "Modification", - "manage_users_actions" : "Actions", - "manage_users_restore_tooltip" : "Restore account", - "manage_users_delete_tooltip" : "Delete account", - "manage_users_user_tooltip" : "Convert to user account", - "manage_users_admin_tooltip" : "Convert to adminstrator account", - "manage_users_user": "User", - "manage_users_admin": "Administrator", - "manage_system_title":"System", - "manage_system_gbs" : "gigabytes", - "manage_system_gb" : "gigabyte", - "manage_system_mbs" : "megabytes", - "manage_system_mb" : "megabyte", - "manage_system_days" : "days", - "manage_system_day" : "day", - "manage_system_hours" : "hours", - "manage_system_hour" : "hour", - "manage_system_minutes" : "minutes", - "manage_system_minute" : "minute", - "manage_system_seconds" : "seconds", - "manage_system_second" : "second", - "manage_system_load_title" : "Load", - "manage_system_load_subtitle" : "Shows the average CPU load over the last minute.", - "manage_system_uptime" : "Uptime", - "manage_system_memory_title":"Memory", - "manage_system_memory_subtitle":"Shows the heap memory usage at the time of the request.", - "manage_system_max_heap":"Maximum heap size", - "manage_system_equipment_title":"Configuration", - "manage_system_equipment_subtitle":"Shows the hard- and software configuration of the machine.", - "manage_system_os":"Operating system", - "manage_system_os_name":"Name", - "manage_system_os_architecture":"Architecture", - "manage_system_os_version":"Version", - "manage_system_jvm":"Java Virtual Machine", - "manage_system_jvm_name":"Name", - "manage_system_jvm_specification":"Specification", - "manage_system_jvm_vendor":"Vendor", - "manage_system_jvm_version":"Version", - "manage_system_gc": "Garbage Collector", - "manage_system_gc_count" : "Executions", - "manage_system_gc_duration": "Duration", - "manage_system_power": "Computer", - "manage_system_processors": "Processors", - "manage_system_data_title": "Database", - "manage_system_data_subtitle":"Shows the number of database entries for all entities.", - "manage_system_data_entity":"Entity", - "manage_system_data_sum":"Sum", - "manage_system_data_active": "Active", - "manage_system_data_deleted":"Deleted", - "manage_notices_change_success":"The notice has been modified successfully.", - "manage_notices_change_error":"The modification of the notice has failed.", - "manage_notices_title":"Notices", - "manage_notices_id":"ID", - "manage_notices_languages":"Languages", - "manage_notices_creation":"Creation", - "manage_notices_modification":"Modification", - "manage_notices_expiration":"Expiration", - "manage_notices_header":"Title", - "manage_notices_published":"Pub.", - "manage_notices_announced":"An. (Min/Max)", - "manage_notices_actions":"Actions", - "manage_notices_restore_tooltip":"Restore notice", - "manage_notices_delete_tooltip":"Delete notice", - "manage_notices_edit_tooltip":"Edit notice", - "manage_logs_title":"Logs", - "manage_logs_connect_tooltip":"Connect", - "manage_logs_disconnect_tooltip":"Disconnect", - "manage_logs_clear_tooltip":"Clear", - "manage_logs_id":"ID", - "manage_logs_time":"Time", - "manage_logs_thread":"Thread", - "manage_logs_level":"Level", - "manage_logs_class":"Class", - "manage_logs_method":"Method", - "manage_logs_message":"Message", - "manage_logs_trace":"Trace", - "manage_logs_trace_tooltip":"Stacktrace available", - "manage_logs_actions":"Actions", - "manage_logs_details_tooltip":"Show details", - "login_login_title":"Login", - "login_login_subtitle":"Here you can access your data with your account", - "login_login_reset":"Forgot password?", - "login_build_version":"Build version", - "login_build_time":"Build time", - "login_register_title":"You do not have an account?", - "login_register_subtitle":"No problem!", - "login_register_paragraph":"Simply get one and connect your device. Then you can access your device location and your visitied places from everywhere!", - "edit_notice_load_error":"Failed to load the notice.", - "edit_notice_save_success":"The notice has been saved successfully.", - "edit_notice_save_error":"The notice could not be saved.", - "edit_notice_title_new":"Create", - "edit_notice_title_edit":"Edit", - "edit_notice_save_tooltip":"Save notice", - "edit_notice_close_tooltip":"Close notice", - "edit_notice_content_title":"Content", - "edit_notice_content_subtitle":"Here you can change the content of the notice.", - "edit_notice_title_placeholder":"Enter title", - "edit_notice_body_placeholder":"Enter content", - "edit_notice_add_language_tooltip":"Add language", - "edit_notice_settings_title":"Settings", - "edit_notice_settings_subtitle":"Here you can change the publication settings.", - "edit_notice_settings_time_placeholder":"Set expiration time", - "edit_notice_settings_date_placeholder":"Set expiration date", - "edit_notice_settings_publish":"Publish", - "edit_notice_settings_announce":"Announce", - "edit_notice_settings_min_version":"Minimum version", - "edit_notice_settings_max_version":"Maximum version", - "edit_notice_creation":"Creation", - "edit_notice_modification":"Modification", - "devices_delete_confirm_title":"Delete device?", - "devices_delete_confirm_message":"Do you really want to delete the device? This will also delete the visits of the device and it cannot be undone later on.", - "devices_delete_success":"The device has been deleted successfully.", - "devices_delete_error":"The deletion of the device failed. Are you connected to the Internet?", - "devices_title":"Devices", - "devices_id":"ID", - "devices_os":"OS", - "devices_manufacturer":"Manufacturer", - "devices_model":"Model", - "devices_creation":"Registration", - "devices_modification":"Modification", - "devices_actions":"Actions", - "devices_location_tooltip":"Show current location", - "devices_history_tooltip":"Show location history", - "devices_delete_tooltip":"Delete device", - "device_location_device_error":"Failed to load the device information.", - "device_location_location_error":"Failed to load the device location.", - "device_location_device": "Device", - "device_location_id" : "ID", - "device_location_manufacturer": "Manufacturer", - "device_location_model": "Model", - "device_location_os": "Operating system", - "device_location_creation": "Registration", - "device_location_modification": "Modification", - "device_location_time": "Time", - "device_location_availability": "Status", - "device_location_longitude": "Longitude", - "device_location_latitude": "Latitude", - "device_location_location": "Location", - "change_reset_success_title": "Reset successful", - "change_reset_success_message": "Your password has been reset successfully. From now on, you must use your new password to log in.", - "change_reset_error_title": "Reset failed", - "change_reset_error_message": "The password reset failed. Are you connected to the Internet?", - "change_reset_error_badlink":"The reset link is invalid. If you copied it from an email, make sure to copy it completely.", - "change_reset_error_expiredlink":"The reset link is expired. Did you use it already?", - "change_reset_title":"Reset password", - "change_reset_subtitle":"Just enter your new password.", - "activate_title":"Activation", - "activate_subtitle":"Activating your account.", - "activate_success_title":"Activation successful", - "activate_success_message":"The email address has been added to your account. If this is the first email address of a new account, you can now log in. If this was another email address for an existing account, you can now set it as the primary contact address in your account settings.", - "activate_error_title":"Activation failed", - "activate_error_message":"The activation could not be completed. Are you connected to the Internet?", - "activate_error_badlink":"The activation link was invalid. If you copied it from your email program into the browser, make sure to copy it completely.", - "activate_error_expiredlink":"The activation link is no longer valid. Did you already use it?", + 'user_title': 'Account', + 'user_change_title' : 'Change information', + 'user_change_subtitle' : 'Here you can change your contact information.', + 'user_change_primary' : 'Primary email address', + 'user_password_title' : 'Change password', + 'user_password_subtitle' : 'Here you can change your password.', + 'user_password_old' : 'Current password', + 'user_password_old_hint' : 'Enter current password', + 'user_password_new' : 'New password', + 'user_password_new_hint' : 'Enter new password', + 'user_add_email_title' : 'Add email address', + 'user_add_email_subtitle' : 'Here you can register a new email address.', + 'user_del_email_title' : 'Delete email address', + 'user_del_email_subtitle' : 'Here you can delete unused email addresses.', + 'user_del_email_tooltip' : 'Delete email address', + 'user_email_registered_already' : 'The email address is registered already.', + 'user_password_wrong_title' : 'Password invalid', + 'user_password_wrong_message' : 'Your current password does not match the one you provided. Please validate your input and try again.', + 'share_title' : 'Share', + 'share_no_update_info' : 'The share information could not be retrieved.', + 'share_no_update_location' : 'The location could not be retrieved.', + 'share_token' : 'Key', + 'share_message' : 'Message', + 'share_destination' : 'Destination', + 'share_expiration' : 'Expiration', + 'share_location' : 'Location', + 'share_time' : 'Time', + 'share_availability' : 'Status', + 'share_longitude' : 'Longitude', + 'share_latitude' : 'Latitude', + 'share_add_tooltip' : 'Add to account', + 'reset_confirm_title' : 'Password reset', + 'reset_confirm_message' : 'We just sent an email to your primary email address that contains a password reset link. ' + + 'If you remember your password again, you can simply delete the email.', + 'reset_account_error' : 'Account not found. Please check your account name and try again.', + 'reset_network_error' : 'Reset failed. Are you connected to the Internet?', + 'reset_title' : 'Reset password', + 'reset_subtitle' : 'Enter your account name to reset your password', + 'register_accept_terms_title' : 'Terms of service', + 'register_accept_terms_message' : 'To register your account, you must accept the terms of service.', + 'register_success_title' : 'Registration successful', + 'register_success_message' : 'Your account has been created. Before you can use it, you have to activate it. ' + + 'To do this, we just sent you an email with an activation link. Please check your inbox. ' + + 'If the email takes a long time to reach you, make sure to check your spam folder!', + 'register_conflict_error' : 'Your account name is already registered, plase select another one.', + 'register_network_error' : 'Registration failed. Are you connected to the Internet?', + 'register_title' : 'Register', + 'register_subtitle' : 'Enter your data and create a new account.', + 'register_terms_pre' : 'I am 18 years old, I have read the', + 'register_terms_mid' : 'and I accept the', + 'register_terms_end' : '.', + 'register_terms_service' : 'terms of service', + 'register_terms_policy' : 'privacy policy', + 'register_already_title' : 'Do you have an account already?', + 'register_already_subtitle' : 'No problem!', + 'register_already_paragraph' : 'Go to the login page and enter your account name and password. ' + + 'Then you will be able to access all your data immediately.', + 'register_why_title': 'Why should I register?', + 'register_why_subtitle': 'Well, you don\'t have to!', + 'register_why_paragraph': 'Many Maptology features can be used without an account. For example, ' + + 'to share your location with your friends, you only need the mobile app. In order to view shares you only need a web browser.', + 'register_why_moreinfo': 'More Information', + 'privileges_delete_confirm_title': 'Delete share?', + 'privileges_delete_confirm_message': 'Do you really want to delete the share? This action cannot be undone later on.', + 'privileges_delete_success': 'The share has been deleted successfully.', + 'privileges_delete_error': 'The deletion of the share failed. Are you connected to the Internet?', + 'privileges_title': 'Shares', + 'privileges_add_tooltip': 'Add share', + 'privileges_id': 'ID', + 'privileges_token': 'Key', + 'privileges_creation': 'Creation', + 'privileges_message': 'Message', + 'privileges_destination': 'Destination', + 'privileges_expiration': 'Expiration', + 'privileges_actions' : 'Actions', + 'privileges_show_tooltip' : 'Show share', + 'privileges_delete_tooltip' : 'Delete share', + 'places_delete_confirm_title': 'Delete place?', + 'places_delete_confirm_messages': 'Do you really want to delete the place? This will also delete all visits made ' + + 'at the place and you will not be able to undo the deletion later on.', + 'places_delete_success': 'The place has been deleted successfully.', + 'places_delete_error': 'The deletion of the place failed. Are you connected to the Internet?', + 'places_title': 'Places', + 'places_id': 'ID', + 'places_address': 'Address', + 'places_name': 'Name', + 'places_nickname': 'Name', + 'places_longitude': 'Longitude', + 'places_latitude': 'Latitude', + 'places_creation': 'Creation', + 'places_modification': 'Modification', + 'places_actions': 'Actions', + 'places_rename_tooltip': 'Rename place', + 'places_visits_tooltip': 'Show visits', + 'places_delete_tooltip': 'Delete place', + 'visits_delete_confirm_title' : 'Delete visit?', + 'visits_delete_confirm_message' : 'Do you really want to delete the visit? This cannot be undone later on.', + 'visits_delete_success' : 'The visit has been deleted successfully.', + 'visits_delete_error': 'Failed to delete the vist. Are you connected to the Internet?', + 'visits_place_load_error': 'Failed to load the place.', + 'visits_place': 'Place', + 'visits_id': 'ID', + 'visits_manufacturer': 'Manufacturer', + 'visits_model': 'Model', + 'visits_os': 'OS', + 'visits_creation': 'Registration', + 'visits_modification': 'Modification', + 'visits_nickname' : 'Name', + 'visits_address' : 'Address', + 'visits_longitude' : 'Longitude', + 'visits_latitude' : 'Latitude', + 'visits_visits' : 'Visits', + 'visits_begin' : 'Begin', + 'visits_end' : 'End', + 'visits_device' : 'Device', + 'visits_visit' : 'Visits', + 'visits_from' : 'From', + 'visits_to' : 'Until', + 'visits_actions' : 'Actions', + 'visits_device_tooltip' : 'Show device', + 'visits_delete_tooltip' : 'Delete visit', + 'visits_map_tooltip' : 'Center map on place', + 'visits_place_tooltip': 'Show visits for place', + 'visits_previous_tooltip': 'Previous day', + 'visits_next_tooltip': 'Next day', + 'visits_day_placeholder': 'Select day', + 'notices_title' : 'News', + 'manage_users_success' : 'The account has been modified successfully.', + 'manage_users_error' : 'The account modification failed.', + 'manage_users_title' : 'Users', + 'manage_users_term_placeholder' : 'Search term', + 'manage_users_term_required' : 'The search term is required.', + 'manage_users_term_pattern' : 'The search term contains an invalid character.', + 'manage_users_search_tooltip' : 'Search users', + 'manage_users_id' : 'ID', + 'manage_users_type' : 'Type', + 'manage_users_login': 'Account name', + 'manage_users_email' : 'Email address', + 'manage_users_name' : 'User name', + 'manage_users_creation' : 'Registration', + 'manage_users_modification' : 'Modification', + 'manage_users_actions' : 'Actions', + 'manage_users_restore_tooltip' : 'Restore account', + 'manage_users_delete_tooltip' : 'Delete account', + 'manage_users_user_tooltip' : 'Convert to user account', + 'manage_users_admin_tooltip' : 'Convert to adminstrator account', + 'manage_users_user': 'User', + 'manage_users_admin': 'Administrator', + 'manage_system_title': 'System', + 'manage_system_gbs' : 'gigabytes', + 'manage_system_gb' : 'gigabyte', + 'manage_system_mbs' : 'megabytes', + 'manage_system_mb' : 'megabyte', + 'manage_system_days' : 'days', + 'manage_system_day' : 'day', + 'manage_system_hours' : 'hours', + 'manage_system_hour' : 'hour', + 'manage_system_minutes' : 'minutes', + 'manage_system_minute' : 'minute', + 'manage_system_seconds' : 'seconds', + 'manage_system_second' : 'second', + 'manage_system_load_title' : 'Load', + 'manage_system_load_subtitle' : 'Shows the average CPU load over the last minute.', + 'manage_system_uptime' : 'Uptime', + 'manage_system_memory_title': 'Memory', + 'manage_system_memory_subtitle': 'Shows the heap memory usage at the time of the request.', + 'manage_system_max_heap': 'Maximum heap size', + 'manage_system_equipment_title': 'Configuration', + 'manage_system_equipment_subtitle': 'Shows the hard- and software configuration of the machine.', + 'manage_system_os': 'Operating system', + 'manage_system_os_name': 'Name', + 'manage_system_os_architecture': 'Architecture', + 'manage_system_os_version': 'Version', + 'manage_system_jvm': 'Java Virtual Machine', + 'manage_system_jvm_name': 'Name', + 'manage_system_jvm_specification': 'Specification', + 'manage_system_jvm_vendor': 'Vendor', + 'manage_system_jvm_version': 'Version', + 'manage_system_gc': 'Garbage Collector', + 'manage_system_gc_count' : 'Executions', + 'manage_system_gc_duration': 'Duration', + 'manage_system_power': 'Computer', + 'manage_system_processors': 'Processors', + 'manage_system_data_title': 'Database', + 'manage_system_data_subtitle': 'Shows the number of database entries for all entities.', + 'manage_system_data_entity': 'Entity', + 'manage_system_data_sum': 'Sum', + 'manage_system_data_active': 'Active', + 'manage_system_data_deleted': 'Deleted', + 'manage_notices_change_success': 'The notice has been modified successfully.', + 'manage_notices_change_error': 'The modification of the notice has failed.', + 'manage_notices_title': 'Notices', + 'manage_notices_id': 'ID', + 'manage_notices_languages': 'Languages', + 'manage_notices_creation': 'Creation', + 'manage_notices_modification': 'Modification', + 'manage_notices_expiration': 'Expiration', + 'manage_notices_header': 'Title', + 'manage_notices_published': 'Pub.', + 'manage_notices_announced': 'An. (Min/Max)', + 'manage_notices_actions': 'Actions', + 'manage_notices_restore_tooltip': 'Restore notice', + 'manage_notices_delete_tooltip': 'Delete notice', + 'manage_notices_edit_tooltip': 'Edit notice', + 'manage_logs_title': 'Logs', + 'manage_logs_connect_tooltip': 'Connect', + 'manage_logs_disconnect_tooltip': 'Disconnect', + 'manage_logs_clear_tooltip': 'Clear', + 'manage_logs_id': 'ID', + 'manage_logs_time': 'Time', + 'manage_logs_thread': 'Thread', + 'manage_logs_level': 'Level', + 'manage_logs_class': 'Class', + 'manage_logs_method': 'Method', + 'manage_logs_message': 'Message', + 'manage_logs_trace': 'Trace', + 'manage_logs_trace_tooltip': 'Stacktrace available', + 'manage_logs_actions': 'Actions', + 'manage_logs_details_tooltip': 'Show details', + 'login_login_title': 'Login', + 'login_login_subtitle': 'Here you can access your data with your account', + 'login_login_reset': 'Forgot password?', + 'login_build_version': 'Build version', + 'login_build_time': 'Build time', + 'login_register_title': 'You do not have an account?', + 'login_register_subtitle': 'No problem!', + 'login_register_paragraph': 'Simply get one and connect your device. Then you can access your device location ' + + 'and your visitied places from everywhere!', + 'edit_notice_load_error': 'Failed to load the notice.', + 'edit_notice_save_success': 'The notice has been saved successfully.', + 'edit_notice_save_error': 'The notice could not be saved.', + 'edit_notice_title_new': 'Create', + 'edit_notice_title_edit': 'Edit', + 'edit_notice_save_tooltip': 'Save notice', + 'edit_notice_close_tooltip': 'Close notice', + 'edit_notice_content_title': 'Content', + 'edit_notice_content_subtitle': 'Here you can change the content of the notice.', + 'edit_notice_title_placeholder': 'Enter title', + 'edit_notice_body_placeholder': 'Enter content', + 'edit_notice_add_language_tooltip': 'Add language', + 'edit_notice_settings_title': 'Settings', + 'edit_notice_settings_subtitle': 'Here you can change the publication settings.', + 'edit_notice_settings_time_placeholder': 'Set expiration time', + 'edit_notice_settings_date_placeholder': 'Set expiration date', + 'edit_notice_settings_publish': 'Publish', + 'edit_notice_settings_announce': 'Announce', + 'edit_notice_settings_min_version': 'Minimum version', + 'edit_notice_settings_max_version': 'Maximum version', + 'edit_notice_creation': 'Creation', + 'edit_notice_modification': 'Modification', + 'devices_delete_confirm_title': 'Delete device?', + 'devices_delete_confirm_message': 'Do you really want to delete the device? This will also delete the visits ' + + 'of the device and it cannot be undone later on.', + 'devices_delete_success': 'The device has been deleted successfully.', + 'devices_delete_error': 'The deletion of the device failed. Are you connected to the Internet?', + 'devices_title': 'Devices', + 'devices_id': 'ID', + 'devices_os': 'OS', + 'devices_manufacturer': 'Manufacturer', + 'devices_model': 'Model', + 'devices_creation': 'Registration', + 'devices_modification': 'Modification', + 'devices_actions': 'Actions', + 'devices_location_tooltip': 'Show current location', + 'devices_history_tooltip': 'Show location history', + 'devices_delete_tooltip': 'Delete device', + 'device_location_device_error': 'Failed to load the device information.', + 'device_location_location_error': 'Failed to load the device location.', + 'device_location_device': 'Device', + 'device_location_id' : 'ID', + 'device_location_manufacturer': 'Manufacturer', + 'device_location_model': 'Model', + 'device_location_os': 'Operating system', + 'device_location_creation': 'Registration', + 'device_location_modification': 'Modification', + 'device_location_time': 'Time', + 'device_location_availability': 'Status', + 'device_location_longitude': 'Longitude', + 'device_location_latitude': 'Latitude', + 'device_location_location': 'Location', + 'change_reset_success_title': 'Reset successful', + 'change_reset_success_message': 'Your password has been reset successfully. From now on, you must use your new password to log in.', + 'change_reset_error_title': 'Reset failed', + 'change_reset_error_message': 'The password reset failed. Are you connected to the Internet?', + 'change_reset_error_badlink': 'The reset link is invalid. If you copied it from an email, make sure to copy it completely.', + 'change_reset_error_expiredlink': 'The reset link is expired. Did you use it already?', + 'change_reset_title': 'Reset password', + 'change_reset_subtitle': 'Just enter your new password.', + 'activate_title': 'Activation', + 'activate_subtitle': 'Activating your account.', + 'activate_success_title': 'Activation successful', + 'activate_success_message': 'The email address has been added to your account. If this is the first email address of a new account, ' + + 'you can now log in. If this was another email address for an existing account, you can now set it as the ' + + 'primary contact address in your account settings.', + 'activate_error_title': 'Activation failed', + 'activate_error_message': 'The activation could not be completed. Are you connected to the Internet?', + 'activate_error_badlink': 'The activation link was invalid. If you copied it from your email program into the browser, ' + + 'make sure to copy it completely.', + 'activate_error_expiredlink': 'The activation link is no longer valid. Did you already use it?', // layouts - "drawer_navigation":"Navigation", - "drawer_settings":"Settings", - "drawer_management":"Management", - "footer_rights_reserved":"All rights reserved", - "footer_imprint":"Imprint", + 'drawer_navigation': 'Navigation', + 'drawer_settings': 'Settings', + 'drawer_management': 'Management', + 'footer_rights_reserved': 'All rights reserved', + 'footer_imprint': 'Imprint', // pagination provider - "pagination_first_page":"First page", - "pagination_last_page":"Last page", - "pagination_next_page":"Next page", - "pagination_previous_page":"Previous page", - "pagination_items_per_page":"Items per Page", - "pagination_of": "of", + 'pagination_first_page': 'First page', + 'pagination_last_page': 'Last page', + 'pagination_next_page': 'Next page', + 'pagination_previous_page': 'Previous page', + 'pagination_items_per_page': 'Items per Page', + 'pagination_of': 'of', // language titles - "lang_de":"German", - "lang_en":"English", - "lang_fr":"French", - "lang_it":"Italian", - "lang_es":"Spanish", - } + 'lang_de': 'German', + 'lang_en': 'English', + 'lang_fr': 'French', + 'lang_it': 'Italian', + 'lang_es': 'Spanish', + }; /** * The current selection of languages. */ values = this.values_en; readonly languages: Language[] = [ - {value:"de", title:"", flag:"assets/flags/de.svg" }, - {value:"en", title:"", flag:"assets/flags/en.svg"}, - {value:"fr", title:"", flag:"assets/flags/fr.svg"}, - {value:"it", title:"", flag:"assets/flags/it.svg"}, - {value:"es", title:"", flag:"assets/flags/es.svg"}] + {value: 'de', title: '', flag: 'assets/flags/de.svg' }, + {value: 'en', title: '', flag: 'assets/flags/en.svg'}, + {value: 'fr', title: '', flag: 'assets/flags/fr.svg'}, + {value: 'it', title: '', flag: 'assets/flags/it.svg'}, + {value: 'es', title: '', flag: 'assets/flags/es.svg'}]; - constructor() { + constructor() { if (navigator.language) { - if (navigator.language.startsWith("de")) { + if (navigator.language.startsWith('de')) { this.values = this.values_de; } } this.updateLanguages(); - } + } public strings(key: string): string { - let result = this.values[key]; - if (!result) console.log("Failed to load string for: " + key); + const result = this.values[key]; + if (!result) { console.log('Failed to load string for: ' + key); } return result; } public setLanguage(key: string): void { - if (key == "de") this.values = this.values_de; - if (key == "en") this.values = this.values_en; + if (key === 'de') { this.values = this.values_de; } + if (key === 'en') { this.values = this.values_en; } this.updateLanguages(); } private updateLanguages() { - for (let lang of this.languages) { - lang.title = this.strings("lang_" + lang.value); + for (const lang of this.languages) { + lang.title = this.strings('lang_' + lang.value); } } } - \ No newline at end of file + diff --git a/web-angular/src/app/services/user.service.ts b/web-angular/src/app/services/user.service.ts index e3d52e1..78fcbf0 100644 --- a/web-angular/src/app/services/user.service.ts +++ b/web-angular/src/app/services/user.service.ts @@ -3,8 +3,8 @@ import { ConsoleService } from './console.service'; import { BehaviorSubject , Subject } from 'rxjs'; import { HttpErrorResponse } from '@angular/common/http'; import { Router } from '@angular/router'; -import { User } from "../../api/models/user.model"; -import { ApiClientService } from "../../api/index"; +import { User } from '../../api/models/user.model'; +import { ApiClientService } from '../../api/index'; import { UserPassword } from '../../api/models/userpassword.model'; import { CredentialService } from './credential.service'; import { HttpStatusCode } from '../utils/httpcodes'; @@ -33,14 +33,14 @@ export enum UserState { } -/** +/** * The possible roles assigned by the service. */ export enum UserRole { /** The role of a regular user. */ - User = "user", + User = 'user', /** The role of an admin user. */ - Admin = "admin" + Admin = 'admin' } /** @@ -64,16 +64,16 @@ export class UserService { /** * The last error response, if state is Unauthorized. */ - public readonly error: Subject = new Subject(); + public readonly error: Subject = new Subject(); /** * An url to redirect to after login. */ - public redirectUrl:string; + public redirectUrl: string; /** * Creates a new service. - * + * * @param consoleService The console for logging. * @param apiClientService The api client for remote requests. * @param credentailService The credential service to manage the username and password. @@ -87,27 +87,27 @@ export class UserService { } /** Returns an error handler. */ - createErrorHandler():(e:any) => void { - return (e:any):void => { + createErrorHandler(): (e: any) => void { + return (e: any): void => { if (e instanceof HttpErrorResponse) { - if (e.status == HttpStatusCode.FORBIDDEN) { + if (e.status === HttpStatusCode.FORBIDDEN) { this.credentailService.setCredential(this.credentailService.getLogin(), null); } this.error.next(e); this.state.next(UserState.Unavailable); } else { - this.consoleService.log("Unknown error in user service."); + this.consoleService.log('Unknown error in user service.'); console.dir(e); } - this.state.next(UserState.Unavailable); + this.state.next(UserState.Unavailable); }; } /** Returns the current login, if any. - * + * * @returns The current login. */ - getLogin():string { + getLogin(): string { return this.credentailService.getLogin(); } @@ -121,8 +121,8 @@ export class UserService { * @returns True if the change has been applied. */ setUser(login: string, password: string): boolean { - if (this.state.getValue() == UserState.Changing) return false; - this.consoleService.log("Setting user credentials."); + if (this.state.getValue() === UserState.Changing) { return false; } + this.consoleService.log('Setting user credentials.'); this.credentailService.setCredential(login, password); this.state.next(UserState.Unavailable); this.user.next(null); @@ -136,12 +136,12 @@ export class UserService { * the credential as a side-effect. If there is an * ongoing interaction, the call to this method will * be ignored. - * + * * @returns True if the login request has been issued. */ login(): boolean { - if (this.state.getValue() == UserState.Changing) return false; - this.consoleService.log("Issuing login request."); + if (this.state.getValue() === UserState.Changing) { return false; } + this.consoleService.log('Issuing login request.'); this.state.next(UserState.Changing); this.user.next(null); this.apiClientService.getCurrentUser().subscribe(result => { @@ -154,7 +154,7 @@ export class UserService { /** * Requests a logout, that will be executed unless the * service is currently interacting with the server. - * + * * @returns True if the change has been applied. */ logout(): boolean { @@ -163,14 +163,14 @@ export class UserService { /** * Requests a password change. - * + * * @param oldPassword The old password. * @param newPassword The new password. * @returns True if the change has been requested. */ changePassword(oldPassword: string, newPassword: string): boolean { - if (!this.credentailService.hasPassword(oldPassword)) return false; - if (this.state.getValue() == UserState.Changing) return false; + if (!this.credentailService.hasPassword(oldPassword)) { return false; } + if (this.state.getValue() === UserState.Changing) { return false; } this.state.next(UserState.Changing); this.user.next(null); this.apiClientService.setCurrentPassword({ password: newPassword }).subscribe(result => { @@ -184,11 +184,11 @@ export class UserService { /** * Requests a change to the user. - * + * * @param user The user to change. */ changeUser(user: User): boolean { - if (this.state.getValue() == UserState.Changing) return false; + if (this.state.getValue() === UserState.Changing) { return false; } this.state.next(UserState.Changing); this.user.next(null); this.apiClientService.setCurrentUser(user).subscribe(result => { @@ -196,10 +196,10 @@ export class UserService { this.state.next(UserState.Available); }, error => { if (error instanceof HttpErrorResponse) { - if (error.status == HttpStatusCode.CONFLICT) { + if (error.status === HttpStatusCode.CONFLICT) { this.user.next(error.error); this.error.next(error); - this.state.next(UserState.Available) + this.state.next(UserState.Available); } else { this.createErrorHandler()(error); } @@ -215,15 +215,15 @@ export class UserService { * return whether the specified role is assigned to the * user. If the user is not available or changing, the * result will always be false. - * + * * @param role The role to test. - * @returns True if the user is available and the role + * @returns True if the user is available and the role * is assigned. */ hasRole(role: UserRole): boolean { - if (this.state.getValue() != UserState.Available) return false; - for (let r of this.user.getValue().roles) { - if (role === r) return true; + if (this.state.getValue() !== UserState.Available) { return false; } + for (const r of this.user.getValue().roles) { + if (role === r) { return true; } } return false; } diff --git a/web-angular/src/app/services/version.service.ts b/web-angular/src/app/services/version.service.ts index b64ec33..a64c1f4 100644 --- a/web-angular/src/app/services/version.service.ts +++ b/web-angular/src/app/services/version.service.ts @@ -10,20 +10,20 @@ import { ApiClientService } from '../../api'; @Injectable() export class VersionService { - private version = new BehaviorSubject(null); - private loading: boolean = false; + private version = new BehaviorSubject(null); + private loading = false; constructor(private apiClientService: ApiClientService) { } - subscribe(handler:(version:BuildVersion)=>void): Subscription { + subscribe(handler: (version: BuildVersion) => void): Subscription { if (!this.loading && this.version.getValue() == null) { this.loading = true; - this.apiClientService.getBuildVersion().subscribe((v)=> { + this.apiClientService.getBuildVersion().subscribe((v) => { this.version.next(v.body); this.loading = false; - }, (e)=> { + }, (e) => { this.loading = false; - }) + }); } return this.version.subscribe(handler); } diff --git a/web-angular/src/app/utils/formcodes.ts b/web-angular/src/app/utils/formcodes.ts index c17c40d..7ca3e96 100644 --- a/web-angular/src/app/utils/formcodes.ts +++ b/web-angular/src/app/utils/formcodes.ts @@ -1,4 +1,4 @@ -/** +/** * The error codes for standard validations. */ export enum FormErrorCode { @@ -9,15 +9,15 @@ export enum FormErrorCode { MAXLENGTH = 4 } -/** - * A class that can act as base class for +/** + * A class that can act as base class for * components that require error encoding. */ export class FormErrorEncoder { public readonly FormErrorCode = FormErrorCode; - public encode(errors: any):number { + public encode(errors: any): number { if (errors.required) { return FormErrorCode.REQUIRED; } else if (errors.pattern) { diff --git a/web-angular/src/app/utils/httpcodes.ts b/web-angular/src/app/utils/httpcodes.ts index 5aabf81..2530915 100644 --- a/web-angular/src/app/utils/httpcodes.ts +++ b/web-angular/src/app/utils/httpcodes.ts @@ -1,6 +1,6 @@ -/** +/** * Various http status codes to avoid using - * numbers throughout the code. + * numbers throughout the code. */ export enum HttpStatusCode { CONTINUE = 100, @@ -45,4 +45,4 @@ export enum HttpStatusCode { SERVICE_UNAVAILABLE = 503, GATEWAY_TIMEOUT = 504, HTTP_VERSION_NOT_SUPPORTED = 505, - } \ No newline at end of file + } diff --git a/web-angular/src/app/utils/pagination.ts b/web-angular/src/app/utils/pagination.ts index 8adad10..7ce08b1 100644 --- a/web-angular/src/app/utils/pagination.ts +++ b/web-angular/src/app/utils/pagination.ts @@ -1,31 +1,31 @@ -import { DataSource } from "@angular/cdk/table"; -import { CollectionViewer } from "@angular/cdk/collections"; -import { Observable, BehaviorSubject, Subscription } from "rxjs"; -import { ApiClientService } from "../../api"; -import { HttpResponse } from '@angular/common/http'; -import { MatPaginator } from "@angular/material"; +import { DataSource } from '@angular/cdk/table'; +import { CollectionViewer } from '@angular/cdk/collections'; +import { Observable, BehaviorSubject, Subscription } from 'rxjs'; +import { ApiClientService } from '../../api'; +import { HttpResponse } from '@angular/common/http'; +import { MatPaginator } from '@angular/material'; export interface Page { offset: number; size: number; total: number; - elements:E[]; + elements: E[]; } export class PaginationHandler> { private pageSubscription: Subscription; private paginatorSubscription: Subscription; - - constructor(private paginator: MatPaginator, private service: AbstractPageService) { - this.pageSubscription = this.service.page.subscribe((page)=>{ + + constructor(private paginator: MatPaginator, private service: AbstractPageService) { + this.pageSubscription = this.service.page.subscribe((page) => { this.paginator.length = page.total; this.paginator.pageSize = page.size; this.paginator.pageIndex = page.offset / page.size; }); - this.paginatorSubscription = this.paginator.page.subscribe((page)=>{ - let offset = page.pageIndex * page.pageSize; - let size = page.pageSize; + this.paginatorSubscription = this.paginator.page.subscribe((page) => { + const offset = page.pageIndex * page.pageSize; + const size = page.pageSize; this.service.getPage(offset, size); }); } @@ -45,20 +45,20 @@ export abstract class AbstractPageService> extends DataSour private subscriptions = 0; readonly loading = new BehaviorSubject(false); - constructor(protected apiClientService:ApiClientService) { + constructor(protected apiClientService: ApiClientService) { super(); - this.page.subscribe((page)=>{ + this.page.subscribe((page) => { this.elements.next(page.elements); - }) + }); } getPage(offset: number, size: number) { - if (this.loading.getValue()) return; + if (this.loading.getValue()) { return; } this.loading.next(true); - this.loadPage(offset, size).subscribe((result)=>{ + this.loadPage(offset, size).subscribe((result) => { this.loading.next(false); - let page = result.body; + const page = result.body; this.page.next(page); }, (error) => { this.loading.next(false); diff --git a/web-angular/src/app/utils/snackbars.ts b/web-angular/src/app/utils/snackbars.ts index e9a7eb6..9a02e37 100644 --- a/web-angular/src/app/utils/snackbars.ts +++ b/web-angular/src/app/utils/snackbars.ts @@ -8,23 +8,29 @@ export class Snackbars { /** * Shows an error message that disappears after a short period of time. - * + * * @param snackbar The snackbar service. * @param message The message. */ - public static showError(snackbar: MatSnackBar, message: string, duration?:number) { - if (duration == null) snackbar.open(message, null, { panelClass: ["snackbar-accent"], duration: Snackbars.DURATION_SHORT}); - else snackbar.open(message, null, { panelClass: ["snackbar-accent"], duration: duration}); + public static showError(snackbar: MatSnackBar, message: string, duration?: number) { + if (duration == null) { + snackbar.open(message, null, { panelClass: ['snackbar-accent'], duration: Snackbars.DURATION_SHORT}); + } else { + snackbar.open(message, null, { panelClass: ['snackbar-accent'], duration: duration}); + } } /** * Shows a permanent information message that does not disapper automatically. - * + * * @param snackbar The snackbar service. * @param message The message. */ - public static showMessage(snackbar: MatSnackBar, message: string, duration?:number) { - if (duration != null)snackbar.open(message, null, { panelClass: ["snackbar-primary"], duration: duration}); - else snackbar.open(message, null, { panelClass: ["snackbar-primary"]}); + public static showMessage(snackbar: MatSnackBar, message: string, duration?: number) { + if (duration != null) { + snackbar.open(message, null, { panelClass: ['snackbar-primary'], duration: duration}); + } else { + snackbar.open(message, null, { panelClass: ['snackbar-primary']}); + } } -} \ No newline at end of file +} diff --git a/web-angular/src/app/utils/tables.ts b/web-angular/src/app/utils/tables.ts index 6f74413..2f0d475 100644 --- a/web-angular/src/app/utils/tables.ts +++ b/web-angular/src/app/utils/tables.ts @@ -1,5 +1,5 @@ -import { MatTable } from "@angular/material"; -import { ElementRef } from "@angular/core"; +import { MatTable } from '@angular/material'; +import { ElementRef } from '@angular/core'; export interface TableColumn { name: string; @@ -10,39 +10,39 @@ export interface TableColumn { export class TableHandler { - private tableWidth:number = null; + private tableWidth: number = null; private displayColumns: string[] = null; private minWidth: number; private columnsMap: Map = new Map(); constructor( - private table: ElementRef, - private columns:TableColumn[], + private table: ElementRef, + private columns: TableColumn[], private fallback?: TableColumn[]) { // compute the min width once before going to fallback, if available this.minWidth = 0; - for (let c of columns) { - if (c.dropPriority < 0) c.dropPriority = 0; - if (c.dropPriority == 0) this.minWidth += c.width; - this.columnsMap.set(c.name, c); + for (const c of columns) { + if (c.dropPriority < 0) { c.dropPriority = 0; } + if (c.dropPriority === 0) { this.minWidth += c.width; } + this.columnsMap.set(c.name, c); } if (fallback) { - for (let c of fallback) { + for (const c of fallback) { this.columnsMap.set(c.name, c); } } } onCheck(): void { - if (this.table.nativeElement.clientWidth != this.tableWidth) { + if (this.table.nativeElement.clientWidth !== this.tableWidth) { this.displayColumns = null; } } getColumnStyle(name: string): any { - let c = this.columnsMap.get(name); - if (c == null) return { }; + const c = this.columnsMap.get(name); + if (c == null) { return { }; } if (c.fixedWidth) { return { 'width': c.width + 'px', 'min-width': c.width + 'px', 'max-width': c.width + 'px'}; } else { @@ -50,7 +50,7 @@ export class TableHandler { } } - getDisplayColumns():string[] { + getDisplayColumns(): string[] { if (this.displayColumns == null) { this.displayColumns = this.computeColumns(); } @@ -60,20 +60,20 @@ export class TableHandler { private computeColumns(): string[] { this.tableWidth = this.table.nativeElement.clientWidth; // get the columns to process (if too small use fallback) - var selectedColumns: TableColumn[] = []; - let targetColumns: TableColumn[] = (this.fallback && (this.minWidth > this.tableWidth))?this.fallback:this.columns; + const selectedColumns: TableColumn[] = []; + const targetColumns: TableColumn[] = (this.fallback && (this.minWidth > this.tableWidth)) ? this.fallback : this.columns; // sort the copy by priority - var columns = targetColumns.slice(); - columns.sort((c1, c2)=> { return c1.dropPriority - c2.dropPriority }); + const columns = targetColumns.slice(); + columns.sort((c1, c2) => c1.dropPriority - c2.dropPriority); // process columns - var currentWidth: number = 0; + let currentWidth = 0; while (columns.length > 0) { // for each priority, compute the length and the required width - var requiredWidth: number = 0; - var priority:number = columns[0].dropPriority; - var index: number = 0; - for (let c of columns) { - if (c.dropPriority == priority) { + let requiredWidth = 0; + const priority: number = columns[0].dropPriority; + let index = 0; + for (const c of columns) { + if (c.dropPriority === priority) { requiredWidth += c.width; index += 1; } else { @@ -81,8 +81,8 @@ export class TableHandler { } } // now check whether everything fits, and insert the columns as selection - if (priority == 0 || this.tableWidth >= (currentWidth + requiredWidth)) { - for (let c of columns.splice(0, index)) { + if (priority === 0 || this.tableWidth >= (currentWidth + requiredWidth)) { + for (const c of columns.splice(0, index)) { selectedColumns.push(c); } currentWidth += requiredWidth; @@ -92,14 +92,14 @@ export class TableHandler { } } // sort the result by the original ordering - selectedColumns.sort((c1, c2)=> { return targetColumns.indexOf(c1) - targetColumns.indexOf(c2) }) + selectedColumns.sort((c1, c2) => targetColumns.indexOf(c1) - targetColumns.indexOf(c2)); // get the name only - let result: string[] = []; - for (let c of selectedColumns) { + const result: string[] = []; + for (const c of selectedColumns) { result.push(c.name); } return result; } - -} \ No newline at end of file + +} diff --git a/web-angular/src/app/views/activate.component.ts b/web-angular/src/app/views/activate.component.ts index 5c3a7bc..c2d2a27 100644 --- a/web-angular/src/app/views/activate.component.ts +++ b/web-angular/src/app/views/activate.component.ts @@ -1,44 +1,43 @@ -import { Component, OnInit } from "@angular/core"; -import { ApiClientService } from "../../api"; -import { MatDialog } from "@angular/material"; -import { ActivatedRoute, Router } from "@angular/router"; -import { MessageDialogComponent } from "../widgets/message-dialog.component"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { ResourceService } from "../services/resource.service"; +import { Component, OnInit } from '@angular/core'; +import { ApiClientService } from '../../api'; +import { MatDialog } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MessageDialogComponent } from '../widgets/message-dialog.component'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'activate', - templateUrl: './activate.component.html', - host: { class:'match-parent' }, + selector: 'app-activate', + templateUrl: './activate.component.html' }) export class ActivateComponent implements OnInit { - - showMessage: boolean = true; + + showMessage = true; constructor( public res: ResourceService, - private apiClientService: ApiClientService, - private dialog: MatDialog, - private router: Router, + private apiClientService: ApiClientService, + private dialog: MatDialog, + private router: Router, private route: ActivatedRoute) { } ngOnInit(): void { - let token = this.route.snapshot.paramMap.get('token'); + const token = this.route.snapshot.paramMap.get('token'); if (!token) { - this.router.navigate(["/"]); + this.router.navigate(['/']); } else { - this.apiClientService.verifyUserEmail(token).subscribe((result)=>{ + this.apiClientService.verifyUserEmail(token).subscribe((result) => { this.showMessage = false; - MessageDialogComponent.open(this.dialog, { - title: this.res.strings('activate_success_title'), - message: this.res.strings('activate_success_message'), - button: this.res.strings('button_gotit')}).subscribe((close)=>{ - this.router.navigate(["/"]); - }) - }, (error)=> { + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('activate_success_title'), + message: this.res.strings('activate_success_message'), + button: this.res.strings('button_gotit')}).subscribe((close) => { + this.router.navigate(['/']); + }); + }, (error) => { this.showMessage = false; - var message: string = this.res.strings('activate_error_message'); + let message: string = this.res.strings('activate_error_message'); if (error instanceof HttpErrorResponse) { switch (error.status) { case HttpStatusCode.BAD_REQUEST: @@ -51,15 +50,15 @@ import { ResourceService } from "../services/resource.service"; break; } } - MessageDialogComponent.open(this.dialog, { - title:this.res.strings('activate_error_title'), - message:message, - button:this.res.strings('button_gotit') }).subscribe((close)=>{ - this.router.navigate(["/"]); - }) - }) + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('activate_error_title'), + message: message, + button: this.res.strings('button_gotit') }).subscribe((close) => { + this.router.navigate(['/']); + }); + }); } } - + } - \ No newline at end of file + diff --git a/web-angular/src/app/views/change.component.html b/web-angular/src/app/views/change.component.html index 6ae2de0..17530b2 100644 --- a/web-angular/src/app/views/change.component.html +++ b/web-angular/src/app/views/change.component.html @@ -6,7 +6,7 @@
- +
diff --git a/web-angular/src/app/views/change.component.ts b/web-angular/src/app/views/change.component.ts index 16dd599..c9da20c 100644 --- a/web-angular/src/app/views/change.component.ts +++ b/web-angular/src/app/views/change.component.ts @@ -15,14 +15,13 @@ import { MessageDialogComponent } from '../widgets/message-dialog.component'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'reset', - templateUrl: './change.component.html', - host: { class: 'match-parent' } + selector: 'app-change', + templateUrl: './change.component.html' }) export class ChangeComponent implements OnInit, OnDestroy { @ViewChild(PasswordFieldComponent, { static: true }) passwordField: PasswordFieldComponent; - @ViewChild("changeForm", { static: true }) resetForm: NgForm; + @ViewChild('changeForm', { static: true }) resetForm: NgForm; readonly idle = new BehaviorSubject(true); @@ -39,41 +38,42 @@ export class ChangeComponent implements OnInit, OnDestroy { ) { } ngOnInit() { - this.token = this.route.snapshot.paramMap.get("token"); + this.token = this.route.snapshot.paramMap.get('token'); } onChange(): void { this.snackbar.dismiss(); - if (!this.idle || !this.resetForm.valid) return; + if (!this.idle || !this.resetForm.valid) { return; } this.setIdle(false); - this.changeSubscription = this.apiClientService.resetUserPassword(this.token, { password: this.passwordField.password }).subscribe((result) => { + this.changeSubscription = this.apiClientService.resetUserPassword + (this.token, { password: this.passwordField.password }).subscribe((result) => { this.setIdle(true); - MessageDialogComponent.open(this.dialog, { - title: this.res.strings('change_reset_success_title'), - message: this.res.strings('change_reset_success_message'), + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('change_reset_success_title'), + message: this.res.strings('change_reset_success_message'), button: this.res.strings('button_gotit') }).subscribe((close) => { - this.router.navigate(["/"]); + this.router.navigate(['/']); }); }, (error) => { this.setIdle(true); - var message: string = this.res.strings("change_reset_error_message"); + let message: string = this.res.strings('change_reset_error_message'); if (error instanceof HttpErrorResponse) { switch (error.status) { case HttpStatusCode.BAD_REQUEST: - message = this.res.strings("change_reset_error_badlink"); + message = this.res.strings('change_reset_error_badlink'); break; case HttpStatusCode.FORBIDDEN: - message = this.res.strings("change_reset_error_expiredlink"); + message = this.res.strings('change_reset_error_expiredlink'); break; default: break; } } - MessageDialogComponent.open(this.dialog, { - title: this.res.strings("change_reset_error_title"), - message: message, - button: this.res.strings("button_gotit") }).subscribe((close) => { - this.router.navigate(["/"]); + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('change_reset_error_title'), + message: message, + button: this.res.strings('button_gotit') }).subscribe((close) => { + this.router.navigate(['/']); }); }); } @@ -85,7 +85,7 @@ export class ChangeComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.snackbar.dismiss(); - if (this.changeSubscription) this.changeSubscription.unsubscribe(); + if (this.changeSubscription) { this.changeSubscription.unsubscribe(); } } diff --git a/web-angular/src/app/views/device-location.component.html b/web-angular/src/app/views/device-location.component.html index 0149a51..51d0da0 100644 --- a/web-angular/src/app/views/device-location.component.html +++ b/web-angular/src/app/views/device-location.component.html @@ -1,4 +1,4 @@ - + @@ -81,4 +81,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/web-angular/src/app/views/device-location.component.ts b/web-angular/src/app/views/device-location.component.ts index f546fa0..b47536d 100644 --- a/web-angular/src/app/views/device-location.component.ts +++ b/web-angular/src/app/views/device-location.component.ts @@ -1,22 +1,21 @@ -import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit } from "@angular/core"; -import { ApiClientService } from "../../api"; -import { MatDialog, MatSnackBar } from "@angular/material"; -import { ActivatedRoute, Router } from "@angular/router"; -import { MessageDialogComponent } from "../widgets/message-dialog.component"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { Subscription, BehaviorSubject } from "rxjs"; -import { Device, Location } from "../../api/models"; -import { Snackbars } from "../utils/snackbars"; +import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, HostBinding } from '@angular/core'; +import { ApiClientService } from '../../api'; +import { MatDialog, MatSnackBar } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MessageDialogComponent } from '../widgets/message-dialog.component'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { Subscription, BehaviorSubject } from 'rxjs'; +import { Device, Location } from '../../api/models'; +import { Snackbars } from '../utils/snackbars'; import * as L from 'leaflet'; -import { TileMapComponent } from "../widgets/tile-map.component"; -import { MarkerMapComponent } from "../widgets/marker-map.component"; -import { ResourceService } from "../services/resource.service"; +import { TileMapComponent } from '../widgets/tile-map.component'; +import { MarkerMapComponent } from '../widgets/marker-map.component'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'device-location', - templateUrl: './device-location.component.html', - host: { class:'match-parent' }, + selector: 'app-device-location', + templateUrl: './device-location.component.html' }) export class DeviceLocationComponent implements OnInit, OnDestroy { @@ -38,48 +37,48 @@ import { ResourceService } from "../services/resource.service"; ) { } ngOnInit() { - this.id = this.route.snapshot.paramMap.get("id"); + this.id = this.route.snapshot.paramMap.get('id'); this.updateDevice(); this.updateLocation(); } - isUpdatingDevice():boolean { + isUpdatingDevice(): boolean { return this.deviceSubscription != null; } - isUpdatingLocation():boolean { + isUpdatingLocation(): boolean { return this.locationSubscription != null; } - updateDevice():void { - if (this.deviceSubscription) return; - this.deviceSubscription = this.apiClientService.getDevice(parseInt(this.id, 10)).subscribe((result)=>{ + updateDevice(): void { + if (this.deviceSubscription) { return; } + this.deviceSubscription = this.apiClientService.getDevice(parseInt(this.id, 10)).subscribe((result) => { this.device.next(result.body); this.deviceSubscription = null; - }, (error)=>{ + }, (error) => { Snackbars.showError(this.snackbar, this.res.strings('device_location_device_error')); this.deviceSubscription = null; }); } - updateLocation():void { - if (this.locationSubscription) return; - this.locationSubscription = this.apiClientService.getDeviceLocation(parseInt(this.id, 10)).subscribe((result)=>{ + updateLocation(): void { + if (this.locationSubscription) { return; } + this.locationSubscription = this.apiClientService.getDeviceLocation(parseInt(this.id, 10)).subscribe((result) => { this.location.next(result.body); this.map.setMarkerPosition(result.body.coordinate); this.locationSubscription = null; - }, (error)=>{ + }, (error) => { Snackbars.showError(this.snackbar, this.res.strings('device_location_location_error')); this.locationSubscription = null; this.map.setMarkerPosition(null); }); } - + ngOnDestroy() { - if (this.deviceSubscription) this.deviceSubscription.unsubscribe(); - if (this.locationSubscription) this.locationSubscription.unsubscribe(); + if (this.deviceSubscription) { this.deviceSubscription.unsubscribe(); } + if (this.locationSubscription) { this.locationSubscription.unsubscribe(); } } } - \ No newline at end of file + diff --git a/web-angular/src/app/views/device-visits.component.html b/web-angular/src/app/views/device-visits.component.html index 3b8c860..d1144ad 100644 --- a/web-angular/src/app/views/device-visits.component.html +++ b/web-angular/src/app/views/device-visits.component.html @@ -1,4 +1,4 @@ - + @@ -133,4 +133,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/web-angular/src/app/views/device-visits.component.ts b/web-angular/src/app/views/device-visits.component.ts index 72de5df..1f294b9 100644 --- a/web-angular/src/app/views/device-visits.component.ts +++ b/web-angular/src/app/views/device-visits.component.ts @@ -1,61 +1,60 @@ -import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ElementRef, DoCheck } from "@angular/core"; -import { ApiClientService } from "../../api"; -import { MatDialog, MatSnackBar, MatDatepicker, MatDatepickerInputEvent } from "@angular/material"; -import { ActivatedRoute, Router } from "@angular/router"; -import { MessageDialogComponent } from "../widgets/message-dialog.component"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { Subscription, BehaviorSubject } from "rxjs"; -import { Device, Location, Visit } from "../../api/models"; -import { Snackbars } from "../utils/snackbars"; +import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ElementRef, DoCheck } from '@angular/core'; +import { ApiClientService } from '../../api'; +import { MatDialog, MatSnackBar, MatDatepicker, MatDatepickerInputEvent } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MessageDialogComponent } from '../widgets/message-dialog.component'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { Subscription, BehaviorSubject } from 'rxjs'; +import { Device, Location, Visit } from '../../api/models'; +import { Snackbars } from '../utils/snackbars'; import * as L from 'leaflet'; -import { TileMapComponent } from "../widgets/tile-map.component"; -import { MarkerMapComponent } from "../widgets/marker-map.component"; -import { DeviceVisitService } from "../services/device-visit.service"; -import { DataSource } from "@angular/cdk/table"; -import { ConfirmationDialogComponent } from "../widgets/confirmation-dialog.component"; -import { FormControl } from "@angular/forms"; -import { TableColumn, TableHandler } from "../utils/tables"; -import { ResourceService } from "../services/resource.service"; +import { TileMapComponent } from '../widgets/tile-map.component'; +import { MarkerMapComponent } from '../widgets/marker-map.component'; +import { DeviceVisitService } from '../services/device-visit.service'; +import { DataSource } from '@angular/cdk/table'; +import { ConfirmationDialogComponent } from '../widgets/confirmation-dialog.component'; +import { FormControl } from '@angular/forms'; +import { TableColumn, TableHandler } from '../utils/tables'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'device-visits', - templateUrl: './device-visits.component.html', - host: { class: 'match-parent' }, + selector: 'app-device-visits', + templateUrl: './device-visits.component.html' }) export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, DoCheck { private static COLUMNS: TableColumn[] = [ - { name: "time", dropPriority: 0, width: 120, fixedWidth: true }, - { name: "place", dropPriority: 0, width: 120 }, - { name: "actions", dropPriority: 0, width: 130, fixedWidth: true } + { name: 'time', dropPriority: 0, width: 120, fixedWidth: true }, + { name: 'place', dropPriority: 0, width: 120 }, + { name: 'actions', dropPriority: 0, width: 130, fixedWidth: true } ]; private static FALLBACK: TableColumn[] = [ - { name: "visit", dropPriority: 0, width: 120 }, - { name: "actions", dropPriority: 0, width: 130, fixedWidth: true } + { name: 'visit', dropPriority: 0, width: 120 }, + { name: 'actions', dropPriority: 0, width: 130, fixedWidth: true } ]; private static readonly DAY = 24 * 60 * 60 * 1000; @ViewChild(MarkerMapComponent, { static: true }) map: MarkerMapComponent; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; id: string; maxDate = new Date(); minDate = new Date(); selectedDate = new Date(); - minTime: number = 0; - maxTime: number = 0; + minTime = 0; + maxTime = 0; device: BehaviorSubject; dataSource: DataSource; - loading: BehaviorSubject - date: BehaviorSubject + loading: BehaviorSubject; + date: BehaviorSubject; deleting = new BehaviorSubject(false); - compact: boolean = false; + compact = false; private places: L.CircleMarker[] = []; private tableHandler: TableHandler; @@ -91,7 +90,7 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, } hasNextDay(): boolean { - let next = this.selectedDate.getTime() + DeviceVisitsComponent.DAY; + const next = this.selectedDate.getTime() + DeviceVisitsComponent.DAY; return this.maxDate.getTime() >= next; } @@ -101,7 +100,7 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, hasPreviousDay(): boolean { - let next = this.selectedDate.getTime() - DeviceVisitsComponent.DAY; + const next = this.selectedDate.getTime() - DeviceVisitsComponent.DAY; return this.minDate.getTime() <= next; } @@ -111,8 +110,11 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, getPanelWidth(): any { - if (this.compact) return { width: "280px" }; - else return { width: "520px" }; + if (this.compact) { + return { width: '280px' }; + } else { + return { width: '520px' }; + } } getStyle(column: string): any { @@ -130,11 +132,11 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, ngOnInit() { this.tableHandler = new TableHandler(this.table, DeviceVisitsComponent.COLUMNS, DeviceVisitsComponent.FALLBACK); - this.id = this.route.snapshot.paramMap.get("id"); + this.id = this.route.snapshot.paramMap.get('id'); this.deviceVisitSerivce.setDevice(+this.id); this.dateSubscription = this.date.subscribe((date) => { this.selectedDate = date; - let d = new Date(date); + const d = new Date(date); d.setHours(0, 0, 0, 0); this.minTime = d.getTime(); d.setHours(23, 59, 59, 999); @@ -155,8 +157,11 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, ngAfterViewInit() { this.loadingSubscription = this.loading.subscribe((load) => { - if (load) this.clearPlaces(); - else this.createPlaces(); + if (load) { + this.clearPlaces(); + } else { + this.createPlaces(); + } }); } @@ -168,15 +173,15 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, } getPlaceName(id: number): string { - let place = this.deviceVisitSerivce.getPlace(id); + const place = this.deviceVisitSerivce.getPlace(id); if (!place) { - return "" + id; + return '' + id; } else if (place.nickname) { return place.nickname; } else if (place.address) { return place.address; } else { - return "" + place.id; + return '' + place.id; } } @@ -203,11 +208,11 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, this.deleting.next(false); this.deviceVisitSerivce.setDevice(+this.id); Snackbars.showError(this.snackbar, this.res.strings('visits_delete_error')); - }) + }); } onSelectPlace(id: number): void { - let place = this.deviceVisitSerivce.getPlace(id); + const place = this.deviceVisitSerivce.getPlace(id); if (!place) { Snackbars.showError(this.snackbar, this.res.strings('visits_place_load_error')); this.map.setPinPosition(null); @@ -223,55 +228,55 @@ export class DeviceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, private createPlaces(): void { // compute the total and individual stay duration - let placeDurations = new Map(); - var totalDuration = 0; - for (let v of this.deviceVisitSerivce.getVisits()) { - let begin = this.getTime(v.beginTime); - let end = this.getTime(v.endTime); - var duration = end - begin; + const placeDurations = new Map(); + let totalDuration = 0; + for (const v of this.deviceVisitSerivce.getVisits()) { + const begin = this.getTime(v.beginTime); + const end = this.getTime(v.endTime); + let duration = end - begin; totalDuration += duration; if (placeDurations.has(v.place)) { duration += placeDurations.get(v.place); } placeDurations.set(v.place, duration); } - var latlngs: ([number, number])[] = new Array(); + const latlngs: ([number, number])[] = new Array(); // create circles for places placeDurations.forEach((v, k) => { - let place = this.deviceVisitSerivce.getPlace(k); + const place = this.deviceVisitSerivce.getPlace(k); if (place != null) { - let pos = new L.LatLng(place.coordinate.latitude, place.coordinate.longitude); + const pos = new L.LatLng(place.coordinate.latitude, place.coordinate.longitude); latlngs.push([place.coordinate.latitude, place.coordinate.longitude]); - let circle = L.circleMarker(pos, { + const circle = L.circleMarker(pos, { radius: 36, - fillColor: "#f9a825", + fillColor: '#f9a825', fill: true, stroke: true, weight: 4, fillOpacity: this.getOpacity(v, totalDuration), opacity: 0.8, - color: "#01579b" - }) + color: '#01579b' + }); this.places.push(circle); circle.addTo(this.map.map.map); } }); if (latlngs.length > 0) { - let bounds = new L.LatLngBounds(latlngs); + const bounds = new L.LatLngBounds(latlngs); this.map.centerBounds(bounds); } } private getOpacity(duration: number, total: number): number { - let maxOpacity = 0.8; - if (total == 0) return maxOpacity; - let fraction = duration / total; + const maxOpacity = 0.8; + if (total === 0) { return maxOpacity; } + const fraction = duration / total; return fraction * maxOpacity; } private clearPlaces(): void { this.map.setPinPosition(null); - for (let c of this.places) { + for (const c of this.places) { c.remove(); } this.places = []; diff --git a/web-angular/src/app/views/devices.component.ts b/web-angular/src/app/views/devices.component.ts index b5b11c3..506f0f6 100644 --- a/web-angular/src/app/views/devices.component.ts +++ b/web-angular/src/app/views/devices.component.ts @@ -12,23 +12,22 @@ import { TableHandler, TableColumn } from '../utils/tables'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'devices', - templateUrl: 'devices.component.html', - host: { class: 'match-parent' } + selector: 'app-devices', + templateUrl: 'devices.component.html' }) export class DevicesComponent implements OnInit, OnDestroy, DoCheck { private static COLUMNS: TableColumn[] = [ - { name: "id", dropPriority: 2, width: 140, fixedWidth: true }, - { name: "os", dropPriority: 1, width: 60, fixedWidth: true }, - { name: "manufacturer", dropPriority: 0, width: 200 }, - { name: "model", dropPriority: 0, width: 200 }, - { name: "creationTime", dropPriority: 3, width: 130, fixedWidth: true }, - { name: "modificationTime", dropPriority: 4, width: 130, fixedWidth: true }, - { name: "actions", dropPriority: 0, width: 130, fixedWidth: true } + { name: 'id', dropPriority: 2, width: 140, fixedWidth: true }, + { name: 'os', dropPriority: 1, width: 60, fixedWidth: true }, + { name: 'manufacturer', dropPriority: 0, width: 200 }, + { name: 'model', dropPriority: 0, width: 200 }, + { name: 'creationTime', dropPriority: 3, width: 130, fixedWidth: true }, + { name: 'modificationTime', dropPriority: 4, width: 130, fixedWidth: true }, + { name: 'actions', dropPriority: 0, width: 130, fixedWidth: true } ]; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; dataSource: DataSource; @@ -71,8 +70,11 @@ export class DevicesComponent implements OnInit, OnDestroy, DoCheck { } getOsIcon(os: string): string { - if (os === "ANDROID") return "android"; - else return "smartphone"; + if (os === 'ANDROID') { + return 'android'; + } else { + return 'smartphone'; + } } onDelete(id: number): void { @@ -98,7 +100,7 @@ export class DevicesComponent implements OnInit, OnDestroy, DoCheck { this.deleting.next(false); this.deviceSerivce.reload(); Snackbars.showError(this.snackbar, this.res.strings('devices_delete_error')); - }) + }); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/views/edit-notice.component.html b/web-angular/src/app/views/edit-notice.component.html index cbf126f..aaf217a 100644 --- a/web-angular/src/app/views/edit-notice.component.html +++ b/web-angular/src/app/views/edit-notice.component.html @@ -19,7 +19,7 @@
- + {{ res.strings('edit_notice_content_title') }} {{ res.strings('edit_notice_content_subtitle') }} @@ -55,7 +55,7 @@ add_circle_outline
- + diff --git a/web-angular/src/app/views/manage-notices.component.ts b/web-angular/src/app/views/manage-notices.component.ts index ac6cb64..9ae3349 100644 --- a/web-angular/src/app/views/manage-notices.component.ts +++ b/web-angular/src/app/views/manage-notices.component.ts @@ -16,48 +16,47 @@ import { TableHandler, TableColumn } from '../utils/tables'; import { ResourceService, Language } from '../services/resource.service'; @Component({ - selector: 'manage-notices', - templateUrl: 'manage-notices.component.html', - host: { class:'match-parent' } + selector: 'app-manage-notices', + templateUrl: 'manage-notices.component.html' }) export class ManageNoticesComponent extends FormErrorEncoder implements OnInit, OnDestroy, DoCheck { - + private static COLUMNS: TableColumn[] = [ - { name: "id", dropPriority: 6, width: 120, fixedWidth:true}, - { name: "published", dropPriority: 1, width: 55, fixedWidth:true}, - { name: "announced", dropPriority: 1, width: 110, fixedWidth:true}, - { name: "languages", dropPriority: 2, width: 140, fixedWidth:true}, - { name: "title", dropPriority: 0, width: 350}, - { name: "creationTime", dropPriority: 4, width: 130, fixedWidth:true}, - { name: "expirationTime", dropPriority: 3, width: 130 , fixedWidth:true}, - { name: "modificationTime", dropPriority: 5, width: 130 , fixedWidth:true}, - { name: "actions", dropPriority: 0, width: 90, fixedWidth: true } + { name: 'id', dropPriority: 6, width: 120, fixedWidth: true}, + { name: 'published', dropPriority: 1, width: 55, fixedWidth: true}, + { name: 'announced', dropPriority: 1, width: 110, fixedWidth: true}, + { name: 'languages', dropPriority: 2, width: 140, fixedWidth: true}, + { name: 'title', dropPriority: 0, width: 350}, + { name: 'creationTime', dropPriority: 4, width: 130, fixedWidth: true}, + { name: 'expirationTime', dropPriority: 3, width: 130 , fixedWidth: true}, + { name: 'modificationTime', dropPriority: 5, width: 130 , fixedWidth: true}, + { name: 'actions', dropPriority: 0, width: 90, fixedWidth: true } ]; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; language: string; - readonly languages:Language[]; + readonly languages: Language[]; readonly dataSource: DataSource; - readonly loading:BehaviorSubject; - + readonly loading: BehaviorSubject; + private tableHandler: TableHandler; private pageHandler: PaginationHandler; constructor( public res: ResourceService, - private mangeNoticeService: ManageNoticeService, + private mangeNoticeService: ManageNoticeService, private snackbar: MatSnackBar, - private dialog:MatDialog) { + private dialog: MatDialog) { super(); this.dataSource = mangeNoticeService; this.loading = mangeNoticeService.loading; this.languages = res.languages; this.language = res.strings('language'); - } + } getStyle(column: string): any { return this.tableHandler.getColumnStyle(column); @@ -75,50 +74,50 @@ export class ManageNoticesComponent extends FormErrorEncoder implements OnInit, this.tableHandler = new TableHandler(this.table, ManageNoticesComponent.COLUMNS, null); this.pageHandler = new PaginationHandler(this.paginator, this.mangeNoticeService); this.mangeNoticeService.reload(); - } + } ngOnDestroy() { this.pageHandler.destroy(); } getTitle(notice: Notice): string { - for (let m of notice.messages) { - if (m.language == this.language) { + for (const m of notice.messages) { + if (m.language === this.language) { return m.title; } } - return ""; + return ''; } - hasLanguage(notice:Notice, lang:string) { - for (let m of notice.messages) { - if (m.language == lang) return true; + hasLanguage(notice: Notice, lang: string) { + for (const m of notice.messages) { + if (m.language === lang) { return true; } } return false; } - onDelete(notice: Notice):void { - if (this.loading.getValue()) return; + onDelete(notice: Notice): void { + if (this.loading.getValue()) { return; } notice.deleted = true; this.updateNotice(notice); } - onRestore(notice: Notice):void { - if (this.loading.getValue()) return; + onRestore(notice: Notice): void { + if (this.loading.getValue()) { return; } notice.deleted = false; this.updateNotice(notice); } - private updateNotice(notice:Notice) { - this.mangeNoticeService.setNotice(notice).subscribe((result)=> { + private updateNotice(notice: Notice) { + this.mangeNoticeService.setNotice(notice).subscribe((result) => { if (result != null) { - Snackbars.showMessage(this.snackbar, this.res.strings("manage_notices_change_success") , Snackbars.DURATION_SHORT); + Snackbars.showMessage(this.snackbar, this.res.strings('manage_notices_change_success') , Snackbars.DURATION_SHORT); } else { - Snackbars.showError(this.snackbar, this.res.strings("manage_notices_change_error")); + Snackbars.showError(this.snackbar, this.res.strings('manage_notices_change_error')); } }); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/views/manage-system.component.ts b/web-angular/src/app/views/manage-system.component.ts index e5baa5d..a980738 100644 --- a/web-angular/src/app/views/manage-system.component.ts +++ b/web-angular/src/app/views/manage-system.component.ts @@ -1,15 +1,28 @@ -import { Component, OnInit, OnDestroy, HostListener } from "@angular/core"; -import { SystemStatistic, EntityStatistic, LoadStatistic } from "../../api/models"; -import { ApiClientService } from "../../api"; -import { Subscription, Observable, BehaviorSubject } from "rxjs"; -import { DataSource } from "@angular/cdk/table"; -import { CollectionViewer } from "@angular/cdk/collections"; -import { ResourceService } from "../services/resource.service"; +import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; +import { SystemStatistic, EntityStatistic, LoadStatistic } from '../../api/models'; +import { ApiClientService } from '../../api'; +import { Subscription, Observable, BehaviorSubject } from 'rxjs'; +import { DataSource } from '@angular/cdk/table'; +import { CollectionViewer } from '@angular/cdk/collections'; +import { ResourceService } from '../services/resource.service'; + + +class EntityDataSource implements DataSource { + + entities = new BehaviorSubject([]); + + connect(collectionViewer: CollectionViewer): Observable { + return this.entities; + } + disconnect(collectionViewer: CollectionViewer): void { + // do nothing + } + +} @Component({ - selector: 'manage-system', - templateUrl: './manage-system.component.html', - host: { class: 'match-parent' }, + selector: 'app-manage-system', + templateUrl: './manage-system.component.html' }) export class ManageSystemComponent implements OnInit, OnDestroy { @@ -20,20 +33,20 @@ export class ManageSystemComponent implements OnInit, OnDestroy { system: SystemStatistic; readonly entities = new EntityDataSource(); load: LoadStatistic; - columns:number = 1; + columns = 1; private loadSubscription: Subscription; private entitySubscription: Subscription; private systemSubscription: Subscription; - private loadTimer:any = null; + private loadTimer: any = null; private entityTimer: any = null; private systemTimer: any = null; constructor(public res: ResourceService, private apiClientService: ApiClientService) { } @HostListener('window:resize', ['$event']) - onResize(event:Event) { + onResize(event: Event) { this.updateColumns((event.target as Window).innerWidth); } @@ -56,38 +69,38 @@ export class ManageSystemComponent implements OnInit, OnDestroy { this.loadSubscription.unsubscribe(); this.entitySubscription.unsubscribe(); this.systemSubscription.unsubscribe(); - if (this.loadTimer != null) clearTimeout(this.loadTimer); - if (this.entityTimer != null) clearTimeout(this.entityTimer); - if (this.systemTimer != null) clearTimeout(this.systemTimer); + if (this.loadTimer != null) { clearTimeout(this.loadTimer); } + if (this.entityTimer != null) { clearTimeout(this.entityTimer); } + if (this.systemTimer != null) { clearTimeout(this.systemTimer); } } - hasEntities():boolean { - return this.entities.entities.getValue().length == 0; + hasEntities(): boolean { + return this.entities.entities.getValue().length === 0; } private updateLoad(): Subscription { - return this.apiClientService.getLoadStatistic().subscribe((result)=>{ + return this.apiClientService.getLoadStatistic().subscribe((result) => { this.load = result.body; - this.loadTimer = setTimeout(()=>this.loadSubscription = this.updateLoad(),ManageSystemComponent.TIMEOUT_LOAD); - },(error)=>{ - this.loadTimer = setTimeout(()=>this.loadSubscription = this.updateLoad(),ManageSystemComponent.TIMEOUT_ERROR); + this.loadTimer = setTimeout(() => this.loadSubscription = this.updateLoad(), ManageSystemComponent.TIMEOUT_LOAD); + }, (error) => { + this.loadTimer = setTimeout(() => this.loadSubscription = this.updateLoad(), ManageSystemComponent.TIMEOUT_ERROR); }); } private updateEntities(): Subscription { - return this.apiClientService.getEntityStatistics().subscribe((result)=>{ + return this.apiClientService.getEntityStatistics().subscribe((result) => { this.entities.entities.next(result.body); - this.entityTimer = setTimeout(()=>this.entitySubscription = this.updateEntities(), ManageSystemComponent.TIMEOUT_ENTITY); - }, (error)=>{ - this.entityTimer = setTimeout(()=>this.entitySubscription = this.updateEntities(), ManageSystemComponent.TIMEOUT_ERROR); + this.entityTimer = setTimeout(() => this.entitySubscription = this.updateEntities(), ManageSystemComponent.TIMEOUT_ENTITY); + }, (error) => { + this.entityTimer = setTimeout(() => this.entitySubscription = this.updateEntities(), ManageSystemComponent.TIMEOUT_ERROR); }); } private updateSystem(): Subscription { - return this.apiClientService.getSystemStatistic().subscribe((result)=>{ + return this.apiClientService.getSystemStatistic().subscribe((result) => { this.system = result.body; - }, (error)=> { - this.systemTimer = setTimeout(()=>this.systemSubscription = this.updateSystem(), ManageSystemComponent.TIMEOUT_ERROR); + }, (error) => { + this.systemTimer = setTimeout(() => this.systemSubscription = this.updateSystem(), ManageSystemComponent.TIMEOUT_ERROR); }); } @@ -95,42 +108,42 @@ export class ManageSystemComponent implements OnInit, OnDestroy { return this.system != null && this.load != null; } - getCpuLoad():number { - return (this.load.cpuLoad / Math.max(1, this.system.processors) * 100) + getCpuLoad(): number { + return (this.load.cpuLoad / Math.max(1, this.system.processors) * 100); } - - getMemory(bytes: number):string { - let megabytes = Math.floor(bytes / (1024*1024)); - let gb = Math.floor(megabytes / 1000); - let mb = megabytes - (gb * 1000); - var memory = ""; + + getMemory(bytes: number): string { + const megabytes = Math.floor(bytes / (1024 * 1024)); + const gb = Math.floor(megabytes / 1000); + const mb = megabytes - (gb * 1000); + let memory = ''; if (gb > 0) { - memory += gb + " " + this.res.strings(gb==1?"manage_system_gb":"manage_system_gbs"); + memory += gb + ' ' + this.res.strings(gb === 1 ? 'manage_system_gb' : 'manage_system_gbs'); } - memory += mb + " " + this.res.strings(mb==1?"manage_system_mb":"manage_system_mbs"); + memory += mb + ' ' + this.res.strings(mb === 1 ? 'manage_system_mb' : 'manage_system_mbs'); return memory; } - getUptime(uptime:number):string { - let time = this.getTime(uptime); - var result = ""; + getUptime(uptime: number): string { + const time = this.getTime(uptime); + let result = ''; if (time.d > 0) { - result += time.d + " " + this.res.strings(time.d>1?"manage_system_days":"manage_system_day"); + result += time.d + ' ' + this.res.strings(time.d > 1 ? 'manage_system_days' : 'manage_system_day'); } if (time.d > 0 || time.h > 0) { - result += time.h + " " + this.res.strings(time.h==1?"manage_system_hour":"manage_system_hours"); + result += time.h + ' ' + this.res.strings(time.h === 1 ? 'manage_system_hour' : 'manage_system_hours'); } if (time.d > 0 || time.h > 0 || time.m > 0) { - result += time.m + " " + this.res.strings(time.m==1?"manage_system_minute":"manage_system_minutes"); + result += time.m + ' ' + this.res.strings(time.m === 1 ? 'manage_system_minute' : 'manage_system_minutes'); } if (this.columns > 1) { - result += time.s + " " + this.res.strings(time.s==1?"manage_system_second":"manage_system_seconds"); + result += time.s + ' ' + this.res.strings(time.s === 1 ? 'manage_system_second' : 'manage_system_seconds'); } return result; } - - private getTime(ms:number): {d:number, h:number, m: number, s: number} { - var d, h, m, s; + + private getTime(ms: number): {d: number, h: number, m: number, s: number} { + let d, h, m, s; s = Math.floor(ms / 1000); m = Math.floor(s / 60); s = s % 60; @@ -143,16 +156,3 @@ export class ManageSystemComponent implements OnInit, OnDestroy { } - -class EntityDataSource implements DataSource { - - entities = new BehaviorSubject([]); - - connect(collectionViewer: CollectionViewer): Observable { - return this.entities; - } - disconnect(collectionViewer: CollectionViewer): void { - // do nothing - } - -} \ No newline at end of file diff --git a/web-angular/src/app/views/manage-users.component.ts b/web-angular/src/app/views/manage-users.component.ts index 8aa1495..a032470 100644 --- a/web-angular/src/app/views/manage-users.component.ts +++ b/web-angular/src/app/views/manage-users.component.ts @@ -16,29 +16,28 @@ import { TableColumn, TableHandler } from '../utils/tables'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'manage-users', - templateUrl: 'manage-users.component.html', - host: { class:'match-parent' } + selector: 'app-manage-users', + templateUrl: 'manage-users.component.html' }) export class ManageUsersComponent extends FormErrorEncoder implements OnInit, OnDestroy, DoCheck { - + private static COLUMNS: TableColumn[] = [ - { name: "id", dropPriority: 5, width: 120, fixedWidth:true}, - { name: "type", dropPriority: 0, width: 55, fixedWidth:true}, - { name: "login", dropPriority: 0, width: 150}, - { name: "name", dropPriority: 1, width: 200}, - { name: "email", dropPriority: 2, width: 200}, - { name: "creationTime", dropPriority: 3, width: 130, fixedWidth:true}, - { name: "modificationTime", dropPriority: 4, width: 130 , fixedWidth:true}, - { name: "actions", dropPriority: 0, width: 90, fixedWidth: true } + { name: 'id', dropPriority: 5, width: 120, fixedWidth: true}, + { name: 'type', dropPriority: 0, width: 55, fixedWidth: true}, + { name: 'login', dropPriority: 0, width: 150}, + { name: 'name', dropPriority: 1, width: 200}, + { name: 'email', dropPriority: 2, width: 200}, + { name: 'creationTime', dropPriority: 3, width: 130, fixedWidth: true}, + { name: 'modificationTime', dropPriority: 4, width: 130 , fixedWidth: true}, + { name: 'actions', dropPriority: 0, width: 90, fixedWidth: true } ]; - @ViewChild('searchForm', { static: true }) searchForm:NgForm; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('searchForm', { static: true }) searchForm: NgForm; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; dataSource: DataSource; - readonly loading:BehaviorSubject; + readonly loading: BehaviorSubject; term: string; private tableHandler: TableHandler; @@ -49,9 +48,9 @@ export class ManageUsersComponent extends FormErrorEncoder implements OnInit, On public res: ResourceService, private apiClientService: ApiClientService, private userService: UserService, - private manageUserService: ManageUserService, + private manageUserService: ManageUserService, private snackbar: MatSnackBar, - private dialog:MatDialog) { + private dialog: MatDialog) { super(); this.dataSource = manageUserService; this.loading = manageUserService.loading; @@ -74,73 +73,73 @@ export class ManageUsersComponent extends FormErrorEncoder implements OnInit, On this.tableHandler = new TableHandler(this.table, ManageUsersComponent.COLUMNS); this.pageHandler = new PaginationHandler(this.paginator, this.manageUserService); this.manageUserService.reload(); - } + } ngOnDestroy() { this.pageHandler.destroy(); } - getCorrespondence(user: User):string { - for (let email of user.emails) { - if (email.correspondence) return email.address; + getCorrespondence(user: User): string { + for (const email of user.emails) { + if (email.correspondence) { return email.address; } } return null; } - onSearch():void { - if (this.searchForm.invalid || this.loading.getValue()) return; + onSearch(): void { + if (this.searchForm.invalid || this.loading.getValue()) { return; } this.manageUserService.setTerm(this.term); } - isAdmin(user: User):boolean { - for (let r of user.roles) { - if (r == UserRole.Admin) return true; + isAdmin(user: User): boolean { + for (const r of user.roles) { + if (r === UserRole.Admin) { return true; } } return false; } - isSelf(user: User):boolean { + isSelf(user: User): boolean { return user.id === this.userService.user.getValue().id; } - onDelete(user: User):void { - if (this.loading.getValue()) return; + onDelete(user: User): void { + if (this.loading.getValue()) { return; } user.deleted = true; this.updateUser(user); } - onRestore(user: User):void { - if (this.loading.getValue()) return; + onRestore(user: User): void { + if (this.loading.getValue()) { return; } user.deleted = false; this.updateUser(user); } - makeAdmin(user: User):void { - if (this.loading.getValue()) return; - let i = user.roles.indexOf(UserRole.Admin); - if (i != -1) return; + makeAdmin(user: User): void { + if (this.loading.getValue()) { return; } + const i = user.roles.indexOf(UserRole.Admin); + if (i !== -1) { return; } user.roles.push(UserRole.Admin); this.updateUser(user); } makeUser(user: User): void { - if (this.loading.getValue()) return; - let i = user.roles.indexOf(UserRole.Admin); - if (i == -1) return; + if (this.loading.getValue()) { return; } + const i = user.roles.indexOf(UserRole.Admin); + if (i === -1) { return; } user.roles.splice(i, 1); this.updateUser(user); } - private updateUser(user:User) { - this.manageUserService.setUser(user).subscribe((result)=> { + private updateUser(user: User) { + this.manageUserService.setUser(user).subscribe((result) => { if (result) { - Snackbars.showMessage(this.snackbar, this.res.strings("manage_users_success"), Snackbars.DURATION_SHORT); + Snackbars.showMessage(this.snackbar, this.res.strings('manage_users_success'), Snackbars.DURATION_SHORT); } else { - Snackbars.showError(this.snackbar, this.res.strings("manage_users_error")); + Snackbars.showError(this.snackbar, this.res.strings('manage_users_error')); } }); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/views/notices.component.html b/web-angular/src/app/views/notices.component.html index c0b0442..eba2f5c 100644 --- a/web-angular/src/app/views/notices.component.html +++ b/web-angular/src/app/views/notices.component.html @@ -14,7 +14,7 @@ - + diff --git a/web-angular/src/app/views/notices.component.ts b/web-angular/src/app/views/notices.component.ts index a998c1f..6b7b8f8 100644 --- a/web-angular/src/app/views/notices.component.ts +++ b/web-angular/src/app/views/notices.component.ts @@ -14,27 +14,26 @@ import { NoticePage, Notice } from '../../api/models'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'notices', - templateUrl: './notices.component.html', - host: { class: 'match-parent' }, + selector: 'app-notices', + templateUrl: './notices.component.html' }) export class NoticesComponent implements OnInit { loading: BehaviorSubject = new BehaviorSubject(true); page: BehaviorSubject; - columns: number = 1; + columns = 1; constructor(public res: ResourceService, private noticeService: NoticeService) { this.page = noticeService.page; this.loading = noticeService.loading; } - public getLanguage():string { - return this.res.strings("language"); + public getLanguage(): string { + return this.res.strings('language'); } @HostListener('window:resize', ['$event']) - onResize(event:Event) { + onResize(event: Event) { this.updateColumns((event.target as Window).innerWidth); } @@ -56,8 +55,8 @@ export class NoticesComponent implements OnInit { } canShow(notice: Notice, language: String) { - for (let m of notice.messages) { - if (m.language === language) return true; + for (const m of notice.messages) { + if (m.language === language) { return true; } } console.dir(notice); return false; diff --git a/web-angular/src/app/views/place-visits.component.html b/web-angular/src/app/views/place-visits.component.html index fbe1d26..cc7ad4b 100644 --- a/web-angular/src/app/views/place-visits.component.html +++ b/web-angular/src/app/views/place-visits.component.html @@ -1,4 +1,4 @@ - + @@ -111,4 +111,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/web-angular/src/app/views/place-visits.component.ts b/web-angular/src/app/views/place-visits.component.ts index 675b319..5c906f1 100644 --- a/web-angular/src/app/views/place-visits.component.ts +++ b/web-angular/src/app/views/place-visits.component.ts @@ -1,45 +1,44 @@ -import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ViewEncapsulation, DoCheck, ElementRef, Input } from "@angular/core"; -import { ApiClientService } from "../../api"; -import { MatDialog, MatSnackBar, MatPaginator } from "@angular/material"; -import { ActivatedRoute, Router } from "@angular/router"; -import { MessageDialogComponent } from "../widgets/message-dialog.component"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { Subscription, BehaviorSubject } from "rxjs"; -import { Device, Location, Place, VisitPage, Visit } from "../../api/models"; -import { Snackbars } from "../utils/snackbars"; +import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ViewEncapsulation, DoCheck, ElementRef, Input } from '@angular/core'; +import { ApiClientService } from '../../api'; +import { MatDialog, MatSnackBar, MatPaginator } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MessageDialogComponent } from '../widgets/message-dialog.component'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { Subscription, BehaviorSubject } from 'rxjs'; +import { Device, Location, Place, VisitPage, Visit } from '../../api/models'; +import { Snackbars } from '../utils/snackbars'; import * as L from 'leaflet'; -import { TileMapComponent } from "../widgets/tile-map.component"; -import { MarkerMapComponent } from "../widgets/marker-map.component"; -import { PlaceVisitService } from "../services/place-visit.service"; -import { Page, PaginationHandler } from "../utils/pagination"; -import { ConfirmationDialogComponent } from "../widgets/confirmation-dialog.component"; -import { DataSource } from "@angular/cdk/table"; -import { TableColumn, TableHandler } from "../utils/tables"; -import { ResourceService } from "../services/resource.service"; +import { TileMapComponent } from '../widgets/tile-map.component'; +import { MarkerMapComponent } from '../widgets/marker-map.component'; +import { PlaceVisitService } from '../services/place-visit.service'; +import { Page, PaginationHandler } from '../utils/pagination'; +import { ConfirmationDialogComponent } from '../widgets/confirmation-dialog.component'; +import { DataSource } from '@angular/cdk/table'; +import { TableColumn, TableHandler } from '../utils/tables'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'place-visits', - templateUrl: './place-visits.component.html', - host: { class: 'match-parent' }, + selector: 'app-place-visits', + templateUrl: './place-visits.component.html' }) export class PlaceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, DoCheck { private static COLUMNS: TableColumn[] = [ - { name: "device", dropPriority: 0, width: 120 }, - { name: "begin", dropPriority: 0, width: 130 }, - { name: "end", dropPriority: 0, width: 130 }, - { name: "actions", dropPriority: 0, width: 90, fixedWidth: true } + { name: 'device', dropPriority: 0, width: 120 }, + { name: 'begin', dropPriority: 0, width: 130 }, + { name: 'end', dropPriority: 0, width: 130 }, + { name: 'actions', dropPriority: 0, width: 90, fixedWidth: true } ]; private static FALLBACK: TableColumn[] = [ - { name: "visit", dropPriority: 0, width: 120 }, - { name: "actions", dropPriority: 0, width: 90, fixedWidth: true } + { name: 'visit', dropPriority: 0, width: 120 }, + { name: 'actions', dropPriority: 0, width: 90, fixedWidth: true } ]; @ViewChild(MarkerMapComponent, { static: true }) map: MarkerMapComponent; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; id: string; readonly loading: BehaviorSubject; @@ -50,7 +49,7 @@ export class PlaceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, D private paginationHandler: PaginationHandler; private placeSubscription: Subscription; private tableHandler: TableHandler; - compact: boolean = false; + compact = false; constructor( @@ -67,9 +66,12 @@ export class PlaceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, D this.dataSource = placeService; } - getPanelWidth():any { - if (this.compact) return { width: "280px"}; - else return { width: "520px" }; + getPanelWidth(): any { + if (this.compact) { + return { width: '280px'}; + } else { + return { width: '520px' }; + } } reloadPlace() { @@ -91,7 +93,7 @@ export class PlaceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, D ngOnInit() { this.tableHandler = new TableHandler(this.table, PlaceVisitsComponent.COLUMNS, PlaceVisitsComponent.FALLBACK); - this.id = this.route.snapshot.paramMap.get("id"); + this.id = this.route.snapshot.paramMap.get('id'); this.placeService.setPlace(+this.id); this.paginationHandler = new PaginationHandler(this.paginator, this.placeService); } @@ -113,10 +115,10 @@ export class PlaceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, D onDelete(id: number): void { ConfirmationDialogComponent.open(this.dialog, { - title: this.res.strings("visits_delete_confirm_title"), - message: this.res.strings("visits_delete_confirm_message"), - positive: this.res.strings("button_yes"), - negative: this.res.strings("button_no") + title: this.res.strings('visits_delete_confirm_title'), + message: this.res.strings('visits_delete_confirm_message'), + positive: this.res.strings('button_yes'), + negative: this.res.strings('button_no') }).subscribe((result) => { if (result != null && result.confirmed) { this.doDelete(id); @@ -129,12 +131,12 @@ export class PlaceVisitsComponent implements OnInit, AfterViewInit, OnDestroy, D this.apiClientService.deleteVisit(id).subscribe((result) => { this.deleting.next(false); this.placeService.reload(); - Snackbars.showMessage(this.snackbar, this.res.strings("visits_delete_success"), Snackbars.DURATION_SHORT); + Snackbars.showMessage(this.snackbar, this.res.strings('visits_delete_success'), Snackbars.DURATION_SHORT); }, (error) => { this.deleting.next(false); this.placeService.reload(); - Snackbars.showError(this.snackbar, this.res.strings("visits_delete_error")); - }) + Snackbars.showError(this.snackbar, this.res.strings('visits_delete_error')); + }); } } diff --git a/web-angular/src/app/views/places.component.ts b/web-angular/src/app/views/places.component.ts index 7f665ec..311f261 100644 --- a/web-angular/src/app/views/places.component.ts +++ b/web-angular/src/app/views/places.component.ts @@ -13,29 +13,28 @@ import { TableHandler, TableColumn } from '../utils/tables'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'places', - templateUrl: 'places.component.html', - host: { class:'match-parent' } -}) + selector: 'app-places', + templateUrl: 'places.component.html' +}) export class PlacesComponent implements OnInit, OnDestroy, DoCheck { - + private static COLUMNS: TableColumn[] = [ - { name: "id", dropPriority: 1, width: 130, fixedWidth: true }, - { name: "address", dropPriority: 0, width: 200 }, - { name: "nickname", dropPriority: 0, width: 200 }, - { name: "longitude", dropPriority: 4, width: 100, fixedWidth: true }, - { name: "latitude", dropPriority: 4, width: 100, fixedWidth: true }, - { name: "creationTime", dropPriority: 2, width: 130, fixedWidth: true }, - { name: "modificationTime", dropPriority: 3, width: 130, fixedWidth: true }, - { name: "actions", dropPriority: 0, width: 130, fixedWidth: true } + { name: 'id', dropPriority: 1, width: 130, fixedWidth: true }, + { name: 'address', dropPriority: 0, width: 200 }, + { name: 'nickname', dropPriority: 0, width: 200 }, + { name: 'longitude', dropPriority: 4, width: 100, fixedWidth: true }, + { name: 'latitude', dropPriority: 4, width: 100, fixedWidth: true }, + { name: 'creationTime', dropPriority: 2, width: 130, fixedWidth: true }, + { name: 'modificationTime', dropPriority: 3, width: 130, fixedWidth: true }, + { name: 'actions', dropPriority: 0, width: 130, fixedWidth: true } ]; private static FALLBACK: TableColumn[] = [ - { name: "name", dropPriority: 0, width: 130 }, - { name: "actions", dropPriority: 0, width: 130, fixedWidth: true } + { name: 'name', dropPriority: 0, width: 130 }, + { name: 'actions', dropPriority: 0, width: 130, fixedWidth: true } ]; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; dataSource: DataSource; @@ -48,7 +47,7 @@ export class PlacesComponent implements OnInit, OnDestroy, DoCheck { constructor( public res: ResourceService, private apiClientService: ApiClientService, - private placeService: PlaceService, + private placeService: PlaceService, private snackbar: MatSnackBar, private dialog: MatDialog) { this.dataSource = placeService; @@ -79,31 +78,31 @@ export class PlacesComponent implements OnInit, OnDestroy, DoCheck { this.tableHandler = new TableHandler(this.table, PlacesComponent.COLUMNS, PlacesComponent.FALLBACK); this.pageHandler = new PaginationHandler(this.paginator, this.placeService); this.placeService.reload(); - } + } ngOnDestroy() { this.pageHandler.destroy(); } onRename(id: number) { - if (this.loading.getValue()) return; - let p = this.placeService.page.getValue(); - for (let place of p.elements) { + if (this.loading.getValue()) { return; } + const p = this.placeService.page.getValue(); + for (const place of p.elements) { if (place.id === id) { - NicknameDialogComponent.open(this.dialog, place).subscribe((result)=>{ - if (result) this.placeService.reload(); + NicknameDialogComponent.open(this.dialog, place).subscribe((result) => { + if (result) { this.placeService.reload(); } }); break; } } - } + } - onDelete(id:number):void { + onDelete(id: number): void { ConfirmationDialogComponent.open(this.dialog, { - title: this.res.strings("places_delete_confirm_title"), - message:this.res.strings("places_delete_confirm_message"), - positive: this.res.strings("button_yes"), - negative: this.res.strings("button_no") + title: this.res.strings('places_delete_confirm_title'), + message: this.res.strings('places_delete_confirm_message'), + positive: this.res.strings('button_yes'), + negative: this.res.strings('button_no') }).subscribe((result) => { if (result != null && result.confirmed) { this.doDelete(id); @@ -111,19 +110,19 @@ export class PlacesComponent implements OnInit, OnDestroy, DoCheck { }); } - private doDelete(id:number):void { - this.deleting.next(true); + private doDelete(id: number): void { + this.deleting.next(true); this.apiClientService.deletePlace(id).subscribe((result) => { this.deleting.next(false); this.placeService.reload(); - Snackbars.showMessage(this.snackbar, this.res.strings("places_delete_success"), Snackbars.DURATION_SHORT); + Snackbars.showMessage(this.snackbar, this.res.strings('places_delete_success'), Snackbars.DURATION_SHORT); }, (error) => { - this.deleting.next(false); + this.deleting.next(false); this.placeService.reload(); - Snackbars.showError(this.snackbar, this.res.strings("places_delete_error")); - }) + Snackbars.showError(this.snackbar, this.res.strings('places_delete_error')); + }); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/views/privileges.component.ts b/web-angular/src/app/views/privileges.component.ts index f3ba486..f9f2e1d 100644 --- a/web-angular/src/app/views/privileges.component.ts +++ b/web-angular/src/app/views/privileges.component.ts @@ -14,27 +14,26 @@ import { TableColumn, TableHandler } from '../utils/tables'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'privileges', - templateUrl: 'privileges.component.html', - host: { class: 'match-parent' } + selector: 'app-privileges', + templateUrl: 'privileges.component.html' }) export class PrivilegesComponent implements OnInit, OnDestroy, DoCheck { private static COLUMNS: TableColumn[] = [ - { name: "token", dropPriority: 2, width: 180, fixedWidth: true }, - { name: "message", dropPriority: 0, width: 150}, - { name: "destination", dropPriority: 1, width: 150 }, - { name: "expirationTime", dropPriority: 3, width: 130, fixedWidth: true }, - { name: "actions", dropPriority: 0, width: 90, fixedWidth: true } + { name: 'token', dropPriority: 2, width: 180, fixedWidth: true }, + { name: 'message', dropPriority: 0, width: 150}, + { name: 'destination', dropPriority: 1, width: 150 }, + { name: 'expirationTime', dropPriority: 3, width: 130, fixedWidth: true }, + { name: 'actions', dropPriority: 0, width: 90, fixedWidth: true } ]; - @ViewChild("table", { read: ElementRef, static: true }) table: ElementRef; + @ViewChild('table', { read: ElementRef, static: true }) table: ElementRef; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; dataSource: DataSource; private pageHandler: PaginationHandler; readonly deleting = new BehaviorSubject(false); - readonly loading:BehaviorSubject; + readonly loading: BehaviorSubject; private addSubscription: Subscription; private tableHandler: TableHandler; @@ -67,12 +66,12 @@ export class PrivilegesComponent implements OnInit, OnDestroy, DoCheck { ngOnInit() { this.tableHandler = new TableHandler(this.table, PrivilegesComponent.COLUMNS); - let token = this.activatedRoute.snapshot.paramMap.get("add"); + const token = this.activatedRoute.snapshot.paramMap.get('add'); this.pageHandler = new PaginationHandler(this.paginator, this.privilegeService); this.privilegeService.reload(); if (token != null) { - this.router.navigate(["/privileges"], { replaceUrl: true }); - this.addSubscription = this.privilegeService.loading.subscribe((value)=> { + this.router.navigate(['/privileges'], { replaceUrl: true }); + this.addSubscription = this.privilegeService.loading.subscribe((value) => { if (!value) { this.onAdd(token); this.addSubscription.unsubscribe(); @@ -85,24 +84,24 @@ export class PrivilegesComponent implements OnInit, OnDestroy, DoCheck { ngOnDestroy() { this.pageHandler.destroy(); - if (this.addSubscription) this.addSubscription.unsubscribe(); + if (this.addSubscription) { this.addSubscription.unsubscribe(); } } - onAdd(link?:string): void { + onAdd(link?: string): void { ShareDialogComponent.open(this.dialog, link).subscribe((result) => { if (result) { this.privilegeService.reload(); } - }) - } + }); + } onDelete(id: number): void { - if (this.loading.getValue() || this.deleting.getValue()) return; + if (this.loading.getValue() || this.deleting.getValue()) { return; } ConfirmationDialogComponent.open(this.dialog, { - title: this.res.strings("privileges_delete_confirm_title"), - message: this.res.strings("privileges_delete_confirm_message"), - positive: this.res.strings("button_yes"), - negative: this.res.strings("button_no") + title: this.res.strings('privileges_delete_confirm_title'), + message: this.res.strings('privileges_delete_confirm_message'), + positive: this.res.strings('button_yes'), + negative: this.res.strings('button_no') }).subscribe((result) => { if (result != null && result.confirmed) { this.doDelete(id); @@ -115,14 +114,14 @@ export class PrivilegesComponent implements OnInit, OnDestroy, DoCheck { this.apiClientService.deletePrivilege(id).subscribe((result) => { this.deleting.next(false); this.privilegeService.reload(); - Snackbars.showMessage(this.snackbar, this.res.strings("privileges_delete_success"), Snackbars.DURATION_SHORT); + Snackbars.showMessage(this.snackbar, this.res.strings('privileges_delete_success'), Snackbars.DURATION_SHORT); }, (error) => { this.deleting.next(false); this.privilegeService.reload(); - Snackbars.showError(this.snackbar, this.res.strings("privileges_delete_error")); - }) + Snackbars.showError(this.snackbar, this.res.strings('privileges_delete_error')); + }); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/views/register.component.html b/web-angular/src/app/views/register.component.html index b810775..3c9cf07 100644 --- a/web-angular/src/app/views/register.component.html +++ b/web-angular/src/app/views/register.component.html @@ -9,10 +9,10 @@
- - - - + + + + {{ res.strings('register_terms_pre') }} diff --git a/web-angular/src/app/views/register.component.ts b/web-angular/src/app/views/register.component.ts index 5030b60..358bcc1 100644 --- a/web-angular/src/app/views/register.component.ts +++ b/web-angular/src/app/views/register.component.ts @@ -18,9 +18,8 @@ import { MessageDialogComponent } from '../widgets/message-dialog.component'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'register', - templateUrl: './register.component.html', - host: { class:'match-parent' }, + selector: 'app-register', + templateUrl: './register.component.html' }) export class RegisterComponent implements OnInit, OnDestroy { @@ -28,26 +27,27 @@ export class RegisterComponent implements OnInit, OnDestroy { @ViewChild(PasswordFieldComponent, { static: true }) passwordField: PasswordFieldComponent; @ViewChild(NameFieldComponent, { static: true }) nameField: NameFieldComponent; @ViewChild(EmailFieldComponent, { static: true }) emailField: EmailFieldComponent; - @ViewChild("registerForm", { static: true }) registerForm: NgForm; + @ViewChild('registerForm', { static: true }) registerForm: NgForm; readonly idle = new BehaviorSubject(true); - - columns: number = 2; - registration: UserRegistration = { login:"", name:"", email:"", password:"" } + + columns = 2; + registration: UserRegistration = { login: '', name: '', email: '', password: '' }; termsAccepted: true; private registrationSubscription: Subscription; - constructor(public res:ResourceService, private apiClientService:ApiClientService, private snackbar: MatSnackBar, private router: Router, private dialog: MatDialog) { } + constructor(public res: ResourceService, private apiClientService: ApiClientService, + private snackbar: MatSnackBar, private router: Router, private dialog: MatDialog) { } - ngOnInit():void { + ngOnInit(): void { this.updateColumns(window.innerWidth); } @HostListener('window:resize', ['$event']) - onResize(event:Event) { + onResize(event: Event) { this.updateColumns((event.target as Window).innerWidth); } @@ -59,44 +59,44 @@ export class RegisterComponent implements OnInit, OnDestroy { } } - onRegister():void { + onRegister(): void { this.snackbar.dismiss(); - if (!this.idle || !this.registerForm.valid) return; + if (!this.idle || !this.registerForm.valid) { return; } if (!this.termsAccepted) { this.showTermsMessage(); } else { this.sendRegister(); - } + } } - private showTermsMessage():void { - MessageDialogComponent.open(this.dialog, { - title: this.res.strings('register_accept_terms_title'), - message: this.res.strings('register_accept_terms_message'), + private showTermsMessage(): void { + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('register_accept_terms_title'), + message: this.res.strings('register_accept_terms_message'), button: this.res.strings('button_gotit') }); } - private sendRegister():void { + private sendRegister(): void { this.setIdle(false); - this.registration = { - login:this.loginField.login, - name:this.nameField.name, - password:this.passwordField.password, - email:this.emailField.email - } - this.registrationSubscription = this.apiClientService.registerUser(this.registration).subscribe((response)=>{ + this.registration = { + login: this.loginField.login, + name: this.nameField.name, + password: this.passwordField.password, + email: this.emailField.email + }; + this.registrationSubscription = this.apiClientService.registerUser(this.registration).subscribe((response) => { this.setIdle(true); - MessageDialogComponent.open(this.dialog, { - title: this.res.strings('register_success_title'), - message: this.res.strings('register_success_message'), + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('register_success_title'), + message: this.res.strings('register_success_message'), button: this.res.strings('button_gotit') }).subscribe((e) => { - this.router.navigate(["/"]); + this.router.navigate(['/']); }); this.registrationSubscription = null; - }, (error)=>{ - this.registrationSubscription = null; + }, (error) => { + this.registrationSubscription = null; if (error instanceof HttpErrorResponse) { - var message = ""; + let message = ''; switch (error.status) { case HttpStatusCode.CONFLICT: message = this.res.strings('register_conflict_error'); @@ -111,7 +111,7 @@ export class RegisterComponent implements OnInit, OnDestroy { }); } - private setIdle(idle: boolean):void { + private setIdle(idle: boolean): void { this.loginField.disabled = !idle; this.emailField.disabled = !idle; this.passwordField.disabled = !idle; @@ -119,8 +119,8 @@ export class RegisterComponent implements OnInit, OnDestroy { this.idle.next(idle); } - ngOnDestroy():void { - if (this.registrationSubscription) this.registrationSubscription.unsubscribe(); + ngOnDestroy(): void { + if (this.registrationSubscription) { this.registrationSubscription.unsubscribe(); } this.snackbar.dismiss(); } diff --git a/web-angular/src/app/views/reset.component.html b/web-angular/src/app/views/reset.component.html index 3296441..cca498c 100644 --- a/web-angular/src/app/views/reset.component.html +++ b/web-angular/src/app/views/reset.component.html @@ -6,7 +6,7 @@ - + diff --git a/web-angular/src/app/views/reset.component.ts b/web-angular/src/app/views/reset.component.ts index 8de9788..61d7961 100644 --- a/web-angular/src/app/views/reset.component.ts +++ b/web-angular/src/app/views/reset.component.ts @@ -15,14 +15,13 @@ import { MessageDialogComponent } from '../widgets/message-dialog.component'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'reset', - templateUrl: './reset.component.html', - host: { class: 'match-parent' }, + selector: 'app-reset', + templateUrl: './reset.component.html' }) export class ResetComponent implements OnInit, OnDestroy { @ViewChild(LoginFieldComponent, { static: true }) loginField: LoginFieldComponent; - @ViewChild("resetForm", { static: true }) resetForm: NgForm; + @ViewChild('resetForm', { static: true }) resetForm: NgForm; readonly idle = new BehaviorSubject(true); @@ -30,7 +29,9 @@ export class ResetComponent implements OnInit, OnDestroy { login: string; - constructor(public res: ResourceService, private userService: UserService, private apiClientService: ApiClientService, private snackbar: MatSnackBar, private dialog: MatDialog, private router: Router) { } + constructor(public res: ResourceService, private userService: UserService, + private apiClientService: ApiClientService, private snackbar: MatSnackBar, + private dialog: MatDialog, private router: Router) { } ngOnInit(): void { this.login = this.userService.getLogin(); @@ -38,15 +39,15 @@ export class ResetComponent implements OnInit, OnDestroy { onReset(): void { this.snackbar.dismiss(); - if (!this.idle || !this.resetForm.valid) return; + if (!this.idle || !this.resetForm.valid) { return; } this.setIdle(false); this.resetSubscription = this.apiClientService.resetUser(this.loginField.login).subscribe((result) => { this.setIdle(true); - MessageDialogComponent.open(this.dialog, { - title: this.res.strings('reset_confirm_title'), - message: this.res.strings('reset_confirm_message'), + MessageDialogComponent.open(this.dialog, { + title: this.res.strings('reset_confirm_title'), + message: this.res.strings('reset_confirm_message'), button: this.res.strings('button_gotit') }).subscribe((close) => { - this.router.navigate(["/"]); + this.router.navigate(['/']); }); }, (error) => { this.setIdle(true); @@ -69,6 +70,6 @@ export class ResetComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.snackbar.dismiss(); - if (this.resetSubscription) this.resetSubscription.unsubscribe(); + if (this.resetSubscription) { this.resetSubscription.unsubscribe(); } } -} \ No newline at end of file +} diff --git a/web-angular/src/app/views/share.component.html b/web-angular/src/app/views/share.component.html index b6d4e0b..952aded 100644 --- a/web-angular/src/app/views/share.component.html +++ b/web-angular/src/app/views/share.component.html @@ -1,4 +1,4 @@ - + @@ -84,4 +84,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/web-angular/src/app/views/share.component.ts b/web-angular/src/app/views/share.component.ts index 428c36e..5f9505e 100644 --- a/web-angular/src/app/views/share.component.ts +++ b/web-angular/src/app/views/share.component.ts @@ -1,24 +1,23 @@ -import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit } from "@angular/core"; -import { ApiClientService } from "../../api"; -import { MatDialog, MatSnackBar } from "@angular/material"; -import { ActivatedRoute, Router } from "@angular/router"; -import { MessageDialogComponent } from "../widgets/message-dialog.component"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { Subscription, BehaviorSubject } from "rxjs"; -import { Device, Location, ShareInfo } from "../../api/models"; -import { Snackbars } from "../utils/snackbars"; +import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit } from '@angular/core'; +import { ApiClientService } from '../../api'; +import { MatDialog, MatSnackBar } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MessageDialogComponent } from '../widgets/message-dialog.component'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { Subscription, BehaviorSubject } from 'rxjs'; +import { Device, Location, ShareInfo } from '../../api/models'; +import { Snackbars } from '../utils/snackbars'; import * as L from 'leaflet'; -import { TileMapComponent } from "../widgets/tile-map.component"; -import { MarkerMapComponent } from "../widgets/marker-map.component"; -import { ResourceService } from "../services/resource.service"; +import { TileMapComponent } from '../widgets/tile-map.component'; +import { MarkerMapComponent } from '../widgets/marker-map.component'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'share', - templateUrl: './share.component.html', - host: { class:'match-parent' }, + selector: 'app-share', + templateUrl: './share.component.html' }) - export class ShareComponent implements AfterViewInit, OnDestroy { + export class ShareComponent implements AfterViewInit, OnInit, OnDestroy { @ViewChild(MarkerMapComponent, { static: true }) map: MarkerMapComponent; @@ -39,51 +38,51 @@ import { ResourceService } from "../services/resource.service"; ) { } ngOnInit() { - this.token = this.route.snapshot.paramMap.get("token"); + this.token = this.route.snapshot.paramMap.get('token'); this.updateInfo(); } ngAfterViewInit() { } - isUpdatingInfo():boolean { + isUpdatingInfo(): boolean { return this.infoSubscription != null; } - isUpdatingLocation():boolean { + isUpdatingLocation(): boolean { return this.infoSubscription != null || this.locationSubscription != null; } - isOutside():boolean { + isOutside(): boolean { if (this.route.parent != null) { - return this.route.parent.snapshot.url[0].path != "privileges"; + return this.route.parent.snapshot.url[0].path !== 'privileges'; } return false; } - addShare():void { - this.router.navigate(["/privileges", { add: this.token}]); + addShare(): void { + this.router.navigate(['/privileges', { add: this.token}]); } - updateInfo():void { - if (this.infoSubscription) return; - this.infoSubscription = this.apiClientService.getShareInfo(this.token).subscribe((result)=>{ + updateInfo(): void { + if (this.infoSubscription) { return; } + this.infoSubscription = this.apiClientService.getShareInfo(this.token).subscribe((result) => { this.info.next(result.body); this.infoSubscription = null; this.updateLocation(); - }, (error)=>{ + }, (error) => { Snackbars.showError(this.snackbar, this.res.strings('share_no_update_info')); this.infoSubscription = null; }); } - updateLocation():void { - if (this.locationSubscription) return; - this.locationSubscription = this.apiClientService.getShareLocation(this.token).subscribe((result)=>{ + updateLocation(): void { + if (this.locationSubscription) { return; } + this.locationSubscription = this.apiClientService.getShareLocation(this.token).subscribe((result) => { this.location.next(result.body); this.map.setMarkerPosition(result.body.coordinate); this.locationSubscription = null; - }, (error)=>{ + }, (error) => { Snackbars.showError(this.snackbar, this.res.strings('share_no_update_location')); this.map.setMarkerPosition(null); this.locationSubscription = null; @@ -91,9 +90,9 @@ import { ResourceService } from "../services/resource.service"; } ngOnDestroy() { - if (this.locationSubscription) this.locationSubscription.unsubscribe(); - if (this.infoSubscription) this.infoSubscription.unsubscribe(); + if (this.locationSubscription) { this.locationSubscription.unsubscribe(); } + if (this.infoSubscription) { this.infoSubscription.unsubscribe(); } } } - \ No newline at end of file + diff --git a/web-angular/src/app/views/user.component.html b/web-angular/src/app/views/user.component.html index 50fa039..9e9f2f1 100644 --- a/web-angular/src/app/views/user.component.html +++ b/web-angular/src/app/views/user.component.html @@ -13,7 +13,7 @@
- + @@ -42,8 +42,8 @@ {{ res.strings('user_password_subtitle') }} - - + + @@ -60,7 +60,7 @@ {{ res.strings('user_add_email_subtitle') }}
- +
diff --git a/web-angular/src/app/views/user.component.ts b/web-angular/src/app/views/user.component.ts index bea3e70..94116b1 100644 --- a/web-angular/src/app/views/user.component.ts +++ b/web-angular/src/app/views/user.component.ts @@ -16,9 +16,8 @@ import { MessageDialogComponent } from '../widgets/message-dialog.component'; import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'user', - templateUrl: './user.component.html', - host: { class:'match-parent' }, + selector: 'app-user', + templateUrl: './user.component.html' }) export class UserComponent implements OnInit, OnDestroy { @@ -26,36 +25,37 @@ export class UserComponent implements OnInit, OnDestroy { @ViewChild(MatSelect, { static: false }) emailSelect: MatSelect; // add email - @ViewChild(EmailFieldComponent, { static: false }) emailField: EmailFieldComponent; + @ViewChild(EmailFieldComponent, { static: false }) emailField: EmailFieldComponent; // change passwords - @ViewChild("oldPassword", { static: false }) oldPasswordField: PasswordFieldComponent; - @ViewChild("newPassword", { static: false }) newPasswordField: PasswordFieldComponent; + @ViewChild('oldPassword', { static: false }) oldPasswordField: PasswordFieldComponent; + @ViewChild('newPassword', { static: false }) newPasswordField: PasswordFieldComponent; readonly idle = new BehaviorSubject(true); - columns: number = 1; + columns = 1; correspondence: Email; emails: Email[] = []; user: BehaviorSubject; private userSubscription: Subscription; - constructor(public res:ResourceService, private userService: UserService, private snackbar: MatSnackBar, private dialog: MatDialog, private router: Router) { + constructor(public res: ResourceService, private userService: UserService, + private snackbar: MatSnackBar, private dialog: MatDialog, private router: Router) { this.user = userService.user; } ngOnInit(): void { this.updateColumns(window.innerWidth); - this.userSubscription = this.userService.user.subscribe((user)=>{ + this.userSubscription = this.userService.user.subscribe((user) => { this.idle.next(user != null); this.correspondence = this.getCorrespondence(); this.emails = this.getEmails(); }); } - + @HostListener('window:resize', ['$event']) - onResize(event:Event) { + onResize(event: Event) { this.updateColumns((event.target as Window).innerWidth); } @@ -67,64 +67,65 @@ export class UserComponent implements OnInit, OnDestroy { } } - ngOnDestroy():void { + ngOnDestroy(): void { this.userSubscription.unsubscribe(); } - private getEmails():Email[] { - if (this.user.getValue() == null) return []; - return this.user.getValue().emails.sort((a, b)=>{ + private getEmails(): Email[] { + if (this.user.getValue() == null) { return []; } + return this.user.getValue().emails.sort((a, b) => { return a.address.localeCompare(b.address); }); } - private getCorrespondence():Email { - if (this.user.getValue() == null) return null; - for (let email of this.user.getValue().emails) { - if (email.correspondence) return email; + private getCorrespondence(): Email { + if (this.user.getValue() == null) { return null; } + for (const email of this.user.getValue().emails) { + if (email.correspondence) { return email; } } return null; } onAddEmail() { - if (this.user.getValue() == null) return; - let u = this.user.getValue(); - let email = this.emailField.email; - for (var i = 0, s = u.emails.length; i < s; i++) { + if (this.user.getValue() == null) { return; } + const u = this.user.getValue(); + const email = this.emailField.email; + for (let i = 0, s = u.emails.length; i < s; i++) { if (u.emails[i].address === email) { Snackbars.showError(this.snackbar, this.res.strings('user_email_registered_already'), Snackbars.DURATION_SHORT); - this.emailField.email = ""; + this.emailField.email = ''; return; } } - u.emails.push({address:email, id:0, correspondence: false, creationTime: 0, modificationTime: 0, deleted: false, verified: false}); + u.emails.push({address: email, id: 0, correspondence: false, creationTime: 0, modificationTime: 0, deleted: false, verified: false}); this.userService.changeUser(u); } onChangePassword() { - if (this.user.getValue() == null) return; + if (this.user.getValue() == null) { return; } if (!this.userService.changePassword(this.oldPasswordField.password, this.newPasswordField.password)) { - this.oldPasswordField.password = ""; - this.newPasswordField.password = ""; - MessageDialogComponent.open(this.dialog, {title: this.res.strings('user_password_wrong_title'), message: this.res.strings('user_password_wrong_message')}); + this.oldPasswordField.password = ''; + this.newPasswordField.password = ''; + MessageDialogComponent.open(this.dialog, + {title: this.res.strings('user_password_wrong_title'), message: this.res.strings('user_password_wrong_message')}); } } onChangeUser() { - if (this.user.getValue() == null) return; - let u = this.user.getValue(); + if (this.user.getValue() == null) { return; } + const u = this.user.getValue(); u.name = this.nameField.name; - let id = this.correspondence.id; - for (var i = 0, s = u.emails.length; i < s; i++) { + const id = this.correspondence.id; + for (let i = 0, s = u.emails.length; i < s; i++) { u.emails[i].correspondence = (u.emails[i].id === id); } this.userService.changeUser(u); } - onDeleteEmail(id:number) { - if (this.user.getValue() == null) return; - let u = this.user.getValue(); - for (var i = 0, s = u.emails.length; i < s; i++) { + onDeleteEmail(id: number) { + if (this.user.getValue() == null) { return; } + const u = this.user.getValue(); + for (let i = 0, s = u.emails.length; i < s; i++) { if (u.emails[i].id === id) { u.emails[i].deleted = true; this.userService.changeUser(u); diff --git a/web-angular/src/app/widgets/confirmation-dialog.component.ts b/web-angular/src/app/widgets/confirmation-dialog.component.ts index c196fbe..1f73f4d 100644 --- a/web-angular/src/app/widgets/confirmation-dialog.component.ts +++ b/web-angular/src/app/widgets/confirmation-dialog.component.ts @@ -1,41 +1,50 @@ -import { Component, Inject } from "@angular/core"; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from "@angular/material"; +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material'; import { Observable } from 'rxjs'; -import { ResourceService } from "../services/resource.service"; +import { ResourceService } from '../services/resource.service'; export interface ConfirmationDialogData { - title:string; - message:string; - positive?:string; - negative?:string; + title: string; + message: string; + positive?: string; + negative?: string; } export interface ConfirmationDialogResult { - confirmed:boolean; + confirmed: boolean; } @Component({ - selector: 'confirmation-dialog', + selector: 'app-confirmation-dialog', templateUrl: 'confirmation-dialog.component.html', }) export class ConfirmationDialogComponent { - + title: String; message: String; positive: String; negative: String; + public static open(dialog: MatDialog, d: ConfirmationDialogData, w?: string): Observable { + if (w == null) { w = '450px'; } + const ref = dialog.open(ConfirmationDialogComponent, { + width: w, + data: d + }); + return ref.afterClosed(); + } + constructor(public dialog: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: ConfirmationDialogData, public res: ResourceService) { + @Inject(MAT_DIALOG_DATA) public data: ConfirmationDialogData, public res: ResourceService) { this.title = data.title; this.message = data.message; this.positive = data.positive; this.negative = data.negative; - if (!this.positive) this.positive = res.strings("button_ok"); - if (!this.negative) this.negative = res.strings("button_cancel"); + if (!this.positive) { this.positive = res.strings('button_ok'); } + if (!this.negative) { this.negative = res.strings('button_cancel'); } } - + onClose(): void { this.dialog.close({ confirmed: false}); } @@ -44,13 +53,4 @@ export interface ConfirmationDialogResult { this.dialog.close({confirmed: true}); } - public static open(dialog: MatDialog, d: ConfirmationDialogData, w?:string):Observable { - if (w == null) w = "450px"; - let ref = dialog.open(ConfirmationDialogComponent, { - width: w, - data: d - }); - return ref.afterClosed(); - } - - } \ No newline at end of file + } diff --git a/web-angular/src/app/widgets/decision-panel.component.ts b/web-angular/src/app/widgets/decision-panel.component.ts index 1c12e39..1617824 100644 --- a/web-angular/src/app/widgets/decision-panel.component.ts +++ b/web-angular/src/app/widgets/decision-panel.component.ts @@ -1,27 +1,27 @@ -import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, DoCheck } from "@angular/core"; -import { ResourceService } from "../services/resource.service"; +import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, DoCheck } from '@angular/core'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'decision-panel', + selector: 'app-decision-panel', templateUrl: 'decision-panel.component.html' }) export class DecisionPanelComponent implements DoCheck { - @ViewChild("panel", { read: ElementRef, static: true }) panel:ElementRef; + @ViewChild('panel', { read: ElementRef, static: true }) panel: ElementRef; - @Input() positiveName:string; - @Input() negativeName:string; - @Input() positiveIcon:string = "done"; - @Input() negativeIcon:string = "close"; - @Input() processing:boolean = false; - @Input() disabled:boolean = false; + @Input() positiveName: string; + @Input() negativeName: string; + @Input() positiveIcon = 'done'; + @Input() negativeIcon = 'close'; + @Input() processing = false; + @Input() disabled = false; @Output() positive: EventEmitter = new EventEmitter(); @Output() negative: EventEmitter = new EventEmitter(); - compact:boolean = false; + compact = false; constructor(public res: ResourceService) { - this.positiveName = res.strings("button_ok"); - this.negativeName = res.strings("button_cancel"); + this.positiveName = res.strings('button_ok'); + this.negativeName = res.strings('button_cancel'); } onPositive() { @@ -33,8 +33,8 @@ export class DecisionPanelComponent implements DoCheck { } ngDoCheck() { - let width = this.panel.nativeElement.clientWidth; + const width = this.panel.nativeElement.clientWidth; this.compact = (width < 250); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/widgets/email-field.component.html b/web-angular/src/app/widgets/email-field.component.html index 7e5ffb3..d8d7a2b 100644 --- a/web-angular/src/app/widgets/email-field.component.html +++ b/web-angular/src/app/widgets/email-field.component.html @@ -1,4 +1,4 @@ - + {{emailField.value?.length || 0}}/90 diff --git a/web-angular/src/app/widgets/email-field.component.ts b/web-angular/src/app/widgets/email-field.component.ts index 4885dad..9dfdc8d 100644 --- a/web-angular/src/app/widgets/email-field.component.ts +++ b/web-angular/src/app/widgets/email-field.component.ts @@ -8,10 +8,10 @@ import { ResourceService } from '../services/resource.service'; /** * A validated field that enables a user to enter the * email. The email will be available through the - * components name which also acts as an input. + * components name which also acts as an input. */ @Component({ - selector: 'email-field', + selector: 'app-email-field', templateUrl: './email-field.component.html' }) export class EmailFieldComponent extends FormErrorEncoder { @@ -19,11 +19,11 @@ export class EmailFieldComponent extends FormErrorEncoder { /** * The email address. */ - @Input() email:string; + @Input() email: string; /** * Disables the field. */ - @Input() disabled:boolean; + @Input() disabled: boolean; constructor(public res: ResourceService) { super(); diff --git a/web-angular/src/app/widgets/language-select.component.ts b/web-angular/src/app/widgets/language-select.component.ts index 2dda587..b2135db 100644 --- a/web-angular/src/app/widgets/language-select.component.ts +++ b/web-angular/src/app/widgets/language-select.component.ts @@ -1,20 +1,20 @@ -import { Input, Component, Output, EventEmitter } from "@angular/core"; -import { ResourceService, Language } from "../services/resource.service"; +import { Input, Component, Output, EventEmitter } from '@angular/core'; +import { ResourceService, Language } from '../services/resource.service'; @Component({ - selector: 'language-select', + selector: 'app-language-select', templateUrl: 'language-select.component.html', - }) + }) export class LanguageSelectComponent { - + @Input() languages: Language[]; @Input() value: string; @Output() change: EventEmitter = new EventEmitter(); - constructor(public res: ResourceService) { + constructor(public res: ResourceService) { this.languages = res.languages; this.value = res.strings('language'); } -} \ No newline at end of file +} diff --git a/web-angular/src/app/widgets/log-dialog.component.ts b/web-angular/src/app/widgets/log-dialog.component.ts index a734f06..c04eb1b 100644 --- a/web-angular/src/app/widgets/log-dialog.component.ts +++ b/web-angular/src/app/widgets/log-dialog.component.ts @@ -1,33 +1,33 @@ -import { Component, Inject } from "@angular/core"; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from "@angular/material"; +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material'; import { Observable } from 'rxjs'; -import { LogMessage } from "../../api/models"; -import { ResourceService } from "../services/resource.service"; +import { LogMessage } from '../../api/models'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'log-dialog', + selector: 'app-log-dialog', templateUrl: 'log-dialog.component.html', }) export class LogDialogComponent { - + message: LogMessage; + public static open(dialog: MatDialog, d: LogMessage, w?: string): Observable { + const ref = dialog.open(LogDialogComponent, { + width: w, + data: d + }); + return ref.afterClosed(); + } + constructor(public dialog: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: LogMessage, - public res: ResourceService) { + public res: ResourceService) { this.message = data; } - + onClose(): void { this.dialog.close(); } - public static open(dialog: MatDialog, d: LogMessage, w?:string):Observable { - let ref = dialog.open(LogDialogComponent, { - width: w, - data: d - }); - return ref.afterClosed(); - } - - } \ No newline at end of file + } diff --git a/web-angular/src/app/widgets/login-field.component.html b/web-angular/src/app/widgets/login-field.component.html index 5ca61c1..0add1b4 100644 --- a/web-angular/src/app/widgets/login-field.component.html +++ b/web-angular/src/app/widgets/login-field.component.html @@ -1,4 +1,4 @@ - + {{loginField.value?.length || 0}}/32 diff --git a/web-angular/src/app/widgets/login-field.component.ts b/web-angular/src/app/widgets/login-field.component.ts index b944e20..6961271 100644 --- a/web-angular/src/app/widgets/login-field.component.ts +++ b/web-angular/src/app/widgets/login-field.component.ts @@ -8,10 +8,10 @@ import { ResourceService } from '../services/resource.service'; /** * A validated field that enables a user to enter the * login name. The name will be available through the - * components login which also acts as an input. + * components login which also acts as an input. */ @Component({ - selector: 'login-field', + selector: 'app-login-field', templateUrl: './login-field.component.html' }) export class LoginFieldComponent extends FormErrorEncoder { @@ -19,11 +19,11 @@ export class LoginFieldComponent extends FormErrorEncoder { /** * The login name */ - @Input() login:string; + @Input() login: string; /** * Disables the field. */ - @Input() disabled:boolean; + @Input() disabled: boolean; constructor(public res: ResourceService) { super(); diff --git a/web-angular/src/app/widgets/marker-map.component.html b/web-angular/src/app/widgets/marker-map.component.html index 73d3cee..b28cd69 100644 --- a/web-angular/src/app/widgets/marker-map.component.html +++ b/web-angular/src/app/widgets/marker-map.component.html @@ -1,5 +1,5 @@
- +
diff --git a/web-angular/src/app/widgets/marker-map.component.ts b/web-angular/src/app/widgets/marker-map.component.ts index d8d2535..4909a8d 100644 --- a/web-angular/src/app/widgets/marker-map.component.ts +++ b/web-angular/src/app/widgets/marker-map.component.ts @@ -1,26 +1,25 @@ -import { Component, OnInit, OnDestroy, ViewChild, AfterContentInit, AfterViewInit, ElementRef } from "@angular/core"; -import { ApiClientService } from "../../api"; -import { MatDialog, MatSnackBar } from "@angular/material"; -import { ActivatedRoute, Router } from "@angular/router"; -import { MessageDialogComponent } from "../widgets/message-dialog.component"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { Subscription, BehaviorSubject } from "rxjs"; -import { Device, Location } from "../../api/models"; -import { Snackbars } from "../utils/snackbars"; +import { Component, OnInit, OnDestroy, ViewChild, AfterContentInit, AfterViewInit, ElementRef } from '@angular/core'; +import { ApiClientService } from '../../api'; +import { MatDialog, MatSnackBar } from '@angular/material'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MessageDialogComponent } from '../widgets/message-dialog.component'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { Subscription, BehaviorSubject } from 'rxjs'; +import { Device, Location } from '../../api/models'; +import { Snackbars } from '../utils/snackbars'; import * as L from 'leaflet'; -import { TileMapComponent } from "../widgets/tile-map.component"; +import { TileMapComponent } from '../widgets/tile-map.component'; @Component({ - selector: 'marker-map', - templateUrl: './marker-map.component.html', - host: { class: 'match-parent' }, + selector: 'app-marker-map', + templateUrl: './marker-map.component.html' }) export class MarkerMapComponent implements AfterViewInit { @ViewChild(TileMapComponent, { static: true }) map: TileMapComponent; - @ViewChild("overlay", { read: ElementRef, static: true }) overlaySpace: ElementRef; - @ViewChild("tile", { read: ElementRef, static: true }) tileSpace: ElementRef; + @ViewChild('overlay', { read: ElementRef, static: true }) overlaySpace: ElementRef; + @ViewChild('tile', { read: ElementRef, static: true }) tileSpace: ElementRef; private marker: L.Marker; private markerPosition: { latitude: number, longitude: number }; @@ -50,11 +49,11 @@ export class MarkerMapComponent implements AfterViewInit { } private updateMarker() { - if (!this.marker) return; + if (!this.marker) { return; } if (this.markerPosition == null) { this.marker.remove(); } else { - let c = new L.LatLng(this.markerPosition.latitude, this.markerPosition.longitude); + const c = new L.LatLng(this.markerPosition.latitude, this.markerPosition.longitude); this.marker.setLatLng(c); this.marker.addTo(this.map.map); this.centerPoint(c); @@ -67,11 +66,11 @@ export class MarkerMapComponent implements AfterViewInit { } private updatePin() { - if (!this.pin) return; + if (!this.pin) { return; } if (this.pinPosition == null) { this.pin.remove(); } else { - let c = new L.LatLng(this.pinPosition.latitude, this.pinPosition.longitude); + const c = new L.LatLng(this.pinPosition.latitude, this.pinPosition.longitude); this.pin.setLatLng(c); this.pin.addTo(this.map.map); this.centerPoint(c); @@ -87,13 +86,13 @@ export class MarkerMapComponent implements AfterViewInit { centerBounds(latLngExp: L.LatLngBoundsExpression, maxZoom?: number): void { // hacky workaround for bug in leaflet this.map.map.invalidateSize(); - let overlayWidth = this.overlaySpace.nativeElement.clientWidth; - let tileWidth = this.tileSpace.nativeElement.clientWidth; - let freeWidth = tileWidth - overlayWidth; - var padding = 0; + const overlayWidth = this.overlaySpace.nativeElement.clientWidth; + const tileWidth = this.tileSpace.nativeElement.clientWidth; + const freeWidth = tileWidth - overlayWidth; + let padding = 0; if (freeWidth > 100) { padding = overlayWidth; - } + } this.map.map.fitBounds(latLngExp, { paddingBottomRight: [ padding, 0], maxZoom: maxZoom diff --git a/web-angular/src/app/widgets/message-dialog.component.ts b/web-angular/src/app/widgets/message-dialog.component.ts index c3ed253..ca523ea 100644 --- a/web-angular/src/app/widgets/message-dialog.component.ts +++ b/web-angular/src/app/widgets/message-dialog.component.ts @@ -1,43 +1,43 @@ -import { Component, Inject } from "@angular/core"; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from "@angular/material"; +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material'; import { Observable } from 'rxjs'; -import { ResourceService } from "../services/resource.service"; +import { ResourceService } from '../services/resource.service'; export interface MessageDialogData { - title:string; - message:string; - button?:string; + title: string; + message: string; + button?: string; } @Component({ - selector: 'message-dialog', + selector: 'app-message-dialog', templateUrl: 'message-dialog.component.html', }) export class MessageDialogComponent { - + title: String; message: String; button: String; + public static open(dialog: MatDialog, d: MessageDialogData, w?: string): Observable { + if (w == null) { w = '450px'; } + const ref = dialog.open(MessageDialogComponent, { + width: w, + data: d + }); + return ref.afterClosed(); + } + constructor(public dialog: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: MessageDialogData, public res: ResourceService) { + @Inject(MAT_DIALOG_DATA) public data: MessageDialogData, public res: ResourceService) { this.title = data.title; this.message = data.message; this.button = data.button; - if (!this.button) this.button = res.strings('button_ok'); + if (!this.button) { this.button = res.strings('button_ok'); } } - + onClose(): void { this.dialog.close(); } - public static open(dialog: MatDialog, d: MessageDialogData, w?:string):Observable { - if (w == null) w = "450px"; - let ref = dialog.open(MessageDialogComponent, { - width: w, - data: d - }); - return ref.afterClosed(); - } - - } \ No newline at end of file + } diff --git a/web-angular/src/app/widgets/name-field.component.html b/web-angular/src/app/widgets/name-field.component.html index 7e3b41b..7f79714 100644 --- a/web-angular/src/app/widgets/name-field.component.html +++ b/web-angular/src/app/widgets/name-field.component.html @@ -1,4 +1,4 @@ - + {{nameField.value?.length || 0}}/64 diff --git a/web-angular/src/app/widgets/name-field.component.ts b/web-angular/src/app/widgets/name-field.component.ts index 0a21ce8..ac6d451 100644 --- a/web-angular/src/app/widgets/name-field.component.ts +++ b/web-angular/src/app/widgets/name-field.component.ts @@ -8,10 +8,10 @@ import { ResourceService } from '../services/resource.service'; /** * A validated field that enables a user to enter the * human name. The name will be available through the - * components name which also acts as an input. + * components name which also acts as an input. */ @Component({ - selector: 'name-field', + selector: 'app-name-field', templateUrl: './name-field.component.html' }) export class NameFieldComponent extends FormErrorEncoder { @@ -19,13 +19,13 @@ export class NameFieldComponent extends FormErrorEncoder { /** * The human name */ - @Input() name:string; + @Input() name: string; /** * Disables the field. */ - @Input() disabled:boolean; + @Input() disabled: boolean; - constructor(public res:ResourceService) { + constructor(public res: ResourceService) { super(); } } diff --git a/web-angular/src/app/widgets/nickname-dialog.component.html b/web-angular/src/app/widgets/nickname-dialog.component.html index 0d69de0..17301a4 100644 --- a/web-angular/src/app/widgets/nickname-dialog.component.html +++ b/web-angular/src/app/widgets/nickname-dialog.component.html @@ -5,7 +5,7 @@
- + {{nameField.value?.length || 0}} / 140 @@ -17,7 +17,7 @@
- + (negative)="onClose()"> \ No newline at end of file diff --git a/web-angular/src/app/widgets/nickname-dialog.component.ts b/web-angular/src/app/widgets/nickname-dialog.component.ts index 0d60d94..64be927 100644 --- a/web-angular/src/app/widgets/nickname-dialog.component.ts +++ b/web-angular/src/app/widgets/nickname-dialog.component.ts @@ -1,40 +1,49 @@ -import { Component, Inject, ViewChild } from "@angular/core"; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatSnackBar } from "@angular/material"; +import { Component, Inject, ViewChild } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatSnackBar } from '@angular/material'; import { Observable, Subscription } from 'rxjs'; -import { NgForm } from "@angular/forms"; -import { ApiClientService } from "../../api"; -import { Snackbars } from "../utils/snackbars"; -import { FormErrorEncoder } from "../utils/formcodes"; -import { Place } from "../../api/models"; -import { HttpErrorResponse } from "@angular/common/http"; -import { HttpStatusCode } from "../utils/httpcodes"; -import { ResourceService } from "../services/resource.service"; +import { NgForm } from '@angular/forms'; +import { ApiClientService } from '../../api'; +import { Snackbars } from '../utils/snackbars'; +import { FormErrorEncoder } from '../utils/formcodes'; +import { Place } from '../../api/models'; +import { HttpErrorResponse } from '@angular/common/http'; +import { HttpStatusCode } from '../utils/httpcodes'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'nickname-dialog', + selector: 'app-nickname-dialog', templateUrl: 'nickname-dialog.component.html', }) export class NicknameDialogComponent extends FormErrorEncoder { - - @ViewChild("nameForm", { static: true }) nameForm: NgForm; + + @ViewChild('nameForm', { static: true }) nameForm: NgForm; name: String; private place: Place; private subscription: Subscription; + public static open(dialog: MatDialog, data: Place, w?: string): Observable { + if (w == null) { w = '450px'; } + const ref = dialog.open(NicknameDialogComponent, { + data: data, + width: w + }); + return ref.afterClosed(); + } + constructor( public snackbar: MatSnackBar, - public apiClientService: ApiClientService, + public apiClientService: ApiClientService, public dialog: MatDialogRef, @Inject(MAT_DIALOG_DATA) data: Place, public res: ResourceService - ) { + ) { super(); this.place = data; this.name = data.nickname; - } - - isLoading():boolean{ + } + + isLoading(): boolean { return this.subscription != null; } @@ -43,16 +52,16 @@ import { ResourceService } from "../services/resource.service"; } onAccept(): void { - if (this.nameForm.invalid || this.subscription) return; + if (this.nameForm.invalid || this.subscription) { return; } this.place.nickname = this.name.trim(); - this.subscription = this.apiClientService.setPlace(this.place.id, this.place).subscribe((result)=>{ + this.subscription = this.apiClientService.setPlace(this.place.id, this.place).subscribe((result) => { this.subscription = null; this.dialog.close(true); Snackbars.showMessage(this.snackbar, this.res.strings('nickname_dialog_success'), Snackbars.DURATION_SHORT); - }, (error)=>{ + }, (error) => { this.subscription = null; if (error instanceof HttpErrorResponse) { - if (error.status == HttpStatusCode.CONFLICT && error.error) { + if (error.status === HttpStatusCode.CONFLICT && error.error) { this.place = JSON.parse(error.error) as Place; this.name = this.place.nickname; Snackbars.showError(this.snackbar, this.res.strings('nickname_dialog_conflict')); @@ -64,13 +73,4 @@ import { ResourceService } from "../services/resource.service"; }); } - public static open(dialog: MatDialog, data: Place, w?:string):Observable { - if (w == null) w = "450px"; - let ref = dialog.open(NicknameDialogComponent, { - data: data, - width: w - }); - return ref.afterClosed(); - } - - } \ No newline at end of file + } diff --git a/web-angular/src/app/widgets/notice-card.component.ts b/web-angular/src/app/widgets/notice-card.component.ts index 2e08f4a..2d39021 100644 --- a/web-angular/src/app/widgets/notice-card.component.ts +++ b/web-angular/src/app/widgets/notice-card.component.ts @@ -1,17 +1,17 @@ -import { Notice, Message } from "../../api/models"; -import { Input, Component } from "@angular/core"; -import { ResourceService } from "../services/resource.service"; +import { Notice, Message } from '../../api/models'; +import { Input, Component } from '@angular/core'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'notice-card', + selector: 'app-notice-card', templateUrl: './notice-card.component.html' }) export class NoticeCardComponent { - + /** * The notice bound to the card. */ - @Input() notice:Notice; + @Input() notice: Notice; /** * The preferred language to display. @@ -25,12 +25,12 @@ import { ResourceService } from "../services/resource.service"; @Input() createdLabel: string; constructor(public res: ResourceService) { - this.modifiedLabel = res.strings("notice_card_creation"); - this.createdLabel = res.strings("notice_card_modification"); + this.modifiedLabel = res.strings('notice_card_creation'); + this.createdLabel = res.strings('notice_card_modification'); } getTimeLabel(): string { - if (this.notice.modificationTime == this.notice.creationTime) { + if (this.notice.modificationTime === this.notice.creationTime) { return this.createdLabel; } else { return this.modifiedLabel; @@ -38,20 +38,26 @@ import { ResourceService } from "../services/resource.service"; } getTitle(): string { - let m = this.getMessage(); - if (m == null) return ""; - else return m.title; + const m = this.getMessage(); + if (m == null) { + return ''; + } else { + return m.title; + } } getBody(): string { - let m = this.getMessage(); - if (m == null) return ""; - else return m.body; + const m = this.getMessage(); + if (m == null) { + return ''; + } else { + return m.body; + } } private getMessage(): Message { - for (let m of this.notice.messages) { - if (m.language == this.language) { + for (const m of this.notice.messages) { + if (m.language === this.language) { return m; } } @@ -59,4 +65,4 @@ import { ResourceService } from "../services/resource.service"; } } - \ No newline at end of file + diff --git a/web-angular/src/app/widgets/password-field.component.html b/web-angular/src/app/widgets/password-field.component.html index f9991ac..25a7a55 100644 --- a/web-angular/src/app/widgets/password-field.component.html +++ b/web-angular/src/app/widgets/password-field.component.html @@ -1,4 +1,4 @@ - + {{hide ? 'visibility' : 'visibility_off'}} {{passwordField.value?.length || 0}} diff --git a/web-angular/src/app/widgets/password-field.component.ts b/web-angular/src/app/widgets/password-field.component.ts index d96af59..73759bb 100644 --- a/web-angular/src/app/widgets/password-field.component.ts +++ b/web-angular/src/app/widgets/password-field.component.ts @@ -8,48 +8,48 @@ import { ResourceService } from '../services/resource.service'; /** * A validated field that enables a user to enter the * login name. The name will be available through the - * components login which also acts as an input. + * components login which also acts as an input. */ @Component({ - selector: 'password-field', + selector: 'app-password-field', templateUrl: './password-field.component.html' -}) +}) export class PasswordFieldComponent extends FormErrorEncoder { /** * Hide or show the password. */ - hide:boolean = true; + hide = true; /** * The password bound to the component. */ - @Input() password:string; + @Input() password: string; /** * Disables the field. */ - @Input() disabled:boolean; + @Input() disabled: boolean; /** * The name of the field */ - @Input() name:string = "password"; + @Input() name = 'password'; /** * The label for the field. */ - @Input() label:string; + @Input() label: string; /** * The hint for the field. */ - @Input() hint:string; + @Input() hint: string; constructor(public res: ResourceService) { super(); - this.label = res.strings("password_field_placeholder"); - this.hint = res.strings("password_field_hint") + this.label = res.strings('password_field_placeholder'); + this.hint = res.strings('password_field_hint'); } } diff --git a/web-angular/src/app/widgets/profile-button.component.ts b/web-angular/src/app/widgets/profile-button.component.ts index 31065b4..fab07c2 100644 --- a/web-angular/src/app/widgets/profile-button.component.ts +++ b/web-angular/src/app/widgets/profile-button.component.ts @@ -3,11 +3,11 @@ import { Router, RouterEvent, NavigationEnd } from '@angular/router'; import { Subscription } from 'rxjs'; import { UserService } from '../services/user.service'; -/** +/** * Implements a responsive profile button for the toolbar. */ @Component({ - selector: 'profile-button', + selector: 'app-profile-button', templateUrl: './profile-button.component.html' }) export class ProfileButtonComponent { @@ -17,10 +17,10 @@ export class ProfileButtonComponent { */ login: string; - constructor(private userService: UserService) { + constructor(private userService: UserService) { this.login = userService.getLogin(); } - + } diff --git a/web-angular/src/app/widgets/share-dialog.component.html b/web-angular/src/app/widgets/share-dialog.component.html index ec44853..e1c9dc5 100644 --- a/web-angular/src/app/widgets/share-dialog.component.html +++ b/web-angular/src/app/widgets/share-dialog.component.html @@ -5,7 +5,7 @@
- + {{linkField.value?.length || 0}} @@ -18,7 +18,7 @@
- + > \ No newline at end of file diff --git a/web-angular/src/app/widgets/share-dialog.component.ts b/web-angular/src/app/widgets/share-dialog.component.ts index 91d9097..005bdf5 100644 --- a/web-angular/src/app/widgets/share-dialog.component.ts +++ b/web-angular/src/app/widgets/share-dialog.component.ts @@ -1,35 +1,43 @@ -import { Component, Inject, ViewChild } from "@angular/core"; -import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatSnackBar } from "@angular/material"; +import { Component, Inject, ViewChild } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatSnackBar } from '@angular/material'; import { Observable, Subscription } from 'rxjs'; -import { NgForm } from "@angular/forms"; -import { ApiClientService } from "../../api"; -import { Snackbars } from "../utils/snackbars"; -import { FormErrorEncoder } from "../utils/formcodes"; -import { ResourceService } from "../services/resource.service"; +import { NgForm } from '@angular/forms'; +import { ApiClientService } from '../../api'; +import { Snackbars } from '../utils/snackbars'; +import { FormErrorEncoder } from '../utils/formcodes'; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'share-dialog', + selector: 'app-share-dialog', templateUrl: 'share-dialog.component.html', }) export class ShareDialogComponent extends FormErrorEncoder { - - @ViewChild("shareForm", { static: true }) shareForm: NgForm; + + @ViewChild('shareForm', { static: true }) shareForm: NgForm; link: String; private subscription: Subscription; + public static open(dialog: MatDialog, link?: string, w?: string): Observable { + const ref = dialog.open(ShareDialogComponent, { + data: (link) ? link : '', + width: w + }); + return ref.afterClosed(); + } + constructor( public snackbar: MatSnackBar, - public apiClientService: ApiClientService, + public apiClientService: ApiClientService, public dialog: MatDialogRef, @Inject(MAT_DIALOG_DATA) data: string, public res: ResourceService - ) { + ) { super(); this.link = data; - } - - isLoading():boolean{ + } + + isLoading(): boolean { return this.subscription != null; } @@ -38,26 +46,18 @@ import { ResourceService } from "../services/resource.service"; } onAccept(): void { - if (this.shareForm.invalid || this.subscription) return; - var token = this.link.trim(); - let idx = token.lastIndexOf("/"); - if (idx != -1) token = token.substring(idx + 1); - this.subscription = this.apiClientService.addCurrentUserPrivilege(token).subscribe((result)=>{ + if (this.shareForm.invalid || this.subscription) { return; } + let token = this.link.trim(); + const idx = token.lastIndexOf('/'); + if (idx !== -1) { token = token.substring(idx + 1); } + this.subscription = this.apiClientService.addCurrentUserPrivilege(token).subscribe((result) => { this.subscription = null; this.dialog.close(true); Snackbars.showMessage(this.snackbar, this.res.strings('share_dialog_success'), Snackbars.DURATION_SHORT); - }, (error)=>{ + }, (error) => { this.subscription = null; Snackbars.showError(this.snackbar, this.res.strings('share_dialog_error')); }); } - public static open(dialog: MatDialog, link?:string, w?:string):Observable { - let ref = dialog.open(ShareDialogComponent, { - data: (link)?link:"", - width: w - }); - return ref.afterClosed(); - } - - } \ No newline at end of file + } diff --git a/web-angular/src/app/widgets/tile-map.component.ts b/web-angular/src/app/widgets/tile-map.component.ts index 0a710e9..93f8dfa 100644 --- a/web-angular/src/app/widgets/tile-map.component.ts +++ b/web-angular/src/app/widgets/tile-map.component.ts @@ -1,9 +1,9 @@ -import { Component, OnInit, ElementRef, ViewChild } from "@angular/core"; +import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; import * as L from 'leaflet'; -import { ResourceService } from "../services/resource.service"; +import { ResourceService } from '../services/resource.service'; @Component({ - selector: 'tile-map', + selector: 'app-tile-map', templateUrl: './tile-map.component.html' }) export class TileMapComponent implements OnInit { @@ -14,10 +14,10 @@ export class TileMapComponent implements OnInit { private static readonly DEFAULT_ICON_SCALE = 0.2; - private static readonly DEFAULT_PIN_URL = "assets/markers/marker_pin.png"; - private static readonly DEFAULT_NORMAL_URL = "assets/markers/marker_normal.png"; - private static readonly DEFAULT_SELECTED_URL = "assets/markers/marker_selected.png"; - private static readonly DEFAULT_SHADOW_URL = "assets/markers/marker_shadow.png"; + private static readonly DEFAULT_PIN_URL = 'assets/markers/marker_pin.png'; + private static readonly DEFAULT_NORMAL_URL = 'assets/markers/marker_normal.png'; + private static readonly DEFAULT_SELECTED_URL = 'assets/markers/marker_selected.png'; + private static readonly DEFAULT_SHADOW_URL = 'assets/markers/marker_shadow.png'; @ViewChild('map', { read: ElementRef, static: true }) mapElement: ElementRef; @@ -32,7 +32,7 @@ export class TileMapComponent implements OnInit { this.iconNormal = this.createMarkerIcon(TileMapComponent.DEFAULT_NORMAL_URL); this.iconSelected = this.createMarkerIcon(TileMapComponent.DEFAULT_NORMAL_URL); this.iconPin = this.createPinIcon(TileMapComponent.DEFAULT_PIN_URL); - + } getWidth(): number { @@ -60,8 +60,8 @@ export class TileMapComponent implements OnInit { }).addTo(this.map); } - private createMarkerIcon(url: string):L.Icon { - let href = this.getBaseHref(); + private createMarkerIcon(url: string): L.Icon { + const href = this.getBaseHref(); return new L.Icon({ iconUrl: href + url, shadowUrl: href + TileMapComponent.DEFAULT_SHADOW_URL, @@ -72,8 +72,8 @@ export class TileMapComponent implements OnInit { }); } - private createPinIcon(url: string):L.Icon { - let href = this.getBaseHref(); + private createPinIcon(url: string): L.Icon { + const href = this.getBaseHref(); return new L.Icon({ iconUrl: href + url, iconAnchor: [this.scale(100), this.scale(100)], @@ -81,18 +81,18 @@ export class TileMapComponent implements OnInit { }); } - private getBaseHref():string{ - let bases = document.getElementsByTagName('base'); + private getBaseHref(): string { + const bases = document.getElementsByTagName('base'); let baseHref = null; - if (bases.length > 0) baseHref = bases[0].href; - if (baseHref == null) baseHref = "/"; + if (bases.length > 0) { baseHref = bases[0].href; } + if (baseHref == null) { baseHref = '/'; } return baseHref; } - private scale(v:number):number { + private scale(v: number): number { return v * TileMapComponent.DEFAULT_ICON_SCALE; } -} \ No newline at end of file +} diff --git a/web-angular/src/app/widgets/toolbar-button.component.ts b/web-angular/src/app/widgets/toolbar-button.component.ts index 8d4ea22..b9644a3 100644 --- a/web-angular/src/app/widgets/toolbar-button.component.ts +++ b/web-angular/src/app/widgets/toolbar-button.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnInit, OnDestroy } from '@angular/core'; import { Router, RouterEvent, NavigationEnd } from '@angular/router'; import { Subscription } from 'rxjs'; -/** +/** * Implements a responsive button for the toolbar * that consists of an icon, text and a link. * Optionally, it can be disabled and it is possible @@ -11,7 +11,7 @@ import { Subscription } from 'rxjs'; * button will be flat. */ @Component({ - selector: 'toolbar-button', + selector: 'app-toolbar-button', templateUrl: './toolbar-button.component.html' }) export class ToolbarButtonComponent implements OnInit, OnDestroy { @@ -53,7 +53,7 @@ export class ToolbarButtonComponent implements OnInit, OnDestroy { /** * Creates a new button. - * + * * @param router The router. */ constructor(private router: Router) { } @@ -62,12 +62,12 @@ export class ToolbarButtonComponent implements OnInit, OnDestroy { this.routerSubscription = this.router.events.subscribe((event) => { if (event instanceof NavigationEnd) { this.updateVisibility(); - } + } }); this.updateVisibility(); } - private updateVisibility():void { + private updateVisibility(): void { this.visible = (this.router.url !== this.link); } diff --git a/web-angular/src/index.html b/web-angular/src/index.html index 068d448..7f8e649 100644 --- a/web-angular/src/index.html +++ b/web-angular/src/index.html @@ -28,7 +28,7 @@ - + \ No newline at end of file diff --git a/web-angular/src/styles.scss b/web-angular/src/styles.scss index 793f77b..100b8c5 100644 --- a/web-angular/src/styles.scss +++ b/web-angular/src/styles.scss @@ -105,7 +105,7 @@ body { .narrow-value { flex: 1; - font-size: 14px; + font-size: 10px; word-break:break-all; }