Skip to content

Commit

Permalink
Added missing provider
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Aug 15, 2024
1 parent e55d8bf commit 0ac066d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@

use Flow\ETL\Adapter\ChartJS\Chart\{BarChart, LineChart, PieChart};
use Flow\ETL\Row\{EntryReference, References};
use Flow\ETL\Attribute\DSL;
use Flow\ETL\Attribute\Module;
use Flow\ETL\Attribute\Type;
use Flow\Filesystem\Path;

#[DSL(module: Module::CHARTJS, type: Type::HELPER)]
function bar_chart(EntryReference $label, References $datasets) : BarChart
{
return new BarChart($label, $datasets);
}

#[DSL(module: Module::CHARTJS, type: Type::HELPER)]
function line_chart(EntryReference $label, References $datasets) : LineChart
{
return new LineChart($label, $datasets);
}

#[DSL(module: Module::CHARTJS, type: Type::HELPER)]
function pie_chart(EntryReference $label, References $datasets) : PieChart
{
return new PieChart($label, $datasets);
}

#[DSL(module: Module::CHARTJS, type: Type::LOADER)]
function to_chartjs_file(Chart $type, Path|string|null $output = null, Path|string|null $template = null) : ChartJSLoader
{
if (\is_string($output)) {
Expand All @@ -40,6 +47,7 @@ function to_chartjs_file(Chart $type, Path|string|null $output = null, Path|stri
return new ChartJSLoader($type, output: $output, template: $template);
}

#[DSL(module: Module::CHARTJS, type: Type::LOADER)]
function to_chartjs_var(Chart $type, array &$output) : ChartJSLoader
{
/** @psalm-suppress ReferenceConstraintViolation */
Expand Down
2 changes: 1 addition & 1 deletion web/landing/resources/dsl.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ public function all() : array
$sources[] = new Source('documentation_dsl', ['module' => (new Slugify())->slugify($module)]);
}

foreach ($this->dslDefinitions->all() as $definition) {
if ($definition->module() === null) {
dd($definition);
}
$sources[] = new Source('documentation_dsl_function', ['module' => (new Slugify())->slugify($definition->module()), 'function' => (new Slugify())->slugify($definition->name())]);
}

return $sources;
}
}
2 changes: 1 addition & 1 deletion web/landing/templates/documentation/dsl.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<div class="grid grid-cols-2 mb-2">
<div class="text-left">
<h4 class="mb-2 inline" id="dsl-{{ definition.name }}">
<a href="{{ path('documentation_dsl_function', {module: definition.module|lower, function: definition.name|lower, _fragment: "dsl-function"}) }}" class="text-white">
<a href="{{ path('documentation_dsl_function', {module: definition.module |lower, function: definition.name|lower, _fragment: "dsl-function"}) }}" class="text-white">
<img src="{{ asset('images/icons/link.svg') }}" width="16" height="16" alt="feature" class="inline">
{{ definition.name }}
</a>
Expand Down

0 comments on commit 0ac066d

Please sign in to comment.