From 40d8bb91dc3762c9f6e3f39354d232f1f93139b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Wed, 14 Oct 2020 16:57:39 +0300 Subject: [PATCH 01/15] ICookieService implementation. --- .../Components/WebAssembly/CookieService.cs | 33 +++++++++++++++++++ .../Components/WebAssembly/ICookieService.cs | 12 +++++++ 2 files changed, 45 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs new file mode 100644 index 0000000000..3d90d68ccd --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs @@ -0,0 +1,33 @@ +using System; +using System.Threading.Tasks; +using Microsoft.JSInterop; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Components.WebAssembly +{ + [Dependency(ReplaceServices = true)] + public class CookieService : ICookieService, ITransientDependency + { + public IJSRuntime JsRuntime { get; } + + public CookieService(IJSRuntime jsRuntime) + { + JsRuntime = jsRuntime; + } + + public async ValueTask SetAsync(string key, string value, DateTimeOffset? expireDate = null, string path = null) + { + await JsRuntime.InvokeVoidAsync("abp.utils.setCookieValue", key, value, expireDate?.ToString("r"), path); + } + + public async ValueTask GetAsync(string key) + { + return await JsRuntime.InvokeAsync("abp.utils.getCookieValue", key); + } + + public async ValueTask DeleteAsync(string key, string path = null) + { + await JsRuntime.InvokeVoidAsync("abp.utils.deleteCookie", key); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs new file mode 100644 index 0000000000..63eebb6a5e --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs @@ -0,0 +1,12 @@ +using System; +using System.Threading.Tasks; + +namespace Volo.Abp.AspNetCore.Components.WebAssembly +{ + public interface ICookieService + { + public ValueTask SetAsync(string key, string value, DateTimeOffset? expireDate = null, string path = null); + public ValueTask GetAsync(string key); + public ValueTask DeleteAsync(string key, string path = null); + } +} \ No newline at end of file From e01e79775973aee7d99206e30d237bce7dff28aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Wed, 14 Oct 2020 16:57:56 +0300 Subject: [PATCH 02/15] abp.js added to the template. --- .../wwwroot/index.html | 1 + .../wwwroot/libs/abp/core/abp.js | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html index 4566bec3c1..b2b716caa2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html @@ -29,6 +29,7 @@ + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js new file mode 100644 index 0000000000..4a04c50c84 --- /dev/null +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js @@ -0,0 +1,62 @@ +window.abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate; + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; +}; + +/** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ +window.abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; +}; + +/** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ +window.abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; +} \ No newline at end of file From 5ee239c3c95dfe496f3b0577cf725c3e456b6336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Fri, 16 Oct 2020 11:15:32 +0300 Subject: [PATCH 03/15] use a class to take optional parameters. --- .../Components/WebAssembly/CookieOptions.cs | 11 +++++++++++ .../Components/WebAssembly/CookieService.cs | 7 +++---- .../Components/WebAssembly/ICookieService.cs | 2 +- .../wwwroot/libs/abp/core/abp.js | 16 +++++++++++++++- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieOptions.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieOptions.cs new file mode 100644 index 0000000000..929995fa05 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieOptions.cs @@ -0,0 +1,11 @@ +using System; + +namespace Volo.Abp.AspNetCore.Components.WebAssembly +{ + public class CookieOptions + { + public DateTimeOffset? ExpireDate { get; set; } + public string Path { get; set; } + public bool Secure { get; set; } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs index 3d90d68ccd..c0dc94ebfa 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/CookieService.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.JSInterop; using Volo.Abp.DependencyInjection; @@ -15,9 +14,9 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly JsRuntime = jsRuntime; } - public async ValueTask SetAsync(string key, string value, DateTimeOffset? expireDate = null, string path = null) + public async ValueTask SetAsync(string key, string value, CookieOptions options) { - await JsRuntime.InvokeVoidAsync("abp.utils.setCookieValue", key, value, expireDate?.ToString("r"), path); + await JsRuntime.InvokeVoidAsync("abp.utils.setCookieValue", key, value, options?.ExpireDate?.ToString("r"), options?.Path, options?.Secure); } public async ValueTask GetAsync(string key) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs index 63eebb6a5e..21254c9da5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ICookieService.cs @@ -5,7 +5,7 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly { public interface ICookieService { - public ValueTask SetAsync(string key, string value, DateTimeOffset? expireDate = null, string path = null); + public ValueTask SetAsync(string key, string value, CookieOptions options = null); public ValueTask GetAsync(string key); public ValueTask DeleteAsync(string key, string path = null); } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js index 4a04c50c84..1d16d0cc38 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js @@ -1,4 +1,14 @@ -window.abp.utils.setCookieValue = function (key, value, expireDate, path) { +/** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {string} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + * @param {bool} secure (optional) + */ +window.abp.utils.setCookieValue = function (key, value, expireDate, path, secure) { var cookieValue = encodeURIComponent(key) + '='; if (value) { cookieValue = cookieValue + encodeURIComponent(value); @@ -12,6 +22,10 @@ cookieValue = cookieValue + "; path=" + path; } + if (secure) { + cookieValue = cookieValue + "; secure"; + } + document.cookie = cookieValue; }; From c804c0ab36ed708824b023d7d5705a67f5b2d3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Fri, 16 Oct 2020 15:35:49 +0300 Subject: [PATCH 04/15] page header initial implementation. --- .../Components/WebAssembly/BreadcrumbItem.cs | 18 ++++++++++ .../Components/PageHeader.razor | 35 +++++++++++++++++++ .../Components/PageHeader.razor.cs | 34 ++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs create mode 100644 framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor create mode 100644 framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs new file mode 100644 index 0000000000..03943f47d7 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs @@ -0,0 +1,18 @@ +namespace Volo.Abp.AspNetCore.Components.WebAssembly +{ + public class BreadcrumbItem + { + public string Text { get; set; } + + public string Icon { get; set; } + + public string Url { get; set; } + + public BreadcrumbItem(string text, string url = null, string icon = null) + { + Text = text; + Url = url; + Icon = icon; + } + } +} diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor new file mode 100644 index 0000000000..a584038bfd --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor @@ -0,0 +1,35 @@ + + +

@Title

+
+ @if (BreadcrumbItems.Any()) + { + + + @if (BreadcrumbShowHome) + { + + + + } + @foreach (var item in BreadcrumbItems) + { + + + @if (!string.IsNullOrEmpty(item.Icon)) + { + + } + @item.Text + + + } + + + } + +
+ @ChildContent +
+
+
\ No newline at end of file diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs new file mode 100644 index 0000000000..c3b75712ef --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Components; +using Volo.Abp.AspNetCore.Components.WebAssembly; + +namespace Volo.Abp.BlazoriseUI.Components +{ + public partial class PageHeader : ComponentBase + { + [Parameter] + public string Title { get; set; } + + [Parameter] + public bool BreadcrumbShowHome { get; set; } = true; + + [Parameter] + public bool BreadcrumbShowCurrent { get; set; } = true; + + [Parameter] + public RenderFragment ChildContent { get; set; } + + protected List BreadcrumbItems { get; set; } + + public PageHeader() + { + BreadcrumbItems = new List(); + } + + public void AddBreadcrumbItem(string text, string url = null, string icon = null) + { + BreadcrumbItems.Add(new BreadcrumbItem(text, url, icon)); + StateHasChanged(); + } + } +} From d4c41873c7558aec5360adae22ce7648c396249c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 11:40:46 +0300 Subject: [PATCH 05/15] embed abp.js to the webcomponents assembly. --- ...p.AspNetCore.Components.WebAssembly.csproj | 2 +- .../wwwroot/abp.js | 80 +++++++++++++++++++ .../wwwroot/index.html | 2 +- .../wwwroot/libs/abp/core/abp.js | 76 ------------------ 4 files changed, 82 insertions(+), 78 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/wwwroot/abp.js delete mode 100644 templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj index 44a816678c..b7aa91c74e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj @@ -1,4 +1,4 @@ - + diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/wwwroot/abp.js b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/wwwroot/abp.js new file mode 100644 index 0000000000..b945daa56f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/wwwroot/abp.js @@ -0,0 +1,80 @@ +var abp = abp || {}; +(function () { + abp.utils = abp.utils || {}; + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {string} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + * @param {bool} secure (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path, secure) { + var cookieValue = encodeURIComponent(key) + '='; + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate; + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + if (secure) { + cookieValue = cookieValue + "; secure"; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } +})(); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html index b2b716caa2..5bba3d3350 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html @@ -29,7 +29,7 @@ - + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js deleted file mode 100644 index 1d16d0cc38..0000000000 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/libs/abp/core/abp.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {string} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - * @param {bool} secure (optional) - */ -window.abp.utils.setCookieValue = function (key, value, expireDate, path, secure) { - var cookieValue = encodeURIComponent(key) + '='; - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate; - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - if (secure) { - cookieValue = cookieValue + "; secure"; - } - - document.cookie = cookieValue; -}; - -/** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ -window.abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; -}; - -/** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ -window.abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; -} \ No newline at end of file From 2feb304d570f6a5a04156d0364a46238b33b933c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 14:24:33 +0300 Subject: [PATCH 06/15] use blazorise padding instead of setting class. --- framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor index a584038bfd..5931ff1c95 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor @@ -4,7 +4,7 @@ @if (BreadcrumbItems.Any()) { - + @if (BreadcrumbShowHome) { From 3260b0ba37b3aa2d4bc3bd4436c6d572344708d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 14:26:16 +0300 Subject: [PATCH 07/15] add breadcrumbItems parameter and Icon changes. --- .../BreadcrumbItem.cs | 8 +++++--- .../Volo.Abp.BlazoriseUI/Components/PageHeader.razor | 8 +++++--- .../Components/PageHeader.razor.cs | 11 +++-------- 3 files changed, 13 insertions(+), 14 deletions(-) rename framework/src/{Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly => Volo.Abp.BlazoriseUI}/BreadcrumbItem.cs (55%) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs b/framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs similarity index 55% rename from framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs rename to framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs index 03943f47d7..2f918d6c55 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/BreadcrumbItem.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs @@ -1,14 +1,16 @@ -namespace Volo.Abp.AspNetCore.Components.WebAssembly +using Blazorise; + +namespace Volo.Abp.BlazoriseUI { public class BreadcrumbItem { public string Text { get; set; } - public string Icon { get; set; } + public IconName? Icon { get; set; } public string Url { get; set; } - public BreadcrumbItem(string text, string url = null, string icon = null) + public BreadcrumbItem(string text, string url = null, IconName? icon = null) { Text = text; Url = url; diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor index 5931ff1c95..d4870e6f59 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor @@ -9,16 +9,18 @@ @if (BreadcrumbShowHome) { - + + + } @foreach (var item in BreadcrumbItems) { - @if (!string.IsNullOrEmpty(item.Icon)) + @if (item.Icon != null) { - + } @item.Text diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs index c3b75712ef..90e4b0f0c7 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; +using Blazorise; using Microsoft.AspNetCore.Components; -using Volo.Abp.AspNetCore.Components.WebAssembly; namespace Volo.Abp.BlazoriseUI.Components { @@ -18,17 +18,12 @@ namespace Volo.Abp.BlazoriseUI.Components [Parameter] public RenderFragment ChildContent { get; set; } - protected List BreadcrumbItems { get; set; } + [Parameter] + public List BreadcrumbItems { get; set; } public PageHeader() { BreadcrumbItems = new List(); } - - public void AddBreadcrumbItem(string text, string url = null, string icon = null) - { - BreadcrumbItems.Add(new BreadcrumbItem(text, url, icon)); - StateHasChanged(); - } } } From 9a0e1b086a9c149cc144b31581269c4b8045dd26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 21:14:46 +0300 Subject: [PATCH 08/15] breadcrumbitems list added. --- framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs index 8723209c53..ffbb62ba04 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs @@ -184,6 +184,7 @@ namespace Volo.Abp.BlazoriseUI protected TUpdateViewModel EditingEntity; protected Modal CreateModal; protected Modal EditModal; + protected List BreadcrumbItems = new List(2); protected string CreatePolicyName { get; set; } protected string UpdatePolicyName { get; set; } @@ -239,6 +240,7 @@ namespace Volo.Abp.BlazoriseUI protected override async Task OnInitializedAsync() { + await SetBreadcrumbItemsAsync(); await SetPermissionsAsync(); await GetEntitiesAsync(); } @@ -438,5 +440,10 @@ namespace Volo.Abp.BlazoriseUI await AuthorizationService.CheckAsync(policyName); } + + protected virtual ValueTask SetBreadcrumbItemsAsync() + { + return ValueTask.CompletedTask; + } } } From a208f7809ea8e34ebeff1182e1f2d8cdc80d79e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 21:17:05 +0300 Subject: [PATCH 09/15] convert icon property to object so that developer can spesify custom name. --- framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs b/framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs index 2f918d6c55..36417e122a 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/BreadcrumbItem.cs @@ -6,11 +6,11 @@ namespace Volo.Abp.BlazoriseUI { public string Text { get; set; } - public IconName? Icon { get; set; } + public object Icon { get; set; } public string Url { get; set; } - public BreadcrumbItem(string text, string url = null, IconName? icon = null) + public BreadcrumbItem(string text, string url = null, object icon = null) { Text = text; Url = url; From 6fe4b138e6e0f768a16768aa3ed564e80dbf6ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 21:17:23 +0300 Subject: [PATCH 10/15] page header conversion. --- .../SettingManagement/SettingManagement.razor | 27 ++++--------------- .../SettingManagement.razor.cs | 15 ++++++++--- .../_Imports.razor | 1 + 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor index 8f5285ff98..ce854161ef 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor @@ -1,26 +1,9 @@ @page "/setting-management" -@using Microsoft.Extensions.Localization -@using Volo.Abp.SettingManagement.Localization -@inject IStringLocalizer L @inherits SettingManagementBase - @* ************************* PAGE HEADER ************************* *@ -
-
-

@L["Settings"]

-
-
- -
-
-
- -
-
-
+ + + @@ -39,7 +22,7 @@

@group.DisplayName

- + @{ SettingItemRenders.Add(builder => { @@ -47,7 +30,7 @@ builder.CloseComponent(); }); } - + @SettingItemRenders.Last()
} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs index 3d41afd05f..3c4775fd02 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs @@ -3,7 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; +using Volo.Abp.BlazoriseUI; +using Volo.Abp.SettingManagement.Localization; namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement { @@ -11,18 +14,21 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement { [Inject] protected IServiceProvider ServiceProvider { get; set; } - + protected SettingComponentCreationContext SettingComponentCreationContext { get; set; } [Inject] protected IOptions _options { get; set; } + [Inject] + protected IStringLocalizer L { get; set; } protected SettingManagementComponentOptions Options => _options.Value; - + protected List SettingItemRenders { get; set; } = new List(); protected string SelectedGroup; - + protected List BreadcrumbItems = new List(); + protected override async Task OnInitializedAsync() { SettingComponentCreationContext = new SettingComponentCreationContext(ServiceProvider); @@ -31,10 +37,11 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement { await contributor.ConfigureAsync(SettingComponentCreationContext); } - + SettingItemRenders.Clear(); SelectedGroup = GetNormalizedString(SettingComponentCreationContext.Groups.First().Id); + BreadcrumbItems.Add(new BreadcrumbItem(L["Settings"])); } protected string GetNormalizedString(string value) diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/_Imports.razor b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/_Imports.razor index 4685ac9893..de520acc22 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/_Imports.razor +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/_Imports.razor @@ -1,5 +1,6 @@ @using Microsoft.AspNetCore.Components.Web @using Volo.Abp.AspNetCore.Components.WebAssembly @using Volo.Abp.BlazoriseUI +@using Volo.Abp.BlazoriseUI.Components @using Blazorise @using Blazorise.DataGrid \ No newline at end of file From 80298ba15c012685d6d44897e3379b34f786602d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lkay=20=C4=B0lknur?= Date: Mon, 19 Oct 2020 22:17:54 +0300 Subject: [PATCH 11/15] fix page header for multiple toolbar buttons. --- .../src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor index d4870e6f59..4a569cfe95 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/PageHeader.razor @@ -30,8 +30,8 @@
} -
+ @ChildContent -
+
\ No newline at end of file From 73a3caf3fbc5e7525ce5ad86d3a7bd8ccd7d0d9c Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 20 Oct 2020 15:33:19 +0800 Subject: [PATCH 12/15] Enable MongoDB transaction for unit test --- .../Volo.Abp.MongoDB.Tests.csproj | 2 +- .../Volo/Abp/MongoDB/AbpMongoDbTestModule.cs | 12 +-- .../Volo/Abp/MongoDB/MongoDbFixture.cs | 2 +- .../MongoDB/Transactions/Transaction_Tests.cs | 90 +++++++++++++++++++ ...Volo.Abp.AuditLogging.MongoDB.Tests.csproj | 2 +- .../AbpAuditLoggingMongoDbTestModule.cs | 12 +-- .../AuditLogging/MongoDB/MongoDbFixture.cs | 2 +- ...lo.Abp.BackgroundJobs.MongoDB.Tests.csproj | 2 +- .../AbpBackgroundJobsMongoDbTestModule.cs | 12 +-- .../BackgroundJobs/MongoDB/MongoDbFixture.cs | 2 +- .../BlobStoringDatabaseMongoDbTestModule.cs | 12 +-- .../MongoDB/MongoDbFixture.cs | 2 +- ....BlobStoring.Database.MongoDB.Tests.csproj | 2 +- .../Volo.Blogging.MongoDB.Tests.csproj | 2 +- .../MongoDB/BloggingMongoDBTestModule.cs | 12 +-- .../Volo/Blogging/MongoDB/MongoDbFixture.cs | 2 +- .../MongoDB/CmsKitMongoDbTestModule.cs | 12 +-- .../MongoDB/MongoDbFixture.cs | 2 +- .../Volo.CmsKit.MongoDB.Tests.csproj | 2 +- .../Volo.Docs.MongoDB.Tests.csproj | 2 +- .../Docs/MongoDB/DocsMongoDBTestModule.cs | 12 +-- .../Volo/Docs/MongoDB/MongoDbFixture.cs | 2 +- ...Abp.FeatureManagement.MongoDB.Tests.csproj | 2 +- .../AbpFeatureManagementMongoDbTestModule.cs | 12 +-- .../MongoDB/MongoDbFixture.cs | 2 +- .../Volo.Abp.Identity.MongoDB.Tests.csproj | 2 +- .../MongoDB/AbpIdentityMongoDbTestModule.cs | 12 +-- .../Abp/Identity/MongoDB/MongoDbFixture.cs | 2 +- ...lo.Abp.IdentityServer.MongoDB.Tests.csproj | 2 +- .../AbpIdentityServerMongoDbTestModule.cs | 12 +-- .../Volo/Abp/IdentityServer/MongoDbFixture.cs | 2 +- ....PermissionManagement.MongoDB.Tests.csproj | 2 +- ...bpPermissionManagementMongoDbTestModule.cs | 12 +-- .../MongoDb/MongoDbFixture.cs | 2 +- ...Abp.SettingManagement.MongoDB.Tests.csproj | 2 +- .../AbpSettingManagementMongoDbTestModule.cs | 12 +-- .../MongoDB/MongoDbFixture.cs | 2 +- ....Abp.TenantManagement.MongoDB.Tests.csproj | 2 +- .../AbpTenantManagementMongoDbTestModule.cs | 12 +-- .../MongoDb/MongoDbFixture.cs | 2 +- .../MongoDb/MyProjectNameMongoDbFixture.cs | 2 +- .../MongoDb/MyProjectNameMongoDbTestModule.cs | 12 +-- ...anyName.MyProjectName.MongoDB.Tests.csproj | 2 +- .../MongoDB/MongoDbFixture.cs | 2 +- .../MongoDB/MyProjectNameMongoDbTestModule.cs | 12 +-- ...anyName.MyProjectName.MongoDB.Tests.csproj | 2 +- 46 files changed, 180 insertions(+), 150 deletions(-) create mode 100644 framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj index 39cff60ed5..3d0d708c22 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo.Abp.MongoDB.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs index 8ec0b026cd..e580c6fce6 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/AbpMongoDbTestModule.cs @@ -21,9 +21,10 @@ namespace Volo.Abp.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { @@ -35,11 +36,6 @@ namespace Volo.Abp.MongoDB options.AddDefaultRepositories(); options.AddRepository(); }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs index 3fa239ebbb..259d608a86 100644 --- a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs new file mode 100644 index 0000000000..882c849936 --- /dev/null +++ b/framework/test/Volo.Abp.MongoDB.Tests/Volo/Abp/MongoDB/Transactions/Transaction_Tests.cs @@ -0,0 +1,90 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Shouldly; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.TestApp.Domain; +using Volo.Abp.TestApp.Testing; +using Volo.Abp.Uow; +using Xunit; + +namespace Volo.Abp.MongoDB.Transactions +{ + public class Transaction_Tests : TestAppTestBase + { + private readonly IBasicRepository _personRepository; + private readonly IUnitOfWorkManager _unitOfWorkManager; + + public Transaction_Tests() + { + _personRepository = GetRequiredService>(); + _unitOfWorkManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Rollback_Transaction_When_An_Exception_Is_Thrown() + { + var personId = Guid.NewGuid(); + const string exceptionMessage = "thrown to rollback the transaction!"; + + try + { + await WithUnitOfWorkAsync(new AbpUnitOfWorkOptions { IsTransactional = true }, async () => + { + await _personRepository.InsertAsync(new Person(personId, "Adam", 42)); + throw new Exception(exceptionMessage); + }); + } + catch (Exception e) when (e.Message == exceptionMessage) + { + + } + + var person = await _personRepository.FindAsync(personId); + person.ShouldBeNull(); + } + + [Fact] + public async Task Should_Rollback_Transaction_Manually() + { + var personId = Guid.NewGuid(); + + await WithUnitOfWorkAsync(new AbpUnitOfWorkOptions { IsTransactional = true }, async () => + { + _unitOfWorkManager.Current.ShouldNotBeNull(); + + await _personRepository.InsertAsync(new Person(personId, "Adam", 42)); + + await _unitOfWorkManager.Current.RollbackAsync(); + }); + + var person = await _personRepository.FindAsync(personId); + person.ShouldBeNull(); + } + + [Fact] + public async Task Should_Rollback_Transaction_Manually_With_Double_DbContext_Transaction() + { + var personId = Guid.NewGuid(); + var bookId = Guid.NewGuid(); + + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (uowManager.Begin(new AbpUnitOfWorkOptions { IsTransactional = true })) + { + _unitOfWorkManager.Current.ShouldNotBeNull(); + + await _personRepository.InsertAsync(new Person(personId, "Adam", 42)); + + await _unitOfWorkManager.Current.SaveChangesAsync(); + + //Will automatically rollback since not called the Complete! + } + } + + (await _personRepository.FindAsync(personId)).ShouldBeNull(); + } + } +} diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj index dda1379793..ec89bbf896 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo.Abp.AuditLogging.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - +
diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs index a8d213a81f..cd210e6985 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/AbpAuditLoggingMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Abp.AuditLogging.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs index e217faf961..f66be5d113 100644 --- a/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs +++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.MongoDB.Tests/Volo/Abp/AuditLogging/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.AuditLogging.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj index 0f9f0bf566..ce922d5aea 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo.Abp.BackgroundJobs.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - +
diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs index a7ec1ad65f..d1dcaa2a2e 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/AbpBackgroundJobsMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Abp.BackgroundJobs.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs index c358bed276..a348587184 100644 --- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs +++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.MongoDB.Tests/Volo/Abp/BackgroundJobs/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.BackgroundJobs.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs index 12cb8b0de3..2121949da7 100644 --- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs +++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/BlobStoringDatabaseMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Abp.BlobStoring.Database.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs index a7cfb4f4b6..916279f57d 100644 --- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs +++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.BlobStoring.Database.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj index a56030ccc6..e2448c7d5f 100644 --- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj +++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.MongoDB.Tests/Volo.Abp.BlobStoring.Database.MongoDB.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj index 1301bbf1bd..3b73719bdc 100644 --- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj +++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo.Blogging.MongoDB.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs index f66922cfcd..41942f75d0 100644 --- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs +++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/BloggingMongoDBTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Blogging.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs index 71824397b4..6da6ba3662 100644 --- a/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs +++ b/modules/blogging/test/Volo.Blogging.MongoDB.Tests/Volo/Blogging/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Blogging.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs index 521b93cc8c..d8e781a28c 100644 --- a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs +++ b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/CmsKitMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.CmsKit.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/MongoDbFixture.cs index 3898749c10..fd92e70e19 100644 --- a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/MongoDbFixture.cs +++ b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.CmsKit.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj index 834bfca873..783dd21ba9 100644 --- a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj +++ b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/Volo.CmsKit.MongoDB.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj index f8c009a8a7..098634157c 100644 --- a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj +++ b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo.Docs.MongoDB.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs index d00f25b533..5a75a6d182 100644 --- a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs +++ b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/DocsMongoDBTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Docs.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs index 9a40d79492..0f9ab7b6c9 100644 --- a/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs +++ b/modules/docs/test/Volo.Docs.MongoDB.Tests/Volo/Docs/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Docs.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj index 1e667cf711..101ba7d1d4 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo.Abp.FeatureManagement.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs index fdafebef51..129c3b5aaa 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/AbpFeatureManagementMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Abp.FeatureManagement.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs index bb89a83f76..c2fa1c96a7 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.MongoDB.Tests/Volo/Abp/FeatureManagement/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.FeatureManagement.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj index 581e113534..6f4d94340d 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo.Abp.Identity.MongoDB.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs index 101f4836a5..3399b96754 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbTestModule.cs @@ -15,19 +15,15 @@ namespace Volo.Abp.Identity.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs index 09581c13d5..8563470a27 100644 --- a/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs +++ b/modules/identity/test/Volo.Abp.Identity.MongoDB.Tests/Volo/Abp/Identity/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.Identity.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj index 9768c83e98..5ef09a8598 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo.Abp.IdentityServer.MongoDB.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs index ae32aa2d4a..b89da5ebbe 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/AbpIdentityServerMongoDbTestModule.cs @@ -17,18 +17,14 @@ namespace Volo.Abp.IdentityServer { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; - }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; }); } } diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs index 2c2f120acd..eb088c21af 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.MongoDB.Tests/Volo/Abp/IdentityServer/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.IdentityServer static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj index 888e06c2b9..263b5f852d 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo.Abp.PermissionManagement.MongoDB.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs index d896cf01dc..cd47d024e2 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/AbpPermissionManagementMongoDbTestModule.cs @@ -12,19 +12,15 @@ namespace Volo.Abp.PermissionManagement.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs index 97799fc03b..768a6bcb1c 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.MongoDB.Tests/Volo/Abp/PermissionManagement/MongoDb/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.PermissionManagement.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj index b500136b68..398ff74afe 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo.Abp.SettingManagement.MongoDB.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs index 0e456a2df8..8b022c63bf 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/AbpSettingManagementMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Abp.SettingManagement.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs index 4f9142a829..8db91a3e72 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.MongoDB.Tests/Volo/Abp/SettingManagement/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace Volo.Abp.SettingManagement.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj index 135500d917..8efbf4df9a 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo.Abp.TenantManagement.MongoDB.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs index 3bdcf0ad9c..88c5ea05ea 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/AbpTenantManagementMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace Volo.Abp.TenantManagement.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs index 689f273178..d4768a1044 100644 --- a/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs +++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.MongoDB.Tests/Volo/Abp/TenantManagement/MongoDb/MongoDbFixture.cs @@ -12,7 +12,7 @@ namespace Volo.Abp.TenantManagement.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbFixture.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbFixture.cs index d1a863eb2c..3ce3120ddd 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbFixture.cs +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbFixture.cs @@ -10,7 +10,7 @@ namespace MyCompanyName.MyProjectName.MongoDB static MyProjectNameMongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs index 30687dd407..036aac5ce1 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDb/MyProjectNameMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace MyCompanyName.MyProjectName.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MyProjectNameMongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj index 145be5313f..06e9ef3430 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MongoDbFixture.cs index e471590369..630045b802 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MongoDbFixture.cs +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -10,7 +10,7 @@ namespace MyCompanyName.MyProjectName.MongoDB static MongoDbFixture() { - MongoDbRunner = MongoDbRunner.Start(); + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); ConnectionString = MongoDbRunner.ConnectionString; } diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs index 25db3dbaeb..d63a023cdf 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MongoDB/MyProjectNameMongoDbTestModule.cs @@ -13,19 +13,15 @@ namespace MyCompanyName.MyProjectName.MongoDB { public override void ConfigureServices(ServiceConfigurationContext context) { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; Configure(options => { options.ConnectionStrings.Default = connectionString; }); - - Configure(options => - { - options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; - }); } } } diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj index a99dcce57f..fb807fa2d1 100644 --- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj +++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.MongoDB.Tests/MyCompanyName.MyProjectName.MongoDB.Tests.csproj @@ -9,7 +9,7 @@ - + From 88b7702b62621966d647281a79b2feaaad2203d1 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 20 Oct 2020 16:40:30 +0800 Subject: [PATCH 13/15] Re-create migrations and test module templates for IDS4 4.x upgrade. Resolve #5859 --- .../IdentityServerDataSeedContributor.cs | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs index 8e499193df..f37a50da48 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/IdentityServer/IdentityServerDataSeedContributor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using IdentityServer4.Models; @@ -7,8 +7,8 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; -using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.ApiResources; +using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.PermissionManagement; @@ -52,10 +52,15 @@ namespace MyCompanyName.MyProjectName.IdentityServer { await _identityResourceDataSeeder.CreateStandardResourcesAsync(); await CreateApiResourcesAsync(); - await CreateApiScopeAsync(); + await CreateApiScopesAsync(); await CreateClientsAsync(); } + private async Task CreateApiScopesAsync() + { + await CreateApiScopeAsync("MyProjectName"); + } + private async Task CreateApiResourcesAsync() { var commonApiUserClaims = new[] @@ -97,13 +102,22 @@ namespace MyCompanyName.MyProjectName.IdentityServer return await _apiResourceRepository.UpdateAsync(apiResource); } - private async Task CreateApiScopeAsync() + private async Task CreateApiScopeAsync(string name) { - var apiScope = await _apiScopeRepository.GetByNameAsync("MyProjectName"); + var apiScope = await _apiScopeRepository.GetByNameAsync(name); if (apiScope == null) { - await _apiScopeRepository.InsertAsync(new ApiScope(_guidGenerator.Create(), "MyProjectName", "MyProjectName API"), autoSave: true); + apiScope = await _apiScopeRepository.InsertAsync( + new ApiScope( + _guidGenerator.Create(), + name, + name + " API" + ), + autoSave: true + ); } + + return apiScope; } private async Task CreateClientsAsync() @@ -116,7 +130,6 @@ namespace MyCompanyName.MyProjectName.IdentityServer "role", "phone", "address", - "MyProjectName" }; @@ -134,7 +147,7 @@ namespace MyCompanyName.MyProjectName.IdentityServer await CreateClientAsync( name: webClientId, scopes: commonScopes, - grantTypes: new[] {"hybrid"}, + grantTypes: new[] { "hybrid" }, secret: (configurationSection["MyProjectName_Web:ClientSecret"] ?? "1q2w3e*").Sha256(), redirectUri: $"{webClientRootUrl}signin-oidc", postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc", @@ -166,12 +179,10 @@ namespace MyCompanyName.MyProjectName.IdentityServer grantTypes: new[] { "authorization_code" }, secret: configurationSection["MyProjectName_Blazor:ClientSecret"]?.Sha256(), requireClientSecret: false, - requirePkce: true, redirectUri: $"{blazorRootUrl}/authentication/login-callback", postLogoutRedirectUri: $"{blazorRootUrl}/authentication/logout-callback" ); } - } private async Task CreateClientAsync( From 9e8817f9e323282bc1e307f6a294113b154a7f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 20 Oct 2020 13:43:28 +0300 Subject: [PATCH 14/15] Fixed #5646: Change BlazorWebAssemblyEnableLinking to false --- .../MyCompanyName.MyProjectName.Blazor.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj index cba18ad1bd..494e07a905 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj @@ -3,6 +3,7 @@ netstandard2.1 3.0 + false From ecbc2bcc845d3557739ed3933ffc8247f95bca5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 20 Oct 2020 14:35:55 +0300 Subject: [PATCH 15/15] Resolved #5871: Remove Boostrap JS & JQuery dependencies for the Blazor UI --- .../wwwroot/theme.js | 16 ---------------- .../wwwroot/index.html | 6 ------ 2 files changed, 22 deletions(-) delete mode 100644 framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/wwwroot/theme.js diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/wwwroot/theme.js b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/wwwroot/theme.js deleted file mode 100644 index 8a5b94c7c6..0000000000 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/wwwroot/theme.js +++ /dev/null @@ -1,16 +0,0 @@ -$(function () { - $('.dropdown-menu a.dropdown-toggle').on('click', function (e) { - if (!$(this).next().hasClass('show')) { - $(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); - } - - var $subMenu = $(this).next(".dropdown-menu"); - $subMenu.toggleClass('show'); - - $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) { - $('.dropdown-submenu .show').removeClass("show"); - }); - - return false; - }); -}); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html index 4566bec3c1..98756a068a 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html @@ -21,14 +21,8 @@ - - - - - -