blob: af6ced092572836d5f6207779e0814defe0a895a (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { PackageCreationStore } from '../package-creation.store';
import { SharedService } from './shared-service';
@Component({
selector: 'app-template-mapping',
templateUrl: './template-mapping.component.html',
styleUrls: ['./template-mapping.component.css']
})
export class TemplateMappingComponent implements OnInit {
creationView = false;
listView = true;
constructor(
private route: ActivatedRoute,
private pakcageStore: PackageCreationStore,
private sharedService: SharedService
) {
}
ngOnInit() {
if (this.route.snapshot.paramMap.has('id')) {
console.log('Edit mode');
this.creationView = true;
this.listView = false;
console.log('URL contains Id');
this.sharedService.enableEdit();
if (this.pakcageStore.state.mapping.files.size > 0 || this.pakcageStore.state.templates.files.size > 0) {
this.openListView();
}
} else {
console.log('Create mode');
this.pakcageStore.clear();
this.sharedService.disableEdit();
}
}
openCreationView() {
this.creationView = false;
this.listView = true;
}
openListView() {
this.listView = false;
this.creationView = false;
}
closeCreationView() {
this.creationView = true;
this.listView = false;
}
}
|