-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ local.env | |
cookies.txt | ||
dump.sql | ||
test-results/ | ||
**/*.sqlite | ||
**/*.sqlite-* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using LexCore.ServiceInterfaces; | ||
using LfClassicData; | ||
using MongoDB.Driver; | ||
using MongoDB.Driver.Linq; | ||
|
||
namespace LexBoxApi.GraphQL.CustomTypes; | ||
|
||
public class IsLanguageForgeProjectDataLoader : BatchDataLoader<string, bool>, IIsLanguageForgeProjectDataLoader | ||
{ | ||
private readonly SystemDbContext _systemDbContext; | ||
|
||
public IsLanguageForgeProjectDataLoader( | ||
SystemDbContext systemDbContext, | ||
IBatchScheduler batchScheduler, | ||
DataLoaderOptions? options = null) | ||
: base(batchScheduler, options) | ||
{ | ||
_systemDbContext = systemDbContext; | ||
} | ||
|
||
protected override async Task<IReadOnlyDictionary<string, bool>> LoadBatchAsync( | ||
IReadOnlyList<string> projectCodes, | ||
CancellationToken cancellationToken) | ||
{ | ||
return await MongoExtensions.ToAsyncEnumerable(_systemDbContext.Projects.AsQueryable() | ||
.Select(p => p.ProjectCode) | ||
.Where(projectCode => projectCodes.Contains(projectCode))) | ||
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Build API / publish-api
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (ubuntu-latest, 3) / Test ubuntu-latest for Mercurial 3 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (ubuntu-latest, 3) / Test ubuntu-latest for Mercurial 3 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (windows-latest, 3) / Test windows-latest for Mercurial 3 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (windows-latest, 3) / Test windows-latest for Mercurial 3 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (windows-latest, 6) / Test windows-latest for Mercurial 6 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (windows-latest, 6) / Test windows-latest for Mercurial 6 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (ubuntu-latest, 6) / Test ubuntu-latest for Mercurial 6 on staging
Check warning on line 27 in backend/LexBoxApi/GraphQL/CustomTypes/IsLanguageForgeProjectDataLoader.cs GitHub Actions / Integration tests (ubuntu-latest, 6) / Test ubuntu-latest for Mercurial 6 on staging
|
||
.ToDictionaryAsync(projectCode => projectCode, _ => true, cancellationToken); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
"Microsoft.AspNetCore": "Information", | ||
"Microsoft.AspNetCore.HttpOverrides.ForwardedHeadersMiddleware": "Debug", | ||
"Microsoft.EntityFrameworkCore": "Information", | ||
"MongoDB.Command": "Debug", | ||
"MongoDB.Command": "Debug" | ||
} | ||
}, | ||
"ForwardedHeadersOptions": { | ||
|
@@ -66,6 +66,6 @@ | |
"Endpoint": "http://localhost:4317" | ||
}, | ||
"Email": { | ||
"CreateProjectEmailDestination": "admin@languagedepot.org" | ||
"CreateProjectEmailDestination": "[email protected].org" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace LexCore.ServiceInterfaces; | ||
|
||
public interface IIsLanguageForgeProjectDataLoader | ||
{ | ||
public Task<bool> LoadAsync(string projectCode, CancellationToken cancellationToken = default); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ spec: | |
- name: Email__SmtpPort | ||
value: '587' | ||
- name: Email__From | ||
# TODO: need to parameterize this | ||
value: "Language Depot (Develop) <[email protected]>" | ||
- name: Email__BaseUrl | ||
value: "https://develop.lexbox.org" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ spec: | |
- name: Email__SmtpPort | ||
value: '587' | ||
- name: Email__From | ||
# TODO: need to parameterize this | ||
value: "Language Depot <[email protected]>" | ||
- name: Email__CreateProjectEmailDestination | ||
value: "[email protected]" | ||
- name: Email__BaseUrl | ||
value: "https://languagedepot.org" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ spec: | |
- name: Email__SmtpPort | ||
value: '587' | ||
- name: Email__From | ||
# TODO: need to parameterize this | ||
value: "Language Depot (Staging) <[email protected]>" | ||
- name: Email__BaseUrl | ||
value: "https://staging.languagedepot.org" |