Skip to content

Commit

Permalink
Add numeric score to the result row, as bitSortable does not support …
Browse files Browse the repository at this point in the history
…sorting by an object/object-ket (#11483)

Co-authored-by: Daniel James Smith <[email protected]>
  • Loading branch information
djsmith85 and djsmith85 authored Oct 10, 2024
1 parent 16f36a1 commit 14d71e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<th bitCell bitSortable="organizationId" *ngIf="!isAdminConsoleActive">
{{ "owner" | i18n }}
</th>
<th bitCell class="tw-text-right" bitSortable="reportValue" default>
<th bitCell class="tw-text-right" bitSortable="score" default>
{{ "weakness" | i18n }}
</th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { PasswordRepromptService } from "@bitwarden/vault";
import { CipherReportComponent } from "./cipher-report.component";

type ReportScore = { label: string; badgeVariant: BadgeVariant };
type ReportResult = CipherView & { reportValue: ReportScore };
type ReportResult = CipherView & { score: number; reportValue: ReportScore };

@Component({
selector: "app-weak-passwords-report",
Expand Down Expand Up @@ -100,7 +100,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen

if (result.score != null && result.score <= 2) {
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);
}
});
Expand Down

0 comments on commit 14d71e7

Please sign in to comment.