1
0
Fork 0
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:
Sergey Cherepanov 2021-06-10 17:28:58 +03:00
parent 8460d1ee34
commit 68eafeec2d
No known key found for this signature in database
GPG key ID: 085319C64294F576
3 changed files with 4 additions and 6 deletions

View file

@ -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
}

View file

@ -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())