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

Data Selector for JSON Payload #437

Open
wants to merge 6 commits into
base: 1.x
Choose a base branch
from

Conversation

cancan101
Copy link
Contributor

@cancan101 cancan101 commented Nov 22, 2024

@@ -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
Copy link
Contributor Author

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 || '',
Copy link
Contributor Author

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)) {
Copy link
Contributor Author

@cancan101 cancan101 Nov 22, 2024

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

Copy link

sonarcloud bot commented Nov 26, 2024

@@ -52,7 +63,7 @@ protected function doInterpretFileAndCallProcessRow(string $path): void

public function setSettings(array $settings): void
{
//nothing to do
$this->path = $settings['path'];
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant