Skip to content

Commit

Permalink
Merge pull request #112 from NASA-PDS/features/104-sort-spacecraft-on…
Browse files Browse the repository at this point in the history
…-investigations-directory-page

Sorted Spacecraft list alphabetically for each Investigation on the Investigation's directory page.
  • Loading branch information
anilnatha authored Nov 4, 2024
2 parents 26c7fda + a3073f8 commit 5004ea4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RootState, store } from "src/state/store";
import { convertLogicalIdentifier, LID_FORMAT } from "src/utils/strings";
import { ExpandMore } from "@mui/icons-material";
import { FeaturedLink, FeaturedLinkDetails, FeaturedLinkDetailsVariant, Typography } from "@nasapds/wds-react";
import { sortInstrumentHostsByTitle } from "src/utils/arrays";

type InvestigationsIndexedListComponentProps = {
investigations: Investigation[];
Expand All @@ -33,7 +34,7 @@ const getItemsByIndex = (
};

function getAffiliatedSpacecraft(state:RootState, investigation:Investigation) {
const instrumentHostTitles = selectLatestInstrumentHostsForInvestigation(state, investigation[PDS4_INFO_MODEL.REF_LID_INSTRUMENT_HOST])?.map(
const instrumentHostTitles = selectLatestInstrumentHostsForInvestigation(state, investigation[PDS4_INFO_MODEL.REF_LID_INSTRUMENT_HOST])?.sort(sortInstrumentHostsByTitle)?.map(
(instrumentHost) => instrumentHost[PDS4_INFO_MODEL.TITLE]
)
return instrumentHostTitles;
Expand Down

0 comments on commit 5004ea4

Please sign in to comment.