mirror of
https://github.com/bitwarden/browser
synced 2026-01-06 10:33:57 +00:00
[EC-474] Add hidden char count toggle to web and desktop (#3262)
* feat-web: add hidden char count toggle * Added toggle char count for desktop * Use Tailwind and Component Library, add i18n * Hide char count when password is hidden * Initial proposal * Update colors per design spec for all clients Also make variable names consistent across clients * Remove unused scss * Add styling * Set fixed with for password count elements * Add separate wrapped stories * Fix alignment of first char when wrapped * Minor refactors * Make naming consistent * Add Figma url * add barrel files * Use CL component * Fix template * Remove duplicate style * Use ColorPasswordComponent in web, remove old pipe Also remove styling and move pipe out of jslib-module given that it's no longer shared by all Angular clients * Run prettier * Remove unused scss vars * Undo unnecessary changes * Remove unnecessary changes * Fix styling * Fix selector * Collect show password event * Fix incorrect background in dark mode * Fix linting * Use color password for password history * Add char count to hidden custom fields in desktop * Fix char count background in web: take 2 * Update service name * Add missing label toggleCharacterCount for desktop Co-authored-by: Daniel James Smith <djsmith@web.de> Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
This commit is contained in:
committed by
GitHub
parent
87f2908e3e
commit
35b33335fb
@@ -58,6 +58,9 @@ import localeZhCn from "@angular/common/locales/zh-Hans";
|
||||
import localeZhTw from "@angular/common/locales/zh-Hant";
|
||||
import { NgModule } from "@angular/core";
|
||||
|
||||
import { ColorPasswordCountPipe } from "@bitwarden/angular/pipes/color-password-count.pipe";
|
||||
import { ColorPasswordPipe } from "@bitwarden/angular/pipes/color-password.pipe";
|
||||
|
||||
import { AccessibilityCookieComponent } from "./accounts/accessibility-cookie.component";
|
||||
import { DeleteAccountComponent } from "./accounts/delete-account.component";
|
||||
import { EnvironmentComponent } from "./accounts/environment.component";
|
||||
@@ -170,6 +173,8 @@ registerLocaleData(localeZhTw, "zh-TW");
|
||||
AttachmentsComponent,
|
||||
VaultItemsComponent,
|
||||
CollectionsComponent,
|
||||
ColorPasswordPipe,
|
||||
ColorPasswordCountPipe,
|
||||
DeleteAccountComponent,
|
||||
EnvironmentComponent,
|
||||
ExportComponent,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="box-content-row box-content-row-flex" *ngFor="let h of history">
|
||||
<div class="row-main">
|
||||
<div
|
||||
class="generated-wrapper monospaced"
|
||||
class="password-wrapper monospaced"
|
||||
appSelectCopy
|
||||
[innerHTML]="h.password | colorPassword"
|
||||
></div>
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
<div class="box-content condensed">
|
||||
<div class="box-content-row box-content-row-flex" *ngFor="let h of history">
|
||||
<div class="row-main">
|
||||
<span class="text monospaced">
|
||||
{{ h.password }}
|
||||
</span>
|
||||
<span class="text monospaced" [innerHTML]="h.password | colorPassword"></span>
|
||||
<span class="detail">{{ h.lastUsedDate | date: "medium" }}</span>
|
||||
</div>
|
||||
<div class="action-buttons">
|
||||
|
||||
@@ -17,12 +17,16 @@
|
||||
{{ field.value || " " }}
|
||||
</div>
|
||||
<div *ngIf="field.type === fieldType.Hidden">
|
||||
<span *ngIf="!field.showValue" class="monospaced">{{ field.maskedValue }}</span>
|
||||
<span
|
||||
*ngIf="field.showValue"
|
||||
*ngIf="field.showValue && !field.showCount"
|
||||
class="monospaced show-whitespace"
|
||||
[innerHTML]="field.value | colorPassword"
|
||||
></span>
|
||||
<span *ngIf="!field.showValue" class="monospaced">{{ field.maskedValue }}</span>
|
||||
<span
|
||||
*ngIf="field.showValue && field.showCount"
|
||||
[innerHTML]="field.value | colorPasswordCount"
|
||||
></span>
|
||||
</div>
|
||||
<div *ngIf="field.type === fieldType.Boolean">
|
||||
<i class="bwi bwi-check-square" *ngIf="field.value === 'true'" aria-hidden="true"></i>
|
||||
@@ -41,7 +45,18 @@
|
||||
<span>{{ cipher.linkedFieldI18nKey(field.linkedId) | i18n }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-buttons">
|
||||
<div class="action-buttons action-buttons-fixed">
|
||||
<button
|
||||
type="button"
|
||||
class="row-btn"
|
||||
appStopClick
|
||||
appA11yTitle="{{ 'toggleCharacterCount' | i18n }}"
|
||||
*ngIf="field.type === fieldType.Hidden && cipher.viewPassword && field.showValue"
|
||||
(click)="toggleFieldCount(field)"
|
||||
[attr.aria-pressed]="field.showCount"
|
||||
>
|
||||
<i class="bwi bwi-lg bwi-numbered-list" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="row-btn"
|
||||
|
||||
@@ -50,11 +50,15 @@
|
||||
{{ cipher.login.maskedPassword }}
|
||||
</div>
|
||||
<div
|
||||
*ngIf="showPassword"
|
||||
class="monospaced generated-wrapper"
|
||||
*ngIf="showPassword && !showPasswordCount"
|
||||
class="monospaced password-wrapper"
|
||||
appSelectCopy
|
||||
[innerHTML]="cipher.login.password | colorPassword"
|
||||
></div>
|
||||
<div
|
||||
*ngIf="showPassword && showPasswordCount"
|
||||
[innerHTML]="cipher.login.password | colorPasswordCount"
|
||||
></div>
|
||||
</div>
|
||||
<div class="action-buttons" *ngIf="cipher.viewPassword">
|
||||
<button
|
||||
@@ -77,6 +81,18 @@
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="row-btn"
|
||||
appStopClick
|
||||
attr.aria-label="{{ 'toggleCharacterCount' | i18n }} {{ 'password' | i18n }}"
|
||||
appA11yTitle="{{ 'toggleCharacterCount' | i18n }}"
|
||||
(click)="togglePasswordCount()"
|
||||
*ngIf="showPassword"
|
||||
[attr.aria-pressed]="showPasswordCount"
|
||||
>
|
||||
<i class="bwi bwi-lg bwi-numbered-list" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="row-btn"
|
||||
|
||||
Reference in New Issue
Block a user