Ignore:
Timestamp:
Apr 22, 2019, 5:39:46 PM (8 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
041e464
Parents:
5e4cb73
Message:

Improved adding Water UI in mapservice-webclient

File:
1 moved

Legend:

Unmodified
Added
Removed
  • src/mapservice-webclient/src/app/mygnuboat/user.component.ts

    r5e4cb73 rbe25db1  
    33import { first } from 'rxjs/operators';
    44
    5 import { User, UsersService } from '../../../src-gen/gnuboat-mapservice';
     5import { User, UsersService, Water, WatersService } from '../../../src-gen/gnuboat-mapservice';
    66import { AuthenticationService } from '../services';
    77
    … …  
    1111    currentUserSubscription: Subscription;
    1212    apiKeys: string[] = [];
     13    waters: Water[] = [];
    1314
    1415    constructor(
    1516        private authenticationService: AuthenticationService,
    16         private usersService: UsersService
     17        private usersService: UsersService,
     18        private watersService: WatersService
    1719    ) {
    1820        this.currentUserSubscription = this.authenticationService.currentUser.subscribe(user => {
    … …  
    2022            this.usersService.configuration.username = user.username;
    2123            this.usersService.configuration.password = this.authenticationService.currentUserPassword;
     24            // this.watersService.configuration = user.username;
     25            // this.watersService.configuration.password = this.authenticationService.currentUserPassword;
     26            this.watersService.watersGet(undefined, user.username).pipe(first()).subscribe(waters => {
     27              this.waters = waters
     28            });
    2229        });
    2330    }
    … …  
    2532    ngOnInit() {
    2633      this.apiKeys = this.currentUser.apiKeys;
    27       console.log([this.currentUser, this.currentUser.apiKeys, this.apiKeys]);
    2834    }
    2935
    … …  
    3339    }
    3440
    35     deleteApiKey(apiKey: string) {
     41    apiKeyDelete(apiKey: string) {
    3642        this.usersService.usersApiKeyDelete(apiKey).pipe(first()).subscribe(keys => {
    3743          this.apiKeys = keys
    3844        });
    3945    }
     46
     47    apiKeyCreate(){
     48      this.usersService.usersApiKeyCreate().pipe(first()).subscribe(keys => {
     49        this.apiKeys = keys
     50      });
     51    }
    4052}
Note: See TracChangeset for help on using the changeset viewer.