a25f434442b36ad38b76449dd6238fb459b9ea4a
[ccsdk/cds.git] /
1 import {Component, OnInit} from '@angular/core';
2 import {ActivatedRoute} from '@angular/router';
3 import {PackageStore} from './package.store';
4 import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
5
6
7 @Component({
8     selector: 'app-configuration-dashboard',
9     templateUrl: './configuration-dashboard.component.html',
10     styleUrls: ['./configuration-dashboard.component.css']
11 })
12 export class ConfigurationDashboardComponent implements OnInit {
13     viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();
14
15     constructor(private route: ActivatedRoute, private configurationStore: PackageStore) {
16
17         const id = this.route.snapshot.paramMap.get('id');
18         this.configurationStore.getPagedPackages(id);
19
20
21     }
22
23     ngOnInit() {
24         this.configurationStore.state$.subscribe(
25             el => {
26                 if (el && el.configuration) {
27                     this.viewedPackage = el.configuration;
28                     this.configurationStore.downloadResource(
29                         this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion);
30                 }
31             }
32         );
33     }
34
35 }