fix positioning of group delete button and clearing of the cache on delete

This commit is contained in:
Art Lowel
2020-10-28 15:27:44 +01:00
committed by Marie Verdonck
parent 46defed6f2
commit 3c20cb7ee1
2 changed files with 8 additions and 6 deletions

View File

@@ -18,9 +18,11 @@
[formLayout]="formLayout"
(cancel)="onCancel()"
(submitForm)="onSubmit()">
<div *ngIf="groupBeingEdited != null" class="row">
<button class="btn btn-light delete-button" [disabled]="!(canDelete$ | async)" (click)="delete()">
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
</button>
</div>
</ds-form>
<ds-members-list *ngIf="groupBeingEdited != null" [messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>

View File

@@ -144,7 +144,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
});
this.formModel = [
this.groupName,
this.groupDescription
this.groupDescription,
];
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
this.subs.push(this.groupDataService.getActiveGroup().subscribe((activeGroup: Group) => {
@@ -349,8 +349,8 @@ export class GroupFormComponent implements OnInit, OnDestroy {
* This method will ensure that the page gets reset and that the cache is cleared
*/
reset() {
this.groupDataService.getActiveGroup().pipe(take(1)).subscribe((group: Group) => {
this.requestService.removeByHrefSubstring(group.self);
this.groupDataService.getBrowseEndpoint().pipe(take(1)).subscribe((href: string) => {
this.requestService.removeByHrefSubstring(href);
});
this.onCancel();
}