1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-14 06:48:18 +02:00

Add numeric score to the result row, as bitSortable does not support sorting by an object/object-ket (#11483)

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith 2024-10-10 20:29:34 +02:00 committed by GitHub
parent 16f36a1008
commit 14d71e7408
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@
<th bitCell bitSortable="organizationId" *ngIf="!isAdminConsoleActive"> <th bitCell bitSortable="organizationId" *ngIf="!isAdminConsoleActive">
{{ "owner" | i18n }} {{ "owner" | i18n }}
</th> </th>
<th bitCell class="tw-text-right" bitSortable="reportValue" default> <th bitCell class="tw-text-right" bitSortable="score" default>
{{ "weakness" | i18n }} {{ "weakness" | i18n }}
</th> </th>
</tr> </tr>

View File

@ -15,7 +15,7 @@ import { PasswordRepromptService } from "@bitwarden/vault";
import { CipherReportComponent } from "./cipher-report.component"; import { CipherReportComponent } from "./cipher-report.component";
type ReportScore = { label: string; badgeVariant: BadgeVariant }; type ReportScore = { label: string; badgeVariant: BadgeVariant };
type ReportResult = CipherView & { reportValue: ReportScore }; type ReportResult = CipherView & { score: number; reportValue: ReportScore };
@Component({ @Component({
selector: "app-weak-passwords-report", selector: "app-weak-passwords-report",
@ -100,7 +100,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
if (result.score != null && result.score <= 2) { if (result.score != null && result.score <= 2) {
const scoreValue = this.scoreKey(result.score); const scoreValue = this.scoreKey(result.score);
const row = { ...ciph, reportValue: scoreValue } as ReportResult; const row = { ...ciph, score: result.score, reportValue: scoreValue } as ReportResult;
this.weakPasswordCiphers.push(row); this.weakPasswordCiphers.push(row);
} }
}); });