rsanchez
2017-03-10 6078e6018ca05bcc0203241dc44071a59cf5e78c
securis/src/main/webapp/src/app/pack.list.component.ts
....@@ -42,12 +42,13 @@
4242 export class PackListComponent implements AfterViewInit {
4343 data: any[] = [];
4444 columns: ITdDataTableColumn[] = [
45
+ { name: 'lics', label: '' },
4546 { name: 'code', label: 'Code', tooltip: 'License pack code' },
4647 { name: 'application_name', label: 'App name' },
4748 { name: 'licensetype_code', label: 'License type' },
4849 { name: 'organization_name', label: 'Organization' },
49
- { name: 'num_licenses', label: 'Lic', numeric: true, tooltip: 'Initial pack licenses' },
50
- { name: 'num_available', label: 'Ava', numeric: true, tooltip: 'Available licenses' },
50
+ { name: 'used_licenses', label: 'Lics', tooltip: 'Initial/Available pack licenses' },
51
+ { name: 'menu', label: '' }
5152 ];
5253
5354 filteredData: any[] = this.data;
....@@ -80,12 +81,31 @@
8081 }
8182
8283 createPack() : void {
83
- this.dialog.open(PackFormComponent, {
84
+ var ref = this.dialog.open(PackFormComponent, {
8485 height: '50%', // can be px or %
8586 width: '40%', // can be px or %
8687 });
88
+ ref.componentInstance.isNew = true;
89
+ ref.afterClosed().subscribe(result => {
90
+ console.log(result);
91
+ this.filter();
92
+ });
8793 }
8894
95
+ editPack(pack: any) : void {
96
+ var ref = this.dialog.open(PackFormComponent, {
97
+ height: '50%', // can be px or %
98
+ width: '40%', // can be px or %
99
+ });
100
+ ref.componentInstance.isNew = false;
101
+ ref.componentInstance.data = pack;
102
+ ref.afterClosed().subscribe(result => {
103
+ console.log(result);
104
+ this.filter();
105
+ });
106
+ }
107
+
108
+
89109 sort(sortEvent: ITdDataTableSortChangeEvent): void {
90110 this.sortBy = sortEvent.name;
91111 this.sortOrder = sortEvent.order;