From dc7dceb37a917f394e1e1020882dcc5a4e0e9d7c Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Tue, 18 Apr 2017 17:08:34 +0000
Subject: [PATCH] #3582 fix - Fixed license form initial data and submit

---
 securis/src/main/webapp/src/app/forms/license.form.component.ts |    9 +++++++++
 securis/src/main/webapp/src/app/forms/license.form.html         |    4 ++--
 2 files changed, 11 insertions(+), 2 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 ee052b9..b4dbdd1 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
@@ -130,6 +130,15 @@
           },
           err => console.error(err)
         );
+        if (this.isNew) {
+          this.packs.nextLicCode(packId).subscribe(
+              code => {
+                this.data.code = code;
+              },
+              err => console.error(err)
+            );
+        }
+
     });
   }
 }
diff --git a/securis/src/main/webapp/src/app/forms/license.form.html b/securis/src/main/webapp/src/app/forms/license.form.html
index 84d78b6..8d5115b 100644
--- a/securis/src/main/webapp/src/app/forms/license.form.html
+++ b/securis/src/main/webapp/src/app/forms/license.form.html
@@ -101,10 +101,10 @@
 					<div layout="row" layout-align="start center" class="margin">
 						<button *ngIf="canBeDeleted()" md-raised-button color="warn" (click)="delete(data.id)">Delete</button>
 						<span flex></span>
-						<button md-icon-button [mdMenuTriggerFor]="licMenu" aria-label="License menu">
+						<button md-icon-button [mdMenuTriggerFor]="licMenu" aria-label="License menu" *ngIf="!isNew">
 							<md-icon>more_vert</md-icon>
 						</button>
-						<md-menu #licMenu="mdMenu">
+						<md-menu #licMenu="mdMenu" >
 							<button md-menu-item *ngFor="let action of license_menu_options" (click)="licenseAction(action.command)" [disabled]="!licenses.isActionAvailable(action.command, data)">
 								<md-icon *ngIf="!!action.icon">{{ action.icon }}</md-icon> {{ action.name }}
 							</button>

--
Gitblit v1.3.2