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 759707ce Kubernetes icon 759707ce is described below commit 759707ce1f4d3cc351868784aed09e0f08b886d0 Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Sun Dec 17 11:06:11 2023 -0500 Kubernetes icon --- karavan-designer/src/designer/beans/BeanProperties.tsx | 8 ++++---- karavan-designer/src/designer/icons/ComponentIcons.tsx | 5 +++-- .../src/designer/route/property/ComponentParameterField.tsx | 4 ++-- karavan-designer/src/designer/route/property/DslPropertyField.css | 6 ++++++ karavan-designer/src/designer/route/property/DslPropertyField.tsx | 4 ++-- .../src/designer/route/property/KameletPropertyField.tsx | 4 ++-- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/karavan-designer/src/designer/beans/BeanProperties.tsx b/karavan-designer/src/designer/beans/BeanProperties.tsx index df72edca..c3147828 100644 --- a/karavan-designer/src/designer/beans/BeanProperties.tsx +++ b/karavan-designer/src/designer/beans/BeanProperties.tsx @@ -18,7 +18,7 @@ import React, {useEffect, useState} from 'react'; import { Form, FormGroup, - TextInput, Button, Title, Tooltip, Popover, InputGroup, InputGroupItem, + TextInput, Button, Title, Tooltip, Popover, InputGroup, InputGroupItem, capitalize, } from '@patternfly/react-core'; import '../karavan.css'; import "@patternfly/patternfly/patternfly.css"; @@ -34,7 +34,6 @@ import AddIcon from "@patternfly/react-icons/dist/js/icons/plus-circle-icon"; import CloneIcon from '@patternfly/react-icons/dist/esm/icons/clone-icon' import HelpIcon from "@patternfly/react-icons/dist/js/icons/help-icon"; import {InfrastructureSelector} from "../route/property/InfrastructureSelector"; -import KubernetesIcon from "@patternfly/react-icons/dist/js/icons/openshift-icon"; import {InfrastructureAPI} from "../utils/InfrastructureAPI"; import ShowIcon from "@patternfly/react-icons/dist/js/icons/eye-icon"; import HideIcon from "@patternfly/react-icons/dist/js/icons/eye-slash-icon"; @@ -42,6 +41,7 @@ import DockerIcon from "@patternfly/react-icons/dist/js/icons/docker-icon"; import {useDesignerStore} from "../DesignerStore"; import {shallow} from "zustand/shallow"; import {IntegrationHeader} from "../utils/IntegrationHeader"; +import {KubernetesIcon} from "../icons/ComponentIcons"; interface Props { @@ -258,7 +258,7 @@ export function BeanProperties (props: Props) { const showPassword = v[1][2]; const isSecret = key !== undefined && SensitiveKeys.includes(key.toLowerCase()); const inInfrastructure = InfrastructureAPI.infrastructure !== 'local'; - const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? <KubernetesIcon/> : <DockerIcon/> + const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? KubernetesIcon("infra-button"): <DockerIcon/> return ( <div key={"key-" + i} className="bean-property"> <TextInput placeholder="Bean Field Name" className="text-field" isRequired type="text" id={"key-" + i} @@ -268,7 +268,7 @@ export function BeanProperties (props: Props) { }}/> <InputGroup> {inInfrastructure && - <Tooltip position="bottom-end" content="Select value from Infrastructure"> + <Tooltip position="bottom-end" content={"Select from " + capitalize(InfrastructureAPI.infrastructure)}> <Button variant="control" onClick={e => openInfrastructureSelector(i, key)}> {icon} </Button> diff --git a/karavan-designer/src/designer/icons/ComponentIcons.tsx b/karavan-designer/src/designer/icons/ComponentIcons.tsx index bda35d53..90d78ec8 100644 --- a/karavan-designer/src/designer/icons/ComponentIcons.tsx +++ b/karavan-designer/src/designer/icons/ComponentIcons.tsx @@ -1248,12 +1248,13 @@ export function HealthIcon() { ); } -export function KubernetesIcon() { +export function KubernetesIcon(className?: string) { return ( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -10.44 722.846 722.846" - className="icon" width="32px" height="32px"> + className={className ? className + " icon" : "icon"} + width="32px" height="32px"> <path fill="#326ce5" d="M358.986 10.06a46.725 46.342 0 0 0-17.906 4.531L96.736 131.341a46.725 46.342 0 0 0-25.28 31.438l-60.282 262.25a46.725 46.342 0 0 0 6.344 35.531 46.725 46.342 0 0 0 2.656 3.688l169.125 210.28a46.725 46.342 0 0 0 36.531 17.438l271.219-.062a46.725 46.342 0 0 0 36.531-17.406l169.063-210.313a46.725 46.342 0 0 0 9.03-39.219L651.3 162.716a46.725 46.342 0 0 0-25.281-31.437L381.643 14.59a46.725 46.342 0 0 0-22.657-4.53z" diff --git a/karavan-designer/src/designer/route/property/ComponentParameterField.tsx b/karavan-designer/src/designer/route/property/ComponentParameterField.tsx index 49eb2f6a..7186616d 100644 --- a/karavan-designer/src/designer/route/property/ComponentParameterField.tsx +++ b/karavan-designer/src/designer/route/property/ComponentParameterField.tsx @@ -43,7 +43,6 @@ import CompressIcon from "@patternfly/react-icons/dist/js/icons/compress-icon"; import ExpandIcon from "@patternfly/react-icons/dist/js/icons/expand-icon"; import {InfrastructureSelector} from "./InfrastructureSelector"; import {InfrastructureAPI} from "../../utils/InfrastructureAPI"; -import KubernetesIcon from "@patternfly/react-icons/dist/js/icons/openshift-icon"; import DockerIcon from "@patternfly/react-icons/dist/js/icons/docker-icon"; import ShowIcon from "@patternfly/react-icons/dist/js/icons/eye-icon"; import HideIcon from "@patternfly/react-icons/dist/js/icons/eye-slash-icon"; @@ -51,6 +50,7 @@ import PlusIcon from "@patternfly/react-icons/dist/esm/icons/plus-icon"; import {usePropertiesHook} from "../usePropertiesHook"; import {useIntegrationStore} from "../../DesignerStore"; import {shallow} from "zustand/shallow"; +import {KubernetesIcon} from "../../icons/ComponentIcons"; const prefix = "parameters"; const beanPrefix = "#bean:"; @@ -219,7 +219,7 @@ export function ComponentParameterField(props: Props) { function getStringInput(property: ComponentProperty, value: any) { const inInfrastructure = InfrastructureAPI.infrastructure !== 'local'; const noInfraSelectorButton = ["uri", "id", "description", "group"].includes(property.name); - const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? <KubernetesIcon/> : <DockerIcon/> + const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? KubernetesIcon("infra-button") : <DockerIcon/> return <InputGroup> {inInfrastructure && !showEditor && !noInfraSelectorButton && <Tooltip position="bottom-end" diff --git a/karavan-designer/src/designer/route/property/DslPropertyField.css b/karavan-designer/src/designer/route/property/DslPropertyField.css index ee3aa688..3866f7d6 100644 --- a/karavan-designer/src/designer/route/property/DslPropertyField.css +++ b/karavan-designer/src/designer/route/property/DslPropertyField.css @@ -18,3 +18,9 @@ margin: auto; padding-right: 12px; } + +.karavan .designer-page .properties .infra-button { + width: 1em; + height: 1em; + vertical-align: -0.125em; +} \ No newline at end of file diff --git a/karavan-designer/src/designer/route/property/DslPropertyField.tsx b/karavan-designer/src/designer/route/property/DslPropertyField.tsx index f72db408..f092a795 100644 --- a/karavan-designer/src/designer/route/property/DslPropertyField.tsx +++ b/karavan-designer/src/designer/route/property/DslPropertyField.tsx @@ -61,7 +61,6 @@ import {MediaTypes} from "../../utils/MediaTypes"; import {ComponentProperty} from "karavan-core/lib/model/ComponentModels"; import CompressIcon from "@patternfly/react-icons/dist/js/icons/compress-icon"; import ExpandIcon from "@patternfly/react-icons/dist/js/icons/expand-icon"; -import KubernetesIcon from "@patternfly/react-icons/dist/js/icons/openshift-icon"; import {InfrastructureSelector} from "./InfrastructureSelector"; import {InfrastructureAPI} from "../../utils/InfrastructureAPI"; import EditorIcon from "@patternfly/react-icons/dist/js/icons/code-icon"; @@ -71,6 +70,7 @@ import {useDesignerStore, useIntegrationStore} from "../../DesignerStore"; import {shallow} from "zustand/shallow"; import {DataFormatDefinition, ExpressionDefinition} from "karavan-core/lib/model/CamelDefinition"; import {TemplateApi} from "karavan-core/lib/api/TemplateApi"; +import {KubernetesIcon} from "../../icons/ComponentIcons"; interface Props { property: PropertyMeta, @@ -217,7 +217,7 @@ export function DslPropertyField(props: Props) { function getStringInput(property: PropertyMeta, value: any) { const inInfrastructure = InfrastructureAPI.infrastructure !== 'local'; const noInfraSelectorButton = ["uri", "id", "description", "group"].includes(property.name); - const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? <KubernetesIcon/> : <DockerIcon/> + const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? KubernetesIcon("infra-button") : <DockerIcon/> return (<InputGroup> {inInfrastructure && !showEditor && !noInfraSelectorButton && <InputGroupItem> diff --git a/karavan-designer/src/designer/route/property/KameletPropertyField.tsx b/karavan-designer/src/designer/route/property/KameletPropertyField.tsx index 96b880c1..c9e6916c 100644 --- a/karavan-designer/src/designer/route/property/KameletPropertyField.tsx +++ b/karavan-designer/src/designer/route/property/KameletPropertyField.tsx @@ -29,12 +29,12 @@ import CompressIcon from "@patternfly/react-icons/dist/js/icons/compress-icon"; import {Property} from "karavan-core/lib/model/KameletModels"; import {InfrastructureSelector} from "./InfrastructureSelector"; import {InfrastructureAPI} from "../../utils/InfrastructureAPI"; -import KubernetesIcon from "@patternfly/react-icons/dist/js/icons/openshift-icon"; import ShowIcon from "@patternfly/react-icons/dist/js/icons/eye-icon"; import HideIcon from "@patternfly/react-icons/dist/js/icons/eye-slash-icon"; import DockerIcon from "@patternfly/react-icons/dist/js/icons/docker-icon"; import {usePropertiesHook} from "../usePropertiesHook"; import {Select, SelectDirection, SelectOption, SelectVariant} from "@patternfly/react-core/deprecated"; +import {KubernetesIcon} from "../../icons/ComponentIcons"; interface Props { property: Property, @@ -108,7 +108,7 @@ export function KameletPropertyField(props: Props) { const id = prefix + "-" + property.id; const inInfrastructure = InfrastructureAPI.infrastructure !== 'local'; const noInfraSelectorButton = ["uri", "id", "description", "group"].includes(property.id); - const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? <KubernetesIcon/> : <DockerIcon/> + const icon = InfrastructureAPI.infrastructure === 'kubernetes' ? KubernetesIcon("infra-button") : <DockerIcon/> const showInfraSelectorButton = inInfrastructure && !showEditor && !noInfraSelectorButton; const selectFromList: boolean = property.enum !== undefined && property?.enum?.length > 0; const selectOptions: JSX.Element[] = [];