Skip to content

Commit

Permalink
fix(sub source): Display submission source as OneMAC for legacy and m…
Browse files Browse the repository at this point in the history
…icro, blank for all else (#282)

* fix(sub source):  Display submission source as OneMAC for legacy and mako records, blank for all else

* Add submission source to filters
  • Loading branch information
mdial89f authored Dec 31, 2023
1 parent 58ac10a commit b0b61f8
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/packages/shared-types/onemac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const transformOnemac = (id: string) => {
additionalInformation: data.additionalInformation,
submitterEmail: data.submitterEmail,
submitterName: data.submitterName === "-- --" ? null : data.submitterName,
origin: "OneMAC",
rais: {} as {
[key: number]: {
requestedDate?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/shared-types/onemacLegacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const transformOnemacLegacy = (id: string) => {
additionalInformation: data.additionalInformation,
submitterEmail: data.submitterEmail,
submitterName: data.submitterName === "-- --" ? null : data.submitterName,
origin: "oneMAC",
origin: "OneMAC",
rais: {} as {
[key: number]: {
requestedDate?: string;
Expand Down
16 changes: 16 additions & 0 deletions src/services/ui/src/components/Opensearch/Filtering/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ const SPA_FILTER_GROUP = (isCms: boolean): FilterGroup => {
type: "terms",
value: [],
},
"origin.keyword": {
label: "Submission Source",
field: "origin.keyword",
component: "multiSelect",
prefix: "must",
type: "terms",
value: [],
},
};
};

Expand Down Expand Up @@ -129,6 +137,14 @@ const WAIVER_FILTER_GROUP = (isCms: boolean): FilterGroup => {
type: "terms",
value: [],
},
"origin.keyword": {
label: "Submission Source",
field: "origin.keyword",
component: "multiSelect",
prefix: "must",
type: "terms",
value: [],
},
};
};

Expand Down
6 changes: 6 additions & 0 deletions src/services/ui/src/components/Opensearch/useOpensearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ export const useOsAggregate = () => {
type: "terms",
size: 1000,
},
{
field: "origin.keyword",
name: "origin.keyword",
type: "terms",
size: 10,
},
],
filters: DEFAULT_FILTERS[props.queryKey[0]].filters || [],
pagination: { number: 0, size: 1 },
Expand Down
3 changes: 0 additions & 3 deletions src/services/ui/src/pages/dashboard/Lists/spas/consts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ export const useSpaTableColumns = (): OsTableColumn[] => {
label: "Submission Source",
visible: false,
cell: (data) => {
if (data.origin?.toLowerCase() === "onemac") {
return "OneMAC";
}
return data.origin;
},
},
Expand Down
3 changes: 0 additions & 3 deletions src/services/ui/src/pages/dashboard/Lists/waivers/consts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ export const useWaiverTableColumns = (): OsTableColumn[] => {
label: "Submission Source",
visible: false,
cell: (data) => {
if (data.origin?.toLowerCase() === "onemac") {
return "OneMAC";
}
return data.origin;
},
},
Expand Down
6 changes: 1 addition & 5 deletions src/services/ui/src/pages/detail/setup/spa.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ export const submissionDetails = (
},
{
label: "Submission Source",
value: (
<p className="text-lg">
{data?.origin?.toLowerCase() === "onemac" ? "OneMAC" : BLANK_VALUE}
</p>
),
value: <p className="text-lg">{data?.origin || BLANK_VALUE}</p>,
canView: () => true,
},
{
Expand Down

0 comments on commit b0b61f8

Please sign in to comment.