From ac8d1f0e8ab4bab6eb546daa8062a6dad3ab8e23 Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Fri, 10 Mar 2017 11:28:36 +0000
Subject: [PATCH] #3527 fix - Fixed dialog data
---
securis/src/main/webapp/src/app/forms/pack.form.html | 222 ++++++++++++++-----------------------------------------
1 files changed, 58 insertions(+), 164 deletions(-)
diff --git a/securis/src/main/webapp/src/app/forms/pack.form.html b/securis/src/main/webapp/src/app/forms/pack.form.html
index f9fae7f..9b0d17c 100644
--- a/securis/src/main/webapp/src/app/forms/pack.form.html
+++ b/securis/src/main/webapp/src/app/forms/pack.form.html
@@ -1,172 +1,66 @@
-<h3 md-dialog-title>{{form_title}}</h3>
<form #packForm="ngForm" class="inset" (keyup.enter)="save()">
-<md-dialog-content>
+ <md-card>
+ <md-card-title>
+ {{form_title}}
+ </md-card-title>
+ <md-card-subtitle>
+ {{form_subtitle}}
+ </md-card-subtitle>
+<md-divider></md-divider>
+ <md-card-content>
<div layout="column" layout-align="start center">
- <div layout="row" layout-align="start center">
- <md-icon class="form-icon">face</md-icon>
- <md-input-container class="md-icon-float">
- <input mdInput flex placeholder="Username" type="text" [(ngModel)]="data.username" name="username" required />
+ <div layout="row" layout-align="start center" layout-margin>
+ <md-input-container flex>
+ <input mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required />
+ <md-placeholder>
+ <span i18n>Code</span>
+ </md-placeholder>
</md-input-container>
- <div id="invalid-auth-msg" *ngIf="invalidError" class="tc-red-600 text-center" flex i18n>The username or password is incorrect. Please try again.</div>
+ <!-- TODO: <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid">
+ <span class="glyphicon glyphicon-warning-sign"></span>
+ <span ng-show="packForm.code.$error.maxlength" ng-bind="maxLengthErrorMsg('Code', maxlength.code)"
+ class="ng-binding ng-hide">Code length is too long (max: 50).</span>
+ <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')" class="ng-binding">'Code' is required.</span>
+ </div> -->
+ <md-input-container flex>
+ <input mdInput type="number" type="text" [(ngModel)]="data.num_licenses" name="num_licenses" required />
+ <md-placeholder>
+ <span i18n>Num. licenses</span>
+ </md-placeholder>
+ </md-input-container>
</div>
- <div layout="row" layout-align="start center">
- <md-icon class="form-icon">vpn_key</md-icon>
- <md-input-container class="md-icon-float">
- <input mdInput (keyup.enter)="loginForm.form.valid && false" flex placeholder="Password" type="password" [(ngModel)]="data.password"
- name="password" required/>
+ <div layout="row" layout-align="start center" layout-margin>
+ <md-input-container flex>
+ <input mdInput type="date" type="text" [(ngModel)]="data.init_valid_date" name="init_valid_date" required />
+ <md-placeholder>
+ <span i18n>Initial date</span>
+ </md-placeholder>
</md-input-container>
+ <md-input-container flex>
+ <input mdInput type="date" type="text" [(ngModel)]="data.end_valid_date" name="end_valid_date" required />
+ <md-placeholder>
+ <span i18n>End date</span>
+ </md-placeholder>
+ </md-input-container>
+ </div>
+ <div layout="row" layout-align="start center" layout-margin>
+ <md-select flex placeholder="Organization" [(ngModel)]="data.organization_id" name="organization_id">
+ <md-option *ngFor="let org of organizations" [value]="org.id">
+ {{org.label}}
+ </md-option>
+ </md-select>
+ <md-select flex placeholder="License type" [(ngModel)]="data.license_type_id" name="license_type_id">
+ <md-option *ngFor="let lt of lictypes" [value]="lt.id">
+ {{lt.label}}
+ </md-option>
+ </md-select>
</div>
</div>
-</md-dialog-content>
-<md-dialog-actions layout="row" layout-align="end center">
- <button flex [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button>
- <button flex md-button (click)="close()">Cancel</button>
-</md-dialog-actions>
+</md-card-content>
+<md-divider></md-divider>
+<md-card-actions>
+ <button [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button>
+ <button md-button (click)="close()">Cancel</button>
+</md-card-actions>
+</md-card>
</form>
-
-
-<form role="form" class="form-horizontal ng-pristine ng-invalid ng-invalid-required ng-valid-maxlength ng-valid-min" name="packForm" id="packForm" ng-submit="save()">
-<!-- ngIf: !isNew -->
-<div class="form-group">
-<label class="col-md-3 control-label" for="code" i18n="">Code</label>
-<div class="col-md-8">
- <input type="string" id="code" name="code" placeholder="" class="form-control ng-pristine ng-invalid ng-invalid-required ng-valid-maxlength ng-touched" ng-model="pack.code" ng-required="mandatory.code" ng-maxlength="50" required="required">
- <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.code.$error.maxlength" ng-bind="maxLengthErrorMsg('Code', maxlength.code)" class="ng-binding ng-hide">Code length is too long (max: 50).</span> <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')" class="ng-binding">'Code' is required.</span>
- </div>
-</div>
-</div>
-
-<div class="form-group">
-<label class="col-md-3 control-label" for="init_valid_date" i18n="">Validity (from - to)</label>
-<div class="col-md-4">
- <input type="date" id="init_valid_date" name="init_valid_date" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-required" ng-model="pack.init_valid_date" ng-required="mandatory.init_valid_date" required="required">
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.initValidDate.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span>
- <span ng-show="packForm.init_valid_date.$error.required" ng-bind="mandatoryFieldErrorMsg('Init valid date')" class="ng-binding ng-hide">'Init valid date' is required.</span>
- </div>
-</div>
-<div class="col-md-4">
- <input type="date" id="end_valid_date" name="end_valid_date" placeholder="" class="form-control ng-pristine ng-untouched ng-valid-min ng-invalid ng-invalid-required" ng-model="pack.end_valid_date" min="2017-03-09" ng-required="mandatory.end_valid_date" required="required">
- <div class="alert inline-alert alert-warning" ng-show="packForm.end_valid_date.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span>
- <span ng-show="packForm.end_valid_date.$error.required" ng-bind="mandatoryFieldErrorMsg('End valid date')" class="ng-binding">'End valid date' is required.</span>
- <span ng-show="packForm.end_valid_date.$error.min" ng-bind="field1ShouldBeGreaterThanField2('End date', 'Init date')" class="ng-binding ng-hide">End date should be greater than Init date</span>
- </div>
-</div>
-</div>
-
-<div class="form-group">
-<label class="col-md-3 control-label" for="num_licenses" i18n="">Num.
- Licenses</label>
-<div class="col-md-8">
- <input type="number" id="num_licenses" name="num_licenses" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-required" ng-model="pack.num_licenses" ng-required="mandatory.num_licenses" required="required">
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.num_licenses.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.num_licenses.$error.maxlength" ng-bind="maxLengthErrorMsg('Num. Licenses', maxlength.num_licenses)" class="ng-binding ng-hide">Num. Licenses length is too long (max: undefined).</span>
- <span ng-show="packForm.num_licenses.$error.required" ng-bind="mandatoryFieldErrorMsg('Num. Licenses')" class="ng-binding ng-hide">'Num. Licenses' is required.</span>
- </div>
-</div>
-</div>
-
-<!-- ngIf: !isNew -->
-
-<div class="form-group">
-<label class="col-md-3 control-label" for="license_type_id" i18n="">License
- type</label>
-<div class="col-md-8">
- <!-- ngIf: isNew --><select ng-if="isNew" class="form-control ng-pristine ng-untouched ng-scope ng-invalid ng-invalid-required" id="license_type_id" ng-change="updateMetadata()" ng-required="mandatory.license_type_id" ng-model="pack.license_type_id" ng-options="o.id as o.label for o in refs.license_type_id" required="required"><option value="" selected="selected" label=""></option><option value="0" label="CI ConfigServer ext">CI ConfigServer ext</option><option value="1" label="Analytic2">Analytic2</option><option value="2" label="Doxr L2">Doxr L2</option><option value="3" label="Doxr L3">Doxr L3</option><option value="4" label="CurisIntegrity - Desktop">CurisIntegrity - Desktop</option><option value="5" label="CurisIntegrity SA">CurisIntegrity SA</option><option value="6" label="Analytic1">Analytic1</option><option value="7" label="CurisIntegrity - List of modes">CurisIntegrity - List of modes</option><option value="8" label="CurisIntegrity for Curistec">CurisIntegrity for Curistec</option><option value="9" label="CurisIntegrity for BP">CurisIntegrity for BP</option><option value="10" label="CD_AllMod_AllCemtest_Custom_0U">CD_AllMod_AllCemtest_Custom_0U</option><option value="11" label="CurisIntegrity StandAlone - A1CPC">CurisIntegrity StandAlone - A1CPC</option><option value="12" label="CD_AllMod_AllCemtest_MIDtest_Custom_0U">CD_AllMod_AllCemtest_MIDtest_Custom_0U</option><option value="13" label="CI SA Complete">CI SA Complete</option><option value="14" label="CI for Dev Complete">CI for Dev Complete</option><option value="15" label="CD_RockMod_MIDtest_MIDSynth_Express_50U">CD_RockMod_MIDtest_MIDSynth_Express_50U</option><option value="16" label="CurisData for Sonatrach">CurisData for Sonatrach</option><option value="17" label="CD_AllMod_Alltest_Full_100_L_0S_0U">CD_AllMod_Alltest_Full_100_L_0S_0U</option><option value="18" label="CD_CementAdvMod_AllCemtest_Custom_100L_0S_0U">CD_CementAdvMod_AllCemtest_Custom_100L_0S_0U</option><option value="19" label="CD_CementAdvMod_AllCemtest_Custom_30U">CD_CementAdvMod_AllCemtest_Custom_30U</option><option value="20" label="CD_CementAdvMod_30U_10L_Express">CD_CementAdvMod_30U_10L_Express</option><option value="21" label="CD_CementAdv_Monolab">CD_CementAdv_Monolab</option><option value="22" label="Stand alone - MultiComputation">Stand alone - MultiComputation</option><option value="23" label="MultiCement">MultiCement</option><option value="24" label="CD_CementAdvMod_AllCemtest_Custom_100U">CD_CementAdvMod_AllCemtest_Custom_100U</option><option value="25" label="CI StandAlone A1">CI StandAlone A1</option><option value="26" label="CI StandAlone A1 A2 QL CementProperties">CI StandAlone A1 A2 QL CementProperties</option><option value="27" label="CI Corporate A1">CI Corporate A1</option><option value="28" label="CI Demo version">CI Demo version</option><option value="29" label="CD Complete">CD Complete</option></select><!-- end ngIf: isNew -->
- <!-- ngIf: !isNew -->
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.license_type_id.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.license_type_id.$error.required" ng-bind="mandatoryFieldErrorMsg('License type')" class="ng-binding ng-hide">'License type' is required.</span>
- </div>
-</div>
-</div>
-
-<div class="form-group">
-<label class="col-md-3 control-label" for="organization_id" i18n="">Organization</label>
-<div class="col-md-8">
- <!-- ngIf: isNew --><select ng-if="isNew" class="form-control ng-pristine ng-untouched ng-scope ng-invalid ng-invalid-required" ng-model="pack.organization_id" ng-required="mandatory.organization_id" ng-options="o.id as o.label for o in refs.organization_id" required="required"><option value="" selected="selected" label=""></option><option value="0" label="British Petroleum">British Petroleum</option><option value="1" label="CurisTec">CurisTec</option><option value="2" label="KindSoft">KindSoft</option><option value="3" label="CurisIT">CurisIT</option><option value="4" label="Trican">Trican</option><option value="5" label="Schlumberger">Schlumberger</option><option value="6" label="Sonatrach">Sonatrach</option><option value="7" label="Sanjel-Taqa">Sanjel-Taqa</option><option value="8" label="National Petroleum Services Saudi Arabia Int.">National Petroleum Services Saudi Arabia Int.</option></select><!-- end ngIf: isNew -->
- <!-- ngIf: !isNew -->
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.organization_id.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.organization_id.$error.required" ng-bind="mandatoryFieldErrorMsg('Organization')" class="ng-binding ng-hide">'Organization' is required.</span>
- </div>
-</div>
-</div>
-<div class="form-group">
-<label class="col-md-3 control-label" for="license_preactivation" i18n="">License preactivation</label>
-<div class="col-md-8">
- <input type="checkbox" class="form-control ng-pristine ng-untouched ng-valid" ng-model="pack.license_preactivation">
-</div>
-</div>
-<div class="form-group">
-<label class="col-md-3 control-label" for="preactivation_valid_period" i18n="">Preactivation valid period (days)</label>
-<div class="col-md-8">
- <input type="number" id="preactivation_valid_period" name="preactivation_valid_period" min="1" class="form-control ng-pristine ng-untouched ng-valid ng-valid-min ng-valid-required" ng-model="pack.preactivation_valid_period" ng-required="pack.license_preactivation" required="required">
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.preactivation_valid_period.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span>
- <span ng-show="packForm.preactivation_valid_period.$error.required" ng-bind="mandatoryFieldErrorMsg('Preactivation valid period')" class="ng-binding ng-hide">'Preactivation valid period' is required.</span>
- <span ng-show="packForm.preactivation_valid_period.$error.min" ng-bind="field1ShouldBeGreaterThanField2('The preactivation valid period', '0')" class="ng-binding ng-hide">The preactivation valid period should be greater than 0</span>
- </div>
-</div>
-</div>
-<div class="form-group">
-<label class="col-md-3 control-label" for="renew_valid_period" i18n="">Period for renew (days)</label>
-<div class="col-md-8">
- <input type="number" id="renew_valid_period" name="renew_valid_period" min="0" class="form-control ng-pristine ng-untouched ng-valid-min ng-valid ng-valid-required" ng-model="pack.renew_valid_period" ng-required="true" required="required">
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.renew_valid_period.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span>
- <span ng-show="packForm.renew_valid_period.$error.required" ng-bind="mandatoryFieldErrorMsg('Period for renew')" class="ng-binding ng-hide">'Period for renew' is required.</span>
- <span ng-show="packForm.renew_valid_period.$error.min" ng-bind="field1ShouldBeGreaterThanField2('The period for renew valid period', '0')" class="ng-binding ng-hide">The period for renew valid period should be greater than 0</span>
- </div>
-</div>
-</div>
-
-
-<div class="form-group">
-<label class="col-md-3 control-label" for="comments" i18n="">Comments</label>
-<div class="col-md-8">
- <textarea type="string" id="comments" name="comments" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required" ng-model="pack.comments" rows="2" ng-required="mandatory.comments" ng-maxlength="1024"></textarea>
- <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.comments.$invalid">
- <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.comments.$error.maxlength" ng-bind="maxLengthErrorMsg('Comments', maxlength.comments)" class="ng-binding ng-hide">Comments length is too long (max: 1024).</span>
- <span ng-show="packForm.comments.$error.required" ng-bind="mandatoryFieldErrorMsg('comments')" class="ng-binding ng-hide">'comments' is required.</span>
- </div>
-</div>
-</div>
-
-<!-- ngIf: !isNew -->
-
-<!-- ngIf: !isNew -->
-
-<div class="form-group">
-<label class="col-md-3 control-label" i18n="">Metadata</label>
-<div class="col-md-8">
- <table class="table table-hover table-condensed">
- <thead>
- <tr>
- <th i18n="">Key</th>
- <th i18n="">Value</th>
- </tr>
- </thead>
- <tbody>
- <!-- ngRepeat: row_md in pack.metadata -->
- </tbody>
- </table>
-</div>
-</div>
-
-<div class="form-group">
-<div class="col-md-offset-3 col-md-10">
- <button id="save" type="submit" class="btn btn-primary">
- <span i18n="" class="glyphicon glyphicon-floppy-disk"></span> Save
- </button>
- <!-- ngIf: !isNew -->
- <ul class="dropdown-menu" role="menu">
- <li><!-- ngIf: Packs.isActionAvailable('activate', pack) --><a ng-click="execute('activate')" ng-if="Packs.isActionAvailable('activate', pack)" href="#" class="ng-scope">Activate</a><!-- end ngIf: Packs.isActionAvailable('activate', pack) --></li>
- <li><!-- ngIf: Packs.isActionAvailable('putonhold', pack) --></li>
- <li class="divider"></li>
- <li><!-- ngIf: Packs.isActionAvailable('cancel', pack) --></li>
- <li><!-- ngIf: Packs.isActionAvailable('delete', pack) --><a ng-click="execute('delete')" ng-if="Packs.isActionAvailable('delete', pack)" href="#" class="ng-scope">Delete</a><!-- end ngIf: Packs.isActionAvailable('delete', pack) --></li>
- </ul>
-</div>
-</div>
-</form>
\ No newline at end of file
--
Gitblit v1.3.2