make Property.slug editable

This commit is contained in:
Patrick Haßel 2023-04-04 11:21:00 +02:00
parent 6353dd6f9e
commit 5078d1e3bf
3 changed files with 14 additions and 6 deletions

View File

@ -9,7 +9,7 @@
<table>
<tr>
<th>Bezeichnung</th>
<th>Links</th>
<th>Slug</th>
<th>Typ</th>
<th>Wert</th>
<th>Zeitstempel</th>
@ -27,13 +27,21 @@
<div class="links" *ngIf="property.type === 'BOOLEAN'">
<div *ngIf="property.hrefId">{{property.hrefId}}0</div>
<div *ngIf="property.hrefId">{{property.hrefId}}1</div>
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}0</div>
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}1</div>
</div>
<div class="links" *ngIf="property.type === 'SHUTTER'">
<div *ngIf="property.hrefId">{{property.hrefId}}0</div>
<div *ngIf="property.hrefId">{{property.hrefId}}90</div>
<div *ngIf="property.hrefId">{{property.hrefId}}100</div>
</div>
</td>
<td>
<app-text [initial]="property.slug" (valueChange)="edit(property, 'slug', $event)"></app-text>
<div class="links" *ngIf="property.type === 'BOOLEAN'">
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}0</div>
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}1</div>
</div>
<div class="links" *ngIf="property.type === 'SHUTTER'">
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}0</div>
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}90</div>
<div *ngIf="property.hrefSlug">{{property.hrefSlug}}100</div>

View File

@ -1,5 +1,5 @@
<input #input *ngIf="editing" type="text" [(ngModel)]="value" (keydown.enter)="finish()" (blur)="finish()">
<div *ngIf="!editing" [class.empty]="initial == ''" (click)="start()">
<ng-container *ngIf="initial != ''">{{initial}}</ng-container>
<ng-container *ngIf="initial == ''">-</ng-container>
<ng-container *ngIf="!initial">-</ng-container>
</div>

View File

@ -40,8 +40,8 @@ public class PropertyController implements ISearchController {
}
@PostMapping("set/{id}/slug")
public PropertyDto setPropertySlug(@PathVariable final long id, @RequestBody final String propertySlug) {
return propertyWriter.set(id, Property::setSlug, propertySlug);
public PropertyDto setPropertySlug(@PathVariable final long id, @RequestBody(required = false) final String value) {
return propertyWriter.set(id, Property::setSlug, value == null || value.isEmpty() ? null : value);
}
@PostMapping("set/{id}/value")