@@ -26,42 +22,51 @@
}
else
{
-
data source
-
+
+ @foreach(var description in _extensionDescriptions)
+ {
+
@description.Type
-
- @Catalog.Info.DataSourceType
- @@
- @_extensionDescription.Version
-
+
- @if (!string.IsNullOrWhiteSpace(_extensionDescription.Description))
- {
-
@_extensionDescription.Description
- }
+
@description.Version
- @if (!string.IsNullOrWhiteSpace(Catalog.Info.DataSourceInfoUrl))
- {
-
-
- Info Website
-
- }
+ @if (!string.IsNullOrWhiteSpace(description.Description))
+ {
+
@description.Description
+ }
- @if (!string.IsNullOrWhiteSpace(_extensionDescription.ProjectUrl))
- {
-
-
- Project Website
-
- }
+ @* @if (!string.IsNullOrWhiteSpace(description.DataSourceInfoUrl))
+ {
+
+
+ Info Website
+
+ } *@
- @if (!string.IsNullOrWhiteSpace(_extensionDescription.RepositoryUrl))
- {
-
-
- Source Repository
-
+
+
}
}
@@ -70,7 +75,6 @@
@code {
private bool _isCatalogAboutDialogOpen;
- private ExtensionDescription? _extensionDescription;
private IReadOnlyList
? _extensionDescriptions;
[Parameter]
@@ -90,14 +94,20 @@
{
try
{
- _extensionDescriptions = await Client.Sources.GetDescriptionsAsync();
- _extensionDescription = _extensionDescriptions.FirstOrDefault(current => current.Type == Catalog.Info.DataSourceType);
+ var dataSourceTypes = Catalog.Info.PipelineInfo.Types;
+ var extensionDescriptions = await Client.Sources.GetDescriptionsAsync();
+
+ _extensionDescriptions = extensionDescriptions
+ .Where(current => dataSourceTypes.Contains(current.Type))
+ .ToArray();
+
+ _extensionDescriptions = [_extensionDescriptions[0], _extensionDescriptions[0]];
}
catch (Exception ex)
{
AppState.AddError(ex, Snackbar);
}
-
+
StateHasChanged();
});
}
diff --git a/src/Nexus.UI/Core/AppState.cs b/src/Nexus.UI/Core/AppState.cs
index 085faa32..7f734ea0 100644
--- a/src/Nexus.UI/Core/AppState.cs
+++ b/src/Nexus.UI/Core/AppState.cs
@@ -51,10 +51,8 @@ public AppState(
IsReleased: true,
IsVisible: true,
IsOwner: false,
- DataSourceInfoUrl: default,
- DataSourceType: default!,
- DataSourceRegistrationId: default,
- PackageReferenceId: default);
+ PackageReferenceIds: default!,
+ PipelineInfo: default!);
RootCatalog = new FakeResourceCatalogViewModel(rootInfo, "", client, this, childCatalogInfosTask);
diff --git a/src/Nexus.UI/Core/NexusDemoClient.cs b/src/Nexus.UI/Core/NexusDemoClient.cs
index e8eecd18..74a211ee 100644
--- a/src/Nexus.UI/Core/NexusDemoClient.cs
+++ b/src/Nexus.UI/Core/NexusDemoClient.cs
@@ -185,10 +185,12 @@ We hope you enjoy it!
IsReleased: true,
IsVisible: true,
IsOwner: false,
- DataSourceInfoUrl: default,
- DataSourceType: "Nexus.FakeSource",
- DataSourceRegistrationId: Guid.NewGuid(),
- PackageReferenceId: Guid.NewGuid()
+ PackageReferenceIds: [Guid.NewGuid()],
+ PipelineInfo: new PipelineInfo(
+ Id: Guid.NewGuid(),
+ Types: ["Nexus.FakeSource"],
+ InfoUrls: [default]
+ )
);
return Task.FromResult((IReadOnlyList)[catalogInfo]);
diff --git a/src/Nexus.UI/ViewModels/FakeResourceCatalogViewModel.cs b/src/Nexus.UI/ViewModels/FakeResourceCatalogViewModel.cs
index 4fb3ffef..761de583 100644
--- a/src/Nexus.UI/ViewModels/FakeResourceCatalogViewModel.cs
+++ b/src/Nexus.UI/ViewModels/FakeResourceCatalogViewModel.cs
@@ -76,10 +76,8 @@ private static List PrepareChildCatalogs(
IsReleased: true,
IsVisible: true,
IsOwner: false,
- DataSourceInfoUrl: default,
- DataSourceType: "Nexus.FakeSource",
- DataSourceRegistrationId: default,
- PackageReferenceId: default);
+ PackageReferenceIds: default!,
+ PipelineInfo: default!);
var childCatalogInfosTask = Task.FromResult((IReadOnlyList)group.ToList());
result.Add(new FakeResourceCatalogViewModel(childInfo, id, client, appState, childCatalogInfosTask));
diff --git a/src/Nexus/Extensibility/DataSource/DataSourceController.cs b/src/Nexus/Extensibility/DataSource/DataSourceController.cs
index fc09f89d..684ff69a 100644
--- a/src/Nexus/Extensibility/DataSource/DataSourceController.cs
+++ b/src/Nexus/Extensibility/DataSource/DataSourceController.cs
@@ -232,35 +232,46 @@ public async Task GetCatalogAsync(
else
{
- var type = DataSources
- .GetType();
-
var nexusVersion = typeof(Program).Assembly
.GetCustomAttribute()!
.InformationalVersion;
- var dataSourceVersion = type.Assembly
- .GetCustomAttribute()!
- .InformationalVersion;
+ var jsonPipeline = new JsonArray();
+
+ foreach (var dataSource in DataSources)
+ {
+ var type = dataSource.GetType();
- var repositoryUrl = type
- .GetCustomAttribute(inherit: false)!
- .RepositoryUrl;
+ var dataSourceVersion = type.Assembly
+ .GetCustomAttribute()!
+ .InformationalVersion;
- var newResourceProperties = catalogProperties is null
- ? []
- : catalogProperties.ToDictionary(entry => entry.Key, entry => entry.Value);
+ var repositoryUrl = type
+ .GetCustomAttribute(inherit: false)!
+ .RepositoryUrl;
+
+ var jsonPipelineElement = new JsonObject()
+ {
+ ["data-source-repository-url"] = repositoryUrl,
+ ["data-source-version"] = dataSourceVersion
+ };
+
+ jsonPipeline.Add(jsonPipelineElement);
+ }
var originJsonObject = new JsonObject()
{
["origin"] = new JsonObject()
{
["nexus-version"] = nexusVersion,
- ["data-source-repository-url"] = repositoryUrl,
- ["data-source-version"] = dataSourceVersion,
+ ["pipeline"] = jsonPipeline
}
};
+ var newResourceProperties = catalogProperties is null
+ ? []
+ : catalogProperties.ToDictionary(entry => entry.Key, entry => entry.Value);
+
newResourceProperties[DATA_SOURCE_KEY] = JsonSerializer.SerializeToElement(originJsonObject);
catalog = catalog with
diff --git a/src/Nexus/Extensions/Sources/Sample.cs b/src/Nexus/Extensions/Sources/Sample.cs
index fe0fa9ff..ac47a32c 100644
--- a/src/Nexus/Extensions/Sources/Sample.cs
+++ b/src/Nexus/Extensions/Sources/Sample.cs
@@ -117,9 +117,7 @@ public Task EnrichCatalogAsync(
ResourceCatalog catalog,
CancellationToken cancellationToken)
{
- throw new Exception();
-
- // return Task.FromResult(LoadCatalog(catalogId));
+ return Task.FromResult(LoadCatalog(catalog.Id));
}
public Task<(DateTime Begin, DateTime End)> GetTimeRangeAsync(
diff --git a/src/Nexus/wwwroot/css/app.css b/src/Nexus/wwwroot/css/app.css
index bedf785f..69ea3cf3 100644
--- a/src/Nexus/wwwroot/css/app.css
+++ b/src/Nexus/wwwroot/css/app.css
@@ -941,6 +941,10 @@ video {
gap: 1.25rem;
}
+.gap-4 {
+ gap: 1rem;
+}
+
.overflow-auto {
overflow: auto;
}
diff --git a/tests/TestExtensionProject/TestDataSource.cs b/tests/TestExtensionProject/TestDataSource.cs
index e9e71b9b..14e210b2 100644
--- a/tests/TestExtensionProject/TestDataSource.cs
+++ b/tests/TestExtensionProject/TestDataSource.cs
@@ -20,7 +20,7 @@ public Task GetCatalogRegistrationsAsync(string path, Can
throw new NotImplementedException(nameof(EnrichCatalogAsync));
}
- public Task EnrichCatalogAsync(string catalogId, CancellationToken cancellationToken)
+ public Task EnrichCatalogAsync(ResourceCatalog catalog, CancellationToken cancellationToken)
{
throw new NotImplementedException(nameof(EnrichCatalogAsync));
}