Read model page from shared universe state - #19
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the /model Next.js page to prefer phData, phFocus, phUser, and phSource from the shared universe slice (via selectSharedUniverseState), while preserving legacy Redux-connected props as a fallback so existing GoJS/AKMM internals can continue to operate with a legacy-shaped props object.
Changes:
- Read model page state from
selectSharedUniverseStatefirst, with legacy prop fallback, and derive header labels / render gating from the shared-first values. - Construct a “legacy-compatible” props object (
compatibilityProps) and pass it intoModellingto keep downstream expectations unchanged. - Route remote-save eligibility and remote save payloads through the shared-first
ph*values.
Comment on lines
414
to
418
| const username = typeof data?.username === 'string' && data.username | ||
| ? data.username.charAt(0).toUpperCase() + data.username.slice(1) | ||
| : 'Guest'; | ||
| dispatch(setUniverseUser({ ...props.phUser, focusUser: { name: username } })); | ||
| dispatch(setUniverseUser({ ...phUser, focusUser: { name: username } })); | ||
| } catch (error) { |
Comment on lines
+48
to
50
| const workspaceMeta = getWorkspaceSnapshotMeta(phUser); | ||
| const activeMetisScope = normalizeMetisScope(workspaceMeta?.activeMetisScope); | ||
| const metisAvailability = describeMetisAvailability(workspaceMeta?.snapshot); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phData,phFocus,phUser, andphSourcevalues from the shared universe slice first, with legacy connected props as fallback.Modellingso GoJS/AKMM internals can remain unchanged for this slice.Verification
npm run buildpassed.npm testpassed./model?universeSlug=4-enterprise-modeling-generic&universeApi=http%3A%2F%2Flocalhost%3A3001&metisScope=world-modelwithout runtime or console errors. Full remote model rendering still depends on the universe API server on port 3001 being available.