Skip to content

Commit

Permalink
Improved UX on vault items
Browse files Browse the repository at this point in the history
  • Loading branch information
Spitfireap committed Feb 8, 2024
1 parent 3371760 commit 4032a45
Showing 1 changed file with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, EventEmitter, HostBinding, HostListener, Input, Output } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Component, EventEmitter, Input, Output } from "@angular/core";

import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { CipherType } from "@bitwarden/common/vault/enums";
Expand Down Expand Up @@ -35,16 +34,6 @@ export class VaultCipherRowComponent {

protected CipherType = CipherType;

constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
) {}

@HostBinding("class")
get classes() {
return [].concat(this.disabled ? [] : ["tw-cursor-pointer"]);
}

protected get showTotpCopyButton() {
return (
(this.cipher.login?.hasTotp ?? false) &&
Expand All @@ -56,16 +45,6 @@ export class VaultCipherRowComponent {
return this.cipher.hasOldAttachments && this.cipher.organizationId == null;
}

@HostListener("click")
protected click() {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.router.navigate([], {
queryParams: { itemId: this.cipher.id },
queryParamsHandling: "merge",
});
}

protected copy(field: "username" | "password" | "totp") {
this.onEvent.emit({ type: "copyField", item: this.cipher, field });
}
Expand Down

0 comments on commit 4032a45

Please sign in to comment.