mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-8524] Cipher Form - Edit Login Details Section (#10081)
* [PM-8524] Introduce login details section component
* [PM-8524] Add ability to remove passkey
* [PM-8524] Introduce TotpCaptureService and the Browser implementation
* [PM-8524] Tweak storybook
* [PM-8524] Add note regarding existing login view references
* [PM-8524] Fix clone mode so that a new cipher is created
* [PM-8524] Add support for generating usernames/passwords and auditing passwords
* [PM-8524] Migrate password/username generation to CipherFormGenerationService
* [PM-8524] Add optional passwordInput to BitPasswordInputToggle to support conditionally rendered password toggle buttons
* [PM-8524] Add LoginDetailsSection tests
* [PM-8524] Add BrowserTotpCaptureService tests
* Revert "[PM-8524] Add optional passwordInput to BitPasswordInputToggle to support conditionally rendered password toggle buttons"
This reverts commit e76a0ccfe8.
* [PM-8524] Add null check to password input toggle
This commit is contained in:
@@ -9,17 +9,24 @@ import {
|
||||
} from "@storybook/angular";
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
|
||||
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||
import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view";
|
||||
import { FolderView } from "@bitwarden/common/vault/models/view/folder.view";
|
||||
import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
|
||||
import { AsyncActionsModule, ButtonModule, ToastService } from "@bitwarden/components";
|
||||
import { CipherFormConfig, PasswordRepromptService } from "@bitwarden/vault";
|
||||
import {
|
||||
CipherFormConfig,
|
||||
CipherFormGenerationService,
|
||||
PasswordRepromptService,
|
||||
} from "@bitwarden/vault";
|
||||
import { PreloadedEnglishI18nModule } from "@bitwarden/web-vault/src/app/core/tests";
|
||||
|
||||
import { CipherFormService } from "./abstractions/cipher-form.service";
|
||||
import { TotpCaptureService } from "./abstractions/totp-capture.service";
|
||||
import { CipherFormModule } from "./cipher-form.module";
|
||||
import { CipherFormComponent } from "./components/cipher-form.component";
|
||||
|
||||
@@ -73,6 +80,17 @@ const defaultConfig: CipherFormConfig = {
|
||||
collectionIds: ["col1"],
|
||||
favorite: false,
|
||||
notes: "Example notes",
|
||||
viewPassword: true,
|
||||
login: Object.assign(new LoginView(), {
|
||||
username: "testuser",
|
||||
password: "testpassword",
|
||||
fido2Credentials: [
|
||||
{
|
||||
creationDate: new Date(),
|
||||
},
|
||||
],
|
||||
totp: "123456",
|
||||
}) as LoginView,
|
||||
} as unknown as Cipher,
|
||||
};
|
||||
|
||||
@@ -113,6 +131,26 @@ export default {
|
||||
enabled$: new BehaviorSubject(true),
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: CipherFormGenerationService,
|
||||
useValue: {
|
||||
generateInitialPassword: () => Promise.resolve("initial-password"),
|
||||
generatePassword: () => Promise.resolve("random-password"),
|
||||
generateUsername: () => Promise.resolve("random-username"),
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: TotpCaptureService,
|
||||
useValue: {
|
||||
captureTotpSecret: () => Promise.resolve("some-value"),
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: AuditService,
|
||||
useValue: {
|
||||
passwordLeaked: () => Promise.resolve(0),
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
componentWrapperDecorator(
|
||||
|
||||
Reference in New Issue
Block a user