Skip to content
Snippets Groups Projects
Commit 3951fa4d authored by catch's avatar catch
Browse files

Issue #3405660 by smustgrave, quietone, Wim Leers, larowlan, lauriii: Remove tour from themes

parent a201c700
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 27 deletions
File moved
...@@ -16,3 +16,17 @@ tour-styling: ...@@ -16,3 +16,17 @@ tour-styling:
css: css:
component: component:
css/tour.module.css: { media: screen } css/tour.module.css: { media: screen }
tour-claro-styling:
version: VERSION
css:
theme:
css/theme/claro-tour.theme.css: {}
tour-stable9-styling:
version: VERSION
js:
js/theme/tour.js: {}
css:
theme:
css/theme/stable9-tour.module.css: {}
...@@ -115,3 +115,23 @@ function tour_tour_insert($entity) { ...@@ -115,3 +115,23 @@ function tour_tour_insert($entity) {
function tour_tour_update($entity) { function tour_tour_update($entity) {
\Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions(); \Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions();
} }
/**
* Implements hook_library_info_alter().
*/
function tour_library_info_alter(&$libraries, $extension) {
if ($extension === 'tour') {
$theme = \Drupal::service('theme.manager')->getActiveTheme()->getName();
$base_theme = FALSE;
if ($theme && !\Drupal::service('theme_handler')->listInfo()[$theme]) {
$base_theme = \Drupal::service('theme_handler')->listInfo()[$theme]->base_theme;
}
if (in_array('claro', [$theme, $base_theme])) {
$libraries['tour']['dependencies'][] = 'tour/tour-claro-styling';
}
elseif (in_array('stable9', [$theme, $base_theme])) {
$libraries['tour']['dependencies'][] = 'tour/tour-stable9-styling';
}
}
}
...@@ -207,7 +207,10 @@ protected function getAllLibraries() { ...@@ -207,7 +207,10 @@ protected function getAllLibraries() {
$extensions = $modules; $extensions = $modules;
$module_list = array_keys($modules); $module_list = array_keys($modules);
sort($module_list); sort($module_list);
$this->assertEquals($this->allModules, $module_list, 'All core modules are installed.'); // Remove deprecated module Tour.
$module_list = array_diff($module_list, ['tour']);
$all_modules = array_diff($this->allModules, ['tour']);
$this->assertEquals($all_modules, $module_list, 'All core modules are installed.');
$themes = $this->themeHandler->listInfo(); $themes = $this->themeHandler->listInfo();
$extensions += $themes; $extensions += $themes;
...@@ -216,7 +219,8 @@ protected function getAllLibraries() { ...@@ -216,7 +219,8 @@ protected function getAllLibraries() {
$this->assertEquals($this->allThemes, $theme_list, 'All core themes are installed.'); $this->assertEquals($this->allThemes, $theme_list, 'All core themes are installed.');
$libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core'); $libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core');
// Remove deprecated module Tour.
unset($extensions['tour']);
foreach ($extensions as $extension_name => $extension) { foreach ($extensions as $extension_name => $extension) {
$library_file = $extension->getPath() . '/' . $extension_name . '.libraries.yml'; $library_file = $extension->getPath() . '/' . $extension_name . '.libraries.yml';
if (is_file($this->root . '/' . $library_file)) { if (is_file($this->root . '/' . $library_file)) {
......
...@@ -26,6 +26,9 @@ class Stable9LibraryOverrideTest extends StableLibraryOverrideTestBase { ...@@ -26,6 +26,9 @@ class Stable9LibraryOverrideTest extends StableLibraryOverrideTestBase {
'media/drupal.media-icon', 'media/drupal.media-icon',
'options/drupal.options-icon', 'options/drupal.options-icon',
'telephone/drupal.telephone-icon', 'telephone/drupal.telephone-icon',
'tour/tour-styling',
'tour/tour-claro-styling',
'tour/tour-stable9-styling',
]; ];
/** /**
......
...@@ -121,10 +121,15 @@ protected function getAllLibraries() { ...@@ -121,10 +121,15 @@ protected function getAllLibraries() {
$modules = \Drupal::moduleHandler()->getModuleList(); $modules = \Drupal::moduleHandler()->getModuleList();
$module_list = array_keys($modules); $module_list = array_keys($modules);
sort($module_list); sort($module_list);
$this->assertEquals($this->allModules, $module_list, 'All core modules are installed.'); // Remove deprecated module Tour.
$module_list = array_diff($module_list, ['tour']);
$all_modules = array_diff($this->allModules, ['tour']);
$this->assertEquals($all_modules, $module_list, 'All core modules are installed.');
$libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core'); $libraries['core'] = $this->libraryDiscovery->getLibrariesByExtension('core');
// Remove deprecated module Tour.
unset($modules['tour']);
foreach ($modules as $module_name => $module) { foreach ($modules as $module_name => $module) {
$library_file = $module->getPath() . '/' . $module_name . '.libraries.yml'; $library_file = $module->getPath() . '/' . $module_name . '.libraries.yml';
if (is_file($this->root . '/' . $library_file)) { if (is_file($this->root . '/' . $library_file)) {
......
...@@ -128,8 +128,6 @@ libraries-extend: ...@@ -128,8 +128,6 @@ libraries-extend:
- claro/system.admin - claro/system.admin
core/drupal.autocomplete: core/drupal.autocomplete:
- claro/autocomplete - claro/autocomplete
tour/tour-styling:
- claro/tour-styling
shortcut/drupal.shortcut: shortcut/drupal.shortcut:
- claro/drupal.shortcut - claro/drupal.shortcut
core/drupal.ajax: core/drupal.ajax:
......
...@@ -139,12 +139,6 @@ drupal.node.preview: ...@@ -139,12 +139,6 @@ drupal.node.preview:
theme: theme:
css/components/node-preview.css: {} css/components/node-preview.css: {}
tour-styling:
version: VERSION
css:
theme:
css/theme/tour.theme.css: {}
media-form: media-form:
version: VERSION version: VERSION
css: css:
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
position: relative; position: relative;
/** /**
* Ensure mobile site header is always above other elements including * Ensure mobile site header is always above other elements including
* contextual links, and Tour. * contextual links.
*/ */
z-index: 101; z-index: 101;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
position: relative; position: relative;
/** /**
* Ensure mobile site header is always above other elements including * Ensure mobile site header is always above other elements including
* contextual links, and Tour. * contextual links.
*/ */
z-index: 101; z-index: 101;
......
...@@ -261,11 +261,6 @@ libraries-override: ...@@ -261,11 +261,6 @@ libraries-override:
state: state:
css/toolbar.menu.css: css/toolbar/toolbar.menu.css css/toolbar.menu.css: css/toolbar/toolbar.menu.css
tour/tour-styling:
css:
component:
css/tour.module.css: css/tour/tour.module.css
update/drupal.update.admin: update/drupal.update.admin:
css: css:
theme: theme:
...@@ -300,7 +295,3 @@ libraries-override: ...@@ -300,7 +295,3 @@ libraries-override:
css: css:
theme: theme:
css/field_ui_display_mode_table.css: css/field_ui/field_ui_display_mode_table.css css/field_ui_display_mode_table.css: css/field_ui/field_ui_display_mode_table.css
libraries-extend:
tour/tour:
- stable9/tour
...@@ -8,8 +8,3 @@ normalize: ...@@ -8,8 +8,3 @@ normalize:
css: css:
base: base:
css/core/assets/vendor/normalize-css/normalize.css: { weight: -20 } css/core/assets/vendor/normalize-css/normalize.css: { weight: -20 }
tour:
version: VERSION
js:
js/tour.js: {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment