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

Developer Experience: Make getAdditionalConfig extensible #30718

Open
wants to merge 3 commits into
base: 2.5-develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ public function getCurrentStore()

/**
* Returns additional values for js config, con be overridden by descendants
* @deprecated Use composition approach to extend the Configuration (plugin for getAdditionalerConfig method)
* @see getAdditionalConfig to apply `after` plugin and extend an array
*
* @return array
*/
Expand All @@ -215,6 +217,16 @@ protected function _getAdditionalConfig()
return [];
}

/**
* Returns additional values for js config, con be overridden by descendants
*
* @return array
*/
public function getAdditionalConfig()
{
return $this->_getAdditionalConfig();
}

/**
* Composes configuration for js
*
Expand Down Expand Up @@ -245,7 +257,7 @@ public function getJsonConfig()
$config['defaultValues'] = $attributesData['defaultValues'];
}

$config = array_merge($config, $this->_getAdditionalConfig());
$config = array_merge($config, $this->getAdditionalConfig());

return $this->jsonEncoder->encode($config);
}
Expand Down