-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed create project action and added data source handler to project …
…identifier
- Loading branch information
1 parent
f2fb975
commit 802fc91
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Apps.XtrfCustomerPortal.Actions; | ||
using Apps.XtrfCustomerPortal.Invocables; | ||
using Apps.XtrfCustomerPortal.Models.Requests; | ||
using Blackbird.Applications.Sdk.Common.Dynamic; | ||
using Blackbird.Applications.Sdk.Common.Invocation; | ||
|
||
namespace Apps.XtrfCustomerPortal.DataSources; | ||
|
||
public class ProjectDataSource(InvocationContext invocationContext) | ||
: AppInvocable(invocationContext), IAsyncDataSourceHandler | ||
{ | ||
public async Task<Dictionary<string, string>> GetDataAsync(DataSourceContext context, CancellationToken cancellationToken) | ||
{ | ||
var projectActions = new ProjectActions(invocationContext, null!); | ||
|
||
var quotes = await projectActions.SearchProjects(new SearchProjectsRequest() | ||
{ | ||
Search = context.SearchString ?? string.Empty | ||
}); | ||
|
||
return quotes.Projects | ||
.ToDictionary(x => x.ProjectId, x => x.ProjectName); | ||
} | ||
} |
4 changes: 3 additions & 1 deletion
4
Apps.XtrfCustomerPortal/Models/Identifiers/ProjectIdentifier.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
using Apps.XtrfCustomerPortal.DataSources; | ||
using Blackbird.Applications.Sdk.Common; | ||
using Blackbird.Applications.Sdk.Common.Dynamic; | ||
|
||
namespace Apps.XtrfCustomerPortal.Models.Identifiers; | ||
|
||
public class ProjectIdentifier | ||
{ | ||
[Display("Project ID")] | ||
[Display("Project ID"), DataSource((typeof(ProjectDataSource)))] | ||
public string ProjectId { get; set; } | ||
} |