Skip to content

Commit

Permalink
release 5.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jul 25, 2024
1 parent 72da604 commit ded5c1e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"useTabs": true,
"jsxSingleQuote": true,
"singleQuote": true,
"singleAttributePerLine": true,
"printWidth": 180,
"arrowParens": "always",
"bracketSpacing": true,
"semi": true,
"trailingComma": "all"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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/).

## [5.0.3]

### Fixed
- Added field validation to the output of the error msg.
- Additional fixes for legacy output data.

## [5.0.2]

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

- Initial production release.

[5.0.2]: https://github.com/infinum/eightshift-forms/compare/5.0.2...5.0.3
[5.0.1]: https://github.com/infinum/eightshift-forms/compare/5.0.1...5.0.2
[5.0.1]: https://github.com/infinum/eightshift-forms/compare/5.0.0...5.0.1
[5.0.0]: https://github.com/infinum/eightshift-forms/compare/4.0.7...5.0.0
Expand Down
2 changes: 1 addition & 1 deletion eightshift-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level.
* Author: WordPress team @Infinum
* Author URI: https://eightshift.com/
* Version: 5.0.2
* Version: 5.0.3
* Text Domain: eightshift-forms
*
* @package EightshiftForms
Expand Down
18 changes: 7 additions & 11 deletions src/Rest/Routes/AbstractFormSubmit.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,6 @@ protected function getIntegrationCommonSubmitAction(array $formDetails): array

$formDetails[UtilsConfig::FD_RESPONSE_OUTPUT_DATA] = $responseOutput;

$additionalOutput = [];

if (isset($response[UtilsConfig::IARD_VALIDATION])) {
$additionalOutput[UtilsHelper::getStateResponseOutputKey('validation')] = $response[UtilsConfig::IARD_VALIDATION];
}

if ($status === UtilsConfig::STATUS_SUCCESS) {
$successAdditionalData = $this->getIntegrationResponseSuccessOutputAdditionalData($formDetails);

Expand All @@ -389,7 +383,6 @@ protected function getIntegrationCommonSubmitAction(array $formDetails): array
return UtilsApiHelper::getApiSuccessPublicOutput(
$labelsOutput,
\array_merge(
$additionalOutput,
$successAdditionalData['public'],
$successAdditionalData['additional']
),
Expand All @@ -399,7 +392,12 @@ protected function getIntegrationCommonSubmitAction(array $formDetails): array

return UtilsApiHelper::getApiErrorPublicOutput(
$labelsOutput,
$this->getIntegrationResponseErrorOutputAdditionalData($formDetails),
\array_merge(
$this->getIntegrationResponseErrorOutputAdditionalData($formDetails),
((isset($response[UtilsConfig::IARD_VALIDATION])) ? [
UtilsHelper::getStateResponseOutputKey('validation') => $response[UtilsConfig::IARD_VALIDATION],
] : []),
),
$response
);
}
Expand Down Expand Up @@ -510,9 +508,7 @@ protected function getIntegrationResponseSuccessOutputAdditionalData(array $form
$secureData = \json_decode(UtilsEncryption::decryptor($formDetails[UtilsConfig::FD_SECURE_DATA]) ?: '', true);

// Legacy data.
if (isset($secureData['l'])) {
$redirectDataOutput['es-legacy'] = $this->processLegacyData($secureData['l'], $formDetails[UtilsConfig::FD_PARAMS_RAW], $formId);
}
$redirectDataOutput['es-legacy'] = $this->processLegacyData($secureData['l'] ?? [], $formDetails[UtilsConfig::FD_PARAMS_RAW], $formId);

// Redirect custom result output feature.
$formsUseCustomResultOutputFeatureFilterName = UtilsHooksHelper::getFilterName(['block', 'forms', 'useCustomResultOutputFeature']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,17 @@ protected function submitAction(array $formDetails)
*/
protected function callIntegrationResponseSuccessCallback(array $formDetails, array $successAdditionalData): void
{
$this->sendEvent($formDetails, $successAdditionalData);
$this->sendEvent($formDetails);
}

/**
* Send event to Moments if needed.
*
* @param array<string, mixed> $formDetails Data passed from the `getFormDetailsApi` function.
* @param array<string, mixed> $successAdditionalData Data passed from the `getIntegrationResponseSuccessOutputAdditionalData` function.
*
* @return void
*/
private function sendEvent(array $formDetails, array $successAdditionalData): void
private function sendEvent(array $formDetails): void
{
$formId = $formDetails[UtilsConfig::FD_FORM_ID];
$type = $formDetails[UtilsConfig::FD_TYPE] ?? '';
Expand Down

0 comments on commit ded5c1e

Please sign in to comment.