From 78b856e7a6b762ccdc3a123075902f4654eca767 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Mon, 9 Oct 2017 20:59:01 -0700 Subject: [PATCH 1/2] Order sidebar collections alphabetically --- frontend/components/Layout/components/SidebarCollections.js | 2 +- frontend/stores/CollectionsStore.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/components/Layout/components/SidebarCollections.js b/frontend/components/Layout/components/SidebarCollections.js index 965237ffc..3dbec12de 100644 --- a/frontend/components/Layout/components/SidebarCollections.js +++ b/frontend/components/Layout/components/SidebarCollections.js @@ -33,7 +33,7 @@ type Props = { return (
Collections
- {collections.data.map(collection => ( + {collections.orderedData.map(collection => ( collection.name); + } + /** * List of paths to each of the documents, where paths are composed of id and title/name pairs */ From 3c0c00071202ca6c7b20783b36891a73e053e658 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Mon, 9 Oct 2017 22:25:42 -0700 Subject: [PATCH 2/2] Use string over a function --- frontend/stores/CollectionsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/stores/CollectionsStore.js b/frontend/stores/CollectionsStore.js index a973c958d..6b5d2d997 100644 --- a/frontend/stores/CollectionsStore.js +++ b/frontend/stores/CollectionsStore.js @@ -49,7 +49,7 @@ class CollectionsStore { } @computed get orderedData(): Collection[] { - return _.sortBy(this.data, collection => collection.name); + return _.sortBy(this.data, 'name'); } /**