diff --git a/application/frontend/src/pages/CommonRequirementEnumeration/CommonRequirementEnumeration.tsx b/application/frontend/src/pages/CommonRequirementEnumeration/CommonRequirementEnumeration.tsx index faa63e68a..17715d108 100644 --- a/application/frontend/src/pages/CommonRequirementEnumeration/CommonRequirementEnumeration.tsx +++ b/application/frontend/src/pages/CommonRequirementEnumeration/CommonRequirementEnumeration.tsx @@ -85,7 +85,7 @@ export const CommonRequirementEnumeration = () => { {getDocumentDisplayName(display)} {DOCUMENT_TYPE_NAMES[type]}: - {links.map((link, i) => ( + {links.sort((a, b) => getDocumentDisplayName(a.document).localeCompare(getDocumentDisplayName(b.document))).map((link, i) => (
diff --git a/application/frontend/src/pages/Search/components/SearchResults.tsx b/application/frontend/src/pages/Search/components/SearchResults.tsx index 34a4efa18..a618da28c 100644 --- a/application/frontend/src/pages/Search/components/SearchResults.tsx +++ b/application/frontend/src/pages/Search/components/SearchResults.tsx @@ -1,12 +1,13 @@ import React from 'react'; import { DocumentNode } from '../../../components/DocumentNode'; +import { getDocumentDisplayName } from 'application/frontend/src/utils/document'; export const SearchResults = ({ results }) => { if (results && results.length != 0) { return ( <> - {results.map((document, i) => ( + {results.sort((a, b) => getDocumentDisplayName(a).localeCompare(getDocumentDisplayName(b))).map((document, i) => (
diff --git a/application/frontend/src/pages/Standard/Standard.tsx b/application/frontend/src/pages/Standard/Standard.tsx index 6d8afab67..34ab3fa95 100644 --- a/application/frontend/src/pages/Standard/Standard.tsx +++ b/application/frontend/src/pages/Standard/Standard.tsx @@ -9,6 +9,7 @@ import { DocumentNode } from '../../components/DocumentNode'; import { LoadingAndErrorIndicator } from '../../components/LoadingAndErrorIndicator'; import { useEnvironment } from '../../hooks'; import { Document } from '../../types'; +import { getDocumentDisplayName } from '../../utils/document'; export const Standard = () => { let { type, id } = useParams(); @@ -44,7 +45,7 @@ export const Standard = () => { {!loading && !error && - documents.map((standard, i) => ( + documents.sort((a, b) => getDocumentDisplayName(a).localeCompare(getDocumentDisplayName(b))).map((standard, i) => (
diff --git a/application/frontend/src/pages/Standard/StandardSection.tsx b/application/frontend/src/pages/Standard/StandardSection.tsx index aef1cb001..71a0e8b9b 100644 --- a/application/frontend/src/pages/Standard/StandardSection.tsx +++ b/application/frontend/src/pages/Standard/StandardSection.tsx @@ -85,7 +85,7 @@ export const StandardSection = () => { {getDocumentDisplayName(document)} {DOCUMENT_TYPE_NAMES[type]}:
- {links.map((link, i) => ( + {links.sort((a, b) => getDocumentDisplayName(a.document).localeCompare(getDocumentDisplayName(b.document))).map((link, i) => (