mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 21:50:15 +00:00
feat(archive): Desktop - Desktop initial work.
This commit is contained in:
@@ -212,6 +212,41 @@ export class ViewComponent implements OnDestroy, OnInit {
|
||||
return false;
|
||||
}
|
||||
|
||||
async archive(): Promise<boolean> {
|
||||
if (!(await this.promptPassword())) {
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.dialogService.openSimpleDialog({
|
||||
title: { key: "archiveItem" },
|
||||
content: {
|
||||
key: "archiveItemConfirmation",
|
||||
},
|
||||
type: "warning",
|
||||
});
|
||||
|
||||
if (!confirmed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||
await this.deleteCipher(activeUserId);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
title: null,
|
||||
message: this.i18nService.t(
|
||||
this.cipher.isDeleted ? "permanentlyDeletedItem" : "deletedItem",
|
||||
),
|
||||
});
|
||||
this.onDeletedCipher.emit(this.cipher);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async delete(): Promise<boolean> {
|
||||
if (!(await this.promptPassword())) {
|
||||
return;
|
||||
|
||||
@@ -8,6 +8,7 @@ import { VaultFilter } from "../models/vault-filter.model";
|
||||
@Directive()
|
||||
export class StatusFilterComponent {
|
||||
@Input() hideFavorites = false;
|
||||
@Input() hideArchive = false;
|
||||
@Input() hideTrash = false;
|
||||
@Output() onFilterChange: EventEmitter<VaultFilter> = new EventEmitter<VaultFilter>();
|
||||
@Input() activeFilter: VaultFilter;
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type CipherStatus = "all" | "favorites" | "trash";
|
||||
export type CipherStatus = "all" | "favorites" | "archive" | "trash";
|
||||
|
||||
Reference in New Issue
Block a user