Force a fresh search for updates for the notifier
authorAlexander Ebert <ebert@woltlab.com>
Mon, 14 Aug 2023 10:38:26 +0000 (12:38 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 14 Aug 2023 10:38:26 +0000 (12:38 +0200)
Closes #5546

wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/style/layout.scss
wcfsetup/install/files/acp/templates/pageHeaderUser.tpl

index 7f8e27bc475350a8f50e524532170a3f318a26a9..337eb1d35d7e5f5213fd1c73c722dab27b6320fa 100644 (file)
@@ -822,7 +822,14 @@ WCF.ACP.Package.Update.Search = Class.extend({
                }
                
                this._button = elBySel('.jsButtonSearchForUpdates');
-               if (this._button) this._button.addEventListener('click', this._click.bind(this));
+               if (this._button) {
+                       this._button.addEventListener('click', this._click.bind(this));
+
+                       const url = new URL(window.location.href);
+                       if (url.searchParams.has("searchForUpdates")) {
+                               this._click();
+                       }
+               }
        },
        
        /**
@@ -831,7 +838,7 @@ WCF.ACP.Package.Update.Search = Class.extend({
         * @param {Event} event
         */
        _click: function(event) {
-               event.preventDefault();
+               event?.preventDefault();
                
                if (this._button.classList.contains('disabled')) {
                        return;
index 3de05bb539c46092605d85d7b142edb5248da858..6047dd9d7cdc1529fa454f37fce19cfdbe1fa12b 100644 (file)
@@ -206,6 +206,12 @@ html[data-color-scheme="dark"] {
                .pageHeaderPanel fa-icon[size="32"] {
                        display: none;
                }
+
+               #outstandingUpdatesNotification .badgeUpdate {
+                       left: 29px;
+                       top: -4px;
+                       padding: 0 4px;
+               }
        }
 
        @include screen-md-down {
index 742cd6410b0dda076a0b07243610e4b934906ed4..6fae9ee7816b8831cc7d1f4ea18f38e66ee9706b 100644 (file)
@@ -17,8 +17,8 @@
                                </li>
                                
                                {if $__wcf->session->getPermission('admin.configuration.package.canUpdatePackage') && $__wcf->getAvailableUpdates()}
-                                       <li>
-                                               <a href="{link controller='PackageUpdate'}{/link}" class="jsTooltip" title="{lang}wcf.acp.package.updates{/lang}">
+                                       <li id="outstandingUpdatesNotification">
+                                               <a href="{link controller='PackageList' searchForUpdates=true}{/link}" class="jsTooltip" title="{lang}wcf.acp.package.updates{/lang}">
                                                        {icon size=16 name='arrows-rotate'}
                                                        {icon size=32 name='arrows-rotate'}
                                                        <span class="badge badgeUpdate">{#$__wcf->getAvailableUpdates()}</span>