From 2995a204a428641be99e2141e2b83d387d2b7c29 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 17 Jan 2020 12:12:21 +0300 Subject: [PATCH 01/26] updated logout functionality for sso signout --- .../Mvc/Authentication/ChallengeAccountController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs index d3a8025813..c18dcaaab5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs @@ -11,7 +11,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication protected ChallengeAccountController(string[] challengeAuthenticationSchemas = null) { - ChallengeAuthenticationSchemas = challengeAuthenticationSchemas ?? new[]{ "oidc" }; + ChallengeAuthenticationSchemas = challengeAuthenticationSchemas ?? new[] { "oidc" }; } [HttpGet] @@ -42,7 +42,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication { await HttpContext.SignOutAsync().ConfigureAwait(false); - return RedirectSafely(returnUrl, returnUrlHash); + if (HttpContext.User.Identity.AuthenticationType == "Identity.Application") + { + return RedirectSafely(returnUrl, returnUrlHash); + } + + return new SignOutResult(ChallengeAuthenticationSchemas); } protected RedirectResult RedirectSafely(string returnUrl, string returnUrlHash = null) From b5cb8a5808c1cf28739644e1fe674a7e3f836dca Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 20 Jan 2020 11:58:29 +0300 Subject: [PATCH 02/26] Improved hard-coded AuthenticationType. --- .../Mvc/Authentication/ChallengeAccountController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs index c18dcaaab5..cfd75840a7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs @@ -8,10 +8,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication public abstract class ChallengeAccountController : AbpController { protected string[] ChallengeAuthenticationSchemas { get; } + protected string AuthenticationType { get; } protected ChallengeAccountController(string[] challengeAuthenticationSchemas = null) { ChallengeAuthenticationSchemas = challengeAuthenticationSchemas ?? new[] { "oidc" }; + AuthenticationType = "Identity.Application"; } [HttpGet] @@ -42,7 +44,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication { await HttpContext.SignOutAsync().ConfigureAwait(false); - if (HttpContext.User.Identity.AuthenticationType == "Identity.Application") + if (HttpContext.User.Identity.AuthenticationType == AuthenticationType) { return RedirectSafely(returnUrl, returnUrlHash); } From 0139e72b02669d398f25e5b39d369aeb71d81724 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 20 Jan 2020 13:39:55 +0300 Subject: [PATCH 03/26] Added new Logout functionality for identityserver post logout redirect event. --- .../IdentityServerSupportedLogoutModel.cs | 44 +++++++++++++++++++ .../Account/Controllers/LogoutController.cs | 1 + .../Pages/Account/Logout.cshtml | 3 ++ .../Pages/Account/Logout.cshtml.cs | 27 ++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs create mode 100644 modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml create mode 100644 modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs new file mode 100644 index 0000000000..3190834fec --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs @@ -0,0 +1,44 @@ +using IdentityServer4.Services; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.Account.Web.Pages.Account +{ + [ExposeServices(typeof(LogoutModel))] + public class IdentityServerSupportedLogoutModel : LogoutModel + { + protected IIdentityServerInteractionService Interaction { get; } + + public IdentityServerSupportedLogoutModel(IIdentityServerInteractionService interaction) + { + Interaction = interaction; + } + + public override async Task OnGetAsync() + { + await SignInManager.SignOutAsync().ConfigureAwait(false); + + var logoutId = Request.Query["logoutId"].ToString(); + + if (!string.IsNullOrEmpty(logoutId)) + { + var logoutContext = await Interaction.GetLogoutContextAsync(logoutId).ConfigureAwait(false); + + var postLogoutUri = logoutContext.PostLogoutRedirectUri; + + if (!string.IsNullOrEmpty(postLogoutUri)) + { + return Redirect(postLogoutUri); + } + } + + if (ReturnUrl != null) + { + return LocalRedirect(ReturnUrl); + } + + return RedirectToPage("/Account/Login"); + } + } +} diff --git a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs index 878f2aa2d5..594064d28a 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs @@ -17,6 +17,7 @@ namespace Volo.Abp.Account.Web.Areas.Account.Controllers } //todo@alper: this method can be moved to AccountController like "account/logout" + //No longer needed. Already implemented Pages/Account/Logout public async Task Index(string returnUrl = null) { await _signInManager.SignOutAsync().ConfigureAwait(false); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml new file mode 100644 index 0000000000..f57c7258d1 --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml @@ -0,0 +1,3 @@ +@page "/Account/Logout" +@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage +@model Volo.Abp.Account.Web.Pages.Account.LogoutModel \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs new file mode 100644 index 0000000000..6825457a7e --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace Volo.Abp.Account.Web.Pages.Account +{ + public class LogoutModel : AccountPageModel + { + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrl { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public string ReturnUrlHash { get; set; } + + public virtual async Task OnGetAsync() + { + await SignInManager.SignOutAsync().ConfigureAwait(false); + if (ReturnUrl != null) + { + return RedirectSafely(ReturnUrl, ReturnUrlHash); + } + + return RedirectToPage("/Account/Login"); + } + } +} From 8c3ad64c4e75bcba944e844a740ef1f89ee931b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 21 Jan 2020 11:11:40 +0300 Subject: [PATCH 04/26] Remove unused namespace import --- .../Volo/Abp/Application/Services/ApplicationService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs index 038ba0cf29..0145e2c763 100644 --- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs +++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Aspects; using Volo.Abp.Auditing; -using Volo.Abp.Authorization; using Volo.Abp.DependencyInjection; using Volo.Abp.Features; using Volo.Abp.Guids; From 670d4b4b96d52fb9aa01be9cd5670ba230998a90 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Tue, 21 Jan 2020 11:14:10 +0300 Subject: [PATCH 05/26] Removed MVC LogoutController. Already have RazorPage --- .../Account/Controllers/LogoutController.cs | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs diff --git a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs b/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs deleted file mode 100644 index 594064d28a..0000000000 --- a/modules/account/src/Volo.Abp.Account.Web/Areas/Account/Controllers/LogoutController.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; -using IdentityUser = Volo.Abp.Identity.IdentityUser; - -namespace Volo.Abp.Account.Web.Areas.Account.Controllers -{ - [Area("Account")] - public class LogoutController : AbpController - { - private readonly SignInManager _signInManager; - - public LogoutController(SignInManager signInManager) - { - _signInManager = signInManager; - } - - //todo@alper: this method can be moved to AccountController like "account/logout" - //No longer needed. Already implemented Pages/Account/Logout - public async Task Index(string returnUrl = null) - { - await _signInManager.SignOutAsync().ConfigureAwait(false); - - if (returnUrl != null) - { - return LocalRedirect(returnUrl); - } - - return RedirectToPage("/Account/Login"); - } - } -} From 589dea1186f2cde239371e10a75782d46c8c4271 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 21 Jan 2020 14:12:08 +0300 Subject: [PATCH 06/26] fix(theme-shared): add media query to solve mobile responsiveness issues --- .../lib/components/confirmation/confirmation.component.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss b/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss index a28dd3a7c3..5fa1152f3c 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss @@ -24,6 +24,9 @@ width: 450px; min-height: 300px; z-index: 1062 !important; + @media screen and (max-width: 768px) { + width: 90vw; + } .icon-container { display: flex; align-items: center; From 9cb044cd68a11ac73d87c779366d4b4bc4330e71 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Tue, 21 Jan 2020 14:18:31 +0300 Subject: [PATCH 07/26] refactor(theme-shared): change media query width --- .../src/lib/components/confirmation/confirmation.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss b/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss index 5fa1152f3c..a6d25a4946 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/confirmation/confirmation.component.scss @@ -24,7 +24,7 @@ width: 450px; min-height: 300px; z-index: 1062 !important; - @media screen and (max-width: 768px) { + @media screen and (max-width: 500px) { width: 90vw; } .icon-container { From a62ad1d14e3291b4aea3dd0816c6eacb585879da Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 21 Jan 2020 15:36:24 +0300 Subject: [PATCH 08/26] added scrollX to datatables --- .../blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js | 1 + .../src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js | 1 + .../src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js | 1 + .../src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js | 1 + .../Pages/TenantManagement/Tenants/Index.js | 1 + 5 files changed, 5 insertions(+) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js index 0d8e8b3641..c2a18e083d 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/index.js @@ -9,6 +9,7 @@ serverSide: true, paging: false, info: false, + scrollX: true, searching: false, autoWidth: false, scrollCollapse: true, diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js index f1ce283543..d25d04d671 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/index.js @@ -16,6 +16,7 @@ var _dataTable = $('#ProjectsTable').DataTable(abp.libs.datatables.normalizeConfiguration({ processing: true, serverSide: true, + scrollX: true, paging: true, searching: false, autoWidth: false, diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js index eb0892338c..8332a95ac7 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Roles/index.js @@ -17,6 +17,7 @@ searching: false, processing: true, serverSide: true, + scrollX: true, paging: true, ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), columnDefs: [ diff --git a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js index 4d8486d256..64505509ba 100644 --- a/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js +++ b/modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/index.js @@ -15,6 +15,7 @@ order: [[1, "asc"]], processing: true, serverSide: true, + scrollX: true, paging: true, ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList), columnDefs: [ diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js index 3ae75e6ad6..0dc1861790 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js @@ -19,6 +19,7 @@ order: [[1, "asc"]], processing: true, paging: true, + scrollX: true, serverSide: true, ajax: abp.libs.datatables.createAjax(_tenantAppService.getList), columnDefs: [ From 08becb31dc892de56360d937939634717f412ddf Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Jan 2020 20:56:44 +0300 Subject: [PATCH 09/26] fix: fix require non alpha numeric validation --- .../components/change-password/change-password.component.ts | 4 +++- .../account/src/lib/components/register/register.component.ts | 4 +++- .../identity/src/lib/components/users/users.component.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts b/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts index e9125de3c3..87169a2c1f 100644 --- a/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts @@ -54,7 +54,9 @@ export class ChangePasswordComponent passwordRulesArr.push('capital'); } - if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) { + if ( + (passwordRules['Abp.Identity.Password.RequireNonAlphanumeric'] || '').toLowerCase() === 'true' + ) { passwordRulesArr.push('special'); } diff --git a/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts b/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts index a76de66626..6785fc67fd 100644 --- a/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts @@ -71,7 +71,9 @@ export class RegisterComponent implements OnInit { passwordRulesArr.push('capital'); } - if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) { + if ( + (passwordRules['Abp.Identity.Password.RequireNonAlphanumeric'] || '').toLowerCase() === 'true' + ) { passwordRulesArr.push('special'); } diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts index 127cf15735..47ef7cca23 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts @@ -102,7 +102,9 @@ export class UsersComponent implements OnInit { this.passwordRulesArr.push('capital'); } - if (+(passwordRules['Abp.Identity.Password.RequiredUniqueChars'] || 0) > 0) { + if ( + (passwordRules['Abp.Identity.Password.RequireNonAlphanumeric'] || '').toLowerCase() === 'true' + ) { this.passwordRulesArr.push('special'); } From 2a5cfa082376f9fbe6df2abc1a6e4d21b2728495 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 21 Jan 2020 20:57:23 +0300 Subject: [PATCH 10/26] refactor: make permission management modal responsive --- .../src/lib/components/permission-management.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html index 3e4a1ec3a3..5a5e70e2f5 100644 --- a/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html +++ b/npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html @@ -22,7 +22,7 @@
-
+ -
+

{{ selectedGroup?.displayName }}


From 132653a8c97208ccb19a84aa85c05dd867a4d12d Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 22 Jan 2020 11:56:39 +0300 Subject: [PATCH 11/26] style: remove animation from navbar --- .../application-layout.component.html | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html index 890ed1baab..b5fef49cd0 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html @@ -67,9 +67,7 @@ #routeContainer class="dropdown-menu border-0 shadow-sm" (click)="$event.preventDefault(); $event.stopPropagation()" - [class.abp-collapsed-height]="smallScreen" - [class.d-block]="smallScreen" - [class.abp-mh-25]="smallScreen && navbarRootDropdown.expand" + [class.d-block]="smallScreen && navbarRootDropdown.expand" > {{ 'AbpAccount::ManageYourProfile' | abpLocalization }} Date: Wed, 22 Jan 2020 11:56:50 +0300 Subject: [PATCH 12/26] style: make manage profile responsive --- .../components/manage-profile/manage-profile.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html b/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html index 04dd582ac7..20ddf69a06 100644 --- a/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html +++ b/npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.html @@ -3,7 +3,7 @@
-
+ -
+

From edb307d203aa9b076ab8283ce89801bcf77dbc8d Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Wed, 22 Jan 2020 11:58:07 +0300 Subject: [PATCH 13/26] doc(core): add function descriptions --- .../core/src/lib/services/localization.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts index d87d28a938..8d059fc33f 100644 --- a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts @@ -10,6 +10,9 @@ type ShouldReuseRoute = (future: ActivatedRouteSnapshot, curr: ActivatedRouteSna @Injectable({ providedIn: 'root' }) export class LocalizationService { + /** + * Returns currently selected language + */ get currentLang(): string { return this.store.selectSnapshot(state => state.SessionState.language); } @@ -42,6 +45,11 @@ export class LocalizationService { }); } + /** + * Returns translated text with with given the interpolation parameters in current language + * @param key Localizaton key to replace with translation + * @param interpolateParams Values to be interpolated in the translation string. + */ get( key: string | Config.LocalizationWithDefault, ...interpolateParams: string[] From 3627c3c8c0d7798aeb8e448c8ff0fae0e8d45bd7 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Wed, 22 Jan 2020 13:32:28 +0300 Subject: [PATCH 14/26] refactor(core): correct the description of functions --- .../core/src/lib/services/localization.service.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts index 8d059fc33f..b12b517156 100644 --- a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts @@ -46,9 +46,9 @@ export class LocalizationService { } /** - * Returns translated text with with given the interpolation parameters in current language - * @param key Localizaton key to replace with translation - * @param interpolateParams Values to be interpolated in the translation string. + * Returns an observable localized text with the given interpolation parameters in current language. + * @param key Localizaton key to replace with localized text + * @param interpolateParams Values to interpolate */ get( key: string | Config.LocalizationWithDefault, @@ -57,6 +57,11 @@ export class LocalizationService { return this.store.select(ConfigState.getLocalization(key, ...interpolateParams)); } + /** + * Returns localized text with the given interpolation parameters in current language. + * @param key Localization key to replace with localized text + * @param interpolateParams Values to intepolate. + */ instant(key: string | Config.LocalizationWithDefault, ...interpolateParams: string[]): string { return this.store.selectSnapshot(ConfigState.getLocalization(key, ...interpolateParams)); } From 77845f683a7596e229ffc3db73899963cfef7ec5 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 22 Jan 2020 13:41:14 +0300 Subject: [PATCH 15/26] AbpTabsTagHelper col md --- .../TagHelpers/Tab/AbpTabsTagHelperService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs index 37d307ac05..d5e93df321 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs @@ -81,7 +81,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab protected virtual string PlaceInsideColunm(string contents, int columnSize) { - var surroundedContents = "
" + Environment.NewLine + + var surroundedContents = "
" + Environment.NewLine + contents + "
"; From 2f829037b64889b04ff7678484eea67d14847c7a Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 22 Jan 2020 13:42:33 +0300 Subject: [PATCH 16/26] typo fix --- .../TagHelpers/Tab/AbpTabsTagHelperService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs index d5e93df321..fbafb2b63c 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Tab/AbpTabsTagHelperService.cs @@ -45,8 +45,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab var headerColumnSize = GetHeaderColumnSize(); var contentColumnSize = 12 - headerColumnSize; - headers = PlaceInsideColunm(headers, headerColumnSize); - contents = PlaceInsideColunm(contents, contentColumnSize); + headers = PlaceInsideColumn(headers, headerColumnSize); + contents = PlaceInsideColumn(contents, contentColumnSize); } @@ -79,7 +79,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab return surroundedContents; } - protected virtual string PlaceInsideColunm(string contents, int columnSize) + protected virtual string PlaceInsideColumn(string contents, int columnSize) { var surroundedContents = "
" + Environment.NewLine + contents + From 48aa6047d48ac93d8b22ed72475d150f8d4b0427 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 22 Jan 2020 13:48:42 +0300 Subject: [PATCH 17/26] AbpColumnTagHelper remove "col" when a size is given --- .../TagHelpers/Grid/AbpColumnTagHelperService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelperService.cs index e78d59ee82..bb8107bc52 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Grid/AbpColumnTagHelperService.cs @@ -8,6 +8,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid public override void Process(TagHelperContext context, TagHelperOutput output) { output.TagName = "div"; + output.Attributes.AddClass("col"); ProcessSizeClasses(context, output); @@ -52,6 +53,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid classString += "-" + size.ToString("D"); } + output.Attributes.RemoveClass("col"); output.Attributes.AddClass(classString); } From d3c6d73bc2a7946cc0b2433d6973a471322c13e6 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Wed, 22 Jan 2020 17:12:05 +0300 Subject: [PATCH 18/26] refactor(settings-management): change bootstrap class name --- .../src/lib/components/setting-management.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html b/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html index 8d5fd0e8d1..c54a581312 100644 --- a/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html +++ b/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html @@ -2,7 +2,7 @@

{{ 'AbpSettingManagement::Settings' | abpLocalization }}

-