Skip to content

Commit

Permalink
Merge pull request #66 from NASA-PDS/features/featured-link-component…
Browse files Browse the repository at this point in the history
…-facility

Add More Search Result Types To Featured Link Details
  • Loading branch information
eddiesarevalo authored Oct 7, 2024
2 parents 57b1bd4 + 7035f9f commit 5bd173a
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion src/components/FeaturedLinkDetails/FeaturedLinkDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ export enum FeaturedLinkDetailsVariant {
DATA_BUNDLE = "data-bundle",
DATA_COLLECTION = "data-collection",
DATA_SET = "data-set",
FACILITY = "facility",
INSTRUMENT = "instrument",
INSTRUMENT_HOST = "instrument-host",
INVESTIGATION = "investigation",
RESOURCE = "resoruce",
TARGET = "target",
TOOL = "tool",
TELESCOPE = "telescope",
TOOL = "tool"
}

type FeaturedLinkDetailData = {
Expand Down Expand Up @@ -133,6 +136,14 @@ export type FeaturedLinkDataSetDetailsProps = FeaturedLinkDetailsBaseProps & {
variant:FeaturedLinkDetailsVariant.DATA_SET;
}

export type FeaturedLinkFacilityDetailsProps = FeaturedLinkDetailsBaseProps & {
country: FeaturedLinkDetailData;
lid: FeaturedLinkDetailData;
telescopes: Array<string>;
type: FeaturedLinkDetailData;
variant: FeaturedLinkDetailsVariant.FACILITY;
}

export type FeaturedLinkInstrumentDetailsProps = FeaturedLinkDetailsBaseProps & {
instrumentType:Array<string>;
investigation:FeaturedLinkDetailData;
Expand All @@ -142,6 +153,15 @@ export type FeaturedLinkInstrumentDetailsProps = FeaturedLinkDetailsBaseProps &
variant:FeaturedLinkDetailsVariant.INSTRUMENT;
}

export type FeaturedLinkInstrumentHostDetailsProps =
FeaturedLinkDetailsBaseProps & {
investigation: FeaturedLinkDetailData;
instruments: Array<string>;
lid: FeaturedLinkDetailData;
variant: FeaturedLinkDetailsVariant.INSTRUMENT_HOST;
};


export type FeaturedLinkInvestigationDetailsProps = FeaturedLinkDetailsBaseProps & {
instrumentHostTitles:Array<string>;
lid:FeaturedLinkDetailData;
Expand All @@ -164,6 +184,13 @@ export type FeaturedLinkTargetDetailsProps = FeaturedLinkDetailsBaseProps & {
variant:FeaturedLinkDetailsVariant.TARGET;
}

export type FeaturedLinkTelescopeDetailsProps = FeaturedLinkDetailsBaseProps & {
facility: FeaturedLinkDetailData;
instruments: Array<string>;
lid: FeaturedLinkDetailData;
variant: FeaturedLinkDetailsVariant.TELESCOPE;
};

export type FeaturedLinkToolDetailsProps = FeaturedLinkDetailsBaseProps & {
categories:Array<string>;
support:FeaturedLinkDetailData;
Expand All @@ -177,10 +204,13 @@ export type FeaturedLinkDetailsProps = (
| FeaturedLinkDataBundleDetailsProps
| FeaturedLinkDataCollectionDetailsProps
| FeaturedLinkDataSetDetailsProps
| FeaturedLinkFacilityDetailsProps
| FeaturedLinkInstrumentDetailsProps
| FeaturedLinkInstrumentHostDetailsProps
| FeaturedLinkInvestigationDetailsProps
| FeaturedLinkResourceDetailProps
| FeaturedLinkTargetDetailsProps
| FeaturedLinkTelescopeDetailsProps
| FeaturedLinkToolDetailsProps
);

Expand Down Expand Up @@ -252,6 +282,14 @@ export const FeaturedLinkDetails = (props:FeaturedLinkDetailsProps) => {
<DetailRow label={"Target"} value={props.target.value} link={props.target.link} />
</>
}
{
props.variant === FeaturedLinkDetailsVariant.FACILITY && <>
<DetailRow label={"Identifier"} value={props.lid.value} link={props.lid.link} />
<DetailRow label={"Type"} value={props.type.value} link={props.type.link} />
<DetailRow label={"Country"} value={props.country.value} link={props.country.link} />
<DetailRow label={"Telescopes"} value={props.telescopes.join(",")} />
</>
}
{
props.variant === FeaturedLinkDetailsVariant.INSTRUMENT && <>
<DetailRow label={"Investigation"} value={props.investigation.value} link={props.investigation.link} />
Expand All @@ -261,6 +299,13 @@ export const FeaturedLinkDetails = (props:FeaturedLinkDetailsProps) => {
<DetailRow label={"Stop Date"} value={props.stopDate.value} link={props.stopDate.link} />
</>
}
{
props.variant === FeaturedLinkDetailsVariant.INSTRUMENT_HOST && <>
<DetailRow label={"Identifier"} value={props.lid.value} link={props.lid.link} />
<DetailRow label={"Investigation"} value={props.investigation.value} link={props.investigation.link} />
<DetailRow label={"Instruments"} value={props.instruments.join(",")} />
</>
}
{
props.variant === FeaturedLinkDetailsVariant.INVESTIGATION && <>
<DetailRow label={"Identifier"} value={props.lid.value} link={props.lid.link} />
Expand All @@ -284,6 +329,13 @@ export const FeaturedLinkDetails = (props:FeaturedLinkDetailsProps) => {
<DetailRow label={"Type"} value={props.targetType.join(", ")} />
</>
}
{
props.variant === FeaturedLinkDetailsVariant.TELESCOPE && <>
<DetailRow label={"Identifier"} value={props.lid.value} link={props.lid.link} />
<DetailRow label={"Instruments"} value={props.instruments.join(", ")} />
<DetailRow label={"Facility"} value={props.facility.value} link={props.facility.link} />
</>
}
{
props.variant === FeaturedLinkDetailsVariant.TOOL && <>
<DetailRow label={"URL"} value={props.url.value} link={props.url.link} />
Expand Down

0 comments on commit 5bd173a

Please sign in to comment.