acquia / df

Demo Framework - mirrored at https://git.drupal.org/project/df.git
https://www.drupal.org/project/df
18 stars 19 forks source link

Fix the Lightning Media Library tab #65

Closed mortenson closed 6 years ago

saltednut commented 6 years ago

@mortenson looks like this slipped under my radar - by chance do you know if this is still an issue?

saltednut commented 6 years ago

We should not need to override the view anymore. Here's the current diff.

diff --git a/config/install/entity_browser.browser.media_browser.yml b/config/install/entity_browser.browser.media_browser.yml
index 566a2d5..f5c22b8 100644
--- a/config/install/entity_browser.browser.media_browser.yml
+++ b/config/install/entity_browser.browser.media_browser.yml
@@ -1,8 +1,12 @@
+config_rewrite: replace
 langcode: en
 status: true
 dependencies:
+  config:
+    - views.view.media
   module:
     - lightning_media
+    - views
 name: media_browser
 label: 'Media browser'
 display: iframe
@@ -16,6 +20,16 @@ selection_display_configuration: {  }
 widget_selector: tabs
 widget_selector_configuration: {  }
 widgets:
+  134808d9-d854-4a0b-8699-d5eba006b8b7:
+    settings:
+      view: media
+      view_display: entity_browser_1
+      submit_text: Place
+      auto_select: false
+    uuid: 134808d9-d854-4a0b-8699-d5eba006b8b7
+    weight: -10
+    label: Library
+    id: view
   8b142f33-59d1-47b1-9e3a-4ae85d8376fa:
     settings:
       submit_text: Place
saltednut commented 6 years ago

I talked to Adam H about this in our slack and it looks like Lightning will have to do some refactoring to make the Library tab work for us without using config/rewrite to add the missing tab. Right now, Lightning adds this tab during the install process. Once stuff like this goes away, we can merge this change. https://github.com/acquia/lightning-media/blob/8.x-2.x/lightning_media.install#L184