mirror of
https://github.com/bitwarden/browser
synced 2026-02-15 07:54:55 +00:00
[PM-31738] update archive toasts (#18923)
* update archive toast for all clients and trash archive restore toast, update archive cipher utilities spec
This commit is contained in:
@@ -573,14 +573,11 @@
|
||||
"noItemsInArchiveDesc": {
|
||||
"message": "Archived items will appear here and will be excluded from general search results and autofill suggestions."
|
||||
},
|
||||
"itemWasSentToArchive": {
|
||||
"message": "Item was sent to archive"
|
||||
"itemArchiveToast": {
|
||||
"message": "Item archived"
|
||||
},
|
||||
"itemWasUnarchived": {
|
||||
"message": "Item was unarchived"
|
||||
},
|
||||
"itemUnarchived": {
|
||||
"message": "Item was unarchived"
|
||||
"itemUnarchivedToast": {
|
||||
"message": "Item unarchived"
|
||||
},
|
||||
"archiveItem": {
|
||||
"message": "Archive item"
|
||||
|
||||
@@ -383,7 +383,7 @@ export class ItemMoreOptionsComponent {
|
||||
await this.cipherArchiveService.archiveWithServer(this.cipher.id as CipherId, activeUserId);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemWasSentToArchive"),
|
||||
message: this.i18nService.t("itemArchiveToast"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,17 +277,24 @@ export class ViewComponent {
|
||||
};
|
||||
|
||||
restore = async (): Promise<void> => {
|
||||
let toastMessage;
|
||||
try {
|
||||
await this.cipherService.restoreWithServer(this.cipher.id, this.activeUserId);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
|
||||
if (this.cipher.archivedDate) {
|
||||
toastMessage = this.i18nService.t("archivedItemRestored");
|
||||
} else {
|
||||
toastMessage = this.i18nService.t("restoredItem");
|
||||
}
|
||||
|
||||
await this.popupRouterCacheService.back();
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
title: null,
|
||||
message: this.i18nService.t("restoredItem"),
|
||||
message: toastMessage,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ export class ArchiveComponent {
|
||||
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemUnarchived"),
|
||||
message: this.i18nService.t("itemUnarchivedToast"),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -4387,11 +4387,11 @@
|
||||
"noItemsInArchiveDesc": {
|
||||
"message": "Archived items will appear here and will be excluded from general search results and autofill suggestions."
|
||||
},
|
||||
"itemWasSentToArchive": {
|
||||
"message": "Item was sent to archive"
|
||||
"itemArchiveToast": {
|
||||
"message": "Item archived"
|
||||
},
|
||||
"itemWasUnarchived": {
|
||||
"message": "Item was unarchived"
|
||||
"itemUnarchivedToast": {
|
||||
"message": "Item unarchived"
|
||||
},
|
||||
"archiveItem": {
|
||||
"message": "Archive item"
|
||||
|
||||
@@ -616,7 +616,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemWasSentToArchive"),
|
||||
message: this.i18nService.t("itemArchiveToast"),
|
||||
});
|
||||
} catch {
|
||||
this.toastService.showToast({
|
||||
@@ -638,7 +638,7 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemWasUnarchived"),
|
||||
message: this.i18nService.t("itemUnarchivedToast"),
|
||||
});
|
||||
} catch {
|
||||
this.toastService.showToast({
|
||||
|
||||
@@ -744,7 +744,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
||||
await this.cipherArchiveService.archiveWithServer(cipher.id as CipherId, activeUserId);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemWasSentToArchive"),
|
||||
message: this.i18nService.t("itemArchiveToast"),
|
||||
});
|
||||
this.refresh();
|
||||
} catch (e) {
|
||||
@@ -801,7 +801,7 @@ export class VaultComponent<C extends CipherViewLike> implements OnInit, OnDestr
|
||||
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemUnarchived"),
|
||||
message: this.i18nService.t("itemUnarchivedToast"),
|
||||
});
|
||||
|
||||
this.refresh();
|
||||
|
||||
@@ -11905,14 +11905,11 @@
|
||||
"noItemsInArchiveDesc": {
|
||||
"message": "Archived items will appear here and will be excluded from general search results and autofill suggestions."
|
||||
},
|
||||
"itemWasSentToArchive": {
|
||||
"message": "Item was sent to archive"
|
||||
"itemArchiveToast": {
|
||||
"message": "Item archived"
|
||||
},
|
||||
"itemWasUnarchived": {
|
||||
"message": "Item was unarchived"
|
||||
},
|
||||
"itemUnarchived": {
|
||||
"message": "Item was unarchived"
|
||||
"itemUnarchivedToast": {
|
||||
"message": "Item unarchived"
|
||||
},
|
||||
"bulkArchiveItems": {
|
||||
"message": "Items archived"
|
||||
|
||||
@@ -80,7 +80,7 @@ describe("ArchiveCipherUtilitiesService", () => {
|
||||
);
|
||||
expect(toastService.showToast).toHaveBeenCalledWith({
|
||||
variant: "success",
|
||||
message: "itemWasSentToArchive",
|
||||
message: "itemArchiveToast",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ describe("ArchiveCipherUtilitiesService", () => {
|
||||
);
|
||||
expect(toastService.showToast).toHaveBeenCalledWith({
|
||||
variant: "success",
|
||||
message: "itemWasUnarchived",
|
||||
message: "itemUnarchivedToast",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ export class ArchiveCipherUtilitiesService {
|
||||
);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemWasSentToArchive"),
|
||||
message: this.i18nService.t("itemArchiveToast"),
|
||||
});
|
||||
return cipherResponse;
|
||||
} catch {
|
||||
@@ -90,7 +90,7 @@ export class ArchiveCipherUtilitiesService {
|
||||
);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
message: this.i18nService.t("itemWasUnarchived"),
|
||||
message: this.i18nService.t("itemUnarchivedToast"),
|
||||
});
|
||||
return cipherResponse;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user