rsanchez
2017-03-14 38b0782c887f046426c31766901906c614d73140
securis/src/main/webapp/src/app/pack.list.component.ts
....@@ -1,3 +1,4 @@
1
+import { Router } from '@angular/router';
12 import { MdDialog } from '@angular/material';
23 import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core';
34 import { IPageChangeEvent } from '@covalent/core';
....@@ -42,7 +43,6 @@
4243 export class PackListComponent implements AfterViewInit {
4344 data: any[] = [];
4445 columns: ITdDataTableColumn[] = [
45
- { name: 'lics', label: '' },
4646 { name: 'code', label: 'Code', tooltip: 'License pack code' },
4747 { name: 'application_name', label: 'App name' },
4848 { name: 'licensetype_code', label: 'License type' },
....@@ -61,9 +61,25 @@
6161 sortBy: string = 'application_name';
6262 sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;
6363 filteredItems = this.data.length;
64
+ pack_menu_options : any[] = [{
65
+ command: 'edit',
66
+ name: 'Edit'
67
+ },{
68
+ command: 'cancel',
69
+ name: 'Cancel'
70
+ }]
71
+
72
+ packAction(action: any) {
73
+ console.log(action.command);
74
+ }
75
+
76
+ isActionAvailable(pack : any) : boolean {
77
+ return true;
78
+ }
6479
6580 constructor(private _dataTableService: TdDataTableService,
6681 private media: TdMediaService,
82
+ private router: Router,
6783 private dialog: MdDialog,
6884 private packForm: PackFormComponent,
6985 private packs: PacksService) {
....@@ -92,9 +108,13 @@
92108 });
93109 }
94110
111
+ showLicenses(pack: any) : void {
112
+ this.router.navigateByUrl('/licenses');
113
+ }
114
+
95115 editPack(pack: any) : void {
96116 var ref = this.dialog.open(PackFormComponent, {
97
- height: '50%', // can be px or %
117
+ height: '70%', // can be px or %
98118 width: '40%', // can be px or %
99119 });
100120 ref.componentInstance.isNew = false;