1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-04 13:44:00 +01:00
bitwarden-browser/libs/tools/generator/components
Daniel James Smith 03aa4fd4d8
[PM-13667] Add button to open credential history on web (#12100)
* Create CredentialGeneratorHistoryDialogComponent to be re-used on web and desktop

* Add button to open credential histpry on web

* Add button to open credential history on desktop (#12101)

- Register route to open new CredentialGeneratorHistoryDialogComponent when FeatureFlag/GeneratorToolsModernization is enabled
- Add button to credential generator
- Add missing keys to en/messages.json

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2024-11-22 18:29:30 +01:00
..
src [PM-13667] Add button to open credential history on web (#12100) 2024-11-22 18:29:30 +01:00
jest.config.js [PM-7289] implement generator libraries (#9549) 2024-06-11 16:06:37 -04:00
package.json [PM-9008] factor generator-extensions into separate libraries (#9724) 2024-06-20 10:49:23 -04:00
readme.md [PM-8282] credential generator (#11398) 2024-10-08 14:08:34 -04:00
tsconfig.json [PM-7289] Create generator libraries (#9432) 2024-05-30 15:38:31 -04:00
tsconfig.spec.json [PM-7289] Create generator libraries (#9432) 2024-05-30 15:38:31 -04:00

Using generator components

The components within this module require the following import.

import { GeneratorModule } from "@bitwarden/generator-components";

The credential generator provides access to all generator features.

<!-- Bound to active user -->
<tools-credential-generator />

<!-- Bound to a specific user -->
<tools-credential-generator [user-id]="userId" />

<!-- receive updates when a credential is generated.
     `$event` is a `GeneratedCredential`.
-->
<tools-credential-generator (onGenerated)="eventHandler($event)" />

Specialized components are provided for username and password generation. These components support the same properties as the credential generator.

<tools-password-generator [user-id]="userId" (onGenerated)="eventHandler($event)" />
<tools-username-generator [user-id]="userId" (onGenerated)="eventHandler($event)" />

The emission behavior of onGenerated varies according to credential type. When a credential supports immediate execution, the component automatically generates a value and emits from onGenerated. An additional emission occurs each time the user changes a setting. Users may also request a regeneration.

When a credential does not support immediate execution, then onGenerated fires only when the user clicks the "generate" button.