Compare commits

...

4 Commits

Author SHA1 Message Date
kekesidavid 0361a6e5b7 Merge pull request #318 from specklesystems/david/move-text-class-update-pr-to-main
.NET Build and Publish / build (push) Has been cancelled
fix (sdk) Text class updates: removed origin from Text class and added screenAligned prop
2025-06-02 09:22:57 +02:00
David Kekesi 0e97782c29 fixed comment 2025-06-02 09:12:12 +02:00
David Kekesi 298dedc3af text class update pr moved to main 2025-05-30 19:01:02 +02:00
Jedd Morgan efc38d8f5c Added Workspace project visibility (#307)
.NET Build and Publish / build (push) Has been cancelled
2025-05-14 21:37:39 +03:00
7 changed files with 21 additions and 18 deletions
+2
View File
@@ -100,6 +100,8 @@ services:
POSTGRES_PASSWORD: "speckle"
POSTGRES_DB: "speckle"
ENABLE_MP: "false"
LOG_PRETTY: "true"
networks:
default:
+7 -8
View File
@@ -1,6 +1,5 @@
using Speckle.Objects.Geometry;
using Speckle.Sdk.Models;
using Point = Speckle.Objects.Geometry.Point;
namespace Speckle.Objects.Annotation;
@@ -15,11 +14,6 @@ public class Text : Base
/// </summary>
public required string value { get; set; }
/// <summary>
/// Origin point, relation to the text is defined by AlignmentHorizontal and AlignmentVertical
/// </summary>
public required Point origin { get; set; }
/// <summary>
/// Height in linear units or pixels (if Units.None)
/// </summary>
@@ -31,6 +25,11 @@ public class Text : Base
/// </summary>
public required string units { get; set; }
/// <summary>
/// If true, the text is oriented to face the screen (camera-aligned).
/// </summary>
public required bool screenOriented { get; set; }
/// <summary>
/// Horizontal alignment: Left, Center or Right
/// </summary>
@@ -42,9 +41,9 @@ public class Text : Base
public AlignmentVertical alignmentV { get; set; }
/// <summary>
/// Plane will be null if the text object orientation follows camera view
/// Plane axis vectors will be ignored if screenOriented is true
/// </summary>
public Plane? plane { get; set; }
public required Plane plane { get; set; }
/// <summary>
/// Maximum width of the text field (in 'units').
@@ -1,10 +1,11 @@
namespace Speckle.Sdk.Api.GraphQL.Enums;
namespace Speckle.Sdk.Api.GraphQL.Enums;
public enum ProjectVisibility
{
Private = 0,
Private,
Public,
[Obsolete("Use Unlisted instead", true)]
Public = 1,
Unlisted = 2,
[Obsolete("Use Public instead")]
Unlisted,
Workspace,
}
@@ -1,6 +1,7 @@
using FluentAssertions;
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL;
using Speckle.Sdk.Api.GraphQL.Enums;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
using Speckle.Sdk.Common;
@@ -18,7 +19,7 @@ public class ProjectInviteResourceTests : IAsyncLifetime
{
_inviter = await Fixtures.SeedUserWithClient();
_invitee = await Fixtures.SeedUserWithClient();
_project = await _inviter.Project.Create(new("test", null, null));
_project = await _inviter.Project.Create(new("test", null, ProjectVisibility.Public));
_createdInvite = await SeedInvite();
}
@@ -90,7 +90,7 @@ public class ProjectResourceExceptionalTests : IAsyncLifetime
{
var ex = await Assert.ThrowsAsync<AggregateException>(async () =>
_ = await _unauthedUser.Project.CreateInWorkspace(
new(_testProject.id, "My new name", ProjectVisibility.Unlisted, "NonExistentWorkspace")
new(_testProject.id, "My new name", ProjectVisibility.Public, "NonExistentWorkspace")
)
);
ex.InnerExceptions.Single().Should().BeOfType<SpeckleGraphQLException>();
@@ -29,7 +29,7 @@ public class ProjectResourceTests
[Theory]
[InlineData("Very private project", "My secret project", ProjectVisibility.Private)]
[InlineData("Very unlisted project", null, ProjectVisibility.Unlisted)]
[InlineData("Very unlisted project", null, ProjectVisibility.Public)]
public async Task ProjectCreate_Should_CreateProjectSuccessfully(
string name,
string? description,
@@ -70,7 +70,7 @@ public class ProjectResourceTests
// Arrange
const string NEW_NAME = "MY new name";
const string NEW_DESCRIPTION = "MY new desc";
const ProjectVisibility NEW_VISIBILITY = ProjectVisibility.Unlisted;
const ProjectVisibility NEW_VISIBILITY = ProjectVisibility.Public;
// Act
var newProject = await Sut.Update(
@@ -57,7 +57,7 @@ public class GeneralSendTest
client = TestDataHelper.ServiceProvider.GetRequiredService<IClientFactory>().Create(acc);
_project = await client.Project.Create(
new($"General Send Test run {Guid.NewGuid()}", null, ProjectVisibility.Unlisted)
new($"General Send Test run {Guid.NewGuid()}", null, ProjectVisibility.Public)
);
_remote = TestDataHelper.ServiceProvider.GetRequiredService<IServerTransportFactory>().Create(acc, _project.id);
}