summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
blob: a25f434442b36ad38b76449dd6238fb459b9ea4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PackageStore} from './package.store';
import {BluePrintDetailModel} from '../model/BluePrint.detail.model';


@Component({
    selector: 'app-configuration-dashboard',
    templateUrl: './configuration-dashboard.component.html',
    styleUrls: ['./configuration-dashboard.component.css']
})
export class ConfigurationDashboardComponent implements OnInit {
    viewedPackage: BluePrintDetailModel = new BluePrintDetailModel();

    constructor(private route: ActivatedRoute, private configurationStore: PackageStore) {

        const id = this.route.snapshot.paramMap.get('id');
        this.configurationStore.getPagedPackages(id);


    }

    ngOnInit() {
        this.configurationStore.state$.subscribe(
            el => {
                if (el && el.configuration) {
                    this.viewedPackage = el.configuration;
                    this.configurationStore.downloadResource(
                        this.viewedPackage.artifactName + '/' + this.viewedPackage.artifactVersion);
                }
            }
        );
    }

}