1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-31 07:33:23 +00:00

[CL-850] Remove anon layout default icon and require either icon or no icon (#16433)

This commit is contained in:
Vicki League
2025-10-20 14:07:48 -04:00
committed by GitHub
parent 22eb49aed1
commit d2c6757626
24 changed files with 129 additions and 103 deletions

View File

@@ -87,7 +87,7 @@ export default {
props: args,
template: /*html*/ `
<auth-anon-layout
[hideIcon]="true"
[icon]="null"
[hideBackgroundIllustration]="true"
>
<dirt-phishing-warning></dirt-phishing-warning>

View File

@@ -23,6 +23,7 @@ import {
UserLockIcon,
VaultIcon,
LockIcon,
DomainIcon,
TwoFactorAuthSecurityKeyIcon,
} from "@bitwarden/assets/svg";
import {
@@ -565,6 +566,8 @@ const routes: Routes = [
key: "verifyYourIdentity",
},
showBackButton: true,
// `TwoFactorAuthComponent` manually sets its icon based on the 2fa type
pageIcon: null,
} satisfies RouteDataProperties & ExtensionAnonLayoutWrapperData,
},
{
@@ -572,6 +575,7 @@ const routes: Routes = [
data: {
elevation: 1,
hideFooter: true,
pageIcon: LockIcon,
} satisfies RouteDataProperties & ExtensionAnonLayoutWrapperData,
children: [
{
@@ -617,9 +621,9 @@ const routes: Routes = [
path: "",
component: IntroCarouselComponent,
data: {
hideIcon: true,
pageIcon: null,
hideFooter: true,
},
} satisfies ExtensionAnonLayoutWrapperData,
},
],
},
@@ -637,6 +641,7 @@ const routes: Routes = [
key: "confirmKeyConnectorDomain",
},
showBackButton: true,
pageIcon: DomainIcon,
} satisfies ExtensionAnonLayoutWrapperData,
},
],
@@ -722,7 +727,7 @@ const routes: Routes = [
},
],
data: {
hideIcon: true,
pageIcon: null,
hideBackgroundIllustration: true,
showReadonlyHostname: true,
} satisfies AnonLayoutWrapperData,

View File

@@ -11,13 +11,15 @@ export class ExtensionAnonLayoutWrapperDataService
extends DefaultAnonLayoutWrapperDataService
implements AnonLayoutWrapperDataService
{
protected override anonLayoutWrapperDataSubject = new Subject<ExtensionAnonLayoutWrapperData>();
protected override anonLayoutWrapperDataSubject = new Subject<
Partial<ExtensionAnonLayoutWrapperData>
>();
override setAnonLayoutWrapperData(data: ExtensionAnonLayoutWrapperData): void {
override setAnonLayoutWrapperData(data: Partial<ExtensionAnonLayoutWrapperData>): void {
this.anonLayoutWrapperDataSubject.next(data);
}
override anonLayoutWrapperData$(): Observable<ExtensionAnonLayoutWrapperData> {
override anonLayoutWrapperData$(): Observable<Partial<ExtensionAnonLayoutWrapperData>> {
return this.anonLayoutWrapperDataSubject.asObservable();
}
}

View File

@@ -23,7 +23,6 @@
[hideLogo]="true"
[maxWidth]="maxWidth"
[hideFooter]="hideFooter"
[hideIcon]="hideIcon"
[hideCardWrapper]="hideCardWrapper"
>
<router-outlet></router-outlet>

View File

@@ -27,7 +27,6 @@ export interface ExtensionAnonLayoutWrapperData extends AnonLayoutWrapperData {
showBackButton?: boolean;
showLogo?: boolean;
hideFooter?: boolean;
hideIcon?: boolean;
}
@Component({
@@ -50,7 +49,6 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
protected showAcctSwitcher: boolean;
protected showBackButton: boolean;
protected showLogo: boolean = true;
protected hideIcon: boolean = false;
protected pageTitle: string;
protected pageSubtitle: string;
@@ -134,10 +132,6 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
this.showLogo = Boolean(firstChildRouteData["showLogo"]);
}
if (firstChildRouteData["hideIcon"] !== undefined) {
this.hideIcon = Boolean(firstChildRouteData["hideIcon"]);
}
if (firstChildRouteData["hideCardWrapper"] !== undefined) {
this.hideCardWrapper = Boolean(firstChildRouteData["hideCardWrapper"]);
}
@@ -196,10 +190,6 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
if (data.showLogo !== undefined) {
this.showLogo = data.showLogo;
}
if (data.hideIcon !== undefined) {
this.hideIcon = data.hideIcon;
}
}
private handleStringOrTranslation(value: string | Translation): string {
@@ -222,7 +212,6 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy {
this.showLogo = null;
this.maxWidth = null;
this.hideFooter = null;
this.hideIcon = null;
this.hideCardWrapper = null;
}

View File

@@ -208,7 +208,9 @@ export const DefaultContentExample: Story = {
children: [
{
path: "default-example",
data: {},
data: {
pageIcon: LockIcon,
} satisfies ExtensionAnonLayoutWrapperData,
children: [
{
path: "",
@@ -244,7 +246,6 @@ const initialData: ExtensionAnonLayoutWrapperData = {
showAcctSwitcher: true,
showBackButton: true,
showLogo: true,
hideIcon: false,
};
const changedData: ExtensionAnonLayoutWrapperData = {
@@ -258,7 +259,6 @@ const changedData: ExtensionAnonLayoutWrapperData = {
showAcctSwitcher: false,
showBackButton: false,
showLogo: false,
hideIcon: false,
};
@Component({
@@ -337,9 +337,9 @@ export const HasLoggedInAccountExample: Story = {
{
path: "has-logged-in-account",
data: {
hasLoggedInAccount: true,
showAcctSwitcher: true,
},
pageIcon: LockIcon,
} satisfies ExtensionAnonLayoutWrapperData,
children: [
{
path: "",