Skip to content

Commit

Permalink
feature: Add Form Extension (#4)
Browse files Browse the repository at this point in the history
* chore: Update composer

* feature: Add form extension

* Refactor: ActiveCampaign has block requirements (#5)

* feature: add block placeholder and notice

* feature: add window declaration

* refactor: remove inline window declaration, update list and tag options, use new placeholder and notice

* refactor: use credential test prior to api calls, add method for tags, update localized script.

* feature: add credential test prior to adding new block

* refactor: replace blocknotice

* refactor; reformat, update strings.

* refactor: reformat remove spaces in src/FormExtension/Actions/EnqueueFormBuilderScripts.php

* doc: update unreleased tags

* doc: update unreleased tags

* refactor: replace relative url path with admin_url for better WP support

* Refactor: block design improvements (#6)

* feature: add block placeholder and notice

* feature: add window declaration

* refactor: remove inline window declaration, update list and tag options, use new placeholder and notice

* refactor: use credential test prior to api calls, add method for tags, update localized script.

* feature: add credential test prior to adding new block

* refactor: replace blocknotice

* refactor; reformat, update strings.

* refactor: reformat remove spaces in src/FormExtension/Actions/EnqueueFormBuilderScripts.php

* doc: update unreleased tags

* doc: update unreleased tags

* refactor: replace relative url path with admin_url for better WP support

* refactor: update template styles for consistency

* refactor: reformat

* refactor: update & export window types

* feature: add tag & list controls. Split InspectorControls into new directory

* refactor: use update inspectorControls

* chore: remove debug log

* chore: formatting

* refactor: add ending bracket

* refactor: update metadata default label

* refactor: update template defaultChecked prop to checkeda

* refactor: replace selectedEmailList attribute to selectedLists

* refactor: update list control label

* refactor: fix translation domain on subscriber tags

* refactor: update listControl to always have one list selected

* refactor: use array fallback on selectedLists

* refactor: update domain names

* refactor: return early on methods requiring credential tests

* Refactor: use early return on add block to new form

* refactor: fix double negative conditonal

* refactor: update conditionals

* refactor: enqueue scripts in header

---------

Co-authored-by: Joshua Dinh <[email protected]>
Co-authored-by: Joshua Dinh <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2024
1 parent 46412dd commit 3be6c99
Show file tree
Hide file tree
Showing 29 changed files with 44,497 additions and 1,798 deletions.
26 changes: 17 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"name": "impress-org/give-activecampaign",
"authors": [
{
"name": "GiveWP",
"email": "[email protected]",
"homepage": "https://givewp.com",
"role": "Developer"
}
],
"type": "wordpress-plugin",
"scripts": {
"unreleased": "./vendor/bin/since-unreleased.sh"
},
"require": {
"activecampaign/api-php": "2.0.3"
},
"minimum-stability": "dev"
"require-dev": {
"kjohnson/since-unreleased": "^1.0"
},
"autoload": {
"psr-4": {
"GiveActiveCampaign\\": "src/"
}
},
"config": {
"platform": {
"php": "7.2"
}
}
}
32 changes: 30 additions & 2 deletions give-activecampaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ class Give_ActiveCampaign {
*/
public $notices = array();

/**
* @unreleased
* @var array
*/
private $serviceProviders = [
\GiveActiveCampaign\FormExtension\ServiceProvider::class,
];

/**
* Returns the singleton instance of this class.
*
Expand All @@ -87,7 +95,12 @@ public static function get_instance() {
*/
private function setup() {

add_action( 'give_init', array( $this, 'init' ), 10 );
require_once GIVE_ACTIVECAMPAIGN_PATH . '/vendor/autoload.php';

// Load service providers.
add_action('before_give_init', [$this, 'registerServiceProviders']);

add_action( 'give_init', array( $this, 'init' ), 10 );
add_action( 'admin_init', array( $this, 'check_environment' ) );
add_action( 'admin_notices', array( $this, 'admin_notices' ), 15 );
add_action( 'give_add_email_tags', array( $this, 'add_email_tags' ), 9999999 );
Expand All @@ -99,6 +112,22 @@ private function setup() {

}

/**
* Register service providers
*
* @unreleased
*/
public function registerServiceProviders()
{
if ( ! $this->get_environment_warning() ) {
return;
}

foreach ($this->serviceProviders as $className) {
give()->registerServiceProvider($className);
}
}

/**
* Init the plugin after plugins_loaded so environment variables are set.
*
Expand All @@ -120,7 +149,6 @@ public function init() {
return false;
}

require_once GIVE_ACTIVECAMPAIGN_PATH . '/vendor/autoload.php';
require_once GIVE_ACTIVECAMPAIGN_PATH . '/includes/helpers.php';
require_once GIVE_ACTIVECAMPAIGN_PATH . '/includes/metabox.php';

Expand Down
60 changes: 0 additions & 60 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit 3be6c99

Please sign in to comment.