Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.0.0 #11

Merged
merged 24 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [3.0.0]

### Removed
- `FD_EMAIL_RESPONSE_TAGS`, `FD_ADDON`, `FD_SUCCESS_REDIRECT`, `FD_ENTRY_ID` constants.
- `getApiPublicAdditionalDataOutput` method.
- `resultOutputItems`, `resultOutputParts` responseOutputKeys enums.
- `downloads` successRedirectUrlKeys enum.

### Added
- `FD_PARAMS_ORIGINAL_DEBUG`, `FD_SECURE_DATA` constants.
- `getStateSuccessRedirectUrlKeys` and `getStateSuccessRedirectUrlKey` methods.
- Additional level of security check for the form data.
- `secureData` params enum.
- `formSecureData` attr enum.
- `processExternally`, `processExternally`, `trackingEventName`, `trackingAdditionalData`, `hideGlobalMsgOnSuccess`, `hideFormOnSuccess`, `variation`, `entry` and `formId` responseOutputKeys enums.
- `entry`, `customResultOutput` successRedirectUrlKeys enums.

## [2.0.2]

### Added
Expand Down Expand Up @@ -167,7 +184,8 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a

- Initial production release.

[2.0.1]: https://github.com/infinum/eightshift-forms-utils/compare/2.0.1...2.0.2
[3.0.0]: https://github.com/infinum/eightshift-forms-utils/compare/2.0.2...3.0.0
[2.0.2]: https://github.com/infinum/eightshift-forms-utils/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/infinum/eightshift-forms-utils/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/infinum/eightshift-forms-utils/compare/1.3.6...2.0.0
[1.3.6]: https://github.com/infinum/eightshift-forms-utils/compare/1.3.5...1.3.6
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0",
"infinum/eightshift-coding-standards": "^3.0.0",
"php-parallel-lint/php-parallel-lint": "^v1.4.0",
"php-stubs/wordpress-stubs": "^v6.5.3",
"szepeviktor/phpstan-wordpress": "^v1.3.4"
"php-stubs/wordpress-stubs": "v6.6.0",
"szepeviktor/phpstan-wordpress": "^v1.3.5"
},
"require": {
"php": ">=8.2",
Expand Down
80 changes: 41 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Config/UtilsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,11 @@ class UtilsConfig
public const FD_FIELDS_ONLY = 'fieldsOnly';
public const FD_FILES_UPLOAD = 'filesUpload';
public const FD_ACTION = 'action';
public const FD_SECURE_DATA = 'secureData';
public const FD_ACTION_EXTERNAL = 'actionExternal';
public const FD_API_STEPS = 'apiSteps';
public const FD_CAPTCHA = 'captcha';
public const FD_STORAGE = 'storage';
public const FD_EMAIL_RESPONSE_TAGS = 'emailResponseTags';
public const FD_IS_VALID = 'isValid';
public const FD_IS_API_VALID = 'isApiValid';
public const FD_LABEL = 'label';
Expand All @@ -505,9 +505,9 @@ class UtilsConfig
public const FD_FIELD_NAMES_FULL = 'fieldNamesFull';
public const FD_STEPS_SETUP = 'stepsSetup';
public const FD_RESPONSE_OUTPUT_DATA = 'responseOutputData';
public const FD_ADDON = 'addon';
public const FD_SUCCESS_REDIRECT = 'successRedirect';
public const FD_ENTRY_ID = 'entryId';

// Never use this parameter because it is only used for fallback purposes.
public const FD_PARAMS_ORIGINAL_DEBUG = 'paramsOriginalDebug';

// ------------------------------------------------------------------
// Integration API response details data Keys
Expand Down
22 changes: 0 additions & 22 deletions src/Helpers/UtilsApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,28 +134,6 @@ public static function getIntegrationSuccessInternalOutput(array $details, array
);
}

/**
* Get api public output additional data used on both integrations and none integrations.
*
* @param array<string, mixed> $formDetails Data passed from the `getFormDetailsApi` function.
*
* @return array<string, mixed>
*/
public static function getApiPublicAdditionalDataOutput(array $formDetails): array
{
$output = [];

if (isset($formDetails[UtilsConfig::FD_SUCCESS_REDIRECT]) && $formDetails[UtilsConfig::FD_SUCCESS_REDIRECT]) {
$output[UtilsHelper::getStateResponseOutputKey('successRedirect')] = $formDetails[UtilsConfig::FD_SUCCESS_REDIRECT];
}

if (isset($formDetails[UtilsConfig::FD_ADDON]) && $formDetails[UtilsConfig::FD_ADDON]) {
$output[UtilsHelper::getStateResponseOutputKey('addon')] = $formDetails[UtilsConfig::FD_ADDON];
}

return $output;
}

/**
* Return API error response array.
*
Expand Down
14 changes: 12 additions & 2 deletions src/Helpers/UtilsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,25 @@ public static function getStateResponseOutputKey(string $name): string
return self::getStateResponseOutputKeys()[$name] ?? '';
}

/**
* Return successRedirectUrlKeys enum values.
*
* @return array<string>
*/
public static function getStateSuccessRedirectUrlKeys(): array
{
return self::getUtilsManifest()['enums']['successRedirectUrlKeys'] ?? [];
}

/**
* Return successRedirectUrlKeys enum value by name.
*
* @param string $name Name of the enum.
*
* @return string
*/
public static function getStateSuccessRedirectUrlKeys(string $name): string
public static function getStateSuccessRedirectUrlKey(string $name): string
{
return self::getUtilsManifest()['enums']['successRedirectUrlKeys'][$name] ?? '';
return self::getStateSuccessRedirectUrlKeys()[$name] ?? '';
}
}
Loading