1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

[PM-20988][PM-20986][PM-20983][PM-20971][PM-21019] - Multiple defect fixes for desktop cipher form update (#14559)

* multiple bug fixes

* favor getters to local state

* fix tests
This commit is contained in:
Jordan Aasen
2025-05-02 14:21:08 -07:00
committed by GitHub
parent fdfb0196d0
commit 237002b633
6 changed files with 31 additions and 29 deletions

View File

@@ -2007,6 +2007,21 @@
"message": "Premium",
"description": "Premium membership"
},
"freeOrgsCannotUseAttachments": {
"message": "Free organizations cannot use attachments"
},
"singleFieldNeedsAttention": {
"message": "1 field needs your attention."
},
"multipleFieldsNeedAttention": {
"message": "$COUNT$ fields need your attention.",
"placeholders": {
"count": {
"content": "$1",
"example": "2"
}
}
},
"cardExpiredTitle": {
"message": "Expired card"
},

View File

@@ -44,7 +44,7 @@
<button
type="button"
class="primary"
*ngIf="cipher.id && !cipher?.organizationId && !cipher.isDeleted && action !== 'clone'"
*ngIf="cipher.id && !cipher?.organizationId && !cipher.isDeleted && action === 'view'"
(click)="clone()"
appA11yTitle="{{ 'clone' | i18n }}"
>

View File

@@ -13,7 +13,7 @@ import { ActivatedRoute, Router } from "@angular/router";
import { firstValueFrom, Subject, takeUntil, switchMap } from "rxjs";
import { filter, map, take } from "rxjs/operators";
import { CollectionView } from "@bitwarden/admin-console/common";
import { CollectionService, CollectionView } from "@bitwarden/admin-console/common";
import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref";
import { ModalService } from "@bitwarden/angular/services/modal.service";
import { VaultViewPasswordHistoryService } from "@bitwarden/angular/services/view-password-history.service";
@@ -29,7 +29,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SyncService } from "@bitwarden/common/platform/sync";
import { CipherId, UserId } from "@bitwarden/common/types/guid";
import { CipherId, CollectionId, UserId } from "@bitwarden/common/types/guid";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { PremiumUpgradePromptService } from "@bitwarden/common/vault/abstractions/premium-upgrade-prompt.service";
import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service";
@@ -175,6 +175,7 @@ export class VaultV2Component implements OnInit, OnDestroy {
private cipherService: CipherService,
private formConfigService: CipherFormConfigService,
private premiumUpgradePromptService: PremiumUpgradePromptService,
private collectionService: CollectionService,
) {}
async ngOnInit() {
@@ -359,7 +360,7 @@ export class VaultV2Component implements OnInit, OnDestroy {
this.cipherId = cipher.id;
this.cipher = cipher;
this.collections =
this.vaultFilterComponent?.collections.fullList.filter((c) =>
this.vaultFilterComponent?.collections?.fullList.filter((c) =>
cipher.collectionIds.includes(c.id),
) ?? null;
this.action = "view";
@@ -548,6 +549,9 @@ export class VaultV2Component implements OnInit, OnDestroy {
this.cipherId = null;
this.action = "view";
await this.vaultItemsComponent?.refresh().catch(() => {});
this.collections = await firstValueFrom(
this.collectionService.decryptedCollectionViews$(cipher.collectionIds as CollectionId[]),
);
this.cipherId = cipher.id;
this.cipher = cipher;
if (this.activeUserId) {