Skip to content

Commit

Permalink
Merge pull request #20 from neuroglia-io/fix-ui-improvements
Browse files Browse the repository at this point in the history
Multiple fixes and improvements
  • Loading branch information
cdavernas authored Dec 4, 2023
2 parents d257c73 + 28f4907 commit e2e750c
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 223 deletions.
6 changes: 3 additions & 3 deletions samples/StreetLightsApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Neuroglia.AsyncApi.v2;
using Neuroglia.AsyncApi.v2.Bindings.Http;
using Neuroglia.AsyncApi.v2.Bindings.Mqtt;
using Neuroglia.Data.Schemas;
using Neuroglia.Data.Schemas.Json;
using StreetLightsApi.Server.Services;
using System.Net.Mime;

Expand All @@ -35,7 +35,7 @@
jsonSchemaBuilder.Properties(("type", new JsonSchemaBuilder().Const("com.streetlights.sensor.movement-detected.v2").Build()), ("datacontenttype", new JsonSchemaBuilder().Const(MediaTypeNames.Application.Json).Build()));
var movementDetectedEventSchema = jsonSchemaBuilder.Build();

builder.Services.AddHttpClient(); //todo: move to proper extension
builder.Services.AddHttpClient();
builder.Services.AddRazorPages()
.AddRazorRuntimeCompilation();
builder.Services.AddAsyncApiUI();
Expand Down Expand Up @@ -102,7 +102,7 @@
.WithClientCredentialsFlow(flow => flow
.WithAuthorizationUrl(new("https://fake.idp.com/token"))
.WithScope("api:read", "The scope used to read data")))));
builder.Services.AddSingleton<IJsonSchemaResolver, JsonSchemaResolver>(); //todo: remove
builder.Services.AddSingleton<IJsonSchemaResolver, JsonSchemaResolver>();

var app = builder.Build();
app.UseStaticFiles();
Expand Down
2 changes: 1 addition & 1 deletion samples/StreetLightsApi/StreetLightsApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageReference Include="MQTTnet" Version="4.3.1.873" />
<PackageReference Include="MQTTnet" Version="4.3.2.930" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/neuroglia-io/framework</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>neuroglia asyncapi async api asp ui</PackageTags>
<Version>2.6.0</Version>
<Version>2.6.1</Version>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
4 changes: 2 additions & 2 deletions src/Neuroglia.AsyncApi.AspNetCore.UI/Pages/AsyncApi.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
</button>
<ul class="dropdown-menu" aria-labelledby="downloadBtnGroup">
<li>
<a class="dropdown-item" href="@ServingOptions.Value.GenerateRouteFor(document, AsyncApiDocumentFormat.Json)">
<a class="dropdown-item" href="@ServingOptions.Value.GenerateRouteFor(document, AsyncApiDocumentFormat.Json)" target="_blank">
<small>JSON</small>
</a>
</li>
<li>
<a class="dropdown-item" href="@ServingOptions.Value.GenerateRouteFor(document, AsyncApiDocumentFormat.Yaml)">
<a class="dropdown-item" href="@ServingOptions.Value.GenerateRouteFor(document, AsyncApiDocumentFormat.Yaml)" target="_blank">
<small>YAML</small>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a data-bs-toggle="collapse" href="#@messageRef" role="button" aria-expanded="false" title="@message?.Summary">
<div class="card-header">
<div class="row">
<div class="col-md-5">
<div class="col-md-9">
<span class="fw-bold fs-5 text-secondary align-middle">#@Model.Index</span>
<span class="text-muted align-middle mx-2">@message?.Name</span>
<span class="badge border border-secondary text-secondary">@message?.ContentType</span>
Expand All @@ -22,7 +22,7 @@
<i class="bi bi-link ms-2 text-dark" role="button" title="The message is correlatable"></i>
}
</div>
<div class="col-md-7 text-end">
<div class="col-md-3 text-end">
@if (message?.Tags != null)
{
foreach (var tag in message.Tags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
}
else
{
int index = 0;
int index = 1;
foreach(var messageOption in message.OneOf)
{
<partial name="_Message" model="new MessageDefinitionViewModel(this.Model.Document, index, operationRef, messageOption)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div id="@this.Model.Key" class="card-body collapse">
@if (!string.IsNullOrWhiteSpace(server.Description))
{
<p class="mb-3">@server.Description</p>
<p><small class="text-secondary">@server.Description</small></p>
}
@if (server.Variables != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@using Neuroglia.AsyncApi.AspNetCore.UI.Models
@using Neuroglia.AsyncApi.Generation
@using Neuroglia.AsyncApi.v2
@using Neuroglia.Data.Schemas
@using Neuroglia.Data.Schemas.Json
@using Neuroglia.Serialization
@using Json.Schema
@using System.Text.Json.Serialization
Expand Down
184 changes: 0 additions & 184 deletions src/Neuroglia.AsyncApi.AspNetCore.UI/TOREMOVE.cs

This file was deleted.

3 changes: 2 additions & 1 deletion src/Neuroglia.AsyncApi.AspNetCore.UI/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

global using Json.Schema;
global using Neuroglia.AsyncApi.v2;
global using Json.Schema;
global using Neuroglia.Data.Schemas.Json;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/neuroglia-io/framework</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>neuroglia asyncapi async api asp</PackageTags>
<Version>2.6.0</Version>
<Version>2.6.1</Version>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Neuroglia.AsyncApi.FluentBuilders;
using Neuroglia.AsyncApi.v2;
using Neuroglia.Eventing.CloudEvents;
using Neuroglia.Json.Schema.Generation;
using Neuroglia.Data.Schemas.Json;

namespace Neuroglia.AsyncApi.CloudEvents;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<RepositoryUrl>https://github.com/neuroglia-io/framework</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>neuroglia asyncapi async api cloud-event</PackageTags>
<Version>2.6.0</Version>
<Version>2.6.1</Version>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neuroglia.Eventing.CloudEvents" Version="4.7.1" />
<PackageReference Include="Neuroglia.Eventing.CloudEvents" Version="4.7.2" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Neuroglia.AsyncApi.Core/Neuroglia.AsyncApi.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<RepositoryUrl>https://github.com/neuroglia-io/framework</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>neuroglia asyncapi async api core</PackageTags>
<Version>2.6.0</Version>
<Version>2.6.1</Version>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -30,8 +30,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JsonSchema.Net" Version="5.4.0" />
<PackageReference Include="Neuroglia.Serialization" Version="4.7.1" />
<PackageReference Include="JsonSchema.Net" Version="5.4.1" />
<PackageReference Include="Neuroglia.Serialization" Version="4.7.2" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// limitations under the License.

using Json.Schema;
using Neuroglia.AsyncApi.v2.Bindings;

namespace Neuroglia.AsyncApi.v2.Bindings.Http;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<RepositoryUrl>https://github.com/neuroglia-io/framework</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>neuroglia asyncapi async api dependency injection di extensions</PackageTags>
<Version>2.6.0</Version>
<Version>2.6.1</Version>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface IServerDefinitionBuilder
/// </summary>
/// <param name="description">The description to use</param>
/// <returns>The configured <see cref="IServerDefinitionBuilder"/></returns>
IServerDefinitionBuilder WithDescription(string description);
IServerDefinitionBuilder WithDescription(string? description);

/// <summary>
/// Adds the specified <see cref="VariableDefinition"/> to the <see cref="ServerDefinition"/> to build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Neuroglia.AsyncApi.v2;
using Neuroglia.Json.Schema.Generation;
using Neuroglia.Data.Schemas.Json;

namespace Neuroglia.AsyncApi.FluentBuilders;

Expand Down
Loading

0 comments on commit e2e750c

Please sign in to comment.