Skip to content

Commit

Permalink
doc: update unreleased tags
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Apr 12, 2024
1 parent 4726777 commit a6abb8d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
use GiveAddon\FormExtension\DonationForm\ValueObjects\ColorField;

/**
* @unreleased
* @since 1.0.0
*/
class ConvertDonationFormBlocksToFieldsApi
{
/**
* Converts the Sample Blocks to the form in GiveWP Field API fields
*
* @unreleased
* @since 1.0.0
*
* @throws EmptyNameException
*/
Expand All @@ -42,23 +42,23 @@ public function __invoke(?Node $node, BlockModel $block, int $index, int $formId
}

/**
* @unreleased
* @since 1.0.0
*/
private function setFieldOptions(Select $field, BlockModel $block)
{
$field->options(...$this->getValidOptions($block));
}

/**
* @unreleased
* @since 1.0.0
*/
private function isAdminChoice(BlockModel $block): bool
{
return count($this->getValidOptions($block)) <= 1;
}

/**
* @unreleased
* @since 1.0.0
*/
private function getValidOptions(BlockModel $block): array
{
Expand All @@ -73,7 +73,7 @@ private function getValidOptions(BlockModel $block): array
}

/**
* @unreleased
* @since 1.0.0
*/
private function getDefaultValue(BlockModel $block): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const mergeOptionsWithColors = (options: OptionProps[], colors: ColorOptionProps
};

/**
* @unreleased
* @since 1.0.0
*/
export default function Edit({attributes, setAttributes}: BlockEditProps<any>) {
const {colors, colorSettingsUrl} = getGiveAddonFormBuilderWindowData();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {OptionProps} from '@givewp/form-builder-library/build/OptionsPanel/types';

/**
* @unreleased
* @since 1.0.0
*/
export type ColorOptionProps = OptionProps & {
isDefault: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/FormExtension/FormBuilder/resources/js/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ export function getGiveCoreFormBuilderWindowData() {
* @since 1.0.0
*/
export function getGiveAddonFormBuilderWindowData() {
console.log(window.GiveAddonFormBuilder);
return window.GiveAddonFormBuilder;
}
41 changes: 3 additions & 38 deletions src/FormExtension/FormExtensionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,23 @@
use GiveAddon\FormExtension\DonationForm\Actions\ConvertDonationFormBlocksToFieldsApi;
use GiveAddon\FormExtension\FormBuilder\Actions\LoadFormBuilderAssets;


/**
* Example of a service provider responsible for Form Extension initialization.
*
* @package GiveAddon\FormExtension
* @copyright Copyright (c) 2020, GiveWP
* @sice 1.0.0
*/
class FormExtensionServiceProvider implements ServiceProvider
{
/**
* @inheritDoc
* @sice 1.0.0
*/
public function register()
{

}

/**
* @inheritDoc
* @sice 1.0.0
*/
public function boot()
{
// Load add-on translations.
//Hooks::addAction('init', Language::class, 'load');
// Load add-on links.
//Hooks::addFilter('plugin_action_links_' . ADDON_CONSTANT_BASENAME, Links::class);

$this->loadBackend();
/*is_admin()
? $this->loadBackend()
: $this->loadFrontend();*/
}

/**
* Load add-on backend assets.
*
* @return void
* @since 1.0.0
*/
private function loadBackend()
{
Hooks::addAction('givewp_form_builder_enqueue_scripts', LoadFormBuilderAssets::class, '__invoke', 10, 2);
Hooks::addFilter(
Expand All @@ -57,16 +34,4 @@ private function loadBackend()
4
);
}

/**
* Load add-on front-end assets.
*
* @return void
* @since 1.0.0
*/
private function loadFrontend()
{
// Load front-end assets.
//Hooks::addAction('wp_enqueue_scripts', Assets::class, 'loadFrontendAssets');
}
}

0 comments on commit a6abb8d

Please sign in to comment.