Add validators for URL and keywords

This commit is contained in:
Tobias Eidelpes
2021-05-03 15:15:34 +02:00
parent 55f41cabb8
commit da2c0efdf2
4 changed files with 22 additions and 6 deletions
@@ -6,13 +6,15 @@
<div class=" input-row">
<mat-form-field appearance="standard" class="input">
<mat-label>Vollständige URL des RSS-Feeds</mat-label>
<input matInput formControlName="url" placeholder="https://rss.orf.at/news.xml" required>
<input matInput type="url" formControlName="url" placeholder="https://rss.orf.at/news.xml" required>
<mat-error *ngIf="feedForm.get('url').hasError('invalidURLFormat')">Geben Sie eine valide URL ein.</mat-error>
</mat-form-field>
</div>
<div class="input-row text-left">
<mat-form-field appearance="standard" class="input">
<mat-label>Gesuchte Stichwörter</mat-label>
<mat-label>Gesuchte Stichworte</mat-label>
<input matInput formControlName="keywords" placeholder="Spiel,Spaß,Schokolade" required>
<mat-error *ngIf="feedForm.get('keywords').hasError('invalidKeywords')">Maximal 3 Wörter und jedes Wort mindestens 3 Zeichen</mat-error>
</mat-form-field>
<mat-checkbox formControlName="match_all_keywords">Alle Stichworte müssen enthalten sein</mat-checkbox>
</div>
@@ -24,7 +26,7 @@
<mat-error *ngIf="feedForm.get('icon').hasError('maxContentSize')">
Die maximale Dateigröße ist {{feedForm.get('icon')?.getError('maxContentSize').maxSize | byteFormat}}
({{feedForm.get('icon')?.getError('maxContentSize').actualSize
| byteFormat}}).
| byteFormat}})
</mat-error>
</mat-form-field>
</div>