🎨 Update webhook URL details UI (#2004)

* Update the webhook URL details

* Change radio buttons values

* Limit the effects for the webhook node
This commit is contained in:
MedAliMarz 2021-07-23 17:42:46 +02:00 committed by GitHub
parent 10acbecfaa
commit 5602929210
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,20 +1,17 @@
<template> <template>
<div v-if="webhooksNode.length" class="webhoooks"> <div v-if="webhooksNode.length" class="webhoooks">
<div class="clickable headline" :class="{expanded: !isMinimized}" @click="isMinimized=!isMinimized" :title="isMinimized ? 'Click to display Webhook URLs' : 'Click to hide Webhook URLs'"> <div class="clickable headline" :class="{expanded: !isMinimized}" @click="isMinimized=!isMinimized" :title="isMinimized ? 'Click to display Webhook URLs' : 'Click to hide Webhook URLs'">
<font-awesome-icon icon="angle-up" class="minimize-button minimize-icon" /> <font-awesome-icon icon="angle-down" class="minimize-button minimize-icon" />
Webhook URLs Webhook URLs
</div> </div>
<el-collapse-transition> <el-collapse-transition>
<div class="node-webhooks" v-if="!isMinimized"> <div class="node-webhooks" v-if="!isMinimized">
<div class="url-selection"> <div class="url-selection">
<el-row> <el-row>
<el-col :span="10" class="mode-selection-headline"> <el-col :span="24">
Display URL for:
</el-col>
<el-col :span="14">
<el-radio-group v-model="showUrlFor" size="mini"> <el-radio-group v-model="showUrlFor" size="mini">
<el-radio-button label="Production"></el-radio-button> <el-radio-button label="test">Test URL</el-radio-button>
<el-radio-button label="Test"></el-radio-button> <el-radio-button label="production">Production URL</el-radio-button>
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-row> </el-row>
@ -68,8 +65,8 @@ export default mixins(
], ],
data () { data () {
return { return {
isMinimized: true, isMinimized: this.nodeType.name !== 'n8n-nodes-base.webhook',
showUrlFor: 'Production', showUrlFor: 'test',
}; };
}, },
computed: { computed: {
@ -104,7 +101,7 @@ export default mixins(
}, },
getWebhookUrl (webhookData: IWebhookDescription): string { getWebhookUrl (webhookData: IWebhookDescription): string {
let baseUrl = this.$store.getters.getWebhookUrl; let baseUrl = this.$store.getters.getWebhookUrl;
if (this.showUrlFor === 'Test') { if (this.showUrlFor === 'test') {
baseUrl = this.$store.getters.getWebhookTestUrl; baseUrl = this.$store.getters.getWebhookTestUrl;
} }
@ -117,7 +114,7 @@ export default mixins(
}, },
watch: { watch: {
node () { node () {
this.isMinimized = true; this.isMinimized = false;
}, },
}, },
}); });