Skip to content

Commit

Permalink
updating block admin enque
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jan 17, 2024
1 parent 06c112d commit 9dcb5cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/Config/UtilsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ class UtilsConfig
public const FD_API_STEPS = 'apiSteps';
public const FD_CAPTCHA = 'captcha';
public const FD_STORAGE = 'storage';
public const FD_ADDON_DATA = 'addonData';
public const FD_EMAIL_RESPONSE_TAGS = 'emailResponseTags';
public const FD_IS_VALID = 'isValid';
public const FD_IS_API_VALID = 'isApiValid';
Expand All @@ -481,6 +480,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_VALIDATION = 'validation';


// ------------------------------------------------------------------
Expand Down
11 changes: 8 additions & 3 deletions src/Helpers/UtilsApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,15 @@ public static function getIntegrationApiPublicOutput(array $formDetails, string

$additionalOutput = [];

$allowedOutputKeys = UtilsHelper::getStateResponseOutputKeys();
$allowedOutput = [
UtilsConfig::FD_SUCCESS_REDIRECT => UtilsHelper::getStateResponseOutputKey('successRedirect'),
UtilsConfig::FD_ADDON => UtilsHelper::getStateResponseOutputKey('addon'),
UtilsConfig::FD_VALIDATION => UtilsHelper::getStateResponseOutputKey('validation'),
];

foreach ($allowedOutputKeys as $value) {
if (isset($response[$value])) {
// Populate additional output with allowed keys and aproppriate allowed output keys used in JS.
foreach ($allowedOutput as $key => $value) {
if (isset($response[$key])) {
$additionalOutput[$value] = $response[$value];
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/Rest/Routes/AbstractUtilsBaseRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,6 @@ protected function getFormDetailsApi($request): array
// Get form storage from params.
$output[UtilsConfig::FD_STORAGE] = \json_decode($params['storage'] ?? '', true) ?? [];

// Create placeholder for addon data.
$output[UtilsConfig::FD_ADDON_DATA] = [];

return $output;
}

Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@
},
"responseOutputKeys": {
"validation": "validation",
"addon": "addon",
"successRedirectData": "successRedirectData",
"addon": "addonData",
"successRedirect": "successRedirectData",
"file": "file",
"stepType": "stepType",
"stepNextStep": "stepNextStep",
Expand Down

0 comments on commit 9dcb5cc

Please sign in to comment.