From da969cdff220dd26bafa5d8ba652c14d68b256e8 Mon Sep 17 00:00:00 2001 From: Leslie Tilton <23057410+Banrion@users.noreply.github.com> Date: Mon, 3 Nov 2025 10:07:24 -0600 Subject: [PATCH] Removed obsolete code --- apps/web/src/locales/en/messages.json | 9 - .../activity/assign-tasks-view.component.html | 195 ------------------ .../activity/assign-tasks-view.component.ts | 134 ------------ 3 files changed, 338 deletions(-) delete mode 100644 bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.html delete mode 100644 bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.ts diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 1456d8a7e71..36dbd2143bb 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -376,18 +376,9 @@ "selectCriticalApplicationsDescription": { "message": "Select which applications are most critical to your organization, then assign security tasks to members to resolve risks." }, - "atRiskItems": { - "message": "At-risk items" - }, "clickIconToMarkAppAsCritical": { "message": "Click the star icon to mark an app as critical" }, - "totalItems": { - "message": "Total items" - }, - "membersAffected": { - "message": "Members affected" - }, "markAsCriticalPlaceholder": { "message": "Mark as critical functionality will be implemented in a future update" }, diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.html deleted file mode 100644 index 7d097425469..00000000000 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.html +++ /dev/null @@ -1,195 +0,0 @@ -
- -
- -
- -
-
- - {{ "taskSummary" | i18n }} -
- -
- {{ criticalAppsAtRiskMemberCount }} - {{ "membersWithAtRiskPasswords" | i18n }} - for - {{ selectedApplicationsCount() }} - {{ "criticalApplications" | i18n }} -
-
- - -
- -
- - {{ criticalAppsAtRiskMemberCount }} - - - {{ "membersWithAtRiskPasswords" | i18n }} - -
-
- - -
- -
-
- - {{ selectedApplicationsCount() }} - - - of {{ totalApplicationsCount }} total - -
- - {{ "criticalApplications" | i18n }} at-risk - -
-
-
- - -
- -
- -
- -
-
-
-
-
-
-
- example.com -
-
-
- - -
- -
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
- - -
-
-
-
-
- - -
-
-
-
-
- - - -
- - -
-
-
-
- - -
- {{ "membersWillReceiveNotification" | i18n }} -
-
-
- - -
- - -
-
diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.ts deleted file mode 100644 index 4a58852e48f..00000000000 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/activity/assign-tasks-view.component.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { CommonModule } from "@angular/common"; -import { Component, OnInit, inject, input, output } from "@angular/core"; -import { firstValueFrom } from "rxjs"; - -import { AllActivitiesService } from "@bitwarden/bit-common/dirt/reports/risk-insights"; -import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; -import { OrganizationId } from "@bitwarden/common/types/guid"; -import { - ButtonModule, - IconTileComponent, - ToastService, - TypographyModule, -} from "@bitwarden/components"; -import { I18nPipe } from "@bitwarden/ui-common"; - -import { DefaultAdminTaskService } from "../../../vault/services/default-admin-task.service"; -import { AccessIntelligenceSecurityTasksService } from "../shared/security-tasks.service"; - -/** - * Embedded component for displaying task assignment UI. - * Not a dialog - intended to be embedded within a parent dialog. - * - * Important: This component provides its own instances of AccessIntelligenceSecurityTasksService - * and DefaultAdminTaskService. These services are scoped to this component to ensure proper - * dependency injection when the component is dynamically rendered within the structure. - * Without these providers, Angular would throw NullInjectorError when trying to inject - * DefaultAdminTaskService, which is required by AccessIntelligenceSecurityTasksService. - */ -// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush -// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection -@Component({ - selector: "dirt-assign-tasks-view", - templateUrl: "./assign-tasks-view.component.html", - imports: [CommonModule, ButtonModule, TypographyModule, I18nPipe, IconTileComponent], - providers: [AccessIntelligenceSecurityTasksService, DefaultAdminTaskService], -}) -export class AssignTasksViewComponent implements OnInit { - /** - * Number of applications selected as critical - */ - readonly selectedApplicationsCount = input.required(); - - /** - * Organization ID - passed from parent instead of reading from route - * because this component is embedded in a dialog and doesn't have direct route access - */ - readonly organizationId = input.required(); - - /** - * Emitted when tasks have been successfully assigned - */ - readonly tasksAssigned = output(); - - /** - * Emitted when user clicks Back button - */ - readonly back = output(); - - protected criticalAppsAtRiskMemberCount = 0; - protected totalApplicationsCount = 0; - protected isAssigning = false; - - private allActivitiesService = inject(AllActivitiesService); - private accessIntelligenceSecurityTasksService = inject(AccessIntelligenceSecurityTasksService); - private toastService = inject(ToastService); - private i18nService = inject(I18nService); - private logService = inject(LogService); - - async ngOnInit(): Promise { - // Get unique members with at-risk passwords and total applications from report summary - // Uses the same pattern as all-activity.component.ts - await this.loadReportSummary(); - } - - /** - * Loads the count of unique members with at-risk passwords and total applications. - * Uses the same pattern as all-activity.component.ts - */ - private async loadReportSummary(): Promise { - try { - const summary = await firstValueFrom(this.allActivitiesService.reportSummary$); - this.criticalAppsAtRiskMemberCount = summary.totalCriticalAtRiskMemberCount; - this.totalApplicationsCount = summary.totalApplicationCount; - } catch (error) { - this.logService.error("[AssignTasksView] Failed to load report summary", error); - this.criticalAppsAtRiskMemberCount = 0; - this.totalApplicationsCount = 0; - } - } - - /** - * Handles the assign tasks button click - */ - protected onAssignTasks = async () => { - if (this.isAssigning) { - return; // Prevent double-click - } - - this.isAssigning = true; - - try { - // Get critical applications details - const allApplicationsDetails = await firstValueFrom( - this.allActivitiesService.allApplicationsDetails$, - ); - - // Filter to only critical apps - const criticalApps = allApplicationsDetails.filter((app) => app.isMarkedAsCritical); - - // Assign tasks using the security tasks service - // Uses the same logic as password-change-metric.component.ts - await this.accessIntelligenceSecurityTasksService.assignTasks( - this.organizationId(), - criticalApps, - ); - - // Success toast is shown by the service - // Emit success event to parent - this.tasksAssigned.emit(); - } catch (error) { - this.logService.error("[AssignTasksView] Failed to assign tasks", error); - // Error toast is shown by the service - this.isAssigning = false; // Re-enable button on error - } - }; - - /** - * Handles the back button click - */ - protected onBack = () => { - this.back.emit(); - }; -}