Added redemptions page. Fixed some issues. Removed some instances of console.log().
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{redemption.id ? "Edit" : "Add"}} Redemption
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<twitch-redemption-dropdown
|
||||
ngDefaultControl
|
||||
[formControl]="redemptionFormControl"
|
||||
[errorMessages]="redemptionErrorMessages"
|
||||
[twitchRedemptions]="twitchRedemptions"
|
||||
[(twitchRedemptionId)]="redemption.redemption_id" />
|
||||
|
||||
<action-dropdown
|
||||
ngDefaultControl
|
||||
[formControl]="actionFormControl"
|
||||
[errorMessages]="actionErrorMessages"
|
||||
[actions]="redeemableActions"
|
||||
[(action)]="redemption.action_name" />
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Order</mat-label>
|
||||
<input matInput type="number" [formControl]="orderFormControl" [value]="redemption.order" />
|
||||
@if (orderFormControl.invalid && (orderFormControl.dirty || orderFormControl.touched)) {
|
||||
@for (error of orderErrorMessageKeys; track $index) {
|
||||
@if (orderFormControl.hasError(error)) {
|
||||
<small class="error">{{orderErrorMessages[error]}}</small>
|
||||
}
|
||||
}
|
||||
}
|
||||
</mat-form-field>
|
||||
<div class="buttons">
|
||||
<button
|
||||
mat-icon-button
|
||||
class="save"
|
||||
[disabled]="waitForResponse || formGroups.invalid"
|
||||
(click)="save()">
|
||||
<mat-icon>save</mat-icon>
|
||||
</button>
|
||||
@if (redemption.id) {
|
||||
<button
|
||||
mat-icon-button
|
||||
class="delete"
|
||||
[disabled]="waitForResponse"
|
||||
(click)="delete()">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</mat-card-content>
|
||||
@if (responseError) {
|
||||
<mat-card-footer>
|
||||
<small class="error below">{{responseError}}</small>
|
||||
</mat-card-footer>
|
||||
}
|
||||
</mat-card>
|
||||
Reference in New Issue
Block a user