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 2023/07/02 21:22:02 UTC

[camel-karavan] 02/03: Refactoring for file delete #809

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

commit 5aa07738aae6a0d037854b710724fd31536c12d6
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Sun Jul 2 14:25:31 2023 -0400

    Refactoring for file delete #809
---
 karavan-app/src/main/webui/src/project/ProjectPage.tsx           | 5 +++--
 karavan-app/src/main/webui/src/project/files/UploadFileModal.tsx | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/karavan-app/src/main/webui/src/project/ProjectPage.tsx b/karavan-app/src/main/webui/src/project/ProjectPage.tsx
index 2f2ac1c4..817b8980 100644
--- a/karavan-app/src/main/webui/src/project/ProjectPage.tsx
+++ b/karavan-app/src/main/webui/src/project/ProjectPage.tsx
@@ -90,13 +90,14 @@ export const ProjectPage = () => {
     const types = isBuildIn()
         ? (isKameletsProject() ? ['KAMELET'] : ['CODE', 'PROPERTIES'])
         : ProjectFileTypes.filter(p => !['PROPERTIES', 'LOG', 'KAMELET'].includes(p.name)).map(p => p.name);
+    const showFilePanel = file !== undefined && operation === 'select';
     return (
         <PageSection key={key} className="kamelet-section project-page" padding={{default: 'noPadding'}}>
             <PageSection className="tools-section" padding={{default: 'noPadding'}}>
                 <MainToolbar title={<ProjectTitle/>} tools={tools()}/>
             </PageSection>
-            {file === undefined && operation !== 'select' && <ProjectPanel/>}
-            {file !== undefined && operation === 'select' && <FileEditor/>}
+            {showFilePanel && <FileEditor/>}
+            {!showFilePanel && <ProjectPanel/>}
             <ProjectLogPanel/>
         </PageSection>
     )
diff --git a/karavan-app/src/main/webui/src/project/files/UploadFileModal.tsx b/karavan-app/src/main/webui/src/project/files/UploadFileModal.tsx
index d4a067d3..cc5779eb 100644
--- a/karavan-app/src/main/webui/src/project/files/UploadFileModal.tsx
+++ b/karavan-app/src/main/webui/src/project/files/UploadFileModal.tsx
@@ -55,7 +55,7 @@ export class UploadFileModal extends React.Component<Props, State> {
     };
 
     closeModal = () => {
-        useFileStore.setState({operation:"none", file: undefined});
+        useFileStore.setState({operation:"none"});
     }
 
     saveAndCloseModal = () => {