From 1a0491f2462d2c309bd8e310b22c11019a79ce1e Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Mon, 20 Mar 2017 16:02:14 +0000
Subject: [PATCH] #3527 fix - Added applications forms and metadata component

---
 securis/src/main/webapp/src/app/forms/license.form.component.ts |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/securis/src/main/webapp/src/app/forms/license.form.component.ts b/securis/src/main/webapp/src/app/forms/license.form.component.ts
index e2604f9..b8089fb 100644
--- a/securis/src/main/webapp/src/app/forms/license.form.component.ts
+++ b/securis/src/main/webapp/src/app/forms/license.form.component.ts
@@ -7,7 +7,7 @@
 import { AfterViewInit, Component, ViewChild } from '@angular/core';
 import { ActivatedRoute, Router } from '@angular/router';
 
-import { TdMediaService, TdFileInputComponent } from '@covalent/core';
+import { TdMediaService, TdFileInputComponent, TdDialogService } from '@covalent/core';
 import { FormBase, IComboOption } from './base';
 import { ToastsManager } from "ng2-toastr/ng2-toastr";
 
@@ -20,11 +20,7 @@
 export class LicenseFormComponent extends FormBase {
 
   @ViewChild('requestFileUploader') requestFileUploader : TdFileInputComponent;
-  form_title: string = '';
-  form_subtitle: string = '';
-  data: any = {};
   pack: any = null;
-  isNew : boolean = true;
 
   constructor(private http: Http,
               private licenses: LicensesService,
@@ -32,8 +28,9 @@
               private packs: PacksService,
               toaster: ToastsManager,
               route: ActivatedRoute,
-              $L: LocaleService) {
-      super($L, route, toaster, licenses, $L.get('license'));
+              $L: LocaleService,
+              dialogs: TdDialogService) {
+      super($L, route, toaster, licenses, $L.get('license'), dialogs);
   }
 
   requestFileSelected(file: File) : void {
@@ -41,7 +38,7 @@
     console.log(this.requestFileUploader);
 		if (!window.FileReader) { // Browser is not
           // compatible
-          console.log(this.$L.get("Open your .req file with a text editor and copy&paste the content in the form text field?"));
+          console.log(this.$L.get("Open your .req file with a text editor and copy&paste the content in the form text field"));
           return;
   	}
     var reader = new FileReader();
@@ -54,6 +51,7 @@
     this.requestFileUploader.clear();
   } 
   
+
   requestFileUploaded(file: File) : void {
     console.log(file);
   }
@@ -82,10 +80,16 @@
 
     this.route.params.subscribe(params => {
       var packId = +params['packId']; // (+) converts string 'id' to a number
-      super.prepareData('licenseId', {
+      super.prepareInitialData('licenseId', {
         pack_id: packId,            
         activation_code: this.createActivationCode()
       });
+      this.packs.get(packId).subscribe(
+          packData => {
+            this.pack = packData;
+          },
+          err => console.error(err)
+        );
     });
   }
 }

--
Gitblit v1.3.2