Skip to content

Commit

Permalink
Merge branch 'juliet' into juliet-james
Browse files Browse the repository at this point in the history
  • Loading branch information
jdinh8124 authored Apr 3, 2024
2 parents 36c6cf9 + 74b4ff6 commit b9be40a
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 39 deletions.
18 changes: 15 additions & 3 deletions src/services/api/handlers/packageActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ import {
import { produceMessage } from "../libs/kafka";
import { response } from "../libs/handler";
import { SEATOOL_STATUS } from "shared-types/statusHelper";
import { formatSeatoolDate, seaToolFriendlyTimestamp, getNextBusinessDayTimestamp } from "shared-utils";
import {
formatSeatoolDate,
seaToolFriendlyTimestamp,
getNextBusinessDayTimestamp,
} from "shared-utils";
import { buildStatusMemoQuery } from "../libs/statusMemo";

const TOPIC_NAME = process.env.topicName as string;
Expand Down Expand Up @@ -174,7 +178,7 @@ export async function withdrawRai(body: RaiWithdraw, document: any) {
...result.data,
actionType: Action.WITHDRAW_RAI,
notificationMetadata: {
submissionDate: getNextBusinessDayTimestamp()
submissionDate: getNextBusinessDayTimestamp(),
},
}),
);
Expand Down Expand Up @@ -279,7 +283,7 @@ export async function respondToRai(body: RaiResponse, document: any) {
responseDate: today,
actionType: Action.RESPOND_TO_RAI,
notificationMetadata: {
submissionDate: getNextBusinessDayTimestamp()
submissionDate: getNextBusinessDayTimestamp(),
},
}),
);
Expand Down Expand Up @@ -529,6 +533,14 @@ export async function updateId(body: any) {
WHERE ID_Number = '${body.id}';
`);

//Copy Action_Officers rows
await transaction.request().query(`
INSERT INTO Action_Officers (ID_Number, Officer_ID)
SELECT '${result.data.newId}', Officer_ID
FROM Action_Officers
WHERE ID_Number = '${body.id}';
`);

// Put Status Memo notes in the old package
await transaction.request().query(`
UPDATE SEA.dbo.State_Plan
Expand Down
4 changes: 2 additions & 2 deletions src/services/api/libs/package/appk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { opensearch } from "shared-types";

export const getAppkChildren = async (
packageId: string,
filter: any[] = []
filter: any[] = [],
) => {
if (!process.env.osDomain) {
throw new Error("process.env.osDomain must be defined");
Expand All @@ -17,7 +17,7 @@ export const getAppkChildren = async (
must: [{ term: { "appkParentId.keyword": packageId } }].concat(filter),
},
},
})) as opensearch.changelog.Response;
})) as opensearch.main.Response;

return response;
};
40 changes: 14 additions & 26 deletions src/services/data/handlers/sinkMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,34 +172,22 @@ const onemac = async (kafkaRecords: KafkaRecord[], topicPartition: string) => {
item._source.actionType &&
item._source.actionType === "Extend"
) {
const seatoolStatus = SEATOOL_STATUS.TERMINATED;
const { stateStatus, cmsStatus } = getStatus(seatoolStatus);
docs.push(
{ ...item._source, id: record.newId },
{
id,
origin: null,
seatoolStatus,
cmsStatus,
stateStatus,
},
);
docs.push({ ...item._source, id: record.newId });
} else {
docs.push(
{
id: record.newId,
appkParentId: item._source.appkParentId,
origin: item._source.origin,
raiWithdrawEnabled: item._source.raiWithdrawEnabled,
submitterName: item._source.submitterName,
submitterEmail: item._source.submitterEmail,
},
{
id,
origin: null,
},
);
docs.push({
id: record.newId,
appkParentId: item._source.appkParentId,
origin: item._source.origin,
raiWithdrawEnabled: item._source.raiWithdrawEnabled,
submitterName: item._source.submitterName,
submitterEmail: item._source.submitterEmail,
});
}
// Delete old
docs.push({
id,
delete: true,
});

// Handle the appk children when an appk parent id is updated
// I'd like a better way to identify an appk parent.
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/src/components/BreadCrumb/BreadCrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const BreadCrumbBar = ({ children }: React.PropsWithChildren) => {
<nav
role="navigation"
aria-label="breadcrumbs for spa or waiver choices"
className="mt-4"
className="m-4"
>
<ul className="flex gap-1">{children}</ul>
</nav>
Expand Down
9 changes: 6 additions & 3 deletions src/services/ui/src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const TableRow = React.forwardRef<
<tr
ref={ref}
className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted text-sm",
className,
)}
{...props}
Expand All @@ -86,7 +86,7 @@ const TableHead = React.forwardRef<
<th
ref={ref}
className={cn(
"h-12 px-4 text-left font-semibold text-base text-muted-foreground [&:has([role=checkbox])]:pr-0 leading-5",
"px-4 pl-2 text-left font-semibold text-muted-foreground [&:has([role=checkbox])]:pr-0 leading-5",
className,
{ "cursor-pointer": !!props?.onClick },
)}
Expand Down Expand Up @@ -123,7 +123,10 @@ const TableCell = React.forwardRef<
>(({ className, ...props }, ref) => (
<td
ref={ref}
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
className={cn(
"px-2 py-3 text-left align-middle text-sm [&:has([role=checkbox])]:pr-0",
className,
)}
{...props}
/>
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
SubjectInput,
TypeSelect,
} from "../submission/shared-components";
import { unflatten } from "flat";

export const performIntakeSchema = z.object({
subject: z
Expand Down Expand Up @@ -65,7 +64,7 @@ export const PerformIntake = () => {

return (
<>
<SC.Heading title={"Perform Intake"} />
<SC.Heading title={"Complete Intake"} />
<SC.RequiredFieldDescription />
<SC.ActionDescription>
<p>
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/src/features/package/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const DetailsSidebar: FC<{ id: string }> = ({ id }) => {
const links = useDetailsSidebarLinks(id);

return (
<aside className="min-w-56 flex-none font-semibold m-4 mt-6 pr-8">
<aside className="min-w-56 flex-none font-semibold m-4 mt-6 pr-8 pl-4">
{links.map(({ id, href, displayName }) => (
<a className="block mb-2 text-blue-900" key={id} href={href}>
{displayName}
Expand Down
2 changes: 1 addition & 1 deletion src/services/ui/src/utils/labelMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const mapActionLabel = (a: Action) => {
);

if (performIntake && a === Action.PERFORM_INTAKE) {
return "Perform Intake";
return "Complete Intake";
}

switch (a) {
Expand Down

0 comments on commit b9be40a

Please sign in to comment.