Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion services/drupal/composer.patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@
},
"drupal/diff": {
"Patch diff interface to get language to match core patches in these issues: 3252521, 2899719, and 3252540": "patches/diff-patch-revision-language-to-match-3252521-2899719-3252540-3.patch",
"Add classes to allow color-coding of revisions list": "https://www.drupal.org/files/issues/2021-12-03/diff-add_classes-3252547-2.patch"
"Add classes to allow color-coding of revisions list": "https://www.drupal.org/files/issues/2021-12-03/diff-add_classes-3252547-2.patch",
"Adjust dropbuttons to be links for https://forumone.atlassian.net/browse/EPAD8-2525": "patches/make-diff-dropbuttons-links.diff"
},
"drupal/entitygroupfield": {
"Limit available groups in widget to ones user has permission to.": "https://www.drupal.org/files/issues/2020-08-07/entitygroupfield-Autocomplete_permissions-3163814-4.patch",
Expand Down
85 changes: 85 additions & 0 deletions services/drupal/patches/make-diff-dropbuttons-links.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
diff --git a/src/Controller/PluginRevisionController.php b/src/Controller/PluginRevisionController.php
index b266591..e500934 100644
--- a/src/Controller/PluginRevisionController.php
+++ b/src/Controller/PluginRevisionController.php
@@ -168,10 +168,13 @@ class PluginRevisionController extends ControllerBase {

// Build the layout filter.
$build['controls']['diff_layout'] = [
- '#type' => 'item',
+ '#theme' => 'item_list',
+ '#type' => 'ul',
'#title' => $this->t('Layout'),
'#wrapper_attributes' => ['class' => ['diff-controls__item']],
- 'filter' => $this->buildLayoutNavigation($entity, $left_revision->getRevisionId(), $right_revision->getRevisionId(), $filter),
+ '#prefix' => '<div class="diff-controls--layout">',
+ '#suffix' => '</div>',
+ '#items' => $this->buildLayoutNavigation($entity, $left_revision->getRevisionId(), $right_revision->getRevisionId(), $filter),
];

// Perform comparison only if both entity revisions loaded successfully.
@@ -209,8 +212,9 @@ class PluginRevisionController extends ControllerBase {
$layouts = $this->diffLayoutManager->getPluginOptions();
foreach ($layouts as $key => $value) {
$links[$key] = [
- 'title' => $value,
- 'url' => $this->diffRoute($entity, $left_revision_id, $right_revision_id, $key),
+ '#type' => 'link',
+ '#title' => $value,
+ '#url' => $this->diffRoute($entity, $left_revision_id, $right_revision_id, $key),
];
}

@@ -219,12 +223,12 @@ class PluginRevisionController extends ControllerBase {
unset($links[$active_filter]);
array_unshift($links, $filter);

- $filter = [
- '#type' => 'operations',
- '#links' => $links,
- ];
+// $filter = [
+// '#type' => 'operations',
+// '#links' => $links,
+// ];

- return $filter;
+ return $links;
}

/**
diff --git a/src/Plugin/diff/Layout/VisualInlineDiffLayout.php b/src/Plugin/diff/Layout/VisualInlineDiffLayout.php
index e8c5552..c3a832b 100644
--- a/src/Plugin/diff/Layout/VisualInlineDiffLayout.php
+++ b/src/Plugin/diff/Layout/VisualInlineDiffLayout.php
@@ -155,8 +155,9 @@ class VisualInlineDiffLayout extends DiffLayoutBase {
continue;
}
$options[$view_mode] = [
- 'title' => $view_mode_info,
- 'url' => PluginRevisionController::diffRoute($entity,
+ '#type' => 'link',
+ '#title' => $view_mode_info,
+ '#url' => PluginRevisionController::diffRoute($entity,
$left_revision->getRevisionId(),
$right_revision->getRevisionId(),
'visual_inline',
@@ -182,13 +183,13 @@ class VisualInlineDiffLayout extends DiffLayoutBase {
array_unshift($options, $filter);

$build['controls']['view_mode'] = [
- '#type' => 'item',
+ '#theme' => 'item_list',
+ '#type' => 'ul',
+ '#items' => $options,
'#title' => $this->t('View mode'),
+ '#prefix' => '<div class="diff-controls--view-mode">',
+ '#suffix' => '</div>',
'#wrapper_attributes' => ['class' => ['diff-controls__item']],
- 'filter' => [
- '#type' => 'operations',
- '#links' => $options,
- ],
];

$view_builder = $this->entityTypeManager->getViewBuilder($entity->getEntityTypeId());