Skip to content

Commit

Permalink
Replace use of the hidden moderation state as a CSS class (#4158)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-m committed Apr 11, 2024
1 parent 17c34df commit 117b5f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/datastore/src/Form/DashboardForm.php
Expand Up @@ -407,6 +407,13 @@ protected function buildRevisionRows(array $datasetInfo, string $harvestStatus)
* Three-column revision row (expected to be merged with one resource row).
*/
protected function buildRevisionRow(array $rev, int $resourceCount, string $harvestStatus) {
// Moderation state can be 'hidden', which is not a good CSS class if we
// don't want data to be hidden. We hijack the 'registered' class for use
// here.
$moderation_class = $rev['moderation_state'];
if ($moderation_class == 'hidden') {
$moderation_class = 'registered';
}
return [
[
'rowspan' => $resourceCount,
Expand All @@ -424,7 +431,7 @@ protected function buildRevisionRow(array $rev, int $resourceCount, string $harv
'#theme' => 'datastore_dashboard_revision_cell',
'#revision_id' => $rev['revision_id'],
'#modified' => $this->dateFormatter->format(strtotime($rev['modified_date_dkan']), 'short'),
'#moderation_state' => $rev['moderation_state'],
'#moderation_state' => $moderation_class,
],
],
[
Expand Down

0 comments on commit 117b5f9

Please sign in to comment.