geido commented on code in PR #45522:
URL: https://github.com/apache/superset/pull/45522#discussion_r4351302983
##########
superset-core/src/superset_core/extensions/types.py:
##########
@@ -29,12 +29,85 @@
from superset_core.extensions.constants import (
DISPLAY_NAME_PATTERN,
+ PAGE_PATH_PATTERN,
+ PERMISSION_NAME_PATTERN,
PUBLISHER_PATTERN,
TECHNICAL_NAME_PATTERN,
VERSION_PATTERN,
)
+class PageNav(BaseModel):
+ """Placement of a page in the navigation."""
+
+ label: str = Field(
+ ...,
+ description="Text of the navigation entry",
+ min_length=1,
+ )
Review Comment:
Confirmed with the CLI. `"nav": {"category": "Manage"}` fails
`superset-extensions validate` with `contributions.pages.0.nav.label Field
required`, so the documented "defaults to the page's name" behaviour can't be
used.
##########
superset-extensions-cli/src/superset_extensions_cli/templates/frontend/webpack.config.js.j2:
##########
@@ -61,6 +61,15 @@ module.exports = (env, argv) => {
singleton: true,
import: false,
},
+ // Declared here as well as by the host, because Module Federation
+ // only consumes the share scope for modules the remote itself
+ // declares as shared. Without this the extension bundles its own
+ // copy, whose SupersetClient is never configured -- so every call
+ // through it goes out without a CSRF token.
+ "@superset-ui/core": {
+ singleton: true,
+ import: false,
+ },
Review Comment:
Confirmed. A fresh `superset-extensions init` scaffold that imports
`SupersetClient` fails with `TS2307: Cannot find module '@superset-ui/core'`.
Adding the dependency isn't straightforward either: the only npm release is
`@superset-ui/[email protected]` from Dec 2024, which doesn't match the host.
Relatedly, the scaffold's `@apache-superset/core@^0.1.0` from npm has no
`pages` export (`TS2305`), so external extensions can't build against the new
API until a new `@apache-superset/core` is published.
--
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]