| .. | .. |
|---|
| 1 | +import { Router } from '@angular/router'; |
|---|
| 1 | 2 | import { MdDialog } from '@angular/material'; |
|---|
| 2 | 3 | import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core'; |
|---|
| 3 | 4 | import { IPageChangeEvent } from '@covalent/core'; |
|---|
| .. | .. |
|---|
| 42 | 43 | export class PackListComponent implements AfterViewInit { |
|---|
| 43 | 44 | data: any[] = []; |
|---|
| 44 | 45 | columns: ITdDataTableColumn[] = [ |
|---|
| 45 | | - { name: 'lics', label: '' }, |
|---|
| 46 | 46 | { name: 'code', label: 'Code', tooltip: 'License pack code' }, |
|---|
| 47 | 47 | { name: 'application_name', label: 'App name' }, |
|---|
| 48 | 48 | { name: 'licensetype_code', label: 'License type' }, |
|---|
| .. | .. |
|---|
| 61 | 61 | sortBy: string = 'application_name'; |
|---|
| 62 | 62 | sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending; |
|---|
| 63 | 63 | 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 | + } |
|---|
| 64 | 79 | |
|---|
| 65 | 80 | constructor(private _dataTableService: TdDataTableService, |
|---|
| 66 | 81 | private media: TdMediaService, |
|---|
| 82 | + private router: Router, |
|---|
| 67 | 83 | private dialog: MdDialog, |
|---|
| 68 | 84 | private packForm: PackFormComponent, |
|---|
| 69 | 85 | private packs: PacksService) { |
|---|
| .. | .. |
|---|
| 92 | 108 | }); |
|---|
| 93 | 109 | } |
|---|
| 94 | 110 | |
|---|
| 111 | + showLicenses(pack: any) : void { |
|---|
| 112 | + this.router.navigateByUrl('/licenses'); |
|---|
| 113 | + } |
|---|
| 114 | + |
|---|
| 95 | 115 | editPack(pack: any) : void { |
|---|
| 96 | 116 | var ref = this.dialog.open(PackFormComponent, { |
|---|
| 97 | | - height: '50%', // can be px or % |
|---|
| 117 | + height: '70%', // can be px or % |
|---|
| 98 | 118 | width: '40%', // can be px or % |
|---|
| 99 | 119 | }); |
|---|
| 100 | 120 | ref.componentInstance.isNew = false; |
|---|