properly display line-breaks in customer address fields + STRINGDECODE \n

This commit is contained in:
Michael Hoennig 2019-04-09 11:33:34 +02:00
parent dccafcc900
commit 1bb712276c
2 changed files with 8 additions and 7 deletions

View File

@ -51,7 +51,7 @@
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.contractualAddress">Contractual Address</span></dt>
<dd> <dd>
<span>{{customer.contractualAddress}}</span> <span [innerHTML]="customer.contractualAddress | linebreaks"></span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.billingSalutation">Billing Salutation</span></dt>
<dd> <dd>
@ -59,7 +59,7 @@
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.billingAddress">Billing Address</span></dt>
<dd> <dd>
<span>{{customer.billingAddress}}</span> <span [innerHTML]="customer.billingAddress | linebreaks"></span>
</dd> </dd>
<dt><span jhiTranslate="hsadminNgApp.customer.remark">Remark</span></dt> <dt><span jhiTranslate="hsadminNgApp.customer.remark">Remark</span></dt>
<dd> <dd>

View File

@ -159,9 +159,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress" for="field_contractualAddress">Contractual Address</label> <label class="form-control-label" jhiTranslate="hsadminNgApp.customer.contractualAddress"
<input type="text" class="form-control" name="contractualAddress" id="field_contractualAddress" for="field_contractualAddress">Contractual Address X</label>
[(ngModel)]="customer.contractualAddress" required maxlength="400"/> <textarea class="form-control" name="contractualAddress" id="field_contractualAddress" rows="3"
[(ngModel)]="customer.contractualAddress" required maxlength="400"></textarea>
<div [hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)"> <div [hidden]="!(editForm.controls.contractualAddress?.dirty && editForm.controls.contractualAddress?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.contractualAddress?.errors?.required" jhiTranslate="entity.validation.required"> [hidden]="!editForm.controls.contractualAddress?.errors?.required" jhiTranslate="entity.validation.required">
@ -186,8 +187,8 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingAddress" for="field_billingAddress">Billing Address</label> <label class="form-control-label" jhiTranslate="hsadminNgApp.customer.billingAddress" for="field_billingAddress">Billing Address</label>
<input type="text" class="form-control" name="billingAddress" id="field_billingAddress" <textarea class="form-control" name="billingAddress" id="field_billingAddress" rows="3"
[(ngModel)]="customer.billingAddress" maxlength="400"/> [(ngModel)]="customer.billingAddress" maxlength="400"></textarea>
<div [hidden]="!(editForm.controls.billingAddress?.dirty && editForm.controls.billingAddress?.invalid)"> <div [hidden]="!(editForm.controls.billingAddress?.dirty && editForm.controls.billingAddress?.invalid)">
<small class="form-text text-danger" <small class="form-text text-danger"
[hidden]="!editForm.controls.billingAddress?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }"> [hidden]="!editForm.controls.billingAddress?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" [translateValues]="{ max: 400 }">