rsanchez
2017-03-20 1a0491f2462d2c309bd8e310b22c11019a79ce1e
securis/src/main/webapp/src/app/forms/pack.form.component.ts
....@@ -5,7 +5,7 @@
55 import { LicenseTypesService } from '../resources/license_types';
66 import { LocaleService } from '../common/i18n';
77 import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core';
8
-import { IPageChangeEvent } from '@covalent/core';
8
+import { TdDialogService } from '@covalent/core';
99 import { Component, AfterViewInit } from '@angular/core';
1010 import { TdMediaService } from '@covalent/core';
1111 import { IComboOption, FormBase } from './base';
....@@ -21,39 +21,16 @@
2121
2222 organizations : IComboOption[];
2323 licensetypes : IComboOption[];
24
- data: any = {};
25
- isNew : boolean = true;
26
- fields: any = {
27
- 'code': '',
28
- 'num_licenses': '',
29
- 'init_valid_date': '',
30
- 'end_valid_date': '',
31
- 'license_preactivation': '',
32
- 'license_type_id': '',
33
- 'organization_id': '',
34
- 'licensetype_code': '',
35
- 'organization_name': '',
36
- 'preactivation_valid_period': '',
37
- 'renew_valid_period': '',
38
- 'application_name': '',
39
- 'status': '',
40
- 'metadata': '',
41
- 'comments': '',
42
- 'key': '',
43
- 'value': '',
44
- }
24
+
4525 constructor(private http: Http,
46
- toaster: ToastsManager,
4726 private licenseTypes: LicenseTypesService,
48
- route: ActivatedRoute,
4927 private router: Router,
5028 private packs: PacksService,
51
- $L: LocaleService) {
52
- super($L, route, toaster, packs, $L.get('pack'));
53
- }
54
-
55
- public getFieldName(fieldId: string) : string {
56
- return this.fields[fieldId];
29
+ toaster: ToastsManager,
30
+ route: ActivatedRoute,
31
+ $L: LocaleService,
32
+ dialogs: TdDialogService) {
33
+ super($L, route, toaster, packs, $L.get('pack'), dialogs);
5734 }
5835
5936 loadCombos(): void {
....@@ -93,14 +70,10 @@
9370 console.log(this.data.organization_id);
9471 }
9572
96
- ngOnInit(): void {
97
-
98
- }
99
-
10073
10174 ngAfterViewInit(): void {
10275 this.loadCombos();
103
- super.prepareData('packId', {
76
+ super.prepareInitialData('packId', {
10477 status: PACK_STATUS.CREATED
10578 });
10679 }