Add dkan_datastore_preview datastore submodule - #4784
Draft
dcgoodwin2112 wants to merge 2 commits into
Draft
Conversation
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 [issue#]
Describe your changes
Adds
dkan_datastore_preview, a submodule ofdkan_datastorethat renders a paginated, sortable HTML table of datastore data for each CSV/TSV distribution on the server-rendered dataset page (/node/{nid}). MVP scope from the ticket: find the datastore table and display it in thedkan_metastoretwig template; the block and a configurable data-source plugin system are follow-ups.DataSourceInterface+DatabaseDataSource(seam for a future plugin system),DataPreviewBuilder,dkan_datastore_previewrender element,ImportStatusMessagedp0_order,dp1_page_size, …) so multiple previews on one page don't share state; no JavaScriptnode--data.html.twigprints{{ content.data_preview }}(empty when the module is disabled;dkan_metastoregains no dependency ondkan_datastore)ddev dkan-site-installenables the moduleQA Steps
Prerequisite: a dataset with one imported CSV distribution (
drush dkan:datastore:listshowsdone), enough rows to page (more than 25).drush en dkan_datastore_preview, then open the dataset's node page (/node/{nid}, not the React/dataset/{uuid}page). A captioned preview table renders below Downloads with "Showing 1-25 of N results".dp0_order/dp0_sort, the header getsaria-sort, rows re-sort. Click again to reverse.dp0_page_size=10.drush watchdog:show.drush dkan:datastore:drop <identifier>(identifier fromdrush dkan:datastore:list),drush cr, reload: "Data preview is not yet available…" message instead of the table.drush dkan:datastore:import <identifier> && drush queue:run datastore_import, reload withoutdrush cr: the table is back.drush pmu dkan_datastore_preview, reload: page renders normally with no preview and no errors.Checklist before requesting review
If any of these are left unchecked, please provide an explanation
Co-authored by: Github Copilot