diff --git a/portals/devportal/src/main/webapp/site/public/locales/en.json b/portals/devportal/src/main/webapp/site/public/locales/en.json index 384de1abbb7..caa0c72675d 100644 --- a/portals/devportal/src/main/webapp/site/public/locales/en.json +++ b/portals/devportal/src/main/webapp/site/public/locales/en.json @@ -205,9 +205,9 @@ "Apis.Details.Documents.Documentation.title": "API Documentation", "Apis.Details.Documents.Documentation.type.api.msg.format": "API_MESSAGE_FORMAT", "Apis.Details.Documents.Documentation.type.how.to": "HOWTO", - "Apis.Details.Documents.Documentation.type.other": "Other", + "Apis.Details.Documents.Documentation.type.other": "OTHER", "Apis.Details.Documents.Documentation.type.public.forum": "PUBLIC_FORUM", - "Apis.Details.Documents.Documentation.type.samples": "Samples", + "Apis.Details.Documents.Documentation.type.samples": "SAMPLES", "Apis.Details.Documents.Documentation.type.support.forum": "SUPPORT_FORUM", "Apis.Details.Documents.Documentation.type.swagger.doc": "SWAGGER_DOC", "Apis.Details.Documents.View.btn.download": "Download", diff --git a/portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/Documents/DocList.jsx b/portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/Documents/DocList.jsx index 9c2b5316f0a..7c8274f2e5d 100644 --- a/portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/Documents/DocList.jsx +++ b/portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/Documents/DocList.jsx @@ -234,6 +234,9 @@ function DocList(props) { const { documentList, apiId, selectedDoc, setbreadcrumbDocument, intl, } = props; + + const documentTypeOrder = ['HOWTO', 'SAMPLES', 'PUBLIC_FORUM', 'SUPPORT_FORUM', 'OTHER']; + const documentTypes = { HOWTO: intl.formatMessage({ id: 'Apis.Details.Documents.Documentation.type.how.to', @@ -241,7 +244,7 @@ function DocList(props) { }), SAMPLES: intl.formatMessage({ id: 'Apis.Details.Documents.Documentation.type.samples', - defaultMessage: 'Samples', + defaultMessage: 'SAMPLES', }), PUBLIC_FORUM: intl.formatMessage({ id: 'Apis.Details.Documents.Documentation.type.public.forum', @@ -261,7 +264,7 @@ function DocList(props) { }), OTHER: intl.formatMessage({ id: 'Apis.Details.Documents.Documentation.type.other', - defaultMessage: 'Other', + defaultMessage: 'OTHER', }), }; @@ -289,7 +292,13 @@ function DocList(props) { value={selectedDoc} id='document-autocomplete' className={classes.autocomplete} - options={documentList.sort((a, b) => -b.type.localeCompare(a.type))} + options={documentList.sort((a, b) => { + const getOrder = (type) => { + const order = documentTypeOrder.indexOf(type); + return order === -1 ? -1 : order; + }; + return getOrder(a.type) - getOrder(b.type); + })} groupBy={(document) => { if (document.type in documentTypes) { return documentTypes[document.type];