Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div role="group">
<label for="retry_attempts">{{ $t('Retry Attempts') }}</label>
<b-form-input id="retry_attempts" type="number" v-model="config.retry_attempts" min="0" max="50"></b-form-input>
<b-form-input id="retry_attempts" type="number" v-model="config.retry_attempts" @input="updateConfig" min="0" max="50"></b-form-input>
<small class="form-text text-muted">{{ helper }}</small>
</div>
</template>
Expand All @@ -15,6 +15,7 @@ export default {
config: {
retry_attempts: "",
},
valueContent: "",
}
},
watch: {
Expand All @@ -29,21 +30,54 @@ export default {
node() {
return this.$root.$children[0].$refs.modeler.highlightedNode.definition;
},
getNodeConfig() {
getNodeConfig(newValue) {
this.valueContent = newValue;
const configString = _.get(this.node(), 'errorHandling', null);
if (configString) {
const config = JSON.parse(configString);
this.config.retry_attempts = _.get(config, 'retry_attempts', "");
if (this.config.id) {
if (this.config.id !== this.valueContent.id) {
this.config.retry_attempts = this.valueContent.retry_attempts;
this.config.id = this.valueContent.id;
} else {
if (configString) {
const config = JSON.parse(configString);
this.config.retry_attempts = _.get(config, 'retry_attempts');
}
}
} else {
this.config.id = this.valueContent.id;
if (!configString) {
this.config.retry_attempts = this.valueContent.retry_attempts;
}
if (this.valueContent.method) {
this.config.retry_attempts = this.valueContent.retry_attempts;
if (this.config.id !== this.valueContent.id) {
this.config.retry_attempts = this.valueContent.retry_attempts;
this.config.id = this.valueContent.id;
} else {
if (configString) {
const config = JSON.parse(configString);
this.config.retry_attempts = _.get(config, 'retry_attempts');
}
}
}
}
},
setNodeConfig() {
const existingSetting = JSON.parse(_.get(this.node(), 'errorHandling', '{}'));
const json = JSON.stringify({ ...existingSetting, retry_attempts: this.config.retry_attempts });
Vue.set(this.node(), 'errorHandling', json);
},
updateConfig() {
if (this.valueContent.retry_attempts !== this.config.retry_attempts) {
this.setNodeConfig();
}
},
},
mounted() {
this.getNodeConfig();
this.$root.$on("contentChanged", this.getNodeConfig);
},
beforeDestroy() {
this.$root.$off("contentChanged", this.getNodeConfig);
},
computed: {
helper() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div role="group">
<label for="retry_wait_time">{{ $t('Retry Wait Time') }}</label>
<b-form-input id="retry_wait_time" type="number" v-model="config.retry_wait_time" min="0" max="3600"></b-form-input>
<b-form-input id="retry_wait_time" type="number" v-model="config.retry_wait_time" @input="updateConfig" min="0" max="3600"></b-form-input>
<small class="form-text text-muted">{{ helper }}</small>
</div>
</template>
Expand All @@ -15,6 +15,7 @@ export default {
config: {
retry_wait_time: "",
},
valueContent: "",
}
},
watch: {
Expand All @@ -29,21 +30,54 @@ export default {
node() {
return this.$root.$children[0].$refs.modeler.highlightedNode.definition;
},
getNodeConfig() {
getNodeConfig(newValue) {
this.valueContent = newValue;
const configString = _.get(this.node(), 'errorHandling', null);
if (configString) {
const config = JSON.parse(configString);
this.config.retry_wait_time = _.get(config, 'retry_wait_time', "");
if (this.config.id) {
if (this.config.id !== this.valueContent.id) {
this.config.retry_wait_time = this.valueContent.retry_wait_time;
this.config.id = this.valueContent.id;
} else {
if (configString) {
const config = JSON.parse(configString);
this.config.retry_wait_time = _.get(config, 'retry_wait_time');
}
}
} else {
this.config.id = this.valueContent.id;
if (!configString) {
this.config.retry_wait_time = this.valueContent.retry_wait_time;
}
if (this.valueContent.method) {
this.config.retry_wait_time = this.valueContent.retry_wait_time;
if (this.config.id !== this.valueContent.id) {
this.config.retry_wait_time = this.valueContent.retry_wait_time;
this.config.id = this.valueContent.id;
} else {
if (configString) {
const config = JSON.parse(configString);
this.config.retry_wait_time = _.get(config, 'retry_wait_time');
}
}
}
}
},
setNodeConfig() {
const existingSetting = JSON.parse(_.get(this.node(), 'errorHandling', '{}'));
const json = JSON.stringify({ ...existingSetting, retry_wait_time: this.config.retry_wait_time });
Vue.set(this.node(), 'errorHandling', json);
},
updateConfig() {
if (this.valueContent.retry_wait_time !== this.config.retry_wait_time) {
this.setNodeConfig();
}
},
},
mounted() {
this.getNodeConfig();
this.$root.$on("contentChanged", this.getNodeConfig);
},
beforeDestroy() {
this.$root.$off("contentChanged", this.getNodeConfig);
},
computed: {
helper() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div role="group">
<label for="timeout">{{ $t('Timeout') }}</label>
<b-form-input id="timeout" type="number" min="0" max="3600" v-model="config.timeout"></b-form-input>
<b-form-input id="timeout" type="number" min="0" max="3600" v-model="config.timeout" @input="updateConfig"></b-form-input>
<small class="form-text text-muted">{{ helper }}</small>
</div>
</template>
Expand All @@ -15,6 +15,7 @@ export default {
config: {
timeout: "",
},
valueContent: ""
}
},
watch: {
Expand All @@ -29,21 +30,54 @@ export default {
node() {
return this.$root.$children[0].$refs.modeler.highlightedNode.definition;
},
getNodeConfig() {
getNodeConfig(newValue) {
this.valueContent = newValue;
const configString = _.get(this.node(), 'errorHandling', null);
if (configString) {
const config = JSON.parse(configString);
this.config.timeout = _.get(config, 'timeout', "");
if (this.config.id) {
if (this.config.id !== this.valueContent.id) {
this.config.timeout = this.valueContent.timeout;
this.config.id = this.valueContent.id;
} else {
if (configString) {
const config = JSON.parse(configString);
this.config.timeout = _.get(config, 'timeout');
}
}
} else {
this.config.id = this.valueContent.id;
if (!configString) {
this.config.timeout = this.valueContent.timeout;
}
if (this.valueContent.method) {
this.config.timeout = this.valueContent.timeout;
if (this.config.id !== this.valueContent.id) {
this.config.timeout = this.valueContent.timeout;
this.config.id = this.valueContent.id;
} else {
if (configString) {
const config = JSON.parse(configString);
this.config.timeout = _.get(config, 'timeout');
}
}
}
}
},
setNodeConfig() {
const existingSetting = JSON.parse(_.get(this.node(), 'errorHandling', '{}'));
const json = JSON.stringify({ ...existingSetting, timeout: this.config.timeout });
Vue.set(this.node(), 'errorHandling', json);
},
updateConfig() {
if (this.valueContent.timeout !== this.config.timeout) {
this.setNodeConfig();
}
},
},
mounted() {
this.getNodeConfig();
this.$root.$on("contentChanged", this.getNodeConfig);
},
beforeDestroy() {
this.$root.$off("contentChanged", this.getNodeConfig);
},
computed: {
helper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
export default {
props: ["value", "label", "helper", "params", 'required'],
data() {
return {
content: "",
loading: false,
scripts: [],
return {
content: "",
loading: false,
scripts: [],
error: ''
};
},
Expand Down Expand Up @@ -80,6 +80,7 @@
.then(response => {
this.loading = false;
this.content = response.data;
this.$root.$emit("contentChanged", this.content);
})
.catch(error => {
this.loading = false;
Expand Down