-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-14426] At-risk password Getting Started Carousel (#13383)
* [PM-14426] Add hideIcon input to simple dialog component * [PM-14426] Introduce dark-image-source.directive.ts * [PM-14426] Tweaks to the Vault Carousel component - Create a Carousel NgModule so that the carousel component and carousel slide component are exported - Update barrel files - Adjust min height calculation logic to wait for ;hidden slides to finish rendering before calculating height * [PM-14426] Introduce at risk password getting started carousel component and images * [PM-14426] Refactor at-risk-password-page.service.ts to use the same state definition for banner and carousel dismissal * [PM-14426] Open the getting started carousel on page load * [PM-14426] Add tests * [PM-14426] Use booleanAttribute * [PM-14426] Fix failing type checking
- Loading branch information
1 parent
9aee5f1
commit b9ebf07
Showing
22 changed files
with
334 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+32.6 KB
apps/browser/src/images/at-risk-password-carousel/generate_password.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.3 KB
apps/browser/src/images/at-risk-password-carousel/generate_password.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.6 KB
apps/browser/src/images/at-risk-password-carousel/review_at-risk_logins.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.4 KB
apps/browser/src/images/at-risk-password-carousel/review_at-risk_logins.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.9 KB
apps/browser/src/images/at-risk-password-carousel/update_login.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.2 KB
apps/browser/src/images/at-risk-password-carousel/update_login.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions
54
...src/vault/popup/components/at-risk-carousel-dialog/at-risk-carousel-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<bit-simple-dialog hideIcon> | ||
<div bitDialogContent> | ||
<vault-carousel label="Placeholder" (slideChange)="onSlideChange($event)"> | ||
<vault-carousel-slide [label]="'reviewAtRiskLogins' | i18n"> | ||
<img | ||
class="tw-max-w-full tw-max-h-40" | ||
src="../../../../images/at-risk-password-carousel/review_at-risk_logins.light.png" | ||
appDarkImgSrc="../../../../images/at-risk-password-carousel/review_at-risk_logins.dark.png" | ||
[alt]="'reviewAtRiskLoginSlideImgAlt' | i18n" | ||
/> | ||
<h2 bitTypography="h2" class="tw-mt-8">{{ "reviewAtRiskLogins" | i18n }}</h2> | ||
<p bitTypography="body1"> | ||
{{ "reviewAtRiskLoginsSlideDesc" | i18n }} | ||
</p> | ||
</vault-carousel-slide> | ||
<vault-carousel-slide [label]="'generatePassword' | i18n"> | ||
<img | ||
class="tw-max-w-full tw-max-h-40" | ||
src="../../../../images/at-risk-password-carousel/generate_password.light.png" | ||
appDarkImgSrc="../../../../images/at-risk-password-carousel/generate_password.dark.png" | ||
[alt]="'generatePasswordSlideImgAlt' | i18n" | ||
/> | ||
<h2 bitTypography="h2" class="tw-mt-8">{{ "generatePassword" | i18n }}</h2> | ||
<p bitTypography="body1"> | ||
{{ "generatePasswordSlideDesc" | i18n }} | ||
</p> | ||
</vault-carousel-slide> | ||
<vault-carousel-slide [label]="'updateInBitwarden' | i18n"> | ||
<img | ||
class="tw-max-w-full tw-max-h-40" | ||
src="../../../../images/at-risk-password-carousel/update_login.light.png" | ||
appDarkImgSrc="../../../../images/at-risk-password-carousel/update_login.dark.png" | ||
[alt]="'updateInBitwardenSlideImgAlt' | i18n" | ||
/> | ||
<h2 bitTypography="h2" class="tw-mt-8">{{ "updateInBitwarden" | i18n }}</h2> | ||
<p bitTypography="body1"> | ||
{{ "updateInBitwardenSlideDesc" | i18n }} | ||
</p> | ||
</vault-carousel-slide> | ||
</vault-carousel> | ||
</div> | ||
<div bitDialogFooter class="tw-w-full"> | ||
<button | ||
type="button" | ||
bitButton | ||
buttonType="primary" | ||
block | ||
[disabled]="!dismissBtnEnabled()" | ||
(click)="dismiss()" | ||
> | ||
{{ "reviewAtRiskPasswords" | i18n }} | ||
</button> | ||
</div> | ||
</bit-simple-dialog> |
46 changes: 46 additions & 0 deletions
46
...r/src/vault/popup/components/at-risk-carousel-dialog/at-risk-carousel-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { DialogRef } from "@angular/cdk/dialog"; | ||
import { Component, inject, signal } from "@angular/core"; | ||
|
||
import { ButtonModule, DialogModule, DialogService, TypographyModule } from "@bitwarden/components"; | ||
import { I18nPipe } from "@bitwarden/ui-common"; | ||
import { DarkImageSourceDirective, VaultCarouselModule } from "@bitwarden/vault"; | ||
|
||
export enum AtRiskCarouselDialogResult { | ||
Dismissed = "dismissed", | ||
} | ||
|
||
@Component({ | ||
selector: "vault-at-risk-carousel-dialog", | ||
templateUrl: "./at-risk-carousel-dialog.component.html", | ||
imports: [ | ||
DialogModule, | ||
VaultCarouselModule, | ||
TypographyModule, | ||
ButtonModule, | ||
DarkImageSourceDirective, | ||
I18nPipe, | ||
], | ||
standalone: true, | ||
}) | ||
export class AtRiskCarouselDialogComponent { | ||
private dialogRef = inject(DialogRef); | ||
|
||
protected dismissBtnEnabled = signal(false); | ||
|
||
protected async dismiss() { | ||
this.dialogRef.close(AtRiskCarouselDialogResult.Dismissed); | ||
} | ||
|
||
protected onSlideChange(slideIndex: number) { | ||
// Only enable the dismiss button on the last slide | ||
if (slideIndex === 2) { | ||
this.dismissBtnEnabled.set(true); | ||
} | ||
} | ||
|
||
static open(dialogService: DialogService) { | ||
return dialogService.open<AtRiskCarouselDialogResult>(AtRiskCarouselDialogComponent, { | ||
disableClose: true, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.