mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
template fix layout rewrite
This commit is contained in:
parent
8460d1ee34
commit
68eafeec2d
3 changed files with 4 additions and 6 deletions
|
@ -818,7 +818,9 @@ func (sb *smartBlock) setObjectTypes(s *state.State, objectTypes []string) (err
|
|||
|
||||
ot := otypes[len(otypes)-1]
|
||||
s.SetObjectTypes(objectTypes)
|
||||
s.SetDetailAndBundledRelation(bundle.RelationKeyLayout, pbtypes.Float64(float64(ot.Layout)))
|
||||
if pbtypes.Get(s.Details(), bundle.RelationKeyLayout.String()) == nil {
|
||||
s.SetDetailAndBundledRelation(bundle.RelationKeyLayout, pbtypes.Float64(float64(ot.Layout)))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/app/testapp"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/editor/state"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/source"
|
||||
"github.com/anytypeio/go-anytype-middleware/pkg/lib/pb/model"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/testMock/mockSource"
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -18,9 +16,7 @@ func Test_registerBuiltin(t *testing.T) {
|
|||
s := mockSource.NewMockService(ctrl)
|
||||
s.EXPECT().Name().Return(source.CName).AnyTimes()
|
||||
s.EXPECT().Init(gomock.Any()).AnyTimes()
|
||||
s.EXPECT().NewStaticSource(gomock.Any(), gomock.Any(), gomock.Any()).Do(func(id string, sbt model.SmartBlockType, s *state.State) {
|
||||
t.Log(s.StringDebug())
|
||||
}).AnyTimes()
|
||||
s.EXPECT().NewStaticSource(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
|
||||
s.EXPECT().RegisterStaticSource(gomock.Any(), gomock.Any()).AnyTimes()
|
||||
|
||||
a := testapp.New().With(s).With(New())
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue