mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
[SM-595] add project sort to secrets list (#4914)
This commit is contained in:
parent
04d1fbb716
commit
2b95c786d8
@ -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
|
||||
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user