-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/get all collections directories #117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
if ( | ||
curr.type === 'dir' | ||
&& !ISOMER_TEMPLATE_DIRS.includes(curr.name) | ||
&& curr.name.slice(0, 1) === '_' | ||
) acc.push(curr.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove the underscore on the backend instead of the frontend, but I'm open to either option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved with 7f8b635. For consistency, we will abstract the _
character away from the frontend entirely, and the backend will be responsible for removing and appending the _
character
lgtm. Regarding underscore prefix, based on offline discussion we have decided that frontend will have no knowledge of underscore prefix, hence backend will handle any necessary prefixing and slicing. |
This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo.
This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection
7f8b635
to
b78ca35
Compare
* feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name * fix: use read route handler wrapper Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: create CollectionConfig which extends Config class, with methods for creating and deleting the collection.yml file * feat: updates Collection class to use CollectionConfig for create, delete and rename functions * fix: updates folders listAll route to use CollectionConfig * fix: adds more details to inline comment for .list() * feat: adds functions to support adding and removing item from CollectionConfig * fix: removes endpoint variable * fix: uses passed siteName variable instead of class variable * fix: destructures err response status * fix: allows Collection.create to take in optional orderArray * fix: rename config to collectionConfig in Collection for clarity * fix: updates Collection.rename to modify collectionName in collection.yml after git tree changes * fix: typo in variable names Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: add function for creating new collection page * feat: add route for creating new collection page * fix: updates createCollectionPage endpoint to use /new in endpoint url * feat: creates equivalent createPage endpoint for creating new unlinked pages * fix: updates authenticated endpoints on backend * fix: updates unlinkedPages to use Directory for .list() * fix: removes unused listUnlinkedPages route Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * fix: resolving merge conflicts * fix: restores comments that were accidentally deleted * fix: applies missing URI decoding to page routes * fix: updates CollectionConfig to return and accept spliced index * fix: updates renameCollectionPage to use updated CollectionConfig functions * fix: adds updateItemInOrder and read methods to CollectionConfig * fix: updates collectionPages route to use updated CollectionConfig methods * fix: changes updateItemInOrder to use single read and update API call * fix: removes unused imports Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: add moveResources API * fix: adds backend check for if resource categories exist prior to move * fix: update resourcePages routes to handle Base64 encoding on backend * fix: update moveResource route to work on single file only * Revert "fix: update moveResource route to work on single file only" This reverts commit 81b4786. * fix: typo in auth for resources route Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name * fix: use read route handler wrapper Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: create CollectionConfig which extends Config class, with methods for creating and deleting the collection.yml file * feat: updates Collection class to use CollectionConfig for create, delete and rename functions * fix: updates folders listAll route to use CollectionConfig * fix: adds more details to inline comment for .list() * feat: adds functions to support adding and removing item from CollectionConfig * fix: removes endpoint variable * fix: uses passed siteName variable instead of class variable * fix: destructures err response status * fix: allows Collection.create to take in optional orderArray * fix: rename config to collectionConfig in Collection for clarity * fix: updates Collection.rename to modify collectionName in collection.yml after git tree changes * fix: typo in variable names Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: add function for creating new collection page * feat: add route for creating new collection page * fix: updates createCollectionPage endpoint to use /new in endpoint url * feat: creates equivalent createPage endpoint for creating new unlinked pages * fix: updates authenticated endpoints on backend * fix: updates unlinkedPages to use Directory for .list() * fix: removes unused listUnlinkedPages route Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * fix: resolving merge conflicts * fix: restores comments that were accidentally deleted * fix: applies missing URI decoding to page routes * fix: updates CollectionConfig to return and accept spliced index * fix: updates renameCollectionPage to use updated CollectionConfig functions * fix: adds updateItemInOrder and read methods to CollectionConfig * fix: updates collectionPages route to use updated CollectionConfig methods * fix: changes updateItemInOrder to use single read and update API call * fix: removes unused imports Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
* Feat/get all collections directories (#117) * feat: add RootType Directory This commit adds a RootType to the Directory class so that we can retrieve directories from the root of a repo. * feat: new endpoint for retrieving information on all folders This commit introduces a new GET `/:siteName/folders/all` endpoint which: 1) gets the names of all collections/folders within the repo 2) gets the collection.yml directory config file for each collection * fix: remove _ before sending folder name Co-authored-by: jiehao <[email protected]> * feat: add moveResources API * fix: adds backend check for if resource categories exist prior to move * fix: update resourcePages routes to handle Base64 encoding on backend * fix: update moveResource route to work on single file only * Revert "fix: update moveResource route to work on single file only" This reverts commit 81b4786. * fix: typo in auth for resources route Co-authored-by: kwajiehao <[email protected]> Co-authored-by: jiehao <[email protected]>
Overview
Note: this PR is to be reviewed in conjunction with PR #362 on the frontend.
It adds a new GET
/:siteName/folders/all
endpoint which returns thecollection.yml
directory config file for all collections/folders in the requested repo.