Added groups - missing user management. Fixed several issues.
This commit is contained in:
@ -4,7 +4,7 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import RedeemableAction from '../../shared/models/redeemable_action';
|
||||
import RedeemableAction from '../../shared/models/redeemable-action';
|
||||
|
||||
@Component({
|
||||
selector: 'action-dropdown',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, inject, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import RedeemableAction from '../../shared/models/redeemable_action';
|
||||
import RedeemableAction from '../../shared/models/redeemable-action';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@ -235,9 +235,10 @@ export class ActionItemEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
deleteAction(action: RedeemableAction): void {
|
||||
if (this.isNew)
|
||||
if (this.isNew || this.waitForResponse)
|
||||
return;
|
||||
|
||||
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(),
|
||||
@ -248,12 +249,15 @@ export class ActionItemEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
save(): void {
|
||||
if (this.formGroup.invalid) {
|
||||
if (this.formGroup.invalid || this.waitForResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.waitForResponse = true;
|
||||
|
||||
const fields = this.actionEntries[this.action.type];
|
||||
if (fields.some(f => f.control.invalid)) {
|
||||
this.waitForResponse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -265,6 +269,7 @@ export class ActionItemEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
if (!(this.action.type in this.actionEntries)) {
|
||||
this.waitForResponse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ main {
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
justify-self: center;
|
||||
background-color: #fafafa;
|
||||
width: 80%;
|
||||
|
||||
& .container {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, EventEmitter, inject, Input, Output } from '@angular/core';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import RedeemableAction from '../../shared/models/redeemable_action';
|
||||
import RedeemableAction from '../../shared/models/redeemable-action';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ActionsComponent } from './actions/actions.component';
|
||||
import { ActionListComponent } from './action-list/action-list.component';
|
||||
import { ActionItemEditComponent } from './action-item-edit/action-item-edit.component';
|
||||
|
@ -27,5 +27,5 @@
|
||||
</mat-form-field>
|
||||
</article>
|
||||
</section>
|
||||
<action-list [actions]="actions" (actionsChange)="items.push($event)" />
|
||||
<action-list class="center" [actions]="actions" (actionsChange)="items.push($event)" />
|
||||
</body>
|
@ -1,5 +1,4 @@
|
||||
body, h3 {
|
||||
background-color: #fafafa;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
@ -12,6 +11,7 @@ body {
|
||||
|
||||
h3 {
|
||||
margin-bottom: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
section {
|
||||
@ -30,4 +30,9 @@ section {
|
||||
display: flex;
|
||||
justify-content:space-around;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
@ -5,7 +5,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { HermesClientService } from '../../hermes-client.service';
|
||||
import RedeemableAction from '../../shared/models/redeemable_action';
|
||||
import RedeemableAction from '../../shared/models/redeemable-action';
|
||||
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import RedeemableActionService from '../../shared/services/redeemable-action.service';
|
||||
|
Reference in New Issue
Block a user