| .. | .. |
|---|
| 1 | 1 | import { Router } from '@angular/router'; |
|---|
| 2 | | -import { MdDialog } from '@angular/material'; |
|---|
| 2 | +import { MdDialog, MdDialogConfig } from '@angular/material'; |
|---|
| 3 | 3 | import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core'; |
|---|
| 4 | 4 | import { IPageChangeEvent } from '@covalent/core'; |
|---|
| 5 | 5 | import { Component, AfterViewInit } from '@angular/core'; |
|---|
| .. | .. |
|---|
| 22 | 22 | pack_id: 18, |
|---|
| 23 | 23 | request_data: '{"appCode":"CISA","activationCode":"19fa8d30-29cb-4b59-81b5-3837af8204b6","arch":"x86_64","osName":"Mac OS X","macAddresses":["60-03-08-95-AE-D0","B6-2B-33-E9-64-2D"],"crcLogo":"10f6379e0e1c00ebc403160307e3c5d0aba0727c9cae0bf1ac7cd19d84fdc80f"}', |
|---|
| 24 | 24 | status: 'AC' } |
|---|
| 25 | + |
|---|
| 26 | +const DIALOG_OPTIONS : MdDialogConfig = { |
|---|
| 27 | + height: '80%', // can be px or % |
|---|
| 28 | + width: '45%', // can be px or % |
|---|
| 29 | +} |
|---|
| 25 | 30 | |
|---|
| 26 | 31 | @Component({ |
|---|
| 27 | 32 | selector: 'license-list', |
|---|
| .. | .. |
|---|
| 85 | 90 | this.filter(); |
|---|
| 86 | 91 | } |
|---|
| 87 | 92 | |
|---|
| 88 | | - createPack() : void { |
|---|
| 89 | | - var ref = this.dialog.open(LicenseFormComponent, { |
|---|
| 90 | | - height: '50%', // can be px or % |
|---|
| 91 | | - width: '40%', // can be px or % |
|---|
| 92 | | - }); |
|---|
| 93 | + createLicense() : void { |
|---|
| 94 | + let ref = this.dialog.open(LicenseFormComponent, DIALOG_OPTIONS); |
|---|
| 95 | + |
|---|
| 93 | 96 | ref.componentInstance.isNew = true; |
|---|
| 97 | + ref.componentInstance.data = {}; |
|---|
| 94 | 98 | ref.afterClosed().subscribe(result => { |
|---|
| 95 | | - console.log(result); |
|---|
| 96 | 99 | this.filter(); |
|---|
| 97 | 100 | }); |
|---|
| 101 | + |
|---|
| 98 | 102 | } |
|---|
| 99 | 103 | |
|---|
| 100 | 104 | editLicense(lic: any) : void { |
|---|
| 101 | | - var ref = this.dialog.open(LicenseFormComponent, { |
|---|
| 102 | | - height: '50%', // can be px or % |
|---|
| 103 | | - width: '40%', // can be px or % |
|---|
| 104 | | - }); |
|---|
| 105 | + let ref = this.dialog.open(LicenseFormComponent, DIALOG_OPTIONS); |
|---|
| 105 | 106 | ref.componentInstance.isNew = false; |
|---|
| 106 | 107 | ref.componentInstance.data = lic; |
|---|
| 107 | 108 | ref.afterClosed().subscribe(result => { |
|---|
| 108 | | - console.log(result); |
|---|
| 109 | 109 | this.filter(); |
|---|
| 110 | 110 | }); |
|---|
| 111 | 111 | } |
|---|