Browse Source

Fixed filtering on deployments

jnfrati 4 years ago
parent
commit
bfce51f8d6

+ 7 - 3
dashboard/src/main/home/cluster-dashboard/preview-environments/deployments/DeploymentList.tsx

@@ -16,7 +16,7 @@ import PullRequestCard from "./PullRequestCard";
 
 
 const AvailableStatusFilters = [
 const AvailableStatusFilters = [
   "all",
   "all",
-  "creating",
+  "created",
   "failed",
   "failed",
   "active",
   "active",
   "inactive",
   "inactive",
@@ -169,6 +169,10 @@ const DeploymentList = ({ environments }: { environments: Environment[] }) => {
   }, [selectedRepo, statusSelectorVal, deploymentList]);
   }, [selectedRepo, statusSelectorVal, deploymentList]);
 
 
   const filteredPullRequests = useMemo(() => {
   const filteredPullRequests = useMemo(() => {
+    if (statusSelectorVal !== "not_deployed" && statusSelectorVal !== "all") {
+      return [];
+    }
+
     if (selectedRepo === "all") {
     if (selectedRepo === "all") {
       return pullRequests;
       return pullRequests;
     }
     }
@@ -274,8 +278,8 @@ const DeploymentList = ({ environments }: { environments: Environment[] }) => {
                   label: "Failed",
                   label: "Failed",
                 },
                 },
                 {
                 {
-                  value: "active",
-                  label: "Active",
+                  value: "created",
+                  label: "Created",
                 },
                 },
                 {
                 {
                   value: "inactive",
                   value: "inactive",