Added user management for groups. Improved user experience slightly. Added some error checks for request acks.
This commit is contained in:
@ -108,7 +108,8 @@
|
||||
}
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions class="actions">
|
||||
<mat-card-actions class="actions"
|
||||
align="end">
|
||||
@if (!isNew) {
|
||||
<button mat-raised-button
|
||||
class="delete"
|
||||
|
@ -213,9 +213,9 @@ export class ActionItemEditComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.isNew = this.action.name.length <= 0;
|
||||
this.previousName = this.action.name;
|
||||
if (!this.isNew)
|
||||
if (!this.isNew) {
|
||||
this.formGroup.get('name')!.disable()
|
||||
else {
|
||||
} else {
|
||||
this.formGroup.get('name')?.addValidators(createItemExistsInArrayValidator(this.actions, a => a.name));
|
||||
}
|
||||
}
|
||||
@ -241,7 +241,13 @@ export class ActionItemEditComponent implements OnInit {
|
||||
this.waitForResponse = true;
|
||||
this.client.first((d: any) => d.op == 4 && d.d.request.type == 'delete_redeemable_action' && d.d.request.data.name == this.action.name)
|
||||
.subscribe({
|
||||
next: () => this.dialogRef.close(),
|
||||
next: (d) => {
|
||||
if (d.d.error) {
|
||||
// TODO: update & show response error message.
|
||||
} else {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
},
|
||||
error: () => this.waitForResponse = false,
|
||||
complete: () => this.waitForResponse = false,
|
||||
});
|
||||
@ -277,7 +283,13 @@ export class ActionItemEditComponent implements OnInit {
|
||||
const requestType = isNewAction ? 'create_redeemable_action' : 'update_redeemable_action';
|
||||
this.client.first((d: any) => d.op == 4 && d.d.request.type == requestType && d.d.data.name == this.action.name)
|
||||
.subscribe({
|
||||
next: () => this.dialogRef.close(this.action),
|
||||
next: (d) => {
|
||||
if (d.d.error) {
|
||||
// TODO: update & show response error message.
|
||||
} else {
|
||||
this.dialogRef.close(this.action);
|
||||
}
|
||||
},
|
||||
error: () => this.waitForResponse = false,
|
||||
complete: () => this.waitForResponse = false,
|
||||
});
|
||||
|
Reference in New Issue
Block a user