-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add integration action components and update integration JSON files - Introduced new action components for Email, Slack, Discord, Webhook, and Google Sheets integrations, enhancing the user interface for managing these integrations. - Updated the `integrations.json` files to include `actions_file_name` for each integration, linking them to their respective action components. - Improved the `GoogleSheetsIntegrationActions.vue` component by replacing direct provider information display with a badge for better UI consistency. These changes aim to streamline integration management and improve the overall user experience. * Minor UI fixes --------- Co-authored-by: Julien Nahum <julien@nahum.net>
- Loading branch information
1 parent
49c2d6b
commit c1ee072
Showing
9 changed files
with
235 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
client/components/open/integrations/components/DiscordIntegrationActions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<div class="flex flex-1 items-center"> | ||
<div | ||
v-if="integration" | ||
class="hidden md:block space-y-1" | ||
> | ||
<UBadge | ||
:label="mentionAsText(integration.data.message)" | ||
color="gray" | ||
size="xs" | ||
class="max-w-[300px] truncate" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { mentionAsText } from '~/lib/utils.js' | ||
const props = defineProps({ | ||
integration: { | ||
type: Object, | ||
required: true, | ||
}, | ||
form: { | ||
type: Object, | ||
required: true, | ||
} | ||
}) | ||
const formIntegrationsStore = useFormIntegrationsStore() | ||
let interval = null | ||
onMounted(() => { | ||
if (!props.integration.data || props.integration.data.length === 0) { | ||
interval = setInterval(() => formIntegrationsStore.fetchFormIntegrations(props.form.id), 3000) | ||
setTimeout(() => { clearInterval(interval) }, 30000) | ||
} | ||
}) | ||
onBeforeUnmount(() => { | ||
if (interval) { | ||
clearInterval(interval) | ||
} | ||
}) | ||
</script> |
70 changes: 70 additions & 0 deletions
70
client/components/open/integrations/components/EmailIntegrationActions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<template> | ||
<div class="flex flex-1 items-center"> | ||
<div | ||
v-if="integration" | ||
class="hidden md:block space-y-1" | ||
> | ||
<UBadge | ||
:label="mentionAsText(integration.data.subject)" | ||
color="gray" | ||
size="xs" | ||
class="max-w-[300px] block truncate" | ||
/> | ||
<div class="flex items-center gap-1"> | ||
<UBadge | ||
:label="firstEmail" | ||
color="white" | ||
size="xs" | ||
class="max-w-[300px] block truncate" | ||
/> | ||
<UBadge | ||
v-if="additionalEmailsCount > 0" | ||
:label="`+${additionalEmailsCount}`" | ||
color="white" | ||
size="xs" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { mentionAsText } from '~/lib/utils.js' | ||
const props = defineProps({ | ||
integration: { | ||
type: Object, | ||
required: true, | ||
}, | ||
form: { | ||
type: Object, | ||
required: true, | ||
} | ||
}) | ||
const formIntegrationsStore = useFormIntegrationsStore() | ||
let interval = null | ||
onMounted(() => { | ||
if (!props.integration.data || props.integration.data.length === 0) { | ||
interval = setInterval(() => formIntegrationsStore.fetchFormIntegrations(props.form.id), 3000) | ||
setTimeout(() => { clearInterval(interval) }, 30000) | ||
} | ||
}) | ||
onBeforeUnmount(() => { | ||
if (interval) { | ||
clearInterval(interval) | ||
} | ||
}) | ||
const firstEmail = computed(() => { | ||
const emails = mentionAsText(props.integration.data.send_to).split('\n').filter(Boolean) | ||
return emails[0] || '' | ||
}) | ||
const additionalEmailsCount = computed(() => { | ||
const emails = mentionAsText(props.integration.data.send_to).split('\n').filter(Boolean) | ||
return Math.max(0, emails.length - 1) | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
client/components/open/integrations/components/SlackIntegrationActions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<div class="flex flex-1 items-center"> | ||
<div | ||
v-if="integration" | ||
class="hidden md:block space-y-1" | ||
> | ||
<UBadge | ||
:label="mentionAsText(integration.data.message)" | ||
color="gray" | ||
size="xs" | ||
class="max-w-[300px] block truncate" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { mentionAsText } from '~/lib/utils.js' | ||
const props = defineProps({ | ||
integration: { | ||
type: Object, | ||
required: true, | ||
}, | ||
form: { | ||
type: Object, | ||
required: true, | ||
} | ||
}) | ||
const formIntegrationsStore = useFormIntegrationsStore() | ||
let interval = null | ||
onMounted(() => { | ||
if (!props.integration.data || props.integration.data.length === 0) { | ||
interval = setInterval(() => formIntegrationsStore.fetchFormIntegrations(props.form.id), 3000) | ||
setTimeout(() => { clearInterval(interval) }, 30000) | ||
} | ||
}) | ||
onBeforeUnmount(() => { | ||
if (interval) { | ||
clearInterval(interval) | ||
} | ||
}) | ||
</script> |
44 changes: 44 additions & 0 deletions
44
client/components/open/integrations/components/WebhookIntegrationActions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div class="flex flex-1 items-center"> | ||
<div | ||
v-if="integration" | ||
class="hidden md:block space-y-1" | ||
> | ||
<UBadge | ||
:label="integration.data.webhook_url" | ||
color="gray" | ||
size="xs" | ||
class="max-w-[300px] block truncate" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
const props = defineProps({ | ||
integration: { | ||
type: Object, | ||
required: true, | ||
}, | ||
form: { | ||
type: Object, | ||
required: true, | ||
} | ||
}) | ||
const formIntegrationsStore = useFormIntegrationsStore() | ||
let interval = null | ||
onMounted(() => { | ||
if (!props.integration.data || props.integration.data.length === 0) { | ||
interval = setInterval(() => formIntegrationsStore.fetchFormIntegrations(props.form.id), 3000) | ||
setTimeout(() => { clearInterval(interval) }, 30000) | ||
} | ||
}) | ||
onBeforeUnmount(() => { | ||
if (interval) { | ||
clearInterval(interval) | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters