Description
Hi Team,
This customer is using WSO2 API Manager 4.6.0 and noticed that the API documents in the Dev Portal are not displayed in alphabetical order.
We also observed the same behaviour in our local setup. Please refer to the screenshots below.
- APIM 4.6.0
Here, we can see that the documents are categorised by type. However, within the same type, there is no alphabetical sorting observed.
Then we checked the code in WSO2 API Manager 4.6.0. It uses Material-UI’s component to render the document search/dropdown input. This file organises the documents using a two-step process:
- The Top-Level Order (Sorting by Category Type):
The options prop sorts the documents based on their type according to your hardcoded sequence (documentTypeOrder):
const documentTypeOrder = ['HOWTO', 'SAMPLES', 'PUBLIC_FORUM', 'SUPPORT_FORUM', 'OTHER'];
This means all "HOWTO" documents will always appear at the top of the dropdown list, followed by all "SAMPLES", and so on.
- Visual Grouping:
The groupBy prop tells the Autocomplete component to physically inject a visual category header dividing these sections based on localised labels (e.g., translating 'HOWTO' to its actual display name).
The Problem: There is no secondary sort applied to the actual document names (document.name). Within each category block, the documents will display in whatever random order they were sent by the server API.
In WSO2 API Manager 4.6.0, the document list retrieved via the /documents REST API does not include any inherent sorting in the response. A comparison of both responses confirms that sorting is not handled at the backend level.
Therefore, it appears that alphabetical sorting needs to be handled in the frontend layer. This behaviour should be addressed in APIM 4.6.0 to ensure consistency with the previous UI experience.
Steps to Reproduce
- Download APIM 4.6.0 and update it to the latest update level.
- Start the server and publish an API.
- Add multiple documents to the API with different document types. Ensure the document names start with different letters.
- Open the document dropdown list in the devportal UI. The documents are categorized by type, but the document names are not sorted in alphabetical order.
Version
APIM 4.6.0
Environment Details (with versions)
No response
Description
Hi Team,
This customer is using WSO2 API Manager 4.6.0 and noticed that the API documents in the Dev Portal are not displayed in alphabetical order.
We also observed the same behaviour in our local setup. Please refer to the screenshots below.
Here, we can see that the documents are categorised by type. However, within the same type, there is no alphabetical sorting observed.
Then we checked the code in WSO2 API Manager 4.6.0. It uses Material-UI’s component to render the document search/dropdown input. This file organises the documents using a two-step process:
The options prop sorts the documents based on their type according to your hardcoded sequence (documentTypeOrder):
This means all "HOWTO" documents will always appear at the top of the dropdown list, followed by all "SAMPLES", and so on.
The groupBy prop tells the Autocomplete component to physically inject a visual category header dividing these sections based on localised labels (e.g., translating 'HOWTO' to its actual display name).
The Problem: There is no secondary sort applied to the actual document names (document.name). Within each category block, the documents will display in whatever random order they were sent by the server API.
In WSO2 API Manager 4.6.0, the document list retrieved via the /documents REST API does not include any inherent sorting in the response. A comparison of both responses confirms that sorting is not handled at the backend level.
Therefore, it appears that alphabetical sorting needs to be handled in the frontend layer. This behaviour should be addressed in APIM 4.6.0 to ensure consistency with the previous UI experience.
Steps to Reproduce
Version
APIM 4.6.0
Environment Details (with versions)
No response