Draft
Conversation
…datastore data. Includes pluggable data sources (database, API, array), block plugin, render element, extra field, ResourceIdResolver service, and inline preview links on dataset edit forms and the datastore dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4672
Describe your changes
Add
datastore_data_previewsub-module undermodules/datastore/modules/that renders datastore data as paginated, sortable HTML tables using Drupal core's TableSort and pager. No JavaScript frameworks required.Integration points:
#type => 'data_preview'render element/admin/dkan/data-preview/{resource_id}Services:
dkan.data_preview.resource_resolver— resolves distribution UUIDs or nodes toidentifier__versionresource IDsdkan.data_preview.builder— builds paginated, sortable table render arraysdkan.data_preview.datasource.database— direct DB queries to datastore tablesdkan.data_preview.datasource.api— HTTP queries to DKAN's REST API (supports external sites)Also includes
ArrayDataSourcefor in-memory data (not a service — instantiate directly).QA Steps
drush en datastore_data_preview/admin/dkan/data-preview/{resource_id}with a valid resource ID — verify paginated sortable table renders/admin/dkan/datastore/status— verify preview links appear for importable resources/admin/structure/block— verify it renders with a configured resource IDphpcs --standard=Drupal,DrupalPractice modules/datastore/modules/datastore_data_preview/— verify zero errors and warningsphpunit modules/datastore/modules/datastore_data_preview/tests/— verify all 112 tests passChecklist before requesting review
If any of these are left unchecked, please provide an explanation