Skip to content
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

ASSETS-34548 : Update the Collection API Endpoints #39

Merged
merged 20 commits into from
Mar 14, 2024
Merged

Conversation

TyroneAEM
Copy link
Collaborator

@TyroneAEM TyroneAEM commented Feb 23, 2024

JIRA : ASSETS-34548

  • Updated Collection API Endpoints to the ones in https://adobe-aem-assets-delivery-experimental.redoc.ly/#operation/getAllCollections
  • Updated following functions in collections.js : getCollection, createCollection, patchCollection, deleteCollection.
  • Replaced the function listCollection with searchListCollection which does not use the List All Collection API as that has not completed yet, instead the Search Collection API endpoint is used instead.
  • Updated adp-add-to-collection-modal.js that is used to create new collections, and add assets to a existing collection.
  • Updated adp-collection-header.js which is used to for the Collection Header.
  • Updated CollectionDatasource.js which is used to display the cards for all the existing Collections
  • Updated the file admin-config.xlsx and added the property searchCollectionIndex, which is used in the Search Collection API.

Test URLs:

Before: https://main--adobe-gmo--hlxsites.hlx.page/
After: https://assets-34548--adobe-gmo--hlxsites.hlx.page/qa/assets

…1-347a-4c50-a55b-aad555671b22

which is a collection that was created with the new api to create a collection
https://adobe-aem-assets-delivery-experimental.redoc.ly/#operation/createCollection

Once the List All Collections API is working can this code be updated to be completed
…ollection(limit = undefined, page = 0)

Pagination in files
/adobe-gmo/blocks/adp-infinite-results-collections/CollectionsDatasource.js

Needs to be fixed as not all the new Collections are showing up
…gination for the Collection Cards needs to be fixed

/scripts/collections.js :  Tested that the getCollection method only works with the new Collections created with the Create and Update Collection API calls  /adobe/assets/collections/{collectionId}/
…d in the header in the new Assets Delete API
…onsUrl()}/${collectionId} to ${getBaseAssetsCollectionsUrl()}/${collectionId}/items
…it = undefined, page = 0), added logic when the parameter page = null

to not add the page parameter in the data / body parameters

/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js : Removed hard coded getCollection('urn:cid:aem:8f67c491-347a-4c50-a55b-aad555671b22') call to call the selected collection for add to an existing collection.
…host

/scripts/collections.js : Removed deprecated listCollection function
/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js : Removed all the commented out old code that called listCollections
/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js : Removed all the commented out old code that called listCollections
…file admin-config.json

which is stored in a new property searchCollectionIndex e.g.
        {
            "ID": "searchCollectionIndex",
            "Value": "108396-1046543_collections"
        }
…them in the Collection dropdown list.

Deleted the  dropdownSelect.addEventListener('scroll' .... as the <select> tag does not support the scroll event
Copy link

aem-code-sync bot commented Feb 23, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Feb 23, 2024

Page Scores Audits Google
/qa/assets PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@TyroneAEM TyroneAEM self-assigned this Feb 23, 2024
Copy link
Collaborator

@mathieu-lessard mathieu-lessard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some suggestions. I'm unsure how to test the patchCollection portion of the code. I'm unfamiliar with the APIs being used and seeing collectionData.collectionMetadata.title without ?. makes me nervous.

Overall looks good to me.

scripts/collections.js Outdated Show resolved Hide resolved
scripts/collections.js Show resolved Hide resolved
@jwtnewbie
Copy link

JIRA : ASSETS-34548

  • Updated Collection API Endpoints to the ones in https://adobe-aem-assets-delivery-experimental.redoc.ly/#operation/getAllCollections
  • Updated following functions in collections.js : getCollection, createCollection, patchCollection, deleteCollection.
  • Replaced the function listCollection with searchListCollection which does not use the List All Collection API as that has not completed yet, instead the Search Collection API endpoint is used instead.
  • Updated adp-add-to-collection-modal.js that is used to create new collections, and add assets to a existing collection.
  • Updated adp-collection-header.js which is used to for the Collection Header.
  • Updated CollectionDatasource.js which is used to display the cards for all the existing Collections
  • Updated the file admin-config.xlsx and added the property searchCollectionIndex, which is used in the Search Collection API.

Test URLs:

Before: https://main--adobe-gmo--hlxsites.hlx.page/ After: https://assets-34548--adobe-gmo--hlxsites.hlx.page/qa/assets

Authoring

Edit the file admin-config.xlsx

Then add the new property
searchCollectionIndex
and the value is the name of the index.
e.g. for QA the index name is 108396-1046543_collections

scripts/collections.js Outdated Show resolved Hide resolved
scripts/collections.js Show resolved Hide resolved
scripts/collections.js Outdated Show resolved Hide resolved
@shiv-gup shiv-gup merged commit 94b1229 into main Mar 14, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants