From 2d562aa782b0f0c56c2795f5fd9c42c459ff4330 Mon Sep 17 00:00:00 2001 From: Miles Blackwood Date: Wed, 30 Apr 2025 13:29:47 -0400 Subject: [PATCH] Finalize action button open by using temporarily duplicated service. UI fixes. --- .../background/notification.background.ts | 9 +- .../overlay-notifications.background.ts | 3 - .../components/buttons/action-button.ts | 16 ++- .../content/components/notification/body.ts | 21 ++-- .../notification/confirmation/footer.ts | 8 +- .../notification/confirmation/message.ts | 2 +- .../components/notification/container.ts | 1 + .../content/components/notification/footer.ts | 13 ++- .../abstractions/notification-bar.ts | 2 +- ...ification-change-login-password.service.ts | 99 +++++++++++++++++++ 10 files changed, 152 insertions(+), 22 deletions(-) create mode 100644 apps/browser/src/autofill/services/notification-change-login-password.service.ts diff --git a/apps/browser/src/autofill/background/notification.background.ts b/apps/browser/src/autofill/background/notification.background.ts index b8b7a060a60..683ef873410 100644 --- a/apps/browser/src/autofill/background/notification.background.ts +++ b/apps/browser/src/autofill/background/notification.background.ts @@ -57,6 +57,7 @@ import { import { CollectionView } from "../content/components/common-types"; import { NotificationQueueMessageType } from "../enums/notification-queue-message-type.enum"; import { AutofillService } from "../services/abstractions/autofill.service"; +import { TemporaryNotificationChangeLoginService } from "../services/notification-change-login-password.service"; import { AddChangePasswordQueueMessage, @@ -393,9 +394,11 @@ export default class NotificationBackground { message: NotificationBackgroundExtensionMessage, sender: chrome.runtime.MessageSender, ) { - const { activeUserId, securityTask, uri } = message.data; + const { activeUserId, securityTask, cipher } = message.data; + const domain = Utils.getDomain(sender.tab.url); + const passwordChangeUri = + await new TemporaryNotificationChangeLoginService().getChangePasswordUrl(cipher); - const domain = Utils.getDomain(uri); const addLoginIsEnabled = await this.getEnableAddedLoginPrompt(); const wasVaultLocked = AuthenticationStatus.Locked && addLoginIsEnabled; @@ -411,7 +414,7 @@ export default class NotificationBackground { domain, wasVaultLocked, type: NotificationQueueMessageType.AtRiskPassword, - passwordChangeUri: domain, + passwordChangeUri, organizationName: organization.name, tab: sender.tab, launchTimestamp, diff --git a/apps/browser/src/autofill/background/overlay-notifications.background.ts b/apps/browser/src/autofill/background/overlay-notifications.background.ts index 2bd6f9b7d53..7b146d90dcc 100644 --- a/apps/browser/src/autofill/background/overlay-notifications.background.ts +++ b/apps/browser/src/autofill/background/overlay-notifications.background.ts @@ -519,9 +519,6 @@ export class OverlayNotificationsBackground implements OverlayNotificationsBackg const cipher = ciphers.find((cipher) => cipher.id === securityTask.cipherId); return { securityTask, cipher, uri: modifyLoginData.uri }; - // see at-risk-password-component launchChangePassword - // DefaultChangeLoginPasswordService - // this can be implemented as a provider in the view. } /** diff --git a/apps/browser/src/autofill/content/components/buttons/action-button.ts b/apps/browser/src/autofill/content/components/buttons/action-button.ts index 881b44b4785..233a4ef9b99 100644 --- a/apps/browser/src/autofill/content/components/buttons/action-button.ts +++ b/apps/browser/src/autofill/content/components/buttons/action-button.ts @@ -10,11 +10,13 @@ export function ActionButton({ disabled = false, theme, handleClick, + fullWidth = true, }: { buttonText: string | TemplateResult; disabled?: boolean; theme: Theme; handleClick: (e: Event) => void; + fullWidth?: boolean; }) { const handleButtonClick = (event: Event) => { if (!disabled) { @@ -24,7 +26,7 @@ export function ActionButton({ return html`