Skip to content

Commit

Permalink
fix(OY2-25752): os export hide columns (#443)
Browse files Browse the repository at this point in the history
* fix(OY2-25752): os export hide columns

* feat(OY3): add rai withdraw enabled bool filter

* feat(appk): add form amendment title

---------

Co-authored-by: Mike Dial <[email protected]>
  • Loading branch information
pkim-gswell and mdial89f authored Mar 15, 2024
1 parent 54c76a2 commit 5c00dea
Show file tree
Hide file tree
Showing 26 changed files with 347 additions and 379 deletions.
5 changes: 3 additions & 2 deletions src/packages/shared-types/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { s3ParseUrl } from "shared-utils/s3-url-parser";
import { Authority } from "./authority";

export const attachmentTitleMap = (
authority: Authority
authority: Authority,
): Record<string, string> => ({
// SPA
cmsForm179: "CMS Form 179",
Expand Down Expand Up @@ -40,6 +40,7 @@ export const attachmentTitleMap = (
"1915(b)(4) FFS Selective Contracting (Streamlined) Waiver Application Pre-print",
b4IndependentAssessment:
"1915(b)(4) FFS Selective Contracting (Streamlined) Independent Assessment (first two renewals only)",
appk: "1915(c) Appendix K Amendment Waiver Template",
waiverExtensionRequest: "Waiver Extension Request",
});
export type AttachmentKey = keyof typeof attachmentTitleMap;
Expand All @@ -65,7 +66,7 @@ export const legacyAttachmentSchema = z.object({
export type LegacyAttachment = z.infer<typeof legacyAttachmentSchema>;

export function handleLegacyAttachment(
attachment: LegacyAttachment
attachment: LegacyAttachment,
): Attachment | null {
const parsedUrl = s3ParseUrl(attachment.url || "");
if (!parsedUrl) return null;
Expand Down
5 changes: 0 additions & 5 deletions src/packages/shared-types/opensearch/_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,4 @@ export type AggResult = Record<
}
>;

export type ExportHeaderOptions<TData> = {
transform: (data: TData) => string;
name: string;
};

export type Index = "main" | "insights" | "changelog" | "types" | "subtypes";
2 changes: 0 additions & 2 deletions src/packages/shared-types/opensearch/changelog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Filterable as FIL,
QueryState,
AggQuery,
ExportHeaderOptions,
} from "./../_";
import {
OneMac,
Expand Down Expand Up @@ -36,4 +35,3 @@ export type Field = keyof Document | `${keyof Document}.keyword`;
export type Filterable = FIL<Field>;
export type State = QueryState<Field>;
export type Aggs = AggQuery<Field>;
export type ExportHeader = ExportHeaderOptions<Document>;
2 changes: 0 additions & 2 deletions src/packages/shared-types/opensearch/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Filterable as FIL,
QueryState,
AggQuery,
ExportHeaderOptions,
} from "./../_";
import { z } from "zod";
import { ItemResult as Changelog } from "./../changelog";
Expand Down Expand Up @@ -38,6 +37,5 @@ export type Field = keyof Document | `${keyof Document}.keyword`;
export type Filterable = FIL<Field>;
export type State = QueryState<Field>;
export type Aggs = AggQuery<Field>;
export type ExportHeader = ExportHeaderOptions<Document>;

export * from "./transforms";
2 changes: 0 additions & 2 deletions src/packages/shared-types/opensearch/subtypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Filterable as FIL,
QueryState,
AggQuery,
ExportHeaderOptions,
} from "./../_";
import { z } from "zod";
import { Type } from "./transforms";
Expand All @@ -20,6 +19,5 @@ export type Field = keyof Document | `${keyof Document}.keyword`;
export type Filterable = FIL<Field>;
export type State = QueryState<Field>;
export type Aggs = AggQuery<Field>;
export type ExportHeader = ExportHeaderOptions<Document>;

export * from "./transforms";
2 changes: 0 additions & 2 deletions src/packages/shared-types/opensearch/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Filterable as FIL,
QueryState,
AggQuery,
ExportHeaderOptions,
} from "./../_";
import { z } from "zod";
import { SPA_Type } from "./transforms";
Expand All @@ -20,6 +19,5 @@ export type Field = keyof Document | `${keyof Document}.keyword`;
export type Filterable = FIL<Field>;
export type State = QueryState<Field>;
export type Aggs = AggQuery<Field>;
export type ExportHeader = ExportHeaderOptions<Document>;

export * from "./transforms";
13 changes: 13 additions & 0 deletions src/services/api/handlers/appkNewSubmission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ import { search } from "../../../libs/opensearch-lib";

export const submit = async (event: APIGatewayEvent) => {
// reject no body
/**
state: z.string(),
parentWaiver: zAppkWaiverNumberSchema,
childWaivers: z.array(zAppkWaiverNumberSchema),
additionalInformation: z.string().max(4000).optional(),
title: z.string(),
attachments: z.object({
appk: zAttachmentRequired({ min: 1 }),
other: zAttachmentRequired({ min: 1 }),
}),
proposedEffectiveDate: z.date(),
seaActionType: z.string().default("Amend"),
*/
if (!event.body) {
return response({
statusCode: 400,
Expand Down
78 changes: 0 additions & 78 deletions src/services/ui/src/components/ExportButton/index.tsx

This file was deleted.

11 changes: 11 additions & 0 deletions src/services/ui/src/components/Form/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ export const FormIntroText = () => (
</div>
);

export const FormIntroTextForAppK = () => (
<div>
<FormIntroText />
<strong className="bold">
If your Appendix K submission is for more than one waiver number, please
enter one of the applicable waiver numbers. You do not need to create
multiple submissions.
</strong>
</div>
);

export const SpaIdFormattingDesc = () => (
<>
<p className="text-gray-800 font-light">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ export const BOOL_INITIALINTAKENEEDED: DrawerFilterableGroup = {
value: null,
};

export const BOOL_RAIWITHDRAWENABLED: DrawerFilterableGroup = {
label: "RAI Withdraw Enabled",
field: "raiWithdrawEnabled",
component: "boolean",
prefix: "must",
type: "match",
value: null,
};

export const CHECK_ACTIONTYPE: DrawerFilterableGroup = {
label: "Action Type",
field: "actionType.keyword",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const useFilterState = () => {
...(!!user?.isCms && {
[C.BOOL_INITIALINTAKENEEDED.field]: C.BOOL_INITIALINTAKENEEDED,
}),
[C.BOOL_RAIWITHDRAWENABLED.field]: C.BOOL_RAIWITHDRAWENABLED,
[C.DATE_SUBMISSION.field]: C.DATE_SUBMISSION,
[C.DATE_RAIRECEIVED.field]: C.DATE_RAIRECEIVED,
[C.SELECT_CPOC.field]: C.SELECT_CPOC,
Expand All @@ -52,6 +53,7 @@ export const useFilterState = () => {
...(!!user?.isCms && {
[C.BOOL_INITIALINTAKENEEDED.field]: C.BOOL_INITIALINTAKENEEDED,
}),
[C.BOOL_RAIWITHDRAWENABLED.field]: C.BOOL_RAIWITHDRAWENABLED,
[C.DATE_SUBMISSION.field]: C.DATE_SUBMISSION,
[C.DATE_RAIRECEIVED.field]: C.DATE_RAIRECEIVED,
[C.SELECT_CPOC.field]: C.SELECT_CPOC,
Expand Down Expand Up @@ -147,15 +149,18 @@ export const useFilterDrawer = () => {
}, [url.state.filters, drawer.drawerOpen]);

const aggs = useMemo(() => {
return Object.entries(_aggs || {}).reduce((STATE, [KEY, AGG]) => {
return {
...STATE,
[KEY]: AGG.buckets.map((BUCK) => ({
label: `${labelMap[BUCK.key] || BUCK.key}`,
value: BUCK.key,
})),
};
}, {} as Record<opensearch.main.Field, { label: string; value: string }[]>);
return Object.entries(_aggs || {}).reduce(
(STATE, [KEY, AGG]) => {
return {
...STATE,
[KEY]: AGG.buckets.map((BUCK) => ({
label: `${labelMap[BUCK.key] || BUCK.key}`,
value: BUCK.key,
})),
};
},
{} as Record<opensearch.main.Field, { label: string; value: string }[]>
);
}, [_aggs]);

return {
Expand Down

This file was deleted.

Loading

0 comments on commit 5c00dea

Please sign in to comment.