| .. | .. |
|---|
| 7 | 7 | <span flex></span> |
|---|
| 8 | 8 | <button md-icon-button (click)="save()"><md-icon>save</md-icon></button> |
|---|
| 9 | 9 | </md-toolbar> |
|---|
| 10 | + <!-- |
|---|
| 11 | + code: 'CICS', |
|---|
| 12 | + creation_timestamp: 1418384439000, |
|---|
| 13 | + description: 'Wellbore integrity analysis software', |
|---|
| 14 | + id: 1, |
|---|
| 15 | + license_filename: 'config_server.lic', |
|---|
| 16 | + name: 'CurisIntegrity', |
|---|
| 17 | + metadata: |
|---|
| 18 | + [ { key: 'max_docs', |
|---|
| 19 | + value: '250000', |
|---|
| 20 | + readonly: true, |
|---|
| 21 | + mandatory: true } ] |
|---|
| 22 | +} |
|---|
| 23 | + --> |
|---|
| 10 | 24 | <div class="margin" layout-align-gt-xs="center start" layout-fill="" layout-gt-xs="row"> |
|---|
| 11 | 25 | <md-card flex="70"> |
|---|
| 12 | 26 | <md-card-title> |
|---|
| .. | .. |
|---|
| 27 | 41 | </md-input-container> |
|---|
| 28 | 42 | <error-checker [fieldName]="getFieldName('code')" [formField]="applicationForm.controls.code"></error-checker> |
|---|
| 29 | 43 | </div> |
|---|
| 44 | + </div> |
|---|
| 45 | + <div layout="row" layout-fill layout-padding> |
|---|
| 30 | 46 | <div layout="column" layout-fill flex> |
|---|
| 31 | | - <md-input-container> |
|---|
| 32 | | - <input mdInput type="number" [(ngModel)]="data.num_licenses" name="num_licenses" required /> |
|---|
| 47 | + <md-input-container flex> |
|---|
| 48 | + <input mdInput type="text" [(ngModel)]="data.name" name="name" required /> |
|---|
| 33 | 49 | <md-placeholder> |
|---|
| 34 | | - <span i18n="field.num_licenses"></span> |
|---|
| 50 | + <span i18n="field.name"></span> |
|---|
| 35 | 51 | </md-placeholder> |
|---|
| 36 | 52 | </md-input-container> |
|---|
| 37 | | - <error-checker [fieldName]="getFieldName('num_licenses')" [formField]="applicationForm.controls.num_licenses"></error-checker> |
|---|
| 53 | + <error-checker [fieldName]="getFieldName('name')" [formField]="applicationForm.controls.name"></error-checker> |
|---|
| 54 | + </div> |
|---|
| 55 | + <div layout="column" layout-fill flex> |
|---|
| 56 | + <md-input-container flex> |
|---|
| 57 | + <input mdInput type="text" [(ngModel)]="data.license_filename" name="license_filename" required /> |
|---|
| 58 | + <md-placeholder> |
|---|
| 59 | + <span i18n="field.license_filename"></span> |
|---|
| 60 | + </md-placeholder> |
|---|
| 61 | + </md-input-container> |
|---|
| 62 | + <error-checker [fieldName]="getFieldName('license_filename')" [formField]="applicationForm.controls.license_filename"></error-checker> |
|---|
| 38 | 63 | </div> |
|---|
| 39 | 64 | </div> |
|---|
| 40 | 65 | <div layout="row" layout-fill layout-padding> |
|---|
| 41 | 66 | <div layout="column" layout-fill flex> |
|---|
| 42 | 67 | <md-input-container flex> |
|---|
| 43 | | - <input mdInput type="date" [(ngModel)]="data.init_valid_date" name="init_valid_date" required /> |
|---|
| 68 | + <textarea mdInput type="text" type="text" [(ngModel)]="data.description" name="description" maxlength="1024"></textarea> |
|---|
| 44 | 69 | <md-placeholder> |
|---|
| 45 | | - <span i18n="field.end_valid_date"></span> |
|---|
| 46 | | - </md-placeholder> |
|---|
| 47 | | - </md-input-container> |
|---|
| 48 | | - <error-checker [fieldName]="getFieldName('init_valid_date')" [formField]="applicationForm.controls.init_valid_date"></error-checker> |
|---|
| 49 | | - </div> |
|---|
| 50 | | - <div layout="column" layout-fill flex> |
|---|
| 51 | | - <md-input-container flex> |
|---|
| 52 | | - <input mdInput type="date" [(ngModel)]="data.end_valid_date" name="end_valid_date" required /> |
|---|
| 53 | | - <md-placeholder> |
|---|
| 54 | | - <span i18n="field.end_valid_date"></span> |
|---|
| 55 | | - </md-placeholder> |
|---|
| 56 | | - </md-input-container> |
|---|
| 57 | | - <error-checker [fieldName]="getFieldName('end_valid_date')" [formField]="applicationForm.controls.end_valid_date"></error-checker> |
|---|
| 58 | | - </div> |
|---|
| 59 | | - </div> |
|---|
| 60 | | - <div layout="row" layout-fill layout-padding *ngIf="isNew"> |
|---|
| 61 | | - <div layout="column" layout-fill flex> |
|---|
| 62 | | - <md-select [placeholder]="getFieldName('organization_id')" flex [(ngModel)]="data.organization_id" name="organization_id" |
|---|
| 63 | | - (change)="changeOrg($event)"> |
|---|
| 64 | | - <md-option *ngFor="let org of organizations" [value]="org.id"> |
|---|
| 65 | | - {{org.label}} |
|---|
| 66 | | - </md-option> |
|---|
| 67 | | - </md-select> |
|---|
| 68 | | - <error-checker [fieldName]="getFieldName('organization_id')" [formField]="applicationForm.controls.organization_id"></error-checker> |
|---|
| 69 | | - </div> |
|---|
| 70 | | - <div layout="column" layout-fill flex> |
|---|
| 71 | | - <md-select flex [placeholder]="getFieldName('license_type_id')" [(ngModel)]="data.license_type_id" name="license_type_id" |
|---|
| 72 | | - (change)="changeLicType($event)"> |
|---|
| 73 | | - <md-option *ngFor="let lt of licensetypes" [value]="lt.id"> |
|---|
| 74 | | - {{lt.label}} |
|---|
| 75 | | - </md-option> |
|---|
| 76 | | - </md-select> |
|---|
| 77 | | - <error-checker [fieldName]="getFieldName('license_type_id')" [formField]="applicationForm.controls.license_type_id"></error-checker> |
|---|
| 78 | | - </div> |
|---|
| 79 | | - </div> |
|---|
| 80 | | - <div layout="row" layout-fill layout-padding *ngIf="!isNew"> |
|---|
| 81 | | - <field-readonly [value]="data.organization_name" label="field.organization_id" flex></field-readonly> |
|---|
| 82 | | - <field-readonly [value]="data.licensetype_code" label="field.license_type_id" flex></field-readonly> |
|---|
| 83 | | - </div> |
|---|
| 84 | | - <div layout="row" layout-fill layout-padding> |
|---|
| 85 | | - <div layout="column" layout-fill flex> |
|---|
| 86 | | - <md-input-container flex> |
|---|
| 87 | | - <input mdInput type="number" [(ngModel)]="data.preactivation_valid_period" name="preactivation_valid_period" required /> |
|---|
| 88 | | - <md-placeholder> |
|---|
| 89 | | - <span i18n="field.preactivation_valid_period"></span> |
|---|
| 90 | | - </md-placeholder> |
|---|
| 91 | | - <md-hint align="end">days</md-hint> |
|---|
| 92 | | - </md-input-container> |
|---|
| 93 | | - <error-checker [fieldName]="getFieldName('preactivation_valid_period')" [formField]="applicationForm.controls.preactivation_valid_period"></error-checker> |
|---|
| 94 | | - </div> |
|---|
| 95 | | - <div layout="column" layout-fill flex> |
|---|
| 96 | | - <md-input-container flex> |
|---|
| 97 | | - <input mdInput type="number" [(ngModel)]="data.renew_valid_period" name="renew_valid_period" required /> |
|---|
| 98 | | - <md-placeholder> |
|---|
| 99 | | - <span i18n="field.renew_valid_period"></span> |
|---|
| 100 | | - </md-placeholder> |
|---|
| 101 | | - <md-hint align="end">days</md-hint> |
|---|
| 102 | | - </md-input-container> |
|---|
| 103 | | - <error-checker [fieldName]="getFieldName('renew_valid_period')" [formField]="applicationForm.controls.renew_valid_period"></error-checker> |
|---|
| 104 | | - </div> |
|---|
| 105 | | - </div> |
|---|
| 106 | | - <div layout="row" layout-fill layout-padding> |
|---|
| 107 | | - <div layout="column" layout-fill flex> |
|---|
| 108 | | - <md-input-container flex> |
|---|
| 109 | | - <textarea mdInput type="text" type="text" [(ngModel)]="data.comments" name="comments" maxlength="1024"></textarea> |
|---|
| 110 | | - <md-placeholder> |
|---|
| 111 | | - <span i18n="field.comments"></span> |
|---|
| 70 | + <span i18n="field.description"></span> |
|---|
| 112 | 71 | </md-placeholder> |
|---|
| 113 | 72 | <md-hint align="end">(max 1024)</md-hint> |
|---|
| 114 | 73 | </md-input-container> |
|---|
| 115 | 74 | </div> |
|---|
| 116 | 75 | </div> |
|---|
| 117 | 76 | <div layout="row" layout-fill layout-padding *ngIf="!isNew"> |
|---|
| 118 | | - <field-readonly [value]="data.created_by_name" label="field.created_by" flex></field-readonly> |
|---|
| 119 | 77 | <field-readonly [value]="data.creation_timestamp | date: 'medium'" label="field.creation_timestamp" flex></field-readonly> |
|---|
| 120 | 78 | </div> |
|---|
| 121 | | - <div layout="column" layout-fill> |
|---|
| 122 | | - <span class="md-title" i18n>License metadata</span> |
|---|
| 123 | | - <div layout="row" layout-fill layout-padding *ngFor="let pair of data.metadata"> |
|---|
| 124 | | - <md-input-container flex="40"> |
|---|
| 125 | | - <input mdInput type="text" [ngModelOptions]="{standalone: true}" [(ngModel)]="pair.key" readonly /> |
|---|
| 126 | | - <md-placeholder> |
|---|
| 127 | | - <span i18n="field.key"></span> |
|---|
| 128 | | - </md-placeholder> |
|---|
| 129 | | - </md-input-container> |
|---|
| 130 | | - <md-input-container flex> |
|---|
| 131 | | - <input mdInput type="text" [ngModelOptions]="{standalone: true}" [(ngModel)]="pair.value" [readonly]="pair.readonly" [required]="pair.required" |
|---|
| 132 | | - /> |
|---|
| 133 | | - <md-placeholder> |
|---|
| 134 | | - <span i18n="field.value"></span> |
|---|
| 135 | | - </md-placeholder> |
|---|
| 136 | | - </md-input-container> |
|---|
| 137 | | - </div> |
|---|
| 138 | | - </div> |
|---|
| 79 | + <metadata-manager addOrDelete="true" editKeys="true" [metadata]="data.metadata" ></metadata-manager> |
|---|
| 139 | 80 | </div> |
|---|
| 140 | 81 | </form> |
|---|
| 141 | 82 | </md-card-content> |
|---|
| 142 | 83 | <md-divider></md-divider> |
|---|
| 143 | 84 | <md-card-actions> |
|---|
| 144 | 85 | <div layout="row" layout-align="start center" class="margin"> |
|---|
| 86 | + <button *ngIf="!isNew" md-raised-button color="warn" (click)="delete(data.id)">Delete</button> |
|---|
| 145 | 87 | <span flex></span> |
|---|
| 146 | 88 | <button [disabled]="!applicationForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button> |
|---|
| 147 | 89 | <button md-button (click)="goBack()">Cancel</button> |
|---|