1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

[SM-252] Enable strict templates (#3601)

This commit is contained in:
Oscar Hinton
2022-11-28 18:59:46 +01:00
committed by GitHub
parent b312f6b925
commit d994faa8a6
97 changed files with 302 additions and 301 deletions

View File

@@ -57,7 +57,7 @@
class="primary"
(click)="purchase()"
*ngIf="!isPremium"
[disabled]="purchaseBtn.loading"
[disabled]="$any(purchaseBtn).loading"
>
<b>{{ "premiumPurchase" | i18n }}</b>
</button>
@@ -67,18 +67,18 @@
#refreshBtn
type="button"
(click)="refresh()"
[disabled]="refreshBtn.loading"
[disabled]="$any(refreshBtn).loading"
appA11yTitle="{{ 'premiumRefresh' | i18n }}"
[appApiAction]="refreshPromise"
>
<i
class="bwi bwi-refresh bwi-lg bwi-fw"
[hidden]="refreshBtn.loading"
[hidden]="$any(refreshBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!refreshBtn.loading"
[hidden]="!$any(refreshBtn).loading"
aria-hidden="true"
></i>
</button>

View File

@@ -65,7 +65,7 @@
</ng-container>
<ng-container *ngIf="selectedProviderType === providerType.WebAuthn">
<div id="web-authn-frame">
<iframe id="webauthn_iframe" [allow]="webAuthnAllow"></iframe>
<iframe id="webauthn_iframe" [attr.allow]="webAuthnAllow"></iframe>
</div>
<div class="box first">
<div class="box-content">

View File

@@ -5,12 +5,7 @@ import { Utils } from "@bitwarden/common/misc/utils";
@Component({
selector: "app-avatar",
template: `<img
*ngIf="src"
[src]="src"
title="{{ data }}"
[ngClass]="{ 'rounded-circle': circle }"
/>`,
template: `<img *ngIf="src" [src]="src" [ngClass]="{ 'rounded-circle': circle }" />`,
})
export class AvatarComponent implements OnChanges, OnInit {
@Input() size = 45;
@@ -20,7 +15,7 @@ export class AvatarComponent implements OnChanges, OnInit {
@Input() circle = false;
@Input() color?: string;
@Input() id?: number;
@Input() id?: string;
@Input() text?: string;
private svgCharCount = 2;

View File

@@ -12,7 +12,7 @@
<app-avatar
[text]="activeAccount.name"
[id]="activeAccount.id"
size="25"
[size]="25"
[circle]="true"
[fontSize]="14"
[dynamic]="true"
@@ -61,7 +61,7 @@
<app-avatar
[text]="a.value.profile.name ?? a.value.profile.email"
[id]="a.value.profile.userId"
size="25"
[size]="25"
[circle]="true"
[fontSize]="14"
[dynamic]="true"

View File

@@ -35,7 +35,7 @@
name="Type_{{ o.value }}"
id="type_{{ o.value }}"
[value]="o.value"
(change)="typeChanged(o)"
(change)="typeChanged()"
[checked]="send.type === o.value"
[disabled]="disableSend"
/>
@@ -280,10 +280,14 @@
appA11yTitle="{{ 'delete' | i18n }}"
*ngIf="editMode"
>
<i class="bwi bwi-trash bwi-lg bwi-fw" [hidden]="deleteBtn.loading" aria-hidden="true"></i>
<i
class="bwi bwi-trash bwi-lg bwi-fw"
[hidden]="$any(deleteBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!deleteBtn.loading"
[hidden]="!$any(deleteBtn).loading"
aria-hidden="true"
></i>
</button>

View File

@@ -46,7 +46,6 @@
formControlName="defaultExpirationDateTime"
required
placeholder="MM/DD/YYYY HH:MM AM/PM"
[readOnly]="disableSend"
/>
<small *ngIf="editMode" class="help-block">{{ "expirationDateDesc" | i18n }}</small>
</div>

View File

@@ -79,8 +79,8 @@
[(ngModel)]="f.value"
*ngIf="f.type === fieldType.Boolean"
appTrueFalseValue
trueValue="true"
falseValue="false"
[trueValue]="true"
[falseValue]="false"
attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/>

View File

@@ -75,16 +75,16 @@
appA11yTitle="{{ 'checkPassword' | i18n }}"
(click)="checkPassword()"
[appApiAction]="checkPasswordPromise"
[disabled]="checkPasswordBtn.loading"
[disabled]="$any(checkPasswordBtn).loading"
>
<i
class="bwi bwi-lg bwi-check-circle"
[hidden]="checkPasswordBtn.loading"
[hidden]="$any(checkPasswordBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-lg bwi-spinner bwi-spin"
[hidden]="!checkPasswordBtn.loading"
[hidden]="!$any(checkPasswordBtn).loading"
aria-hidden="true"
></i>
</button>
@@ -485,7 +485,10 @@
id="loginUriMatch{{ i }}"
name="Login.Uris[{{ i }}].Match"
[(ngModel)]="u.match"
[hidden]="u.showOptions === false || (u.showOptions == null && u.match == null)"
[hidden]="
$any(u).showOptions === false ||
($any(u).showOptions == null && u.match == null)
"
(change)="loginUriMatchChanged(u)"
>
<option *ngFor="let o of uriMatchOptions" [ngValue]="o.value">
@@ -501,7 +504,10 @@
appA11yTitle="{{ 'toggleOptions' | i18n }}"
(click)="toggleUriOptions(u)"
[attr.aria-expanded]="
!(u.showOptions === false || (u.showOptions == null && u.match == null))
!(
$any(u).showOptions === false ||
($any(u).showOptions == null && u.match == null)
)
"
>
<i class="bwi bwi-lg bwi-cog" aria-hidden="true"></i>
@@ -634,7 +640,7 @@
<input
id="collection_{{ i }}"
type="checkbox"
[(ngModel)]="c.checked"
[(ngModel)]="$any(c).checked"
name="Collection[{{ i }}].Checked"
/>
</div>
@@ -647,12 +653,16 @@
type="submit"
class="primary"
appA11yTitle="{{ 'save' | i18n }}"
[disabled]="form.loading"
[disabled]="$any(form).loading"
>
<i class="bwi bwi-save-changes bwi-lg bwi-fw" [hidden]="form.loading" aria-hidden="true"></i>
<i
class="bwi bwi-save-changes bwi-lg bwi-fw"
[hidden]="$any(form).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!form.loading"
[hidden]="!$any(form).loading"
aria-hidden="true"
></i>
</button>
@@ -675,13 +685,17 @@
class="danger"
appA11yTitle="{{ 'delete' | i18n }}"
*ngIf="editMode && !cloneMode"
[disabled]="deleteBtn.loading"
[disabled]="$any(deleteBtn).loading"
[appApiAction]="deletePromise"
>
<i class="bwi bwi-trash bwi-lg bwi-fw" [hidden]="deleteBtn.loading" aria-hidden="true"></i>
<i
class="bwi bwi-trash bwi-lg bwi-fw"
[hidden]="$any(deleteBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!deleteBtn.loading"
[hidden]="!$any(deleteBtn).loading"
aria-hidden="true"
></i>
</button>

View File

@@ -21,16 +21,16 @@
(click)="delete(a)"
#deleteBtn
[appApiAction]="deletePromises[a.id]"
[disabled]="deleteBtn.loading"
[disabled]="$any(deleteBtn).loading"
>
<i
class="bwi bwi-trash bwi-lg bwi-fw"
[hidden]="deleteBtn.loading"
[hidden]="$any(deleteBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!deleteBtn.loading"
[hidden]="!$any(deleteBtn).loading"
aria-hidden="true"
></i>
</button>

View File

@@ -19,7 +19,7 @@
<input
id="collection_{{ i }}"
type="checkbox"
[(ngModel)]="c.checked"
[(ngModel)]="$any(c).checked"
name="Collection[{{ i }}].Checked"
/>
</div>

View File

@@ -47,17 +47,17 @@
class="danger"
appA11yTitle="{{ 'delete' | i18n }}"
*ngIf="editMode"
[disabled]="deleteBtn.loading"
[disabled]="$any(deleteBtn).loading"
[appApiAction]="deletePromise"
>
<i
class="bwi bwi-trash bwi-lg bwi-fw"
[hidden]="deleteBtn.loading"
[hidden]="$any(deleteBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
[hidden]="!deleteBtn.loading"
[hidden]="!$any(deleteBtn).loading"
aria-hidden="true"
></i>
</button>

View File

@@ -52,11 +52,11 @@
appStopClick
appA11yTitle="{{ 'regenerateUsername' | i18n }}"
(click)="regenerate()"
[disabled]="form.loading"
[disabled]="$any(form).loading"
>
<i
class="bwi bwi-lg bwi-generate"
[ngClass]="form.loading ? 'bwi-spin' : ''"
[ngClass]="$any(form).loading ? 'bwi-spin' : ''"
aria-hidden="true"
></i>
</button>

View File

@@ -112,7 +112,6 @@
<i
*ngIf="!organization.enabled"
class="bwi bwi-fw bwi-exclamation-triangle text-danger mr-auto"
aria-label="{{ 'organizationIsDisabled' | i18n }}"
appA11yTitle="{{ 'organizationIsDisabled' | i18n }}"
></i>
</span>

View File

@@ -64,16 +64,16 @@
appA11yTitle="{{ 'checkPassword' | i18n }}"
(click)="checkPassword()"
[appApiAction]="checkPasswordPromise"
[disabled]="checkPasswordBtn.loading"
[disabled]="$any(checkPasswordBtn).loading"
>
<i
class="bwi bwi-lg bwi-check-circle"
[hidden]="checkPasswordBtn.loading"
[hidden]="$any(checkPasswordBtn).loading"
aria-hidden="true"
></i>
<i
class="bwi bwi-lg bwi-spinner bwi-spin"
[hidden]="!checkPasswordBtn.loading"
[hidden]="!$any(checkPasswordBtn).loading"
aria-hidden="true"
></i>
</button>
@@ -472,12 +472,12 @@
<small class="row-sub-label">{{ attachment.sizeName }}</small>
<i
class="bwi bwi-download bwi-fw row-sub-icon"
*ngIf="!attachment.downloading"
*ngIf="!$any(attachment).downloading"
aria-hidden="true"
></i>
<i
class="bwi bwi-spinner bwi-fw bwi-spin row-sub-icon"
*ngIf="attachment.downloading"
*ngIf="$any(attachment).downloading"
aria-hidden="true"
></i>
</button>