Skip to content
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

feat: sdk7 ui input submit #5864

Merged
merged 12 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions scripts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typescript": "^4.2.3"
},
"dependencies": {
"@dcl/protocol": "^1.0.0-6590614146.commit-db4a595",
"@dcl/protocol": "https://sdk-team-cdn.decentraland.org/@dcl/protocol/branch//dcl-protocol-1.0.0-6665576309.commit-fbefe5d.tgz",
"@protobuf-ts/protoc": "^2.8.2",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("DCL.ECSComponents.AbstractElements.Tests")]
[assembly: InternalsVisibleTo("ECS7Plugin.Tests")]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:f8afb582bba443878c19a3bf4e7d83c0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public void SetUp()
if (!uiDoc.rootVisualElement.Contains(internalCompData.Value.model.rootElement))
uiDoc.rootVisualElement.Add(internalCompData.Value.model.rootElement);
});

var serviceLocator = ServiceLocatorTestFactory.CreateMocked();
Environment.Setup(serviceLocator);
}

protected static UIDocument InstantiateUiDocument() =>
Expand All @@ -70,6 +73,7 @@ protected static UIDocument InstantiateUiDocument() =>
public void TearDown()
{
sceneTestHelper.Dispose();
Environment.Dispose();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ public void RegisterSetUp()
(COMPONENT_ID, RESULT_COMPONENT_ID, factory, writer, internalUiContainer, handlerBuilder);
}

[TearDown]
public void RegisterTearDown()
{
factory.ClearReceivedCalls();
writer.ClearReceivedCalls();
register.ClearReceivedCalls();
}

[Test]
public void AddDeserializer()
{
factory.Received(1)
.AddOrReplaceComponent(COMPONENT_ID,
Arg.Any<Func<object, PBUiBackground>>(), default);
(o) => { return new PBUiBackground(); }, default);

Assert.IsTrue(factory.componentBuilders.TryGetValue(COMPONENT_ID, out var componentBuilder));
Assert.AreEqual(typeof(ECSComponent<PBUiBackground>), componentBuilder().GetType());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("DCL.ECSComponents.UIBackground.Tests")]
[assembly: InternalsVisibleTo("ECS7Plugin.Tests")]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:f8afb582bba443878c19a3bf4e7d83c0"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("DCL.ECSComponents.UIComponentsUtils.Tests")]
[assembly: InternalsVisibleTo("ECS7Plugin.Tests")]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:f8afb582bba443878c19a3bf4e7d83c0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using DCL.ECS7.ComponentWrapper;
using DCL.ECS7.InternalComponents;
using DCL.Models;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using UnityEngine.UIElements;
Expand All @@ -23,8 +22,12 @@ public static EventCallback<TEvent> RegisterFeedback<TEvent>(
EventCallback<TEvent> callback = evt =>
{
var model = inputResults.GetFor(scene, entity)?.model ?? new InternalUIInputResults(new Queue<InternalUIInputResults.Result>());
model.Results.Enqueue(new InternalUIInputResults.Result(createResult(evt), resultComponentId));
inputResults.PutFor(scene, entity, model);
var result = createResult(evt);
if (result != null)
{
model.Results.Enqueue(new InternalUIInputResults.Result(result, resultComponentId));
inputResults.PutFor(scene, entity, model);
}
};

uiElement.RegisterCallback(callback);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("DCL.ECSComponents.UIDropdown.Tests")]
[assembly: InternalsVisibleTo("ECS7Plugin.Tests")]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:f8afb582bba443878c19a3bf4e7d83c0"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("DCL.ECSComponents.UIInput.Tests")]
[assembly: InternalsVisibleTo("ECS7Plugin.Tests")]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:f8afb582bba443878c19a3bf4e7d83c0"
}
Loading
Loading