-
Notifications
You must be signed in to change notification settings - Fork 54
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
GO-4168 Rollback SetSource #1629
Conversation
Coverage provided by /~https://github.com/seriousben/go-patch-cover-action |
st := sb.NewStateCtx(ctx) | ||
|
||
// nolint:errcheck | ||
_ = st.Iterate(func(b simple.Block) (isContinue bool) { |
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.
encapsulate this in simple/dataview
block
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 dv := b.Model().GetDataview(); dv != nil {
for _, view := range dv.Views {
view.DefaultTemplateId = ""
view.DefaultObjectTypeId = ""
}
st.Set(b)
return false
}
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 have implemented separate method in editor.Dataview for setting source in sets
view.DefaultTemplateId = "" | ||
view.DefaultObjectTypeId = "" | ||
if err = dv.SetView(view.Id, *view); err != nil { | ||
log.With("objectId", d.Id()).Errorf("failed to update view '%s' of set: %v", view.Id, err) |
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.
maybe return with error?
btw use log fields for anything except error
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.
Done!
https://linear.app/anytype/issue/GO-4168/the-selected-query-is-not-deleted-in-the-set-when-clicking-on-the