Beautiful Open-Source Form Builder
feat: add Albato integration support (#1228)
Chirag Chhatrala307ccd56aa3e
diff --git a/api/app/Integrations/Handlers/AlbatoIntegration.php b/api/app/Integrations/Handlers/AlbatoIntegration.phpnew file mode 100644index 000000000..a24566992--- /dev/null+++ b/api/app/Integrations/Handlers/AlbatoIntegration.php@@ -0,0 +1,37 @@+<?php++namespace App\Integrations\Handlers;++use App\Models\Forms\Form;+use App\Rules\PublicWebhookUrlRule;++class AlbatoIntegration extends AbstractIntegrationHandler+{+ public static function getValidationRules(?Form $form): array+ {+ return [+ 'webhook_url' => ['required', 'url', new PublicWebhookUrlRule()],+ '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.jsonindex f4612829b..8e07e6164 100644--- a/api/resources/data/forms/integrations.json+++ b/api/resources/data/forms/integrations.json@@ -99,6 +99,17 @@"is_editable": false,"url": "https://connect.pabbly.com/integrations/opnform"},+ "albato": {+ "name": "Albato",+ "icon": "opnform:albato",+ "section_name": "Automation",+ "file_name": "AlbatoIntegration",+ "actions_file_name": "AlbatoIntegrationActions",+ "required_tier": "free",+ "is_external": true,+ "is_editable": false,+ "url": "https://albato.com/apps/opnform"+ },"google_sheets": {"name": "Google Sheets","icon": "mdi:google-spreadsheet",diff --git a/client/components/open/integrations/components/AlbatoIntegrationActions.vue b/client/components/open/integrations/components/AlbatoIntegrationActions.vuenew file mode 100644index 000000000..7448df759--- /dev/null+++ b/client/components/open/integrations/components/AlbatoIntegrationActions.vue@@ -0,0 +1,36 @@+<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/composables/components/useComponentRegistry.js b/client/composables/components/useComponentRegistry.jsindex d7975d7ad..55a5ae9c8 100644--- a/client/composables/components/useComponentRegistry.js+++ b/client/composables/components/useComponentRegistry.js@@ -29,6 +29,7 @@ const actionRegistry = new Map([['ActivepiecesIntegrationActions', () => import('~/components/open/integrations/components/ActivepiecesIntegrationActions.vue')],['MakeIntegrationActions', () => import('~/components/open/integrations/components/MakeIntegrationActions.vue')],['PabblyIntegrationActions', () => import('~/components/open/integrations/components/PabblyIntegrationActions.vue')],+ ['AlbatoIntegrationActions', () => import('~/components/open/integrations/components/AlbatoIntegrationActions.vue')],])const providerRegistry = new Map([diff --git a/client/data/forms/integrations.json b/client/data/forms/integrations.jsonindex f4612829b..8e07e6164 100644--- a/client/data/forms/integrations.json+++ b/client/data/forms/integrations.json@@ -99,6 +99,17 @@"is_editable": false,"url": "https://connect.pabbly.com/integrations/opnform"},+ "albato": {+ "name": "Albato",+ "icon": "opnform:albato",+ "section_name": "Automation",+ "file_name": "AlbatoIntegration",+ "actions_file_name": "AlbatoIntegrationActions",+ "required_tier": "free",+ "is_external": true,+ "is_editable": false,+ "url": "https://albato.com/apps/opnform"+ },"google_sheets": {"name": "Google Sheets","icon": "mdi:google-spreadsheet",diff --git a/client/public/icons/albato.svg b/client/public/icons/albato.svgnew file mode 100644index 000000000..2beb04add--- /dev/null+++ b/client/public/icons/albato.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 123 28" fill="none">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M25.2402 27.5088H30.6577V0H25.2402V27.5088ZM15.2885 18.2984C15.2885 16.9792 14.8174 15.7026 13.8752 14.7664C12.9758 13.8302 11.7767 13.3195 10.4919 13.3195C9.20707 13.3195 8.00792 13.8302 7.06573 14.7664C6.16636 15.7026 5.65244 16.9792 5.65244 18.2984C5.65244 19.6176 6.16636 20.8517 7.06573 21.8305C8.00792 22.7667 9.20707 23.2773 10.4919 23.2773C11.7767 23.2773 12.9758 22.7667 13.8752 21.8305C14.8174 20.8517 15.2885 19.6176 15.2885 18.2984ZM20.6847 9.14989V27.4895H16.145V25.7022C14.432 27.1491 12.205 28.0002 9.80665 28.0002C4.36834 28.0002 0 23.6603 0 18.2984C0 12.894 4.36834 8.59668 9.80665 8.59668C12.205 8.59668 14.432 9.44777 16.145 10.8946L16.5733 9.14989H20.6847ZM50.4514 14.6837C51.3484 15.6647 51.861 16.9026 51.861 18.2258C51.861 19.5491 51.3484 20.8296 50.4514 21.7687C49.5544 22.7078 48.3584 23.22 47.077 23.22C45.7956 23.22 44.5569 22.7078 43.6599 21.7687C42.7636 20.8296 42.2503 19.5491 42.2503 18.2258C42.2503 16.9026 42.7636 15.6647 43.6599 14.6837C44.5569 13.7439 45.7956 13.2317 47.077 13.2317C48.3584 13.2317 49.5544 13.7439 50.4514 14.6837ZM47.7604 8.45165C45.1129 8.45165 42.6782 9.51878 40.9269 11.2262V0H35.4595V27.4885H40.9269V25.2262C42.6782 26.9336 45.1129 28 47.7604 28C53.1424 28 57.4985 23.6468 57.4985 18.2258C57.4985 12.8475 53.1424 8.45165 47.7604 8.45165ZM75.2494 18.2984C75.2494 16.9792 74.7783 15.7026 73.8361 14.7664C72.9368 13.8302 71.7376 13.3195 70.4528 13.3195C69.168 13.3195 67.9689 13.8302 67.0267 14.7664C66.1273 15.7026 65.6134 16.9792 65.6134 18.2984C65.6134 19.6176 66.1273 20.8517 67.0267 21.8305C67.9689 22.7667 69.168 23.2773 70.4528 23.2773C71.7376 23.2773 72.9368 22.7667 73.8361 21.8305C74.7783 20.8517 75.2494 19.6176 75.2494 18.2984ZM80.6456 9.14989V27.4895H76.106V25.7022C74.3929 27.1491 72.1659 28.0002 69.7676 28.0002C64.3286 28.0002 59.9609 23.6603 59.9609 18.2984C59.9609 12.894 64.3286 8.59668 69.7676 8.59668C72.1659 8.59668 74.3929 9.44777 76.106 10.8946L76.5342 9.14989H80.6456ZM100.468 14.0887V9.08789H84.093V14.0887H89.357V27.5089H94.7776V14.0887H100.468ZM117.601 18.2559C117.601 16.9367 117.13 15.7026 116.23 14.7664C115.287 13.7876 114.131 13.277 112.802 13.277C111.56 13.277 110.317 13.7876 109.46 14.7664C108.475 15.7026 108.003 16.9792 108.003 18.2984C108.003 19.6602 108.475 20.8943 109.46 21.873C110.317 22.8092 111.56 23.3199 112.802 23.3199C114.131 23.3199 115.287 22.8092 116.23 21.873C117.13 20.8943 117.601 19.6176 117.601 18.2559ZM123 18.2984C123 23.7029 118.458 28.0002 112.76 28.0002C107.104 28.0002 102.562 23.7029 102.562 18.2984C102.562 12.9365 107.104 8.59668 112.76 8.59668C118.458 8.59668 123 12.9365 123 18.2984ZM100.468 5.03509H84.093V0H100.468V5.03509Z" fill="#FF592C"/>+</svg>