mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[SM-595] add project sort to secrets list (#4914)
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</th>
|
</th>
|
||||||
<th bitCell bitSortable="name" default>{{ "name" | i18n }}</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 bitSortable="revisionDate">{{ "lastEdited" | i18n }}</th>
|
||||||
<th bitCell class="tw-w-0">
|
<th bitCell class="tw-w-0">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -77,4 +77,14 @@ export class SecretsListComponent implements OnDestroy {
|
|||||||
this.restoreSecretsEvent.emit(this.selection.selected);
|
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);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user