1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

[SM-595] add project sort to secrets list (#4914)

This commit is contained in:
Will Martin 2023-03-03 09:00:20 -05:00 committed by GitHub
parent 04d1fbb716
commit 2b95c786d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -38,7 +38,7 @@
</label>
</th>
<th bitCell bitSortable="name" default>{{ "name" | i18n }}</th>
<th bitCell>{{ "project" | i18n }}</th>
<th bitCell bitSortable="projects" [fn]="sortProjects">{{ "project" | i18n }}</th>
<th bitCell bitSortable="revisionDate">{{ "lastEdited" | i18n }}</th>
<th bitCell class="tw-w-0">
<button

View File

@ -77,4 +77,14 @@ export class SecretsListComponent implements OnDestroy {
this.restoreSecretsEvent.emit(this.selection.selected);
}
}
sortProjects = (a: SecretListView, b: SecretListView): number => {
const aProjects = a.projects;
const bProjects = b.projects;
if (aProjects.length !== bProjects.length) {
return aProjects.length - bProjects.length;
}
return aProjects[0]?.name.localeCompare(bProjects[0].name);
};
}