diff --git a/composer.json b/composer.json index eb259baecb4bd667099f62d06c7689cf0785958d..162f6977987323ccb8c263a5d0ab2d029d5ae3d7 100644 --- a/composer.json +++ b/composer.json @@ -88,7 +88,7 @@ "drupal-composer/drupal-scaffold": "2.5.4", "drupal/address": "1.1", "drupal/addtocalendar": "3.2", - "drupal/admin_toolbar": "2.2", + "drupal/admin_toolbar": "2.3", "drupal/administerusersbyrole": "3.0", "drupal/allowed_formats": "1.2", "drupal/anchor_link": "1.7", diff --git a/composer.lock b/composer.lock index 75583806152513119fe52856b58daac215f967bf..686463af58615cc52aff1e2bbeb7df8c45b388d2 100644 --- a/composer.lock +++ b/composer.lock @@ -2114,29 +2114,26 @@ }, { "name": "drupal/admin_toolbar", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/admin_toolbar.git", - "reference": "8.x-2.2" + "reference": "8.x-2.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/admin_toolbar-8.x-2.2.zip", - "reference": "8.x-2.2", - "shasum": "41ea0e3321e6d1e190c486be49a99e60446d8dd7" + "url": "https://ftp.drupal.org/files/projects/admin_toolbar-8.x-2.3.zip", + "reference": "8.x-2.3", + "shasum": "cf8ee1aa8adfc604db4394655e3ba4c423d5f24a" }, "require": { "drupal/core": "^8.8.0 || ^9.0" }, "type": "drupal-module", "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, "drupal": { - "version": "8.x-2.2", - "datestamp": "1585017179", + "version": "8.x-2.3", + "datestamp": "1592535597", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2145,7 +2142,7 @@ }, "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -2189,7 +2186,7 @@ "Toolbar" ], "support": { - "source": "http://cgit.drupalcode.org/admin_toolbar", + "source": "https://git.drupalcode.org/project/admin_toolbar", "issues": "https://www.drupal.org/project/issues/admin_toolbar" } }, diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ee7b4e969104123b7e51977cd7ab65e767858483..ee4a9d70d9a5d03651559b4373ccf812cf6c9ce8 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2179,30 +2179,27 @@ }, { "name": "drupal/admin_toolbar", - "version": "2.2.0", - "version_normalized": "2.2.0.0", + "version": "2.3.0", + "version_normalized": "2.3.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/admin_toolbar.git", - "reference": "8.x-2.2" + "reference": "8.x-2.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/admin_toolbar-8.x-2.2.zip", - "reference": "8.x-2.2", - "shasum": "41ea0e3321e6d1e190c486be49a99e60446d8dd7" + "url": "https://ftp.drupal.org/files/projects/admin_toolbar-8.x-2.3.zip", + "reference": "8.x-2.3", + "shasum": "cf8ee1aa8adfc604db4394655e3ba4c423d5f24a" }, "require": { "drupal/core": "^8.8.0 || ^9.0" }, "type": "drupal-module", "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - }, "drupal": { - "version": "8.x-2.2", - "datestamp": "1585017179", + "version": "8.x-2.3", + "datestamp": "1592535597", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -2212,7 +2209,7 @@ "installation-source": "dist", "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -2256,7 +2253,7 @@ "Toolbar" ], "support": { - "source": "http://cgit.drupalcode.org/admin_toolbar", + "source": "https://git.drupalcode.org/project/admin_toolbar", "issues": "https://www.drupal.org/project/issues/admin_toolbar" } }, diff --git a/web/modules/admin_toolbar/admin_toolbar.info.yml b/web/modules/admin_toolbar/admin_toolbar.info.yml index 382e37ffb632cbf53b8a88d3ddf18e953a7b7a4b..7053f93183877effa535a6bd2a65256b94ae91b9 100644 --- a/web/modules/admin_toolbar/admin_toolbar.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8.8.0 || ^9.0 dependencies: - drupal:toolbar -# Information added by Drupal.org packaging script on 2020-03-24 -version: '8.x-2.2' +# Information added by Drupal.org packaging script on 2020-06-19 +version: '8.x-2.3' project: 'admin_toolbar' -datestamp: 1585017182 +datestamp: 1592535601 diff --git a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml index 1b8b648077189fd2a7441a268e4a2abec439768f..741feada6357d9ccaf2f1614c033b128fc11e18d 100644 --- a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8.8.0 || ^9.0 dependencies: - admin_toolbar:admin_toolbar -# Information added by Drupal.org packaging script on 2020-03-24 -version: '8.x-2.2' +# Information added by Drupal.org packaging script on 2020-06-19 +version: '8.x-2.3' project: 'admin_toolbar' -datestamp: 1585017182 +datestamp: 1592535601 diff --git a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/composer.json b/web/modules/admin_toolbar/admin_toolbar_links_access_filter/composer.json deleted file mode 100755 index b7a007d7be8a5f115b3167e675baad91560418a8..0000000000000000000000000000000000000000 --- a/web/modules/admin_toolbar/admin_toolbar_links_access_filter/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "drupal/admin_toolbar_links_access_filter", - "description": "Provides a workaround for the common problem that users with 'Use the administration pages and help' permission see menu links they don't have access permission for. Once the issue https://www.drupal.org/node/296693 be solved, this module will be deprecated.", - "type": "drupal-module", - "keywords": ["Drupal", "Toolbar"], - "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Wilfrid Roze (eme)", - "homepage": "https://www.drupal.org/u/eme", - "role": "Maintainer" - }, - { - "name": "Romain Jarraud (romainj)", - "homepage": "https://www.drupal.org/u/romainj", - "role": "Maintainer" - }, - { - "name": "Adrian Cid Almaguer (adriancid)", - "email": "adriancid@gmail.com", - "homepage": "https://www.drupal.org/u/adriancid", - "role": "Maintainer" - }, - { - "name": "Mohamed Anis Taktak (matio89)", - "homepage": "https://www.drupal.org/u/matio89", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" - }, - "require": { - "drupal/admin_toolbar": "^2", - "drupal/core": "^8.8.0 || ^9.0" - } -} diff --git a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml index 3dcad3ac3cfa7958994009a3a2f72a533a0eb6e8..3e68256fb548668d77f29084497e4c5569a3694e 100644 --- a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8.8.0 || ^9.0 dependencies: - admin_toolbar:admin_toolbar -# Information added by Drupal.org packaging script on 2020-03-24 -version: '8.x-2.2' +# Information added by Drupal.org packaging script on 2020-06-19 +version: '8.x-2.3' project: 'admin_toolbar' -datestamp: 1585017182 +datestamp: 1592535601 diff --git a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module index acad2f23cf0384bf4a413ed76a3c1268c182f31a..dcdb4a699070fa04cd6c349b293f5da5b09db981 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module +++ b/web/modules/admin_toolbar/admin_toolbar_search/admin_toolbar_search.module @@ -6,7 +6,6 @@ */ use Drupal\Core\StringTranslation\TranslatableMarkup; -use Drupal\Core\Url; use Drupal\Core\Routing\RouteMatchInterface; /** @@ -28,31 +27,23 @@ function admin_toolbar_search_help($route_name, RouteMatchInterface $route_match * Implements hook_toolbar_alter(). */ function admin_toolbar_search_toolbar_alter(&$items) { - $access = \Drupal::currentUser()->hasPermission('use admin toolbar search'); + if (!\Drupal::currentUser()->hasPermission('use admin toolbar search')) { + return; + } $admin_toolbar_tools_enabled = \Drupal::service('module_handler') ->moduleExists('admin_toolbar_tools'); $items['administration_search'] = [ "#type" => "toolbar_item", - '#access' => $access, + '#weight' => 100, 'tab' => [ - '#type' => 'link', - '#title' => new TranslatableMarkup('Search'), - '#url' => URL::fromRoute('system.admin'), - '#attributes' => [ - 'class' => [ - 'toolbar-icon', - ], - ], - ], - 'tray' => [ 'search' => [ - '#title' => 'Search', '#type' => 'textfield', - '#size' => 60, + '#size' => 30, '#attributes' => [ 'id' => 'admin-toolbar-search-input', 'aria-labelledby' => 'toolbar-item-administration-search', + 'placeholder' => new TranslatableMarkup('Admin Toolbar quick search'), ], ], ], diff --git a/web/modules/admin_toolbar/admin_toolbar_search/composer.json b/web/modules/admin_toolbar/admin_toolbar_search/composer.json deleted file mode 100755 index 919f43f82baf791b5aaa52662deea3bc382f2447..0000000000000000000000000000000000000000 --- a/web/modules/admin_toolbar/admin_toolbar_search/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "drupal/admin_toolbar_search", - "description": "Provides search of admin toolbar items.", - "type": "drupal-module", - "keywords": ["Drupal", "Toolbar", "Search"], - "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Wilfrid Roze (eme)", - "homepage": "https://www.drupal.org/u/eme", - "role": "Maintainer" - }, - { - "name": "Romain Jarraud (romainj)", - "homepage": "https://www.drupal.org/u/romainj", - "role": "Maintainer" - }, - { - "name": "Adrian Cid Almaguer (adriancid)", - "email": "adriancid@gmail.com", - "homepage": "https://www.drupal.org/u/adriancid", - "role": "Maintainer" - }, - { - "name": "Mohamed Anis Taktak (matio89)", - "homepage": "https://www.drupal.org/u/matio89", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" - }, - "require": { - "drupal/admin_toolbar": "^2", - "drupal/core": "^8.8.0 || ^9.0" - } -} diff --git a/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css b/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css index 6215d9b625ea6d9ce16cee0caee2155734314d9d..d12e95bbbf4c7f177f250d0f2b3303155cea491b 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css +++ b/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css @@ -1,33 +1,29 @@ -#toolbar-item-administration-search-tray { - padding-left: 1em; +#admin-toolbar-search-tab .js-form-item.form-item { + margin-top: 0.3rem; + margin-bottom: 0; } -#admin-toolbar-search-tab .toolbar-item:before { - background-image: url('../../misc/icons/bebebe/loupe.svg'); -} - -#admin-toolbar-search-tab .toolbar-item:active:before, -#admin-toolbar-search-tab .toolbar-item.is-active:before { - background-image: url('../../misc/icons/ffffff/loupe.svg'); -} - -#toolbar-item-administration-search-tray label { - display: inline-block; - color: #000000; - margin-right: .5em; - font-weight: bold; +#admin-toolbar-search-input { + min-height: 1rem; + padding: 0 0.4rem; + line-height: 1.75rem; + margin: 0; + color: #3b3b3b; + background: #fcfcfa; + border: 1px solid #ccc; + border-radius: unset; + font-size: 1em; } -#toolbar-item-administration-search-tray div.form-item { - margin: 0.75em 0; +.ui-autocomplete .ui-menu-item span.admin-toolbar-search-url { + color: rgba(0, 0, 0, 0.50); } -#toolbar-item-administration-search-tray input { - display: inline-block; - padding: 0.3em 0.4em 0.3em 0.5em; - font-size: 1em; +.admin-toolbar-search-autocomplete-list { + max-height: 300px; + overflow-y: scroll; } -.ui-autocomplete .ui-menu-item span.admin-toolbar-search-url { - color: rgba(0, 0, 0, 0.50); +.admin-toolbar-search-autocomplete-list .ui-menu-item .ui-state-active { + margin: 0; } diff --git a/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css.orig b/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css.orig new file mode 100755 index 0000000000000000000000000000000000000000..3be4d4e705c52eb53510e058046230974ed74c51 --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_search/css/admin.toolbar_search.css.orig @@ -0,0 +1,20 @@ +#admin-toolbar-search-tab .js-form-item.form-item { + margin-top: 0.3rem; + margin-bottom: 0; +} + +#admin-toolbar-search-input { + min-height: 1rem; + padding: 0 0.4rem; + line-height: 1.75rem; + margin: 0; + color: #3b3b3b; + background: #fcfcfa; + border: 1px solid #ccc; + border-radius: unset; + font-size: 1em; +} + +.ui-autocomplete .ui-menu-item span.admin-toolbar-search-url { + color: rgba(0, 0, 0, 0.50); +} diff --git a/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js b/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js index 701d76fb6c2caf698eb1f4c3310e904d9368e5e9..43a4c791396b191abe40c4c669cab09bee023857 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js +++ b/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js @@ -17,20 +17,8 @@ return; } - var getUrl = window.location; - var baseUrl = getUrl.protocol + "//" + getUrl.host + "/"; var $self = this; this.links = []; - $('.toolbar-tray a[data-drupal-link-system-path]').each(function () { - if (this.href != baseUrl) { - var label = $self.getItemLabel(this); - $self.links.push({ - 'value': $(this).attr('href'), - 'label': label + ' ' + $(this).attr('href'), - 'labelRaw': label - }); - } - }); $("#admin-toolbar-search-input").autocomplete({ minLength: 2, @@ -55,7 +43,7 @@ } }, open: function () { - var zIndex = $('#toolbar-item-administration-search-tray') + var zIndex = $('#toolbar-item-administration-tray') .css("z-index") + 1; $(this).autocomplete('widget').css('z-index', zIndex); @@ -68,38 +56,20 @@ } } }).data("ui-autocomplete")._renderItem = (function (ul, item) { + ul.addClass('admin-toolbar-search-autocomplete-list'); return $("<li>") .append('<div>' + item.labelRaw + ' <span class="admin-toolbar-search-url">' + item.value + '</span></div>') .appendTo(ul); }); - // Focus on search field when tab is clicked, or enter is pressed. - $(context).find('#toolbar-item-administration-search') + // Populate the links for search results when the input is pressed. + $(context).find('#admin-toolbar-search-input') .once('admin_toolbar_search') .each(function () { - if (Drupal.behaviors.adminToolbarSearch.isSearchVisible()) { - $('#admin-toolbar-search-input').focus(); - } - $(this).on('click', function () { - $self.focusOnSearchElement(); + $(this).focus(function() { + Drupal.behaviors.adminToolbarSearch.populateLinks($self); }); }); - - // Initialize hotkey / keyboard shortcut. - this.initHotkey(); - }, - focusOnSearchElement: function () { - var waitforVisible = function () { - if ($('#toolbar-item-administration-search-tray:visible').length) { - $('#admin-toolbar-search-input').focus(); - } - else { - setTimeout(function () { - waitforVisible(); - }, 1); - } - }; - waitforVisible(); }, getItemLabel: function (item) { var breadcrumbs = []; @@ -141,48 +111,25 @@ return suggestions; }, /** - * Whether the search is visible or not. - * - * @returns {boolean} - * True if visible, false otherwise. - */ - isSearchVisible: function () { - return $('#toolbar-item-administration-search-tray').is(':visible'); - }, - /** - * Toggles the toolbar search tray. + * Populates the links in admin toolbar search. */ - toggleSearch: function () { - $('#toolbar-item-administration-search').trigger('click'); - }, - /** - * Binds a keyboard shortcut to toggle the search. - */ - initHotkey: function () { - $(document) - .once('admin_toolbar_search') - .keydown(function (event) { - // Show the form with alt + S. - if (!Drupal.behaviors.adminToolbarSearch.isSearchVisible()) { - // 83 = s. - if (event.altKey === true && event.keyCode === 83) { - Drupal.behaviors.adminToolbarSearch.toggleSearch(); - event.preventDefault(); - } - } - // Hide the search with alt + S or ESC. - else { - // 83 = s. - if ( - (event.altKey === true && event.keyCode === 83) || - event.key === 'Escape' - ) { - Drupal.behaviors.adminToolbarSearch.toggleSearch(); - event.preventDefault(); - } + populateLinks: function ($self) { + // Populate only when links array is empty (only the first time). + if ($self.links.length === 0) { + var getUrl = window.location; + var baseUrl = getUrl.protocol + "//" + getUrl.host + "/"; + $('.toolbar-tray a[data-drupal-link-system-path]').each(function () { + if (this.href !== baseUrl) { + var label = $self.getItemLabel(this); + $self.links.push({ + 'value': this.href, + 'label': label + ' ' + this.href, + 'labelRaw': label + }); } }); - } + } + }, }; })(jQuery, Drupal); diff --git a/web/modules/admin_toolbar/js/admin_toolbar_search.js b/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js.orig similarity index 54% rename from web/modules/admin_toolbar/js/admin_toolbar_search.js rename to web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js.orig index 701d76fb6c2caf698eb1f4c3310e904d9368e5e9..110040741ea91404621840804871188603cbdacc 100755 --- a/web/modules/admin_toolbar/js/admin_toolbar_search.js +++ b/web/modules/admin_toolbar/admin_toolbar_search/js/admin_toolbar_search.js.orig @@ -17,20 +17,8 @@ return; } - var getUrl = window.location; - var baseUrl = getUrl.protocol + "//" + getUrl.host + "/"; var $self = this; this.links = []; - $('.toolbar-tray a[data-drupal-link-system-path]').each(function () { - if (this.href != baseUrl) { - var label = $self.getItemLabel(this); - $self.links.push({ - 'value': $(this).attr('href'), - 'label': label + ' ' + $(this).attr('href'), - 'labelRaw': label - }); - } - }); $("#admin-toolbar-search-input").autocomplete({ minLength: 2, @@ -55,7 +43,7 @@ } }, open: function () { - var zIndex = $('#toolbar-item-administration-search-tray') + var zIndex = $('#toolbar-item-administration-tray') .css("z-index") + 1; $(this).autocomplete('widget').css('z-index', zIndex); @@ -73,33 +61,14 @@ .appendTo(ul); }); - // Focus on search field when tab is clicked, or enter is pressed. - $(context).find('#toolbar-item-administration-search') + // Populate the links for search results when the input is pressed. + $(context).find('#admin-toolbar-search-input') .once('admin_toolbar_search') .each(function () { - if (Drupal.behaviors.adminToolbarSearch.isSearchVisible()) { - $('#admin-toolbar-search-input').focus(); - } - $(this).on('click', function () { - $self.focusOnSearchElement(); + $(this).focus(function() { + Drupal.behaviors.adminToolbarSearch.populateLinks($self); }); }); - - // Initialize hotkey / keyboard shortcut. - this.initHotkey(); - }, - focusOnSearchElement: function () { - var waitforVisible = function () { - if ($('#toolbar-item-administration-search-tray:visible').length) { - $('#admin-toolbar-search-input').focus(); - } - else { - setTimeout(function () { - waitforVisible(); - }, 1); - } - }; - waitforVisible(); }, getItemLabel: function (item) { var breadcrumbs = []; @@ -141,48 +110,25 @@ return suggestions; }, /** - * Whether the search is visible or not. - * - * @returns {boolean} - * True if visible, false otherwise. - */ - isSearchVisible: function () { - return $('#toolbar-item-administration-search-tray').is(':visible'); - }, - /** - * Toggles the toolbar search tray. + * Populates the links in admin toolbar search. */ - toggleSearch: function () { - $('#toolbar-item-administration-search').trigger('click'); - }, - /** - * Binds a keyboard shortcut to toggle the search. - */ - initHotkey: function () { - $(document) - .once('admin_toolbar_search') - .keydown(function (event) { - // Show the form with alt + S. - if (!Drupal.behaviors.adminToolbarSearch.isSearchVisible()) { - // 83 = s. - if (event.altKey === true && event.keyCode === 83) { - Drupal.behaviors.adminToolbarSearch.toggleSearch(); - event.preventDefault(); - } - } - // Hide the search with alt + S or ESC. - else { - // 83 = s. - if ( - (event.altKey === true && event.keyCode === 83) || - event.key === 'Escape' - ) { - Drupal.behaviors.adminToolbarSearch.toggleSearch(); - event.preventDefault(); - } + populateLinks: function ($self) { + // Populate only when links array is empty (only the first time). + if ($self.links.length === 0) { + var getUrl = window.location; + var baseUrl = getUrl.protocol + "//" + getUrl.host + "/"; + $('.toolbar-tray a[data-drupal-link-system-path]').each(function () { + if (this.href !== baseUrl) { + var label = $self.getItemLabel(this); + $self.links.push({ + 'value': this.href, + 'label': label + ' ' + this.href, + 'labelRaw': label + }); } }); - } + } + }, }; })(jQuery, Drupal); diff --git a/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarSearchTest.php b/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarSearchTest.php index f12b8f8543c77c0fa73aba069a55195646199c96..2c6f376aa800a9fbf4cd41528e73c9e212ff2111 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarSearchTest.php +++ b/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarSearchTest.php @@ -14,14 +14,16 @@ class AdminToolbarSearchTest extends AdminToolbarSearchTestBase { * Tests search functionality without admin_toolbar_tools enabled. */ public function testToolbarSearch() { - $search_tab = '#toolbar-item-administration-search'; + $search_tab = '#admin-toolbar-search-tab'; + $search_toolbar_item = '#toolbar-item-administration-search'; $search_tray = '#toolbar-item-administration-search-tray'; $this->drupalLogin($this->userWithAccess); $assert_session = $this->assertSession(); $assert_session->responseContains('admin.toolbar_search.css'); $assert_session->responseContains('admin_toolbar_search.js'); - $assert_session->waitForElementVisible('css', $search_tab)->click(); + $assert_session->waitForElementVisible('css', $search_tab); + $assert_session->waitForElementVisible('css', $search_toolbar_item); $assert_session->waitForElementVisible('css', $search_tray); $this->assertSuggestionContains('perfor', 'admin/config/development/performance'); @@ -33,7 +35,8 @@ public function testToolbarSearch() { * Tests a user without the search permission can't use search. */ public function testNoAccess() { - $search_tab = '#toolbar-item-administration-search'; + $search_tab = '#admin-toolbar-search-tab'; + $search_toolbar_item = '#toolbar-item-administration-search'; $search_tray = '#toolbar-item-administration-search-tray'; $this->drupalLogin($this->noAccessUser); @@ -41,6 +44,7 @@ public function testNoAccess() { $assert_session->responseNotContains('admin.toolbar_search.css'); $assert_session->responseNotContains('admin_toolbar_search.js'); $assert_session->elementNotExists('css', $search_tab); + $assert_session->elementNotExists('css', $search_toolbar_item); $assert_session->elementNotExists('css', $search_tray); } diff --git a/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php b/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php index 239b6ef332fdf4643ddb53c29ce272bb34cc0345..84604bc0770d4e855487c7066081ffbebfc2af6e 100755 --- a/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php +++ b/web/modules/admin_toolbar/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php @@ -97,14 +97,16 @@ public function setUp() { * Tests search functionality with admin_toolbar_tools enabled. */ public function testToolbarSearch() { - $search_tab = '#toolbar-item-administration-search'; + $search_tab = '#admin-toolbar-search-tab'; + $search_toolbar_item = '#toolbar-item-administration-search'; $search_tray = '#toolbar-item-administration-search-tray'; $this->drupalLogin($this->adminUser); $assert_session = $this->assertSession(); $assert_session->responseContains('admin.toolbar_search.css'); $assert_session->responseContains('admin_toolbar_search.js'); - $assert_session->waitForElementVisible('css', $search_tab)->click(); + $assert_session->waitForElementVisible('css', $search_tab); + $assert_session->waitForElementVisible('css', $search_toolbar_item); $assert_session->waitForElementVisible('css', $search_tray); $this->assertSuggestionContains('basic', 'admin/config/system/site-information'); diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml b/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml index 89eedeafa06375c3937d5a6155f15eec2a9d7535..f8fba2be6ceae40decb4cd4f9667411dcb0bd871 100644 --- a/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml +++ b/web/modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml @@ -8,7 +8,7 @@ core_version_requirement: ^8.8.0 || ^9.0 dependencies: - admin_toolbar:admin_toolbar -# Information added by Drupal.org packaging script on 2020-03-24 -version: '8.x-2.2' +# Information added by Drupal.org packaging script on 2020-06-19 +version: '8.x-2.3' project: 'admin_toolbar' -datestamp: 1585017182 +datestamp: 1592535601 diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/composer.json b/web/modules/admin_toolbar/admin_toolbar_tools/composer.json deleted file mode 100755 index fad275ff539e67a174f90e92ce76cc8c3dffe08c..0000000000000000000000000000000000000000 --- a/web/modules/admin_toolbar/admin_toolbar_tools/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "drupal/admin_toolbar_tools", - "description": "Adds menu links to the Admin Toolbar.", - "type": "drupal-module", - "keywords": ["Drupal", "Toolbar"], - "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Wilfrid Roze (eme)", - "homepage": "https://www.drupal.org/u/eme", - "role": "Maintainer" - }, - { - "name": "Romain Jarraud (romainj)", - "homepage": "https://www.drupal.org/u/romainj", - "role": "Maintainer" - }, - { - "name": "Adrian Cid Almaguer (adriancid)", - "email": "adriancid@gmail.com", - "homepage": "https://www.drupal.org/u/adriancid", - "role": "Maintainer" - }, - { - "name": "Mohamed Anis Taktak (matio89)", - "homepage": "https://www.drupal.org/u/matio89", - "role": "Maintainer" - } - ], - "support": { - "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" - }, - "require": { - "drupal/admin_toolbar": "^2", - "drupal/core": "^8.8.0 || ^9.0" - } -} diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/css/tools.css b/web/modules/admin_toolbar/admin_toolbar_tools/css/tools.css index f3eb07f2252088ad86d0a0cce8fbc3ce9fe3590b..8e3baa3731b0f2e7497280671c17d0e9dfbd4c29 100755 --- a/web/modules/admin_toolbar/admin_toolbar_tools/css/tools.css +++ b/web/modules/admin_toolbar/admin_toolbar_tools/css/tools.css @@ -4,14 +4,15 @@ .toolbar-icon-admin-toolbar-tools-help:before { box-sizing: content-box; - background-image: url(../misc/icons/ffffff/d8-item.svg); + background-image: url(../misc/icons/ffffff/drupal-logo.svg); padding-bottom: 0; - padding-left: 4px; - padding-right: 8px; + padding-left: 2px; + padding-right: 2px; padding-top: 2px; + margin-left: 4px; } .toolbar-icon-admin-toolbar-tools-help:active:before, .toolbar-icon-admin-toolbar-tools-help.active:before { - background-image: url(../misc/icons/ffffff/d8-item.svg); + background-image: url(../misc/icons/ffffff/drupal-logo.svg); } diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg b/web/modules/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg deleted file mode 100755 index 40ffae371d6a6b3fa46e6902188c0b38b336d91e..0000000000000000000000000000000000000000 --- a/web/modules/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" preserveAspectRatio="xMinYMin" viewBox="0 0 611 646"><path fill="#2ba9e0" d="M 161.14248,607.07981 C 135.931,577.51327 120.7662,539.33875 120.7662,497.60876 c 0,-87.01545 66.15644,-158.68624 151.648,-168.60413 -14.59612,-20.95856 -23.31588,-46.40824 -23.31588,-73.72922 0,-71.85792 58.95316,-129.86822 131.7442,-129.86822 6.06592,0 11.94228,0.37426 17.62908,1.12278 C 355.44148,89.85249 312.41136,52.61362 278.48012,12.00641 295.73008,190.15417 114.1316,125.40719 46.8378,289.70733 1.91208,399.73977 42.47792,535.78328 161.14248,607.07981 Z m 143.1178,-351.8044 c 0,41.72999 34.31036,75.41339 76.39268,75.41339 42.08232,0 76.58224,-33.87053 76.58224,-75.41339 0,-41.72999 -34.31036,-75.41339 -76.39268,-75.41339 -42.08232,0 -76.58224,33.6834 -76.58224,75.41339 z m 112.97776,124.81571 c 29.57136,30.50219 47.76912,71.85792 47.76912,117.51764 0,57.82317 -29.19224,108.72253 -73.73884,139.41185 82.4586,-25.07542 150.7002,-86.26693 181.21936,-160.37041 42.27188,-102.54724 2.8434,-179.6448 -63.12348,-249.63142 2.08516,8.98224 3.22252,18.52587 3.22252,28.0695 -0.18956,59.50734 -40.37628,109.47105 -95.34868,125.00284 z m -124.35136,18.90013 c -55.16196,0 -99.89812,44.16268 -99.89812,98.61751 0,54.45483 44.73616,98.61751 99.89812,98.61751 55.16196,0 99.89812,-44.16268 99.89812,-98.61751 0,-54.45483 -44.73616,-98.61751 -99.89812,-98.61751 z" /></svg> diff --git a/web/modules/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/drupal-logo.svg b/web/modules/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/drupal-logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..fbc53e3c54bad01973d255b584b2f3923afec80e --- /dev/null +++ b/web/modules/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/drupal-logo.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.15 55.08"><defs><style>.cls-1{fill:#009cde;}</style></defs><title>Risorsa 23</title><g id="Livello_2" data-name="Livello 2"><g id="Livello_1-2" data-name="Livello 1"><path class="cls-1" d="M29.75,11.73C25.87,7.86,22.18,4.16,21.08,0,20,4.16,16.28,7.86,12.4,11.73,6.59,17.54,0,24.12,0,34a21.08,21.08,0,1,0,42.15,0C42.15,24.12,35.56,17.54,29.75,11.73ZM10.84,35.92a14.13,14.13,0,0,0-1.65,2.62.54.54,0,0,1-.36.3H8.65c-.47,0-1-.92-1-.92h0c-.14-.22-.27-.45-.4-.69l-.09-.19C5.94,34.25,7,30.28,7,30.28h0a17.42,17.42,0,0,1,2.52-5.41,31.53,31.53,0,0,1,2.28-3l1,1,4.72,4.82a.54.54,0,0,1,0,.72l-4.93,5.47h0ZM21.32,49.73a7.29,7.29,0,0,1-5.4-12.14c1.54-1.83,3.42-3.63,5.46-6,2.42,2.58,4,4.35,5.55,6.29a3.08,3.08,0,0,1,.32.48,7.15,7.15,0,0,1,1.3,4.12A7.23,7.23,0,0,1,21.32,49.73ZM35,38.14v0a.84.84,0,0,1-.67.58h-.14a1.22,1.22,0,0,1-.68-.55h0a37.77,37.77,0,0,0-4.28-5.31l-1.93-2-6.41-6.65a54,54,0,0,1-3.84-3.94,1.3,1.3,0,0,0-.1-.15,3.84,3.84,0,0,1-.51-1c0-.06,0-.13,0-.19a3.4,3.4,0,0,1,1-3c1.24-1.24,2.49-2.49,3.67-3.79,1.3,1.44,2.69,2.82,4.06,4.19v0a57.6,57.6,0,0,1,7.55,8.58A16,16,0,0,1,35.65,34,14.55,14.55,0,0,1,35,38.14Z"/></g></g></svg> \ No newline at end of file diff --git a/web/modules/admin_toolbar/composer.json b/web/modules/admin_toolbar/composer.json index 650ed769fbab1240e04874011ee85945d5b61948..aaffa92dceda804bf98bad69e8c0c2a451018f60 100755 --- a/web/modules/admin_toolbar/composer.json +++ b/web/modules/admin_toolbar/composer.json @@ -4,7 +4,7 @@ "type": "drupal-module", "keywords": ["Drupal", "Toolbar"], "homepage": "http://drupal.org/project/admin_toolbar", - "license": "GPL-2.0+", + "license": "GPL-2.0-or-later", "authors": [ { "name": "Wilfrid Roze (eme)", @@ -30,7 +30,7 @@ ], "support": { "issues": "https://www.drupal.org/project/issues/admin_toolbar", - "source": "http://cgit.drupalcode.org/admin_toolbar" + "source": "https://git.drupalcode.org/project/admin_toolbar" }, "require": { "drupal/core": "^8.8.0 || ^9.0" diff --git a/web/modules/admin_toolbar/js/admin_toolbar.js b/web/modules/admin_toolbar/js/admin_toolbar.js index 96dfa829acc6787ce3bab44a087495c5e4160757..28944c3f2ab0848b520f3689068ce7ede2926752 100755 --- a/web/modules/admin_toolbar/js/admin_toolbar.js +++ b/web/modules/admin_toolbar/js/admin_toolbar.js @@ -48,6 +48,12 @@ } }); + // Always hide the dropdown menu on mobile. + if ($('#toolbar-item-administration-tray').hasClass('toolbar-tray-vertical')) { + $('#toolbar-item-administration').removeClass('is-active'); + $('#toolbar-item-administration-tray').removeClass('is-active'); + }; + } }; })(jQuery, Drupal);