You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2022/12/19 23:35:07 UTC

[camel-karavan] branch main updated: Clear deployment status in UI

This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new 4ef7bfe  Clear deployment status in UI
4ef7bfe is described below

commit 4ef7bfef501f44774207d7956e1fed28eb6f6b94
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Mon Dec 19 18:35:01 2022 -0500

    Clear deployment status in UI
---
 karavan-app/src/main/webui/src/api/KaravanApi.tsx       | 4 +++-
 karavan-app/src/main/webui/src/projects/ProjectInfo.tsx | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/karavan-app/src/main/webui/src/api/KaravanApi.tsx b/karavan-app/src/main/webui/src/api/KaravanApi.tsx
index 230fd6b..3015400 100644
--- a/karavan-app/src/main/webui/src/api/KaravanApi.tsx
+++ b/karavan-app/src/main/webui/src/api/KaravanApi.tsx
@@ -167,11 +167,13 @@ export class KaravanApi {
         });
     }
 
-    static async getProjectDeploymentStatus(projectId: string, env: string, after: (status: DeploymentStatus) => void) {
+    static async getProjectDeploymentStatus(projectId: string, env: string, after: (status?: DeploymentStatus) => void) {
         instance.get('/api/status/deployment/' + projectId + "/" + env)
             .then(res => {
                 if (res.status === 200) {
                     after(res.data);
+                } else if (res.status === 204){
+                    after(undefined);
                 }
             }).catch(err => {
             console.log(err);
diff --git a/karavan-app/src/main/webui/src/projects/ProjectInfo.tsx b/karavan-app/src/main/webui/src/projects/ProjectInfo.tsx
index 49bf1db..15dfa65 100644
--- a/karavan-app/src/main/webui/src/projects/ProjectInfo.tsx
+++ b/karavan-app/src/main/webui/src/projects/ProjectInfo.tsx
@@ -83,7 +83,7 @@ export class ProjectInfo extends React.Component<Props, State> {
                 this.setState({pipelineStatus: status});
                 // console.log(status);
             });
-            KaravanApi.getProjectDeploymentStatus(projectId, environment, (status: DeploymentStatus) => {
+            KaravanApi.getProjectDeploymentStatus(projectId, environment, (status?: DeploymentStatus) => {
                 this.setState({deploymentStatus: status});
                 // console.log(status);
             });
@@ -228,7 +228,7 @@ export class ProjectInfo extends React.Component<Props, State> {
                             </Tooltip>
                         }
                     </LabelGroup>}
-                    {!deploymentStatus && <Label icon={<DownIcon/>} color={"grey"}>No deployments</Label>}
+                    {deploymentStatus === undefined && <Label icon={<DownIcon/>} color={"grey"}>No deployments</Label>}
                 </FlexItem>
                 <FlexItem>{env === "dev" && this.deleteDeploymentButton(env)}</FlexItem>
             </Flex>