Skip to content

Beautiful Open-Source Form Builder

Add Activepieces integration (#949)

Chirag Chhatralad6760d839c5e
diff --git a/api/app/Integrations/Handlers/ActivepiecesIntegration.php b/api/app/Integrations/Handlers/ActivepiecesIntegration.php
new file mode 100644
index 000000000..4db447fa6
--- /dev/null
+++ b/api/app/Integrations/Handlers/ActivepiecesIntegration.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace App\Integrations\Handlers;
+
+use App\Models\Forms\Form;
+
+class ActivepiecesIntegration extends AbstractIntegrationHandler
+{
+ public static function getValidationRules(?Form $form): array
+ {
+ return [
+ 'webhook_url' => 'required|url',
+ 'provider_url' => 'nullable|url',
+ ];
+ }
+
+ protected function getWebhookUrl(): ?string
+ {
+ return $this->integrationData->webhook_url ?? null;
+ }
+
+ protected function shouldRun(): bool
+ {
+ return !is_null($this->getWebhookUrl()) && parent::shouldRun();
+ }
+
+ protected function getWebhookData(): array
+ {
+ $data = parent::getWebhookData();
+
+ // Remove deprecated fields if they exist
+ unset($data['submission'], $data['message']);
+
+ return $data;
+ }
+}
diff --git a/api/resources/data/forms/integrations.json b/api/resources/data/forms/integrations.json
index 202755e3a..fc8cca9a0 100644
--- a/api/resources/data/forms/integrations.json
+++ b/api/resources/data/forms/integrations.json
@@ -61,6 +61,17 @@
"is_editable": false,
"url": "https://docs.n8n.io/"
},
+ "activepieces": {
+ "name": "Activepieces",
+ "icon": "opnform:activepieces",
+ "section_name": "Automation",
+ "file_name": "ActivepiecesIntegration",
+ "actions_file_name": "ActivepiecesIntegrationActions",
+ "is_pro": false,
+ "is_external": true,
+ "is_editable": false,
+ "url": "https://www.activepieces.com/pieces"
+ },
"google_sheets": {
"name": "Google Sheets",
"icon": "mdi:google-spreadsheet",
diff --git a/client/components/open/integrations/components/ActivepiecesIntegrationActions.vue b/client/components/open/integrations/components/ActivepiecesIntegrationActions.vue
new file mode 100644
index 000000000..ce22ac142
--- /dev/null
+++ b/client/components/open/integrations/components/ActivepiecesIntegrationActions.vue
@@ -0,0 +1,37 @@
+<template>
+ <div class="flex flex-1 items-center">
+ <div
+ v-if="integration && providerUrl"
+ class="hidden md:block space-y-2"
+ >
+ <UButton
+ color="neutral"
+ variant="ghost"
+ size="sm"
+ :href="`${providerUrl}?utm_source=opnform-edit`"
+ target="_blank"
+ external
+ >
+ Edit Workflow
+ </UButton>
+ </div>
+ </div>
+</template>
+
+<script setup>
+const props = defineProps({
+ integration: {
+ type: Object,
+ required: true,
+ },
+ form: {
+ type: Object,
+ required: true,
+ }
+})
+
+const providerUrl = computed(() => {
+ return props.integration?.data?.provider_url || null
+})
+</script>
+
diff --git a/client/components/open/integrations/components/IntegrationCard.vue b/client/components/open/integrations/components/IntegrationCard.vue
index 53024feb2..ec5168ae9 100644
--- a/client/components/open/integrations/components/IntegrationCard.vue
+++ b/client/components/open/integrations/components/IntegrationCard.vue
@@ -157,8 +157,7 @@ const dropdownItems = computed(() => {
}
})
- // Delete option (hidden for external/managed integrations)
- if (!isExternal) {
+ // Delete option
items.push({
label: 'Delete Integration',
icon: 'i-heroicons-trash',
@@ -167,7 +166,6 @@ const dropdownItems = computed(() => {
},
color: 'error',
})
- }
return items
})
@@ -175,7 +173,13 @@ const dropdownItems = computed(() => {
const deleteIntegrationMutation = deleteIntegration()
const deleteFormIntegration = (integrationid) => {
- alert.confirm("Do you really want to delete this form integration?", () => {
+ const isExternal = integrationTypeInfo.value?.is_external === true
+ let msg = 'Do you really want to delete this form integration?'
+ if (isExternal) {
+ msg += ' This might be affect on your '+ integrationTypeInfo.value.name +' workflow.'
+ }
+
+ alert.confirm(msg, () => {
loadingDelete.value = true
deleteIntegrationMutation.mutateAsync({
formId: props.form.id,
diff --git a/client/composables/components/useComponentRegistry.js b/client/composables/components/useComponentRegistry.js
index 3ce312665..191f48f9d 100644
--- a/client/composables/components/useComponentRegistry.js
+++ b/client/composables/components/useComponentRegistry.js
@@ -24,6 +24,7 @@ const actionRegistry = new Map([
['GoogleSheetsIntegrationActions', () => import('~/components/open/integrations/components/GoogleSheetsIntegrationActions.vue')],
['EmailIntegrationActions', () => import('~/components/open/integrations/components/EmailIntegrationActions.vue')],
['N8nIntegrationActions', () => import('~/components/open/integrations/components/N8nIntegrationActions.vue')],
+ ['ActivepiecesIntegrationActions', () => import('~/components/open/integrations/components/ActivepiecesIntegrationActions.vue')],
])
const providerRegistry = new Map([
diff --git a/client/data/forms/integrations.json b/client/data/forms/integrations.json
index dadd624fe..2337ee3fb 100644
--- a/client/data/forms/integrations.json
+++ b/client/data/forms/integrations.json
@@ -66,6 +66,17 @@
"is_editable": false,
"url": "https://n8n.io/"
},
+ "activepieces": {
+ "name": "Activepieces",
+ "icon": "opnform:activepieces",
+ "section_name": "Automation",
+ "file_name": "ActivepiecesIntegration",
+ "actions_file_name": "ActivepiecesIntegrationActions",
+ "is_pro": false,
+ "is_external": true,
+ "is_editable": false,
+ "url": "https://www.activepieces.com/pieces"
+ },
"google_sheets": {
"name": "Google Sheets",
"icon": "mdi:google-spreadsheet",
diff --git a/client/public/icons/activepieces.svg b/client/public/icons/activepieces.svg
new file mode 100644
index 000000000..55bac7950
--- /dev/null
+++ b/client/public/icons/activepieces.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="-0.03 23.71 511.97 464.62"><path d="M154.5 165.5c-27.9-41.8-16.7-98.5 25.1-126.4S278.1 22.4 306 63.3l190.6 282.6c27.9 41.8 16.7 98.5-25.1 126.4S373 489 345.1 448.1l-82.7-122.7c-10.2-13-32.5-11.2-45.6 1.9-11.2 11.2-13.9 38.1-17.7 62.3 0 3.7-.9 6.5-.9 10.2-1.9 15.8-7.4 30.7-16.7 44.6-30.7 45.6-92 57.6-137.6 27s-57.6-92-27-137.6c15.8-23.2 40-38.1 66-42.8 75.3-11.2 89.2-95.8 75.3-119z" fill="currentColor"/></svg>
\ No newline at end of file