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

Add projection type editor and details view in the Dashboard #49

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JBBianchi
Copy link
Member

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

  • Enable schema update and migration in the projection editor
  • Handle/display migration result
  • Add a details view

Closes #11

Special notes for reviewers:

Additional information (if needed):
@cdavernas I'd need your help/input:

  • When serializing a JsonSchema using the YamlSerializer, the resulting yaml is "polluted" with JsonEverything specific properties. This happens when passing ProjectionType.Schema to the MonacoEditor (and the serialization happens in the store of the MonacoEditor L113 in SetDocument)
  • I attempted to migrate a projection type by providing a migration with an empty operations list, but it failed with the error: System.Text.Json.JsonException: 'The JSON value could not be converted to System.Collections.Generic.List1[Json.Patch.PatchOperation]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.' This occurred in the repository'sPatchAsync` method. Could you check whether I made a mistake or if there’s a bug in the process?
    image
System.Text.Json.JsonException
  HResult=0x80131500
  Message=The JSON value could not be converted to System.Collections.Generic.List`1[Json.Patch.PatchOperation]. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
  Source=System.Text.Json
  StackTrace:
   at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.JsonSerializer.Read[TValue](Utf8JsonReader& reader, JsonTypeInfo`1 jsonTypeInfo)
   at Json.Patch.PatchJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
   at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
   at Neuroglia.Serialization.Json.JsonSerializer.Deserialize[T](String json)
   at Neuroglia.Data.PatchModel.Services.JsonPatchHandler.ApplyPatchAsync[T](Object patch, T target, CancellationToken cancellationToken)
   at CloudShapes.Application.Services.Repository.<PatchAsync>d__44.MoveNext() in C:\Dev\Neuroglia\Github\cloud-shapes\src\CloudShapes.Application\Services\Repository.cs:line 297
   at CloudShapes.Application.Commands.ProjectionTypes.MigrateProjectionTypeSchemaCommandHandler.<HandleAsync>d__10.MoveNext() in C:\Dev\Neuroglia\Github\cloud-shapes\src\CloudShapes.Application\Commands\ProjectionTypes\MigrateProjectionTypeSchemaCommandHandler.cs:line 74
   at CloudShapes.Application.Commands.ProjectionTypes.MigrateProjectionTypeSchemaCommandHandler.<HandleAsync>d__10.MoveNext() in C:\Dev\Neuroglia\Github\cloud-shapes\src\CloudShapes.Application\Commands\ProjectionTypes\MigrateProjectionTypeSchemaCommandHandler.cs:line 57
   at Neuroglia.Mediation.RequestPipeline`2.<HandleAsync>d__1.MoveNext()
   at Neuroglia.Mediation.Mediator.<ExecuteAsync>d__7`1.MoveNext()
   at CloudShapes.Api.Controllers.ProjectionTypesController.<MigrateProjectionTypeSchema>d__5.MoveNext() in C:\Dev\Neuroglia\Github\cloud-shapes\src\CloudShapes.Api\Controllers\ProjectionTypesController.cs:line 88
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.<Execute>d__0.MoveNext()
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<<InvokeActionMethodAsync>g__Awaited|12_0>d.MoveNext()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<<InvokeNextActionFilterAsync>g__Awaited|10_0>d.MoveNext()
  • Any feedback on the UI is welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create the component used to view/edit a ProjectionType
1 participant