2018-06-12 17:46:11 +02:00
|
|
|
import { Component, OnDestroy } from "@angular/core";
|
|
|
|
|
2022-06-14 17:10:53 +02:00
|
|
|
import { ShareComponent as BaseShareComponent } from "@bitwarden/angular/components/share.component";
|
|
|
|
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
|
|
|
|
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
|
|
|
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
|
|
|
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
|
|
|
import { OrganizationService } from "@bitwarden/common/abstractions/organization.service";
|
|
|
|
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
|
|
|
import { CollectionView } from "@bitwarden/common/models/view/collectionView";
|
2018-06-12 17:46:11 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "app-vault-share",
|
|
|
|
templateUrl: "share.component.html",
|
|
|
|
})
|
2018-10-23 16:33:40 +02:00
|
|
|
export class ShareComponent extends BaseShareComponent implements OnDestroy {
|
|
|
|
constructor(
|
|
|
|
collectionService: CollectionService,
|
|
|
|
platformUtilsService: PlatformUtilsService,
|
2021-12-14 17:10:26 +01:00
|
|
|
i18nService: I18nService,
|
|
|
|
cipherService: CipherService,
|
|
|
|
organizationService: OrganizationService,
|
|
|
|
logService: LogService
|
|
|
|
) {
|
|
|
|
super(
|
|
|
|
collectionService,
|
|
|
|
platformUtilsService,
|
|
|
|
i18nService,
|
|
|
|
cipherService,
|
|
|
|
logService,
|
|
|
|
organizationService
|
|
|
|
);
|
2018-06-12 17:46:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
2018-06-13 06:03:48 +02:00
|
|
|
this.selectAll(false);
|
2018-06-12 17:46:11 +02:00
|
|
|
}
|
|
|
|
|
2018-07-09 22:27:54 +02:00
|
|
|
check(c: CollectionView, select?: boolean) {
|
|
|
|
(c as any).checked = select == null ? !(c as any).checked : select;
|
2018-06-12 17:46:11 +02:00
|
|
|
}
|
|
|
|
|
2018-07-09 23:07:13 +02:00
|
|
|
selectAll(select: boolean) {
|
2018-06-13 06:03:48 +02:00
|
|
|
const collections = select ? this.collections : this.writeableCollections;
|
2021-02-03 18:41:33 +01:00
|
|
|
collections.forEach((c) => this.check(c, select));
|
2018-06-12 17:46:11 +02:00
|
|
|
}
|
|
|
|
}
|