-
Notifications
You must be signed in to change notification settings - Fork 33
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
Uses new frictionless report component to display validation report #71
Uses new frictionless report component to display validation report #71
Conversation
Codecov Report
@@ Coverage Diff @@
## use-frictionless-framework-v5 #71 +/- ##
=================================================================
- Coverage 84.38% 84.31% -0.08%
=================================================================
Files 24 24
Lines 2075 2078 +3
=================================================================
+ Hits 1751 1752 +1
- Misses 324 326 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@aivuk This is looking good, but there are a couple of things to iron out:
The errors.html template is a good starting point to investigate |
Sorry, just realized this was a draft, so apologies if you were already looking at these |
Thanks, I was working on the dialog, but I'm having an error using the report.js. For some reason the validation_error json is not being passed to the module-validation-report.js (it's undefined), but I checked and the json is there in the template validation/snippets/validation_report_dialog.html but it's not being passed to the JS module. I'm investigating it. I missed the error in the badge, I thought that it would need to be "error", but I got it that we need to have three states. |
…onlessdata/ckanext-validation into use-frictionless-report-component
Hi @amercader, the following points that you raised are fixed:
I'm still debugging why when the plugin is running in sync mode, the report is not being displayed by the component. The same thing happens when the plugin is not running in sync, after you update a resource and click in the badge label before reloading the page. |
README.md
Outdated
@@ -72,9 +72,9 @@ Create the database tables running: | |||
|
|||
## Configuration | |||
|
|||
Once installed, add the `validation` plugin to the `ckan.plugins` configuration option in your INI file: | |||
Once installed, add the `validation` plugin to the `ckan.plugins` configuration option in your INI file. If using ckanext-scheming, the `validation` plugins should be loaded **before** the `scheming_datasets` one: |
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.
Is it feasible to remove this constraint? I know that plugin ordering can be important, but perhaps there is a way to make them more independent?
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.
@ThrawnCA I don't think so. We want ckanext-validation's errors.html to override ckanext-scheming's so we can hook the report to the error messages.
I guess that we could add "If using ckanext-scheming and using synchronous mode, the validation
plugin should be loaded before the scheming_datasets
one" but that would make the instructions a bit more confusing
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.
Oh, and ckanext-scheming defines the base version of that template, which doesn't extend anything, so if ckanext-scheming comes first, then processing stops and ckanext-validation's version is never reached. That makes sense.
Perhaps the reason can be documented here?
Is it necessary to copy the Frictionless web assets into this repo? Are they not available in any PyPI package? |
The frictionless web assets are from https://components.frictionlessdata.io/ and the js package is on npm https://www.npmjs.com/package/frictionless-components. I'm using the latest build (version 1.3.2) instead of a CDN or adding a build it step on ckanext-validation that would download and build the npm package. |
@amercader Fixed the report in sync mode, now the report is being displayed in a dialog if there are errors when creating a new resource. |
Great stuff! Can you make the dialog a bit wider? it's a bit hard to read currently. This probably helps: https://getbootstrap.com/docs/4.2/components/modal/#optional-sizes Besides this, this is good to merge once #69 is done |
It's bigger now |
…onlessdata/ckanext-validation into use-frictionless-report-component
Uses React Frictionless Report component to display a resource validation results.