Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static IServiceCollection AddPoracleServices(this IServiceCollection serv
var scannerConnectionString = configuration.GetConnectionString("ScannerDb");
if (!string.IsNullOrEmpty(scannerConnectionString))
{
services.AddDbContext<ScannerDbContext>(options =>
services.AddDbContext<ScannerContext>(options =>
options.UseMySQL(scannerConnectionString));
services.AddScoped<IScannerService, ScannerService>();
}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- **Removed stale AutoMapper references from the docs site** ([#241](https://github.com/PGAN-Dev/PoracleWeb.NET/issues/241)): AutoMapper was dropped in v2.6.0 ([#173](https://github.com/PGAN-Dev/PoracleWeb.NET/issues/173)) in favour of manual mapping extensions, but four docs pages still described it as the live mapping layer — `architecture/backend.md` even carried a `.ForAllMembers(opts => opts.Condition(...))` snippet that exists nowhere in the codebase. The mapping sections in `architecture/overview.md` and `architecture/backend.md` now describe `AlarmMappingExtensions` (`To*()` / `ApplyUpdate()`) and `EntityMappingExtensions` (`ToModel()` / `ToEntity()` / `ApplyTo()`), with a real `ApplyUpdate` snippet showing the explicit null-skip guards; the `Core.Mappings/` line in the solution tree, the test-coverage bullet in `development/testing.md`, and a passing mention in `architecture/poracleng-proxy.md` are corrected to match. The last piece of AutoMapper residue outside the docs goes with it: the mapping test file was still named `PoracleMappingProfileTests.cs` while the class inside it had been renamed to `MappingExtensionTests`, so the file is renamed to match. No behaviour change.
- **Renamed `ScannerDbContext` to `ScannerContext`** ([#240](https://github.com/PGAN-Dev/PoracleWeb.NET/issues/240)): the scanner DB context was the only one of the three `DbContext` subclasses carrying a `Db` in its name, out of step with its siblings `PoracleContext` and `PoracleWebContext`. Renamed the class, its file, the `DbContextOptions<>` type argument, the `ScannerService` constructor parameter and field, and the `AddDbContext<>` registration, plus the two doc mentions. Purely cosmetic — no functional change: `IScannerService` is untouched, the optional `ConnectionStrings:ScannerDb` key is unchanged, no EF migrations are involved (the scanner DB is read-only and never migrated by PoracleWeb), and there is no wire-contract or config impact for self-hosters.
- **Localized the external SSO / OIDC strings** across all bundled locales. The SSO login feature added 30 i18n keys to English only, so every non-English locale fell back to English for the "Sign in with {provider}" button, the signed-out panel, the OIDC error messages, and the admin Authentication / External SSO settings group. These are now translated into Danish, German, Spanish, French, Italian, Dutch, Polish, Portuguese (PT & BR), and Swedish. Translation-only — no code or behavior change.
- **Admin Server Settings page UX overhaul.** Adds a live **search/filter** (sticky bar, match highlighting, `/` or Ctrl/Cmd+K to focus), a **sticky save + discard bar** so saving is always reachable on the long page, **sign-in providers grouped under Authentication** (Telegram/Discord moved up), and **collapsible sections** (persisted) with per-section "unsaved" chips and state summaries (e.g. "7 of 9 enabled"). Headline fix: the alarm-type/feature toggles were a confusing **double negative** ("Disable X", ON = feature off) mixed with positive `enable_*` toggles; they are now **uniformly positive** (ON = enabled, labels are the feature name, descriptions are "Let users …"). The stored `disable_*` keys are **unchanged** — a presentation-only inversion — so backend feature-gating is unaffected. New UX i18n keys and the reframed positive labels/descriptions are translated across all 11 locales.

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Pgan.PoracleWebNet.slnx
| | WebhookDelegateEntity, QuickPickDefinitionEntity,
| | QuickPickAppliedStateEntity),
| | Configurations/ (EF Core entity type configurations)
| +-- Data.Scanner/ ScannerDbContext for optional scanner DB
| +-- Data.Scanner/ ScannerContext for optional scanner DB
|
+-- Applications/
| +-- Web.Api/ ASP.NET Core host
Expand Down
4 changes: 2 additions & 2 deletions Core/Pgan.PoracleWebNet.Core.Services/ScannerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

namespace Pgan.PoracleWebNet.Core.Services;

public partial class ScannerService(ScannerDbContext context, ILogger<ScannerService> logger) : IScannerService
public partial class ScannerService(ScannerContext context, ILogger<ScannerService> logger) : IScannerService
{
private readonly ScannerDbContext _context = context;
private readonly ScannerContext _context = context;
private readonly ILogger<ScannerService> _logger = logger;

private const int MaxResultRows = 5000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Pgan.PoracleWebNet.Data.Scanner;

public class ScannerDbContext(DbContextOptions<ScannerDbContext> options) : DbContext(options)
public class ScannerContext(DbContextOptions<ScannerContext> options) : DbContext(options)
{
public DbSet<ScannerPokestopEntity> Pokestops => this.Set<ScannerPokestopEntity>();
public DbSet<ScannerGymEntity> Gyms => this.Set<ScannerGymEntity>();
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ A separate EF Core context for **application-owned data**.
!!! info "MariaDB compatibility"
`MySql.EntityFrameworkCore`'s `MigrateAsync()` uses `GET_LOCK(-1)` which returns NULL on MariaDB. The `MariaDbHistoryRepository` class overrides the lock to use `GET_LOCK(3600)` instead. This is registered via `ReplaceService<IHistoryRepository, MariaDbHistoryRepository>()` on `PoracleWebContext`.

### ScannerDbContext (optional)
### ScannerContext (optional)

Connects to a Golbat scanner database for nest, Pokemon, and gym data.

Expand Down
Loading