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 d313abdc Properties for #885 d313abdc is described below commit d313abdc030013befc0d1de7fc4f95c011be3af9 Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Tue Sep 19 10:32:49 2023 -0400 Properties for #885 --- .../snippets/docker-application.properties | 2 +- .../snippets/kubernetes-application.properties | 2 +- .../snippets/openshift-application.properties | 2 +- .../src/main/webui/src/project/file/FileEditor.tsx | 2 +- .../webui/src/project/file/PropertiesPanel.tsx | 51 ++-------------------- .../webui/src/project/file/PropertiesTable.tsx | 11 +++-- 6 files changed, 13 insertions(+), 57 deletions(-) diff --git a/karavan-web/karavan-app/src/main/resources/snippets/docker-application.properties b/karavan-web/karavan-app/src/main/resources/snippets/docker-application.properties index 1917b819..e8256ea2 100644 --- a/karavan-web/karavan-app/src/main/resources/snippets/docker-application.properties +++ b/karavan-web/karavan-app/src/main/resources/snippets/docker-application.properties @@ -8,8 +8,8 @@ camel.jbang.dependencies=camel-console,camel-platform-http-main camel.server.enabled=true camel.server.healthCheckEnabled=true camel.server.devConsoleEnabled=true +camel.main.tracingStandby=true camel.context.dev-console=true -camel.main.beanIntrospectionExtendedStatistics=true camel.health.enabled=true camel.health.exposure-level=full jkube.version=1.14.0 diff --git a/karavan-web/karavan-app/src/main/resources/snippets/kubernetes-application.properties b/karavan-web/karavan-app/src/main/resources/snippets/kubernetes-application.properties index 1c091daf..458d3738 100644 --- a/karavan-web/karavan-app/src/main/resources/snippets/kubernetes-application.properties +++ b/karavan-web/karavan-app/src/main/resources/snippets/kubernetes-application.properties @@ -10,8 +10,8 @@ camel.health.exposure-level=full camel.server.enabled=true camel.server.healthCheckEnabled=true camel.server.devConsoleEnabled=true +camel.main.tracingStandby=true camel.context.dev-console=true -camel.main.beanIntrospectionExtendedStatistics=true label.runtime=app.kubernetes.io/runtime jib.from.image=gcr.io/distroless/java17@sha256:3a4ea21bd7b412b8b6ae61313b39337d8f03bb6844013810e8e4625d8c765edb jkube.version=1.14.0 diff --git a/karavan-web/karavan-app/src/main/resources/snippets/openshift-application.properties b/karavan-web/karavan-app/src/main/resources/snippets/openshift-application.properties index d7ec7986..a636a2e0 100644 --- a/karavan-web/karavan-app/src/main/resources/snippets/openshift-application.properties +++ b/karavan-web/karavan-app/src/main/resources/snippets/openshift-application.properties @@ -10,8 +10,8 @@ camel.health.exposure-level=full camel.server.enabled=true camel.server.healthCheckEnabled=true camel.server.devConsoleEnabled=true +camel.main.tracingStandby=true camel.context.dev-console=true -camel.main.beanIntrospectionExtendedStatistics=true label.runtime=app.openshift.io/runtime jib.from.image=gcr.io/distroless/java17@sha256:3a4ea21bd7b412b8b6ae61313b39337d8f03bb6844013810e8e4625d8c765edb jkube.version=1.14.0 diff --git a/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx b/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx index e323ca83..f8f941c3 100644 --- a/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx +++ b/karavan-web/karavan-app/src/main/webui/src/project/file/FileEditor.tsx @@ -88,7 +88,7 @@ export function FileEditor (props: Props) { const isIntegration = isYaml && file?.code && CamelDefinitionYaml.yamlIsIntegration(file.code); const isProperties = file !== undefined && file.name.endsWith("properties"); const showDesigner = isYaml && isIntegration; - const showEditor = !showDesigner; + const showEditor = !showDesigner && !isProperties; return ( <> {showDesigner && getDesigner()} diff --git a/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesPanel.tsx b/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesPanel.tsx index 2cd41770..ce4b1cf0 100644 --- a/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesPanel.tsx +++ b/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesPanel.tsx @@ -1,60 +1,17 @@ -import React, {useEffect} from 'react'; +import React from 'react'; import { - Badge, - Button, - Bullseye, - EmptyState, - EmptyStateVariant, - EmptyStateIcon, - PageSection, PanelHeader, Panel, Tooltip, Label, EmptyStateHeader, PanelMain, PanelMainBody, Flex, FlexItem, + PageSection, PanelHeader, Panel } from '@patternfly/react-core'; import '../../designer/karavan.css'; -import { - Tbody, - Td, - Th, - Thead, - Tr -} from '@patternfly/react-table'; -import { - Table -} from '@patternfly/react-table/deprecated'; -import DeleteIcon from "@patternfly/react-icons/dist/js/icons/times-icon"; -import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon'; -import {useFilesStore, useFileStore, useProjectStore} from "../../api/ProjectStore"; -import {getProjectFileType, ProjectFile, ProjectFileTypes} from "../../api/ProjectModels"; -import DownloadIcon from "@patternfly/react-icons/dist/esm/icons/download-icon"; -import FileSaver from "file-saver"; +import { useProjectStore} from "../../api/ProjectStore"; +import { ProjectFileTypes} from "../../api/ProjectModels"; import {shallow} from "zustand/shallow"; import {PropertiesToolbar} from "./PropertiesToolbar"; import {PropertiesTable} from "./PropertiesTable"; export function PropertiesPanel () { - const [files] = useFilesStore((s) => [s.files], shallow); const [project] = useProjectStore((s) => [s.project], shallow); - const [operation] = useFileStore((s) => [s.operation], shallow); - - function getDate(lastUpdate: number): string { - if (lastUpdate) { - const date = new Date(lastUpdate); - return date.toISOString().slice(0, 19).replace('T',' '); - } else { - return "N/A" - } - } - - function needCommit(lastUpdate: number): boolean { - return lastUpdate > project.lastCommitTimestamp; - } - - function download (file: ProjectFile) { - if (file) { - const type = file.name.endsWith("yaml") ? "application/yaml;charset=utf-8" : undefined; - const f = new File([file.code], file.name, {type: type}); - FileSaver.saveAs(f); - } - } function isBuildIn(): boolean { return ['kamelets', 'templates', 'services'].includes(project.projectId); diff --git a/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesTable.tsx b/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesTable.tsx index b443f32c..71357cbb 100644 --- a/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesTable.tsx +++ b/karavan-web/karavan-app/src/main/webui/src/project/file/PropertiesTable.tsx @@ -18,7 +18,6 @@ import React, {useEffect, useState} from 'react'; import { Button, Modal, - PageSection, } from '@patternfly/react-core'; import '../../designer/karavan.css'; import { @@ -48,9 +47,8 @@ export function PropertiesTable() { [state.file, state.editAdvancedProperties, state.addProperty, state.setAddProperty], shallow) useEffect(() => { - console.log("PropertiesTable useEffect"); setProperties(getProjectModel().properties) - }, [addProperty]); + }, [addProperty,setDeleteId]); function save(props: ProjectProperty[]) { if (file) { @@ -69,13 +67,11 @@ export function PropertiesTable() { } function startDelete(id: string) { - console.log("startDelete", id) setShowDeleteConfirmation(true); setDeleteId(id); } function confirmDelete() { - console.log("confirmDelete") const props = properties.filter(p => p.id !== deleteId); save(props); setShowDeleteConfirmation(false); @@ -115,7 +111,10 @@ export function PropertiesTable() { {properties.map((property, idx: number) => { const readOnly = (property.key.startsWith("camel.jbang") || property.key.startsWith("camel.karavan")) && !editAdvancedProperties; return ( - <PropertyField property={property} readOnly={readOnly} changeProperty={changeProperty} + <PropertyField key={idx + property.key} + property={property} + readOnly={readOnly} + changeProperty={changeProperty} onDelete={startDelete}/> ) })}