1
0
mirror of https://github.com/bitwarden/web synced 2025-12-20 10:13:15 +00:00

collection add/edit modal

This commit is contained in:
Kyle Spearrin
2018-07-10 10:06:57 -04:00
parent febc3093a9
commit edef454043
8 changed files with 307 additions and 42 deletions

View File

@@ -85,7 +85,7 @@ export class GroupsComponent implements OnInit {
});
childComponent.onDeletedGroup.subscribe(() => {
this.modal.close();
this.load();
this.removeGroup(group);
});
this.modal.onClosed.subscribe(() => {
@@ -109,10 +109,7 @@ export class GroupsComponent implements OnInit {
await this.apiService.deleteGroup(this.organizationId, group.id);
this.analytics.eventTrack.next({ action: 'Deleted Group' });
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));
const index = this.groups.indexOf(group);
if (index > -1) {
this.groups.splice(index, 1);
}
this.removeGroup(group);
} catch { }
}
@@ -135,4 +132,11 @@ export class GroupsComponent implements OnInit {
this.modal = null;
});
}
private removeGroup(group: GroupResponse) {
const index = this.groups.indexOf(group);
if (index > -1) {
this.groups.splice(index, 1);
}
}
}