Show alert when plugin loading times out

When plugin loading fails with an error then we show an alert showing
that error and the plugin name.
When the plugin loading times out then we don't have any alerts fired,
hence fire an alert in this case as well.

Google-bug-id: b/200985287
Change-Id: I3650cf21ed7e3b195fc6ea399fde72c2f4592b22
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-loader.ts b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-loader.ts
index 16656d2..ba6de67 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-loader.ts
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-plugin-loader.ts
@@ -22,6 +22,7 @@
 import {PluginApi} from '../../../api/plugin';
 import {ReportingService} from '../../../services/gr-reporting/gr-reporting';
 import {ShowAlertEventDetail} from '../../../types/events';
+import {fireAlert} from '../../../utils/event-util';
 
 enum PluginState {
   /** State that indicates the plugin is pending to be loaded. */
@@ -209,9 +210,11 @@
       this._updatePluginState(plugin.url, PluginState.LOAD_FAILED);
     }
     this._checkIfCompleted();
-    return `Timeout when loading plugins: ${pending
+    const errorMessage = `Timeout when loading plugins: ${pending
       .map(p => p.name)
       .join(',')}`;
+    fireAlert(document, errorMessage);
+    return errorMessage;
   }
 
   _failToLoad(message: string, pluginUrl?: string) {