diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e31a90..8f44911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Nothing yet. +## [0.2.3] - 2025-01-29 + +### Added + +- Read user by unique name. + ## [0.2.2] - 2025-01-29 ### Fixed @@ -53,7 +59,8 @@ Nothing yet. Initial release, including basic account management, languages, 8 field types, content types & field definitions, and contents, invariant & translated, field values, indices and published contents. -[unreleased]: https://github.com/Logitar/CMS/compare/v0.2.2...HEAD +[unreleased]: https://github.com/Logitar/CMS/compare/v0.2.3...HEAD +[0.2.3]: https://github.com/Logitar/CMS/compare/v0.2.2...v0.2.3 [0.2.2]: https://github.com/Logitar/CMS/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/Logitar/CMS/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/Logitar/CMS/compare/v0.1.0...v0.2.0 diff --git a/backend/src/Logitar.Cms.Core/Logitar.Cms.Core.csproj b/backend/src/Logitar.Cms.Core/Logitar.Cms.Core.csproj index a07babf..04fef1f 100644 --- a/backend/src/Logitar.Cms.Core/Logitar.Cms.Core.csproj +++ b/backend/src/Logitar.Cms.Core/Logitar.Cms.Core.csproj @@ -15,14 +15,14 @@ README.md https://github.com/Logitar/CMS git - 0.2.2.0 + 0.2.3.0 $(AssemblyVersion) LICENSE True - 0.2.2 + 0.2.3 en-CA False - Fixed empty field value descriptions. + Implement read user by unique name. logitar;content;management;system;domain;application;business;core;logic https://github.com/Logitar/CMS/tree/main/backend/src/Logitar.Cms.Core diff --git a/backend/src/Logitar.Cms.Core/Users/IUserQuerier.cs b/backend/src/Logitar.Cms.Core/Users/IUserQuerier.cs index 8fbd009..68fc353 100644 --- a/backend/src/Logitar.Cms.Core/Users/IUserQuerier.cs +++ b/backend/src/Logitar.Cms.Core/Users/IUserQuerier.cs @@ -13,4 +13,5 @@ public interface IUserQuerier Task ReadAsync(User user, CancellationToken cancellationToken = default); Task ReadAsync(UserId id, CancellationToken cancellationToken = default); Task ReadAsync(Guid id, CancellationToken cancellationToken = default); + Task ReadAsync(string uniqueName, CancellationToken cancellationToken = default); } diff --git a/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Logitar.Cms.Infrastructure.PostgreSQL.csproj b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Logitar.Cms.Infrastructure.PostgreSQL.csproj index 5427ab3..33d0800 100644 --- a/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Logitar.Cms.Infrastructure.PostgreSQL.csproj +++ b/backend/src/Logitar.Cms.Infrastructure.PostgreSQL/Logitar.Cms.Infrastructure.PostgreSQL.csproj @@ -15,14 +15,14 @@ README.md https://github.com/Logitar/CMS git - 0.2.2.0 + 0.2.3.0 $(AssemblyVersion) LICENSE True - 0.2.2 + 0.2.3 en-CA False - Fixed empty field value descriptions. + Implement read user by unique name. logitar;cms;efcore;sqlserver;store https://github.com/Logitar/CMS/tree/main/backend/src/Logitar.Cms.Infrastructure.SqlServer diff --git a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Logitar.Cms.Infrastructure.SqlServer.csproj b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Logitar.Cms.Infrastructure.SqlServer.csproj index 1c34b90..89a8700 100644 --- a/backend/src/Logitar.Cms.Infrastructure.SqlServer/Logitar.Cms.Infrastructure.SqlServer.csproj +++ b/backend/src/Logitar.Cms.Infrastructure.SqlServer/Logitar.Cms.Infrastructure.SqlServer.csproj @@ -15,14 +15,14 @@ README.md https://github.com/Logitar/CMS git - 0.2.2.0 + 0.2.3.0 $(AssemblyVersion) LICENSE True - 0.2.2 + 0.2.3 en-CA False - Fixed empty field value descriptions. + Implement read user by unique name. logitar;cms;efcore;sqlserver;store https://github.com/Logitar/CMS/tree/main/backend/src/Logitar.Cms.Infrastructure.SqlServer diff --git a/backend/src/Logitar.Cms.Infrastructure/Logitar.Cms.Infrastructure.csproj b/backend/src/Logitar.Cms.Infrastructure/Logitar.Cms.Infrastructure.csproj index a418944..b07a753 100644 --- a/backend/src/Logitar.Cms.Infrastructure/Logitar.Cms.Infrastructure.csproj +++ b/backend/src/Logitar.Cms.Infrastructure/Logitar.Cms.Infrastructure.csproj @@ -15,14 +15,14 @@ README.md https://github.com/Logitar/CMS git - 0.2.2.0 + 0.2.3.0 $(AssemblyVersion) LICENSE True - 0.2.2 + 0.2.3 en-CA False - Fixed empty field value descriptions. + Implement read user by unique name. logitar;content;management;system;infrastructure;logic;caching;persistence https://github.com/Logitar/CMS/tree/main/backend/src/Logitar.Cms.Infrastructure diff --git a/backend/src/Logitar.Cms.Infrastructure/Queriers/UserQuerier.cs b/backend/src/Logitar.Cms.Infrastructure/Queriers/UserQuerier.cs index 486789d..e3ca785 100644 --- a/backend/src/Logitar.Cms.Infrastructure/Queriers/UserQuerier.cs +++ b/backend/src/Logitar.Cms.Infrastructure/Queriers/UserQuerier.cs @@ -60,6 +60,17 @@ public async Task ReadAsync(User user, CancellationToken cancellation return user == null ? null : await MapAsync(user, cancellationToken); } + public async Task ReadAsync(string uniqueName, CancellationToken cancellationToken) + { + string uniqueNameNormalized = Helper.Normalize(uniqueName); + + UserEntity? user = await _users.AsNoTracking() + .Include(x => x.Identifiers) + .Include(x => x.Roles) + .SingleOrDefaultAsync(x => x.UniqueNameNormalized == uniqueNameNormalized, cancellationToken); + + return user == null ? null : await MapAsync(user, cancellationToken); + } private async Task MapAsync(UserEntity user, CancellationToken cancellationToken) { diff --git a/backend/src/Logitar.Cms.Web/Logitar.Cms.Web.csproj b/backend/src/Logitar.Cms.Web/Logitar.Cms.Web.csproj index 21d7840..3991900 100644 --- a/backend/src/Logitar.Cms.Web/Logitar.Cms.Web.csproj +++ b/backend/src/Logitar.Cms.Web/Logitar.Cms.Web.csproj @@ -16,14 +16,14 @@ README.md https://github.com/Logitar/CMS git - 0.2.2.0 + 0.2.3.0 $(AssemblyVersion) LICENSE True - 0.2.2 + 0.2.3 en-CA False - Fixed empty field value descriptions. + Implement read user by unique name. logitar;cms;web;interface;rest;api;controller;filter;razor;view https://github.com/Logitar/CMS/tree/main/backend/src/Logitar.Cms.Web diff --git a/backend/src/Logitar.Cms/Constants/Api.cs b/backend/src/Logitar.Cms/Constants/Api.cs index b3b72d7..dea8b3a 100644 --- a/backend/src/Logitar.Cms/Constants/Api.cs +++ b/backend/src/Logitar.Cms/Constants/Api.cs @@ -3,5 +3,5 @@ internal static class Api { public const string Title = "CMS API"; - public static readonly Version Version = new(0, 2, 2); + public static readonly Version Version = new(0, 2, 3); } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c6240d8..6d6658d 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "logitar-cms", - "version": "0.2.2", + "version": "0.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "logitar-cms", - "version": "0.2.2", + "version": "0.2.3", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-brands-svg-icons": "^6.5.2", diff --git a/frontend/package.json b/frontend/package.json index cc060f2..9323c5c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "logitar-cms", - "version": "0.2.2", + "version": "0.2.3", "private": true, "type": "module", "scripts": {