Added additional sentence to custom args hint and fixed issue where empty args could be added through the args modifier

This commit is contained in:
Tzahi12345
2020-05-06 02:38:39 -04:00
parent cc47823b0c
commit d4ad1f9fce
4 changed files with 8 additions and 3 deletions

View File

@@ -161,6 +161,11 @@ export class ArgModifierDialogComponent implements OnInit, AfterViewInit {
add(event) { add(event) {
const input = event.input; const input = event.input;
const arg = event.value; const arg = event.value;
if (!arg || arg.trim().length === 0) {
return;
}
this.args_array.push(arg); this.args_array.push(arg);
if (this.modified_args.length > 0) { if (this.modified_args.length > 0) {
this.modified_args += ',,' this.modified_args += ',,'

View File

@@ -24,7 +24,7 @@
</div> </div>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div *ngIf="download.error"> <div *ngIf="download.error">
<strong><ng-container i18n="Error label">An error has occured:</ng-container></strong> <strong><ng-container i18n="Error label">An error has occurred:</ng-container></strong>
<br/> <br/>
{{download.error}} {{download.error}}
</div> </div>

View File

@@ -116,7 +116,7 @@
<input [(ngModel)]="customArgs" [ngModelOptions]="{standalone: true}" [disabled]="!customArgsEnabled" matInput placeholder="Custom args" i18n-placeholder="Custom args placeholder"> <input [(ngModel)]="customArgs" [ngModelOptions]="{standalone: true}" [disabled]="!customArgsEnabled" matInput placeholder="Custom args" i18n-placeholder="Custom args placeholder">
<mat-hint> <mat-hint>
<ng-container i18n="Custom Args input hint"> <ng-container i18n="Custom Args input hint">
No need to include URL, just everything after. No need to include URL, just everything after. Args are delimited using two commas like so: ,,
</ng-container> </ng-container>
</mat-hint> </mat-hint>
</mat-form-field> </mat-form-field>

View File

@@ -143,7 +143,7 @@
<div class="col-12 mt-5"> <div class="col-12 mt-5">
<mat-form-field class="text-field" style="margin-right: 12px;" color="accent"> <mat-form-field class="text-field" style="margin-right: 12px;" color="accent">
<textarea matInput [(ngModel)]="new_config['Downloader']['custom_args']" placeholder="Custom args" i18n-placeholder="Custom args input placeholder"></textarea> <textarea matInput [(ngModel)]="new_config['Downloader']['custom_args']" placeholder="Custom args" i18n-placeholder="Custom args input placeholder"></textarea>
<mat-hint><ng-container i18n="Custom args setting input hint">Global custom args for downloads on the home page.</ng-container></mat-hint> <mat-hint><ng-container i18n="Custom args setting input hint">Global custom args for downloads on the home page. Args are delimited using two commas like so: ,,</ng-container></mat-hint>
<button class="args-edit-button" (click)="openArgsModifierDialog()" mat-icon-button><mat-icon>edit</mat-icon></button> <button class="args-edit-button" (click)="openArgsModifierDialog()" mat-icon-button><mat-icon>edit</mat-icon></button>
</mat-form-field> </mat-form-field>
</div> </div>