-
Notifications
You must be signed in to change notification settings - Fork 59
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
Data Selector for JSON Payload #437
base: 1.x
Are you sure you want to change the base?
Conversation
@@ -45,6 +45,7 @@ plugin_pimcore_datahub_data_importer_configpanel_csv_escape: Escape | |||
plugin_pimcore_datahub_data_importer_configpanel_xlsx_sheet: Sheet | |||
plugin_pimcore_datahub_data_importer_configpanel_xml_xpath: XPath | |||
plugin_pimcore_datahub_data_importer_configpanel_xml_schema: Schema | |||
plugin_pimcore_datahub_data_importer_configpanel_json_path: Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen the name "path" and "expression" used. do we have a preference?
xtype: 'textfield', | ||
fieldLabel: t('plugin_pimcore_datahub_data_importer_configpanel_json_path'), | ||
name: this.dataNamePrefix + 'path', | ||
value: this.data.path || '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do I need anything else here, such as:
allowBlank: true,
msgTarget: 'under'
@@ -32,13 +35,17 @@ class JsonFileInterpreter extends AbstractInterpreter | |||
|
|||
protected function loadData(string $path): array | |||
{ | |||
if ($this->cachedFilePath === $path && !empty($this->cachedContent)) { | |||
if ($this->cachedFilePath !== $path || empty($this->cachedContent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe this logic was wrong before. See fix for Xml: #438
Quality Gate passedIssues Measures |
@@ -52,7 +63,7 @@ protected function doInterpretFileAndCallProcessRow(string $path): void | |||
|
|||
public function setSettings(array $settings): void | |||
{ | |||
//nothing to do | |||
$this->path = $settings['path']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to do any validation here that the path passed in is a valid JmesPath?
See: https://github.com/orgs/pimcore/discussions/17670#discussion-7265373
CC @fashxp
This does add a new dep: "mtdowling/jmespath.php" (https://github.com/jmespath/jmespath.php)