1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 05:53:42 +00:00

PM-27739 app icons to render

This commit is contained in:
voommen-livefront
2025-11-04 14:01:12 -06:00
parent b79625def8
commit 05349d1777
5 changed files with 16 additions and 8 deletions

View File

@@ -92,8 +92,8 @@ export const mockApplicationData: OrganizationReportApplication[] = [
];
export const mockEnrichedReportData: ApplicationHealthReportDetailEnriched[] = [
{ ...mockApplication1, isMarkedAsCritical: true },
{ ...mockApplication2, isMarkedAsCritical: false },
{ ...mockApplication1, isMarkedAsCritical: true, ciphers: [] },
{ ...mockApplication2, isMarkedAsCritical: false, ciphers: [] },
];
export const mockCipherViews: CipherView[] = [

View File

@@ -1,3 +1,5 @@
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import {
ApplicationHealthReportDetail,
OrganizationReportApplication,
@@ -6,6 +8,7 @@ import {
export type ApplicationHealthReportDetailEnriched = ApplicationHealthReportDetail & {
isMarkedAsCritical: boolean;
ciphers: CipherView[];
};
export interface RiskInsightsEnrichedData {
reportData: ApplicationHealthReportDetailEnriched[];

View File

@@ -235,6 +235,7 @@ export class RiskInsightsOrchestratorService {
application,
updatedApplicationData,
),
ciphers: [], // explicitly ignore ciphers at this stage
}),
);
@@ -367,6 +368,7 @@ export class RiskInsightsOrchestratorService {
application,
updatedApplicationData,
),
ciphers: [], // explicitly ignore ciphers at this stage
}),
);
@@ -502,6 +504,7 @@ export class RiskInsightsOrchestratorService {
application,
updatedApplicationData,
),
ciphers: [], // explicitly ignore ciphers at this stage
}),
);
// For now, merge the report with the critical marking flag to make the enriched type
@@ -659,6 +662,7 @@ export class RiskInsightsOrchestratorService {
application,
updatedApplicationData,
),
ciphers: [], // explicitly ignore ciphers at this stage
}),
);
@@ -952,8 +956,8 @@ export class RiskInsightsOrchestratorService {
*/
private _setupEnrichedReportData() {
// Setup the enriched report data pipeline
const enrichmentSubscription = combineLatest([this.rawReportData$]).pipe(
switchMap(([rawReportData]) => {
const enrichmentSubscription = combineLatest([this.rawReportData$, this._ciphers$]).pipe(
switchMap(([rawReportData, ciphers]) => {
this.logService.debug(
"[RiskInsightsOrchestratorService] Enriching report data with ciphers and critical app status",
);
@@ -964,6 +968,7 @@ export class RiskInsightsOrchestratorService {
const enrichedReports: ApplicationHealthReportDetailEnriched[] = rawReports.map((app) => ({
...app,
isMarkedAsCritical: this.reportService.isCriticalApplication(app, criticalAppsData),
ciphers: ciphers?.filter((cipher) => app.cipherIds.includes(cipher.id)) ?? [],
}));
const enrichedData = {

View File

@@ -215,6 +215,7 @@ export class NewApplicationsDialogComponent {
isMarkedAsCritical: updatedStateApplicationData.some(
(a) => a.applicationName == application.applicationName && a.isCritical,
),
ciphers: [], // explicitly ignore ciphers at this stage
}),
) || [];
return from(

View File

@@ -46,10 +46,9 @@
[attr.aria-label]="'viewItem' | i18n"
>
<!-- Passing the first cipher of the application for app-vault-icon cipher input requirement -->
<app-vault-icon
*ngIf="row.cipherIds.length > 0"
[cipher]="row.cipherIds[0]"
></app-vault-icon>
@if (row.ciphers && row.ciphers.length > 0) {
<app-vault-icon [cipher]="row.ciphers[0]"></app-vault-icon>
}
</td>
<td
class="tw-cursor-pointer"