2018-10-23 18:16:27 +02:00
|
|
|
import { Location } from "@angular/common";
|
|
|
|
import { Component } from "@angular/core";
|
|
|
|
import { ActivatedRoute } from "@angular/router";
|
2021-10-14 23:58:59 +02:00
|
|
|
import { first } from "rxjs/operators";
|
|
|
|
|
2022-06-14 17:10:53 +02:00
|
|
|
import { CollectionsComponent as BaseCollectionsComponent } from "@bitwarden/angular/components/collections.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 { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
2018-10-23 18:16:27 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "app-vault-collections",
|
|
|
|
templateUrl: "collections.component.html",
|
|
|
|
})
|
|
|
|
export class CollectionsComponent extends BaseCollectionsComponent {
|
|
|
|
constructor(
|
|
|
|
collectionService: CollectionService,
|
|
|
|
platformUtilsService: PlatformUtilsService,
|
|
|
|
i18nService: I18nService,
|
|
|
|
cipherService: CipherService,
|
2021-10-21 11:10:46 +02:00
|
|
|
private route: ActivatedRoute,
|
|
|
|
private location: Location,
|
|
|
|
logService: LogService
|
|
|
|
) {
|
|
|
|
super(collectionService, platformUtilsService, i18nService, cipherService, logService);
|
2018-10-23 18:16:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
async ngOnInit() {
|
2018-10-23 21:56:45 +02:00
|
|
|
this.onSavedCollections.subscribe(() => {
|
|
|
|
this.back();
|
|
|
|
});
|
2021-10-14 23:58:59 +02:00
|
|
|
this.route.queryParams.pipe(first()).subscribe(async (params) => {
|
2018-10-23 18:16:27 +02:00
|
|
|
this.cipherId = params.cipherId;
|
2019-03-06 20:31:50 +01:00
|
|
|
await this.load();
|
2018-10-23 18:16:27 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
back() {
|
|
|
|
this.location.back();
|
|
|
|
}
|
|
|
|
}
|