1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

Revert "[PM-13404] Weak Passwords Report - Sort by password weakness (#12359)" (#13263)

This reverts commit 582beaf706.
This commit is contained in:
Daniel James Smith
2025-02-05 15:31:37 +01:00
committed by GitHub
parent f6eb08c3b7
commit 9cbe295c74
2 changed files with 1 additions and 31 deletions

View File

@@ -39,13 +39,7 @@
<th bitCell bitSortable="organizationId" *ngIf="!isAdminConsoleActive"> <th bitCell bitSortable="organizationId" *ngIf="!isAdminConsoleActive">
{{ "owner" | i18n }} {{ "owner" | i18n }}
</th> </th>
<th <th bitCell class="tw-text-right" bitSortable="score" default>
bitCell
class="tw-text-right"
bitSortable="score"
default
(sortChange)="onSortChange('score', $event)"
>
{{ "weakness" | i18n }} {{ "weakness" | i18n }}
</th> </th>
</tr> </tr>

View File

@@ -59,7 +59,6 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
this.weakPasswordCiphers = []; this.weakPasswordCiphers = [];
this.filterStatus = [0]; this.filterStatus = [0];
this.findWeakPasswords(allCiphers); this.findWeakPasswords(allCiphers);
this.weakPasswordCiphers = this.sortCiphers(this.weakPasswordCiphers, "score", false);
} }
protected findWeakPasswords(ciphers: CipherView[]): void { protected findWeakPasswords(ciphers: CipherView[]): void {
@@ -113,29 +112,6 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
this.filterCiphersByOrg(this.weakPasswordCiphers); this.filterCiphersByOrg(this.weakPasswordCiphers);
} }
onSortChange(field: string, event: Event) {
const target = event.target as HTMLInputElement;
const ascending = target.checked;
this.weakPasswordCiphers = this.sortCiphers(this.weakPasswordCiphers, field, ascending);
}
protected sortCiphers(
ciphers: ReportResult[],
field: string,
ascending: boolean,
): ReportResult[] {
return ciphers.sort((a, b) => {
const aValue = a[field as keyof ReportResult];
const bValue = b[field as keyof ReportResult];
if (aValue === bValue) {
return 0;
}
const comparison = aValue > bValue ? 1 : -1;
return ascending ? comparison : -comparison;
});
}
protected canManageCipher(c: CipherView): boolean { protected canManageCipher(c: CipherView): boolean {
// this will only ever be false from the org view; // this will only ever be false from the org view;
return true; return true;