mirror of
https://github.com/bitwarden/browser
synced 2026-01-04 01:23:57 +00:00
PM-16891 Applications at risk dialog (#12843)
* Org at risk members click on the card * Fixing at risk member counts * At risk member text modification * Changing ok button to close * PM-16891 added a dialog for at risk apps * PM-16891 fixing order of imports (linting error) * PM-16891 updated PR comments --------- Co-authored-by: Tom <ttalty@bitwarden.com> Co-authored-by: Tom <144813356+ttalty@users.noreply.github.com>
This commit is contained in:
@@ -100,3 +100,12 @@ export type AtRiskMemberDetail = {
|
||||
email: string;
|
||||
atRiskPasswordCount: number;
|
||||
};
|
||||
|
||||
/*
|
||||
* A list of applications and the count of
|
||||
* at risk passwords for each application
|
||||
*/
|
||||
export type AtRiskApplicationDetail = {
|
||||
applicationName: string;
|
||||
atRiskPasswordCount: number;
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
ApplicationHealthReportDetail,
|
||||
ApplicationHealthReportSummary,
|
||||
AtRiskMemberDetail,
|
||||
AtRiskApplicationDetail,
|
||||
CipherHealthReportDetail,
|
||||
CipherHealthReportUriDetail,
|
||||
ExposedPasswordDetail,
|
||||
@@ -114,6 +115,30 @@ export class RiskInsightsReportService {
|
||||
}));
|
||||
}
|
||||
|
||||
generateAtRiskApplicationList(
|
||||
cipherHealthReportDetails: ApplicationHealthReportDetail[],
|
||||
): AtRiskApplicationDetail[] {
|
||||
const appsRiskMap = new Map<string, number>();
|
||||
|
||||
cipherHealthReportDetails
|
||||
.filter((app) => app.atRiskPasswordCount > 0)
|
||||
.forEach((app) => {
|
||||
if (appsRiskMap.has(app.applicationName)) {
|
||||
appsRiskMap.set(
|
||||
app.applicationName,
|
||||
appsRiskMap.get(app.applicationName) + app.atRiskPasswordCount,
|
||||
);
|
||||
} else {
|
||||
appsRiskMap.set(app.applicationName, app.atRiskPasswordCount);
|
||||
}
|
||||
});
|
||||
|
||||
return Array.from(appsRiskMap.entries()).map(([applicationName, atRiskPasswordCount]) => ({
|
||||
applicationName,
|
||||
atRiskPasswordCount,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the summary from the application health report. Returns total members and applications as well
|
||||
* as the total at risk members and at risk applications
|
||||
|
||||
Reference in New Issue
Block a user