diff --git a/src/packages/shared-types/opensearch/main/transforms/new-submission.ts b/src/packages/shared-types/opensearch/main/transforms/new-submission.ts
index 7c85bf57ed..cfcea05744 100644
--- a/src/packages/shared-types/opensearch/main/transforms/new-submission.ts
+++ b/src/packages/shared-types/opensearch/main/transforms/new-submission.ts
@@ -54,9 +54,10 @@ export const transform = (id: string) => {
changedDate: getDateStringOrNullFromEpoc(data.changedDate),
subject: null,
description: null,
- makoChangedDate: !!data.timestamp
- ? new Date(data.timestamp).toISOString()
- : null,
+ makoChangedDate:
+ typeof data.timestamp === "number"
+ ? new Date(data.timestamp).toISOString()
+ : null,
// ----------
};
} else {
@@ -72,9 +73,10 @@ export const transform = (id: string) => {
submitterName:
data.submitterName === "-- --" ? null : data.submitterName,
origin: "OneMAC",
- makoChangedDate: !!data.timestamp
- ? new Date(data.timestamp).toISOString()
- : null,
+ makoChangedDate:
+ typeof data.timestamp === "number"
+ ? new Date(data.timestamp).toISOString()
+ : null,
};
}
});
diff --git a/src/packages/shared-types/opensearch/main/transforms/remove-appk-child.ts b/src/packages/shared-types/opensearch/main/transforms/remove-appk-child.ts
index f71b91dcc7..6556688a92 100644
--- a/src/packages/shared-types/opensearch/main/transforms/remove-appk-child.ts
+++ b/src/packages/shared-types/opensearch/main/transforms/remove-appk-child.ts
@@ -5,7 +5,8 @@ export const transform = (id: string) => {
return {
id,
appkParentId: null,
- makoChangedDate: !!data.timestamp
+ appkParent: true,
+ makoChangedDate: data.timestamp
? new Date(data.timestamp).toISOString()
: null,
};
diff --git a/src/services/ui/src/features/package/index.tsx b/src/services/ui/src/features/package/index.tsx
index b85b122777..779990fd0a 100644
--- a/src/services/ui/src/features/package/index.tsx
+++ b/src/services/ui/src/features/package/index.tsx
@@ -35,21 +35,6 @@ export const DetailsContent: FC<{ id: string }> = ({ id }) => {
if (isLoading) return
Removed from:
{props.appkParentId} diff --git a/src/services/ui/src/features/package/package-details/index.tsx b/src/services/ui/src/features/package/package-details/index.tsx index 80e5ed1e19..f2d0c99797 100644 --- a/src/services/ui/src/features/package/package-details/index.tsx +++ b/src/services/ui/src/features/package/package-details/index.tsx @@ -6,13 +6,14 @@ import { submissionDetails, } from "./hooks"; -import { FC } from "react"; +import { FC, useMemo } from "react"; import { DetailSectionItem } from "./hooks"; import { useGetUser } from "@/api/useGetUser"; import { AppK } from "./appk"; import { cn } from "@/utils"; -import { usePackageDetailsCache } from ".."; +import { Authority } from "shared-types"; +import { ItemResult } from "shared-types/opensearch/main"; export const DetailItemsGrid: FC<{ displayItems: DetailSectionItem[]; @@ -41,24 +42,39 @@ export const DetailItemsGrid: FC<{ ); }; -export const PackageDetails: FC<{ - title: string; -}> = (props) => { - const { data } = usePackageDetailsCache(); +type PackageDetailsProps = { + itemResult: ItemResult; +}; + +export const PackageDetails = ({ itemResult }: PackageDetailsProps) => { + const title = useMemo(() => { + const { _source: source } = itemResult; + + switch (source.authority) { + case Authority["1915b"]: + case Authority["1915c"]: + case undefined: // Some TEs have no authority + if (source.appkParent) return "1915(c) Appendix K Package Details"; + if (source.actionType == "Extend") + return "Temporary Extension Request Details"; + } + + return `${source.authority} Package Details`; + }, [itemResult]); return ( -