fix attributes-editor: allow modifying tablet cell bundle attribute for replicated tables#1424
Open
lesf0 wants to merge 1 commit intoytsaurus:mainfrom
Open
fix attributes-editor: allow modifying tablet cell bundle attribute for replicated tables#1424lesf0 wants to merge 1 commit intoytsaurus:mainfrom
lesf0 wants to merge 1 commit intoytsaurus:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExtends the attributes editor logic so that "tablet cell bundle" (and other in-memory-related attributes) are correctly applied not only to dynamic tables but also to dynamic replicated tables when submitting changes. Sequence diagram for applying in_memory_mode to dynamic replicated tablessequenceDiagram
actor User
participant UI as AttributesEditorUI
participant Store as NavigationStore
participant Action as navigationSetNodeAttributes
User->>UI: Edit tablet cell bundle
UI->>Store: submitAttributes(nodePath, updatedAttributes)
Store->>Action: navigationSetNodeAttributes(nodePath, attrs, in_memory_mode)
Action->>Action: type = ypath.getValue(attrs, /@type)
Action->>Action: isDynamic = ypath.getValue(attrs, /@dynamic)
Action->>Action: isDynTable = [table, replicated_table].includes(type) && isDynamic
alt in_memory_mode defined and isDynTable
Action->>Action: Object.assign(newAttrs, {in_memory_mode})
else in_memory_mode undefined or not isDynTable
Action-->>Action: Do not modify newAttrs.in_memory_mode
end
Action-->>Store: newAttrs with updated in_memory_mode
Store-->>UI: Update UI state
UI-->>User: Show updated attributes applied
Flow diagram for determining when to apply in_memory_modeflowchart TD
A[Start navigationSetNodeAttributes] --> B[Read type from attrs @type]
B --> C[Read isDynamic from attrs @dynamic]
C --> D{Is type table or replicated_table?}
D -->|No| E[isDynTable = false]
D -->|Yes| F[isDynTable = true]
E --> G{Is in_memory_mode defined?}
F --> G
G -->|No| H[Do not change newAttrs in_memory_mode]
G -->|Yes and isDynTable true| I[Assign in_memory_mode to newAttrs]
H --> J[Continue with other attribute updates]
I --> J
J --> K[Finish navigationSetNodeAttributes]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Commit 2757be5 allows it to display "tablet cell bundle" attribute in attributes editor dialog. However, it does nothing on submit when this attribute is changed.
This PR addresses and fixes this issue.
Summary by Sourcery
Bug Fixes: