Skip to content

Commit

Permalink
chore: fixing packs deprecated logic (#1732)
Browse files Browse the repository at this point in the history
* chore: fixing packs deprecated logic

* chore: fixed logic

* chore: minor field fix

* chore: added prod status in test

* chore: removed debugger statement

(cherry picked from commit 97b3227)
  • Loading branch information
karl-cardenas-coding committed Nov 1, 2023
1 parent cc906cc commit 590af7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/PacksTable/PackTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("FilteredTable Tests", () => {
cloudTypesFormatted: "edge-native",
version: "0.1.0",
status: "deprecated",
prodStatus: "deprecated",
packCreateDate: "2022-09-13",
packLastModifiedDate: "2022-09-15",
timeLastUpdated: "11 months",
Expand All @@ -30,6 +31,7 @@ describe("FilteredTable Tests", () => {
cloudTypesFormatted: "eks",
version: "1.0.0",
status: "deprecated",
prodStatus: "deprecated",
packCreateDate: "2021-04-21",
packLastModifiedDate: "2021-05-07",
timeLastUpdated: "2 years",
Expand Down
6 changes: 5 additions & 1 deletion src/components/PacksTable/PacksTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type Pack = {
cloudTypesFormatted: string;
version: string;
status: string;
prodStatus: string;
inProduction: string;
packCreateDate: string;
packLastModifiedDate: string;
timeLastUpdated: string;
Expand Down Expand Up @@ -101,7 +103,9 @@ const FilteredTable: React.FC = () => {
fetch("/packs-data/packs_report.json")
.then((response) => response.json())
.then((packData: PacksData) => {
const deprecatedPackData = packData.Packs.filter((pack) => pack.status !== "active");
const deprecatedPackData = packData.Packs.filter((pack) => {
return pack.prodStatus !== "active" && pack.prodStatus !== "unknown"
});
setDeprecatedPacks(deprecatedPackData);
setLoading(false);
})
Expand Down

0 comments on commit 590af7f

Please sign in to comment.