-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spaces - Client NP Migration, Phase 1 #40856
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
const telemetryOptInProvider = Private(TelemetryOptInProvider); | ||
|
||
const spaceProps = { | ||
spacesEnabled, | ||
}; | ||
|
||
if (spacesEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stray code, was not being used in TememetryForm
component
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
@@ -25,7 +26,6 @@ import { Space } from '../../../common/model/space'; | |||
import { SpaceCards } from '../components/space_cards'; | |||
|
|||
interface Props { | |||
spaces?: Space[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this.props.spaces
was provided, it was via injected variables, which have been removed as part of this PR. Now, the selector screen must request the list of spaces on mount.
@@ -175,6 +187,14 @@ class SpacesMenuUI extends Component<Props, State> { | |||
</EuiContextMenuItem> | |||
); | |||
}; | |||
|
|||
private rendePlaceholderMenuItem = (key: string | number): JSX.Element => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly required as part of this migration, but it makes for a better user experience when loading the list of available spaces. We often take the near-immediate responses for granted when running locally, and forget that these things can take a noticeable amount of time when hosted in the real world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++, it actually looks very nice (testing with throttled network connection) 👍
private rendePlaceholderMenuItem = (key: string | number): JSX.Element => { | |
private rendePlaceholderMenuItem = (key: string | number) => { |
Pinging @elastic/kibana-security |
💔 Build Failed |
retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋! I pulled the branch locally to test the infra changes and I found a thing.
I have two spaces: default
and afgomez
. I'm normally in the second space.
The changes in the useKibanaSpaceId
hook cause the log analysis page to misbehave (in the "Logs" app, the second tab).
This is what I got on master
This is what I got on this branch
As you can see the content of the page changes, showing the wrong results when using this branch. I added a console.log
after this line to see the value of spaceId
before each render.
I think the issue is that useKibanaSpaceId
is now asynchronous. We either need to make sure that it's synchronous again or allow it to return undefined
if the space is not loaded yet. Then the components can decide how to render their respective trees in the absense of a spaceId.
I hope the description of the issue is clear. Please reach out to me if you have any questions <3
@afgomez thanks so much for testing and leaving feedback! I updated the hook locally to return I'll give this some more thought, but I'm learning towards re-introducing the |
@legrego that should be OK. We will take it into account :) Thanks! |
@afgomez I restored the original functionality, and the log analysis UI appears to function correctly for me now. Would you mind double-checking for me when you get a chance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legrego thanks for this! I tried again and it works like a charm.
Infra changes LGTM
@elasticmachine merge upstream |
…o np/spaces-nav-control
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for doing this! I've played with a number of basic Spaces related operations - everything worked as expected.
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Spaces - Client NP Migration, Phase 1 (#40856) * shimming NP for spaces client-side plugin * refresh active space in nav control when updated * fix advanced settings screen * allow npStart from unauthed routes * use NP for deriving space management url * remove security's usage of SpacesManager * remove usages of ui/capabilities * fix tests * implement NP plugin interface * remove hack in favor of convention in migration guide * shim feature catalogue registration * streamline nav control, and handle async loading more gracefully * adding opaqueId * fixes from merge * fix merge from master * fixing merge from master * move _active_space route to NP * moving to the NP feature catalogue registry * moving setup to setup phase * optimizing active space retrieval * reverting test isolation change * Apply suggestions from code review Co-Authored-By: Aleh Zasypkin <[email protected]> * removing unnecessary PluginInitializerContext * updating advanced settings subtitle * using NP anonymousPaths service * additional nav_control_popover cleanup * additional cleanup * testing out onActiveSpaceChange$ property * make the linter happy * make the type checker happy * fixing types * fix merge from master * spaces LP init should run on all pages, not just the kibana app * address nits * fix infra/logs, and the spaces disabled scenario * fix typescript errors * revert changes to infra plugin * reintroducing activeSpace injected var for legacy plugins * fixing react deprecation warning and unhandled promise rejection * restore activeSpace default var * spaces does not need to check its own enabled status * fix from merge Co-authored-by: Elastic Machine <[email protected]> * fix backport merge
This reverts commit fcdaed9.
Summary
This introduces a shim in the client-side spaces plugin to start migrating to the new platform.
This PR uses the following NP core/plugin services:
This PR also performs some ancillary cleanup/prep work for when the rest of the plugin is able to migrate:
SpacesNavState
, an unnecessary angular servicehttp
andnotifications
)ui/capabilities
with the NP equivalentResolves #46255
Out of scope