Remove old code related to notifications (#363)

* Integrations Refactoring - WIP

* integrations list & edit - WIP

* Fix integration store binding issue

* integrations refactor - WIP

* Form integration - WIP

* Form integration Edit - WIP

* Integration Refactor - Slack - WIP

* Integration Refactor - Discord - WIP

* Integration Refactor - Webhook - WIP

* Integration Refactor - Send Submission Confirmation - WIP

* Integration Refactor - Backend handler - WIP

* Form Integration Status field

* Integration Refactor - Backend SubmissionConfirmation - WIP

* IntegrationMigration Command

* skip confirmation email test case

* Small refactoring

* FormIntegration status active/inactive

* formIntegrationData to integrationData

* Rename file name with Integration suffix for integration realted files

* Loader on form integrations

* WIP

* form integration test case

* WIP

* Added Integration card - working on refactoring

* change location for IntegrationCard and update package file

* Form Integration Create/Edit in single Modal

* Remove integration extra pages

* crisp_help_page_slug for integration json

* integration logic as collapse

* UI improvements

* WIP

* Trying to debug vue devtools

* WIP for integrations

* getIntegrationHandler change namespace name

* useForm for integration fields + validation structure

* Integration Test case & apply validation rules

* Apply useform changes to integration other files

* validation rules for FormNotificationsMessageActions fields

* Zapier integration as coming soon

* Update FormCleaner

* set default settings for confirmation integration

* WIP

* Finish validation for all integrations

* Updated purify, added integration formatData

* Fix testcase

* Ran pint; working on integration errors

* Handle integration events

* Remove old code related to notifications

* command for Delete Old Integration Events

* Display Past Events in Modal

* on Integration event create with status error send email to form creator

* Polish styling

* Minor improvements

* Finish badge and integration status

* Fix tests and add an integration event test

* Run linters

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>
Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Chirag Chhatrala
2024-03-28 23:16:29 +05:30
committed by GitHub
parent 6f61faa9ef
commit 35efd6711d
27 changed files with 94 additions and 1020 deletions

View File

@@ -59,9 +59,6 @@ class FormFactory extends Factory
'title' => $this->faker->text(30),
'description' => $this->faker->randomHtml(1),
'visibility' => 'public',
'notifies' => false,
'send_submission_confirmation' => false,
'webhook_url' => null,
'theme' => $this->faker->randomElement(Form::THEMES),
'width' => $this->faker->randomElement(Form::WIDTHS),
'dark_mode' => $this->faker->randomElement(Form::DARK_MODE_VALUES),
@@ -75,17 +72,10 @@ class FormFactory extends Factory
're_fillable' => false,
're_fill_button_text' => 'Fill Again',
'submitted_text' => '<p>Amazing, we saved your answers. Thank you for your time and have a great day!</p>',
'notification_sender' => 'OpenForm',
'notification_subject' => 'We saved your answers',
'notification_body' => 'Hello there 👋 <br>This is a confirmation that your submission was successfully saved.',
'notifications_include_submission' => true,
'use_captcha' => false,
'can_be_indexed' => true,
'password' => false,
'tags' => [],
'slack_webhook_url' => null,
'discord_webhook_url' => null,
'notification_settings' => [],
'editable_submissions_button_text' => 'Edit submission',
'confetti_on_submission' => false,
'seo_meta' => [],

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('forms', function (Blueprint $table) {
$table->dropColumn([
'notifies',
'notification_emails',
'send_submission_confirmation',
'notification_sender',
'notification_subject',
'notification_body',
'notifications_include_submission',
'slack_webhook_url',
'discord_webhook_url',
'webhook_url',
'notification_settings'
]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$driver = DB::getDriverName();
Schema::table('forms', function (Blueprint $table) use ($driver) {
$table->boolean('notifies')->default(false);
$table->text('notification_emails')->nullable();
$table->boolean('send_submission_confirmation')->default(false);
$table->string('notification_sender')->default('OpenForm');
$table->string('notification_subject')->default('We saved your answers');
$table->text('notification_body')->default(new Expression("('<p>Hello there 👋 <br>This is a confirmation that your submission was successfully saved.</p>')"));
$table->boolean('notifications_include_submission')->default(true);
$table->string('slack_webhook_url')->nullable();
$table->string('discord_webhook_url')->nullable();
$table->string('webhook_url')->nullable();
if ($driver === 'mysql') {
$table->json('notification_settings')->default(new Expression('(JSON_OBJECT())'))->nullable(true);
} else {
$table->json('notification_settings')->default('{}')->nullable(true);
}
});
}
};