Skip to content

Commit

Permalink
feat: wip on data quality errors panel
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgarel committed Feb 8, 2023
1 parent b49fbe4 commit 39fe9d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
7 changes: 2 additions & 5 deletions lib/ProductOpener/ContributionKnowledgePanels.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ BEGIN {
use vars @EXPORT_OK;

use ProductOpener::KnowledgePanels qw(create_panel_from_json_template);
use ProductOpener::Tags qw(:all);

use Encode;
use Data::DeepAccess qw(deep_get);
Expand Down Expand Up @@ -117,16 +118,12 @@ sub create_data_quality_errors_panel ($product_ref, $target_lc, $target_cc, $opt
&& ($options_ref->{knowledge_panels_client} eq 'web')
&& (scalar @data_quality_errors_tags))
{
$panel_data_ref->{quality_errors} = tags_by_prop($product_ref, "fix_action", ["description"]);
$panel_data_ref->{quality_errors} = tags_by_prop("data_quality", $product_ref->{data_quality_errors_tags} ,"fix_action", ["description"]);
create_panel_from_json_template("data_quality_errors",
"api/knowledge-panels/contribution/data_quality_errors.tt.json",
$panel_data_ref, $product_ref, $target_lc, $target_cc, $options_ref);
}
return;
}

sub quality_errors_by_action ($product_ref, $attrs) {

}

1;
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,25 @@
"icon_url": "[% static_subdomain %]/images/icons/dist/scale-balance.svg",
},
"elements": [
{
"element_type": "text",
"text_element": "nothing yet !",
},

[% FOREACH fix_action IN data_quality_errors_tags.keys %]
[% descriptions = data_quality_errors_tags.$fix_action.values %]
{
"element_type": "text",
"text_element": `
<ul>
[% FOREACH description IN descriptions %]
<li>[% description %]</li>
[% END %]
</ul>
`,
},
{
"element_type": "action",
"html": `[% lang("action_" . $fix_action) %]`,
"actions": [
"[% fix_action %]",
]
},
[% END %]
]
}

0 comments on commit 39fe9d0

Please sign in to comment.