Skip to content

Commit

Permalink
Merge pull request #70 from keboola/COM-1327-ondra
Browse files Browse the repository at this point in the history
Fix sample actions
  • Loading branch information
ondrajodas authored Feb 4, 2022
2 parents 86ecd78 + 1b19459 commit 01f2a5e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ protected function runSampleAction(): array
$profile = $this->getConfig()->getProfiles()[0];
$parameters = $this->getConfig()->getParameters();

if ($this->getConfigDefinitionClass() === OldConfigDefinition::class) {
$parameters += $parameters['queries'][0];
unset($parameters['queries']);
}

if (empty($parameters['query']['viewId'])) {
$parameters['query']['viewId'] = (string) $profile['id'];
}
Expand All @@ -123,6 +128,11 @@ protected function runSampleJsonAction(): array
$profile = $this->getConfig()->getProfiles()[0];
$parameters = $this->getConfig()->getParameters();

if ($this->getConfigDefinitionClass() === OldConfigDefinition::class) {
$parameters += $parameters['queries'][0];
unset($parameters['queries']);
}

if (empty($parameters['query']['viewId'])) {
$parameters['query']['viewId'] = (string) $profile['id'];
}
Expand Down

0 comments on commit 01f2a5e

Please sign in to comment.