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 da7aee75 Fix #998 da7aee75 is described below commit da7aee754f1a4d0338a924e17a33b3591b6342ee Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Tue Nov 28 20:59:18 2023 -0500 Fix #998 --- karavan-designer/src/designer/route/DslElement.css | 3 +++ karavan-designer/src/designer/route/DslElement.tsx | 5 ++++- karavan-space/src/designer/route/DslElement.css | 3 +++ karavan-space/src/designer/route/DslElement.tsx | 5 ++++- .../src/designer/route/property/InfrastructureSelector.tsx | 11 ++++++----- .../src/main/webui/src/designer/route/DslElement.css | 3 +++ .../src/main/webui/src/designer/route/DslElement.tsx | 5 ++++- 7 files changed, 27 insertions(+), 8 deletions(-) diff --git a/karavan-designer/src/designer/route/DslElement.css b/karavan-designer/src/designer/route/DslElement.css new file mode 100644 index 00000000..71621b45 --- /dev/null +++ b/karavan-designer/src/designer/route/DslElement.css @@ -0,0 +1,3 @@ +.disabled { + opacity: 0.5; +} \ No newline at end of file diff --git a/karavan-designer/src/designer/route/DslElement.tsx b/karavan-designer/src/designer/route/DslElement.tsx index 9e4a8c70..efeaeff8 100644 --- a/karavan-designer/src/designer/route/DslElement.tsx +++ b/karavan-designer/src/designer/route/DslElement.tsx @@ -19,6 +19,7 @@ import { Text, Tooltip, } from '@patternfly/react-core'; import '../karavan.css'; +import './DslElement.css'; import AddIcon from "@patternfly/react-icons/dist/js/icons/plus-circle-icon"; import DeleteIcon from "@patternfly/react-icons/dist/js/icons/times-circle-icon"; import InsertIcon from "@patternfly/react-icons/dist/js/icons/arrow-alt-circle-right-icon"; @@ -413,7 +414,9 @@ export function DslElement(props: Props) { } const element: CamelElement = props.step; - const className = "step-element" + (isElementSelected() ? " step-element-selected" : "") + (!props.step.showChildren ? " hidden-step" : ""); + const className = "step-element" + + (isElementSelected() ? " step-element-selected" : "") + (!props.step.showChildren ? " hidden-step" : "") + + ((element as any).disabled ? " disabled " : ""); return ( <div key={"root" + element.uuid} className={className} diff --git a/karavan-space/src/designer/route/DslElement.css b/karavan-space/src/designer/route/DslElement.css new file mode 100644 index 00000000..71621b45 --- /dev/null +++ b/karavan-space/src/designer/route/DslElement.css @@ -0,0 +1,3 @@ +.disabled { + opacity: 0.5; +} \ No newline at end of file diff --git a/karavan-space/src/designer/route/DslElement.tsx b/karavan-space/src/designer/route/DslElement.tsx index 9e4a8c70..efeaeff8 100644 --- a/karavan-space/src/designer/route/DslElement.tsx +++ b/karavan-space/src/designer/route/DslElement.tsx @@ -19,6 +19,7 @@ import { Text, Tooltip, } from '@patternfly/react-core'; import '../karavan.css'; +import './DslElement.css'; import AddIcon from "@patternfly/react-icons/dist/js/icons/plus-circle-icon"; import DeleteIcon from "@patternfly/react-icons/dist/js/icons/times-circle-icon"; import InsertIcon from "@patternfly/react-icons/dist/js/icons/arrow-alt-circle-right-icon"; @@ -413,7 +414,9 @@ export function DslElement(props: Props) { } const element: CamelElement = props.step; - const className = "step-element" + (isElementSelected() ? " step-element-selected" : "") + (!props.step.showChildren ? " hidden-step" : ""); + const className = "step-element" + + (isElementSelected() ? " step-element-selected" : "") + (!props.step.showChildren ? " hidden-step" : "") + + ((element as any).disabled ? " disabled " : ""); return ( <div key={"root" + element.uuid} className={className} diff --git a/karavan-space/src/designer/route/property/InfrastructureSelector.tsx b/karavan-space/src/designer/route/property/InfrastructureSelector.tsx index 38555892..e849b94d 100644 --- a/karavan-space/src/designer/route/property/InfrastructureSelector.tsx +++ b/karavan-space/src/designer/route/property/InfrastructureSelector.tsx @@ -34,7 +34,8 @@ interface Props { export function InfrastructureSelector(props: Props) { - const [tabIndex, setTabIndex] = useState<string | number>("configMap"); + const tabs = InfrastructureAPI.infrastructure === 'kubernetes' ? ['configMap', 'secret', 'services'] : ['services']; + const [tabIndex, setTabIndex] = useState<string | number>(tabs[0]); const [filter, setFilter] = useState<string>(); function checkFilter (name: string): boolean { @@ -49,9 +50,9 @@ export function InfrastructureSelector(props: Props) { return ( <Form isHorizontal className="search" autoComplete="off"> <FormGroup fieldId="search"> - <TextInput className="text-field" type="text" id="search" name="search" - value={filter} - onChange={(_, value) => setFilter(value)}/> + <TextInput className="text-field" type="text" id="search" name="search" + value={filter} + onChange={(_, value) => setFilter(value)}/> </FormGroup> </Form> ) @@ -190,7 +191,7 @@ export function InfrastructureSelector(props: Props) { ) } - const tabs = InfrastructureAPI.infrastructure === 'kubernetes' ? ['configMap', 'secret', 'services'] : ['services']; + return ( <Modal aria-label="Select from Infrastructure" diff --git a/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.css b/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.css new file mode 100644 index 00000000..71621b45 --- /dev/null +++ b/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.css @@ -0,0 +1,3 @@ +.disabled { + opacity: 0.5; +} \ No newline at end of file diff --git a/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.tsx b/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.tsx index 9e4a8c70..efeaeff8 100644 --- a/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.tsx +++ b/karavan-web/karavan-app/src/main/webui/src/designer/route/DslElement.tsx @@ -19,6 +19,7 @@ import { Text, Tooltip, } from '@patternfly/react-core'; import '../karavan.css'; +import './DslElement.css'; import AddIcon from "@patternfly/react-icons/dist/js/icons/plus-circle-icon"; import DeleteIcon from "@patternfly/react-icons/dist/js/icons/times-circle-icon"; import InsertIcon from "@patternfly/react-icons/dist/js/icons/arrow-alt-circle-right-icon"; @@ -413,7 +414,9 @@ export function DslElement(props: Props) { } const element: CamelElement = props.step; - const className = "step-element" + (isElementSelected() ? " step-element-selected" : "") + (!props.step.showChildren ? " hidden-step" : ""); + const className = "step-element" + + (isElementSelected() ? " step-element-selected" : "") + (!props.step.showChildren ? " hidden-step" : "") + + ((element as any).disabled ? " disabled " : ""); return ( <div key={"root" + element.uuid} className={className}