rusackas commented on code in PR #44101:
URL: https://github.com/apache/superset/pull/44101#discussion_r4131845676


##########
superset-frontend/packages/superset-core/src/extensions/index.ts:
##########
@@ -48,6 +48,27 @@
 import { Extension } from '../common';
 import { ExtensionStorage } from '../storage';
 
+/**
+ * Global, host-level UI surfaces available to an extension, independent of
+ * any specific view or panel it has registered.
+ */
+export interface ExtensionWindow {
+  /**
+   * Show a transient informational toast to the current user.
+   */
+  showInformationMessage(message: string): void;

Review Comment:
   Added an optional `{ duration }` to 
`showInformationMessage`/`showWarningMessage`/`showErrorMessage`, forwarded 
straight through to the toast actions. Better to have it now while the SDK's 
still unreleased.



##########
superset-frontend/src/features/home/RightMenu.test.tsx:
##########
@@ -459,6 +459,41 @@ test('Logs out and clears local storage item redux', async 
() => {
   }
 });
 
+test('renders an extension-contributed item in the Settings dropdown', async 
() => {
+  const { commands, menus } = jest.requireActual('src/core');
+  const { GlobalLocations } = jest.requireActual('src/core/contributions');
+
+  const disposeCommand = commands.registerCommand(
+    { id: 'test-ext.openSettings', title: 'My Extension Settings' },
+    jest.fn(),

Review Comment:
   Fair, that test wasn't actually exercising the wiring. It now clicks the 
item and asserts the registered command callback fires.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to