mirror of
https://github.com/bitwarden/browser
synced 2025-12-31 07:33:23 +00:00
stub out bulk share
This commit is contained in:
@@ -52,11 +52,11 @@ export class ShareComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.unselectAll();
|
||||
this.selectAll(false);
|
||||
}
|
||||
|
||||
filterCollections() {
|
||||
this.unselectAll();
|
||||
this.selectAll(false);
|
||||
if (this.organizationId == null || this.writeableCollections.length === 0) {
|
||||
this.collections = [];
|
||||
} else {
|
||||
@@ -77,17 +77,9 @@ export class ShareComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
cipherView.organizationId = this.organizationId;
|
||||
cipherView.collectionIds = [];
|
||||
for (const collection of this.collections) {
|
||||
if ((collection as any).checked) {
|
||||
cipherView.collectionIds.push(collection.id);
|
||||
}
|
||||
}
|
||||
|
||||
const checkedCollectionIds = this.collections.filter((c) => (c as any).checked).map((c) => c.id);
|
||||
this.formPromise = Promise.all(attachmentPromises).then(async () => {
|
||||
const encCipher = await this.cipherService.encrypt(cipherView);
|
||||
await this.cipherService.shareWithServer(encCipher);
|
||||
await this.cipherService.shareWithServer(cipherView, this.organizationId, checkedCollectionIds);
|
||||
this.onSharedCipher.emit();
|
||||
this.analytics.eventTrack.next({ action: 'Shared Cipher' });
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('sharedItem'));
|
||||
@@ -99,15 +91,10 @@ export class ShareComponent implements OnInit, OnDestroy {
|
||||
(c as any).checked = !(c as any).checked;
|
||||
}
|
||||
|
||||
selectAll() {
|
||||
for (const c of this.collections) {
|
||||
(c as any).checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
unselectAll() {
|
||||
for (const c of this.writeableCollections) {
|
||||
(c as any).checked = false;
|
||||
selectAll(select: false) {
|
||||
const collections = select ? this.collections : this.writeableCollections;
|
||||
for (const c of collections) {
|
||||
(c as any).checked = select;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user