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 1881255 Fix #16 (#29)
1881255 is described below
commit 188125510af7c90c6f6dde888d6c37f7a6cf2d99
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Fri Oct 15 22:24:36 2021 -0400
Fix #16 (#29)
---
karavan-designer/src/designer/api/CamelApi.tsx | 6 ++++--
karavan-designer/src/designer/karavan.css | 3 ++-
karavan-designer/src/designer/ui/DslElement.tsx | 2 +-
karavan-designer/src/designer/ui/DslProperties.tsx | 2 --
karavan-vscode/src/extension.ts | 1 -
karavan-vscode/webview/index.css | 4 ++++
6 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/karavan-designer/src/designer/api/CamelApi.tsx
b/karavan-designer/src/designer/api/CamelApi.tsx
index 7bdb044..d4a6240 100644
--- a/karavan-designer/src/designer/api/CamelApi.tsx
+++ b/karavan-designer/src/designer/api/CamelApi.tsx
@@ -509,8 +509,10 @@ export class CamelApi {
}
static createChoice = (element: any): ChoiceStep => {
- const choiceStep = element ? new ChoiceStep({...element.choice}) : new
ChoiceStep()
- choiceStep.choice.otherwise =
CamelApi.createOtherwise(element?.choice?.otherwise)
+ const choiceStep = element ? new ChoiceStep({...element.choice}) : new
ChoiceStep();
+ if (element?.choice?.otherwise !== undefined){
+ choiceStep.choice.otherwise =
CamelApi.createOtherwise(element?.choice?.otherwise);
+ }
choiceStep.choice.when = element && element?.choice ?
element?.choice?.when.map((x:any) => CamelApi.createWhen(x)) :[]
choiceStep.uuid = element?.uuid ? element.uuid : choiceStep.uuid
return choiceStep
diff --git a/karavan-designer/src/designer/karavan.css
b/karavan-designer/src/designer/karavan.css
index 19ed15d..3f281b0 100644
--- a/karavan-designer/src/designer/karavan.css
+++ b/karavan-designer/src/designer/karavan.css
@@ -502,11 +502,12 @@
.step-element .add-button {
top: 0;
font-size: 15px;
+ height: 15px;
line-height: 1;
border: 0;
padding: 0;
margin: 3px 0 0 0;
- background: transparent;
+ background: white;
color: #fb8824;
visibility: hidden;
z-index: 100;
diff --git a/karavan-designer/src/designer/ui/DslElement.tsx
b/karavan-designer/src/designer/ui/DslElement.tsx
index 06c9878..10a5e1a 100644
--- a/karavan-designer/src/designer/ui/DslElement.tsx
+++ b/karavan-designer/src/designer/ui/DslElement.tsx
@@ -212,7 +212,7 @@ export class DslElement extends React.Component<Props,
State> {
</Tooltip>
}
{this.state.element.dslName === 'choice' &&
- <div className="whens" style={this.horizontal() ?
{display: "flex", flexDirection: "row"} : {}}>
+ <div className={this.getWhens().length > 0 ? "whens" : ""}
style={this.horizontal() ? {display: "flex", flexDirection: "row"} : {}}>
{this.getWhens().map((when, index) => (
<div key={when.uuid} style={{marginLeft: (index
!== 0) ? "6px" : "0"}}>
{this.getArrow()}
diff --git a/karavan-designer/src/designer/ui/DslProperties.tsx
b/karavan-designer/src/designer/ui/DslProperties.tsx
index 8707e46..2c5600f 100644
--- a/karavan-designer/src/designer/ui/DslProperties.tsx
+++ b/karavan-designer/src/designer/ui/DslProperties.tsx
@@ -89,8 +89,6 @@ export class DslProperties extends React.Component<Props,
State> {
}
expressionChanged = (language: string, value: string | undefined) => {
- console.log(this.state.step)
- console.log(this.state.element)
if (this.state.step && this.state.element) {
const clone = (CamelYaml.cloneStep(this.state.step));
const e: any = {};
diff --git a/karavan-vscode/src/extension.ts b/karavan-vscode/src/extension.ts
index 94c0c3e..8957837 100644
--- a/karavan-vscode/src/extension.ts
+++ b/karavan-vscode/src/extension.ts
@@ -139,7 +139,6 @@ function readKamelets(context: vscode.ExtensionContext):
string[] {
function readComponents(context: vscode.ExtensionContext): string[] {
const dir = path.join(context.extensionPath, 'components');
const jsons: string[] = fs.readdirSync(dir).filter(file =>
file.endsWith("json")).map(file => fs.readFileSync(dir + "/" + file, 'utf-8'));
- console.log(jsons)
return jsons;
}
diff --git a/karavan-vscode/webview/index.css b/karavan-vscode/webview/index.css
index 2a2edd2..e9ed60d 100644
--- a/karavan-vscode/webview/index.css
+++ b/karavan-vscode/webview/index.css
@@ -119,4 +119,8 @@ body,
.vscode-dark .pf-c-tooltip {
--pf-c-tooltip__content--BackgroundColor: #585858;
+}
+
+.vscode-dark .step-element .add-button {
+ background: #252526;
}
\ No newline at end of file