From d20d34585213aecf13ac1fc60736fb0a0eca7a1e Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 12 Oct 2020 16:10:43 +0800 Subject: [PATCH 1/9] Show the error message when typing the wrong email --- .../Account/Localization/Resources/en.json | 3 ++- .../Account/Localization/Resources/sl.json | 3 ++- .../Account/Localization/Resources/tr.json | 3 ++- .../Localization/Resources/zh-Hans.json | 5 +++- .../Volo/Abp/Account/AccountAppService.cs | 8 +++--- .../Pages/Account/ForgotPassword.cshtml.cs | 27 ++++++++++++------- 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json index 51abf72a1e..db38b70309 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json @@ -56,6 +56,7 @@ "BackToLogin": "Back to login", "ProfileTab:Password": "Change password", "ProfileTab:PersonalInfo": "Personal info", - "ReturnToApplication": "Return to application" + "ReturnToApplication": "Return to application", + "Volo.Account:InvalidEmailAddress": "Can not find the given email address: {0}" } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json index 747cc752c7..4cd3d801fc 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/sl.json @@ -48,6 +48,7 @@ "ConfirmPassword": "Potrditev (ponovitev) gesla", "ResetPassword_Information": "Prosimo vnesite vaše novo geslo.", "YourPasswordIsSuccessfullyReset": "Vaše geslo je uspešno ponastavljeno.", - "BackToLogin": "Nazaj na prijavo" + "BackToLogin": "Nazaj na prijavo", + "Volo.Account:InvalidEmailAddress": "Navedenega e-poštnega naslova ni mogoče najti: {0}" } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json index 48e43fd6cc..9f8e765759 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/tr.json @@ -56,6 +56,7 @@ "BackToLogin": "Girişe dön", "ProfileTab:Password": "Şifre değiştir", "ProfileTab:PersonalInfo": "Kişisel bilgiler", - "ReturnToApplication": "Uygulamaya geri dön" + "ReturnToApplication": "Uygulamaya geri dön", + "Volo.Account:InvalidEmailAddress": "Email adresi bulunamadı: {0}" } } diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json index 340fe95f74..93174b979d 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/zh-Hans.json @@ -55,6 +55,9 @@ "BackToLogin": "返回登录", "ProfileTab:Password": "更改密码", "ProfileTab:PersonalInfo": "个人信息", - "ReturnToApplication": "返回到应用程序" + "ReturnToApplication": "返回到应用程序", + "Volo.Account:InvalidEmailAddress": "找不到给定的电子邮件地址:{0}", + "Volo.Account:SelfRegistrationDisabled": "自我注册已禁用!", + } } diff --git a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs index 066ce47f64..ac3c6c2735 100644 --- a/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs +++ b/modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs @@ -1,7 +1,7 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Volo.Abp.Account.Emailing; +using Volo.Abp.Account.Localization; using Volo.Abp.Account.Settings; using Volo.Abp.Application.Services; using Volo.Abp.Identity; @@ -26,6 +26,7 @@ namespace Volo.Abp.Account AccountEmailer = accountEmailer; IdentitySecurityLogManager = identitySecurityLogManager; UserManager = userManager; + LocalizationResource = typeof(AccountResource); } public virtual async Task RegisterAsync(RegisterDto input) @@ -66,8 +67,7 @@ namespace Volo.Abp.Account var user = await UserManager.FindByEmailAsync(email); if (user == null) { - throw new BusinessException("Volo.Account:InvalidEmailAddress") - .WithData("Email", email); + throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", email]); } return user; diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml.cs index 1f426fa80f..b66b53c913 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml.cs @@ -29,15 +29,24 @@ namespace Volo.Abp.Account.Web.Pages.Account public virtual async Task OnPostAsync() { - await AccountAppService.SendPasswordResetCodeAsync( - new SendPasswordResetCodeDto - { - Email = Email, - AppName = "MVC", //TODO: Const! - ReturnUrl = ReturnUrl, - ReturnUrlHash = ReturnUrlHash - } - ); + try + { + await AccountAppService.SendPasswordResetCodeAsync( + new SendPasswordResetCodeDto + { + Email = Email, + AppName = "MVC", //TODO: Const! + ReturnUrl = ReturnUrl, + ReturnUrlHash = ReturnUrlHash + } + ); + } + catch (UserFriendlyException e) + { + Alerts.Danger(e.Message); + return Page(); + } + return RedirectToPage( "./PasswordResetLinkSent", From f5d45a1596e6b3e7495e2124debc5b6e23ef1b2e Mon Sep 17 00:00:00 2001 From: muhammedaltug Date: Tue, 13 Oct 2020 11:39:48 +0300 Subject: [PATCH 2/9] feat: inner html added to toaster messafe --- .../src/lib/components/toast/toast.component.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.html b/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.html index 05f8b664e9..8af75bdfc4 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.html +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/toast/toast.component.html @@ -9,8 +9,9 @@
{{ toast.title | abpLocalization: toast.options?.titleLocalizationParams }}
-

- {{ toast.message | abpLocalization: toast.options?.messageLocalizationParams }} -

+

From 1be9cd8ce1b43a8711399ab4c1b317e01d200ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=A3=8A?= Date: Tue, 13 Oct 2020 18:01:41 +0800 Subject: [PATCH 3/9] fix localization error fix localization error --- .../Volo/Abp/Validation/Localization/zh-Hans.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json index 1f40a603e8..0a41ce1ed5 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/zh-Hans.json @@ -27,7 +27,7 @@ "ThisFieldMustMatchTheRegularExpression{0}": "字段必须匹配正则表达式'{0}'.", "ThisFieldIsRequired.": "字段不可为空.", "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "字段必须是长度为{0}的字符串.", - "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{*}的字符串.", + "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "字段必须是最小长度为{1}并且最大长度{0}的字符串.", "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "字段{0}不是有效的完全限定的http,https或ftp URL.", "ThisFieldIsInvalid.": "该字段无效." } From 14af54d2e71b94492f3003331b13044ee8fda278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 13 Oct 2020 15:28:59 +0300 Subject: [PATCH 4/9] Fix the Microsoft.AspNetCore.Components.WebAssembly version That was accidently downgraded. /cc: @maliming --- .../Volo.Abp.AspNetCore.Components.WebAssembly.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3cae39a1e9..9f1c48e3c3 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 @@ -20,7 +20,7 @@ - + From 91b34466dd239dfcb10293dec87dcb118cd70434 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 13 Oct 2020 15:54:58 +0300 Subject: [PATCH 5/9] docs module minor refactors --- .../DocsAdminPermissionDefinitionProvider.cs | 1 - .../Volo/Docs/Admin/DocsAdminPermissions.cs | 1 - .../Docs/Admin/Documents/PullDocumentInput.cs | 12 +----- .../Admin/Projects/ProjectAdminAppService.cs | 7 +-- .../DocsAdminWebAutoMapperProfile.cs | 6 ++- .../Volo.Docs.Admin.Web/DocsAdminWebModule.cs | 1 - .../Pages/Docs/Admin/Documents/Index.cshtml | 20 ++++----- .../Pages/Docs/Admin/Documents/index.js | 43 +++++++------------ .../Pages/Docs/Admin/Projects/index.js | 3 +- .../Docs/DocsApplicationAutoMapperProfile.cs | 5 +-- .../Volo/Docs/Documents/DocumentAppService.cs | 34 +++++++-------- .../Volo/Docs/Projects/ProjectAppService.cs | 7 +-- 12 files changed, 59 insertions(+), 81 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissionDefinitionProvider.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissionDefinitionProvider.cs index c7bb12e3bb..6f9bb6407e 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissionDefinitionProvider.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissionDefinitionProvider.cs @@ -16,7 +16,6 @@ namespace Volo.Docs.Admin projects.AddChild(DocsAdminPermissions.Projects.Create, L("Permission:Create")); group.AddPermission(DocsAdminPermissions.Documents.Default, L("Permission:Documents")); - } private static LocalizableString L(string name) diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs index 26c1c46254..e6043241ea 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/DocsAdminPermissions.cs @@ -19,7 +19,6 @@ namespace Volo.Docs.Admin public const string Default = GroupName + ".Documents"; } - public static string[] GetAll() { return ReflectionHelper.GetPublicConstantsRecursively(typeof(DocsAdminPermissions)); diff --git a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs index dce5de0420..2d48cb6678 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Documents/PullDocumentInput.cs @@ -5,17 +5,9 @@ using Volo.Docs.Documents; namespace Volo.Docs.Admin.Documents { - public class PullDocumentInput + public class PullDocumentInput : PullAllDocumentInput { - public Guid ProjectId { get; set; } - [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxNameLength))] public string Name { get; set; } - - [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxLanguageCodeNameLength))] - public string LanguageCode { get; set; } - - [DynamicStringLength(typeof(DocumentConsts), nameof(DocumentConsts.MaxVersionNameLength))] - public string Version { get; set; } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs index 882a8b8087..bc663a0252 100644 --- a/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs +++ b/modules/docs/src/Volo.Docs.Admin.Application/Volo/Docs/Admin/Projects/ProjectAdminAppService.cs @@ -42,9 +42,10 @@ namespace Volo.Docs.Admin.Projects var totalCount = await _projectRepository.GetCountAsync(); - var dtos = ObjectMapper.Map, List>(projects); - - return new PagedResultDto(totalCount, dtos); + return new PagedResultDto( + totalCount, + ObjectMapper.Map, List>(projects) + ); } public async Task GetAsync(Guid id) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs index 83f993d1e8..d6a1d2230a 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs +++ b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebAutoMapperProfile.cs @@ -10,9 +10,11 @@ namespace Volo.Docs.Admin { public DocsAdminWebAutoMapperProfile() { - CreateMap().Ignore(x => x.ExtraProperties); + CreateMap() + .Ignore(x => x.ExtraProperties); - CreateMap().Ignore(x => x.ExtraProperties); + CreateMap() + .Ignore(x => x.ExtraProperties); CreateMap () .Ignore(x => x.GitHubAccessToken) diff --git a/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs index bcd9616089..ad4e7b58be 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs +++ b/modules/docs/src/Volo.Docs.Admin.Web/DocsAdminWebModule.cs @@ -31,7 +31,6 @@ namespace Volo.Docs.Admin public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => { options.MenuContributors.Add(new DocsMenuContributor()); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml index 1afd658afe..d1816f4017 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/Index.cshtml @@ -98,7 +98,7 @@ - +
@@ -110,12 +110,12 @@ id="CreationTimeMin" name="CreationTimeMin" class="form-control datepicker" - placeholder="@L["StartDate"]"> + placeholder="@L["StartDate"].Value"> -
@@ -132,12 +132,12 @@ id="LastUpdatedTimeMin" name="LastUpdatedTimeMin" class="form-control datepicker" - placeholder="@L["StartDate"]"> + placeholder="@L["StartDate"].Value"> -
@@ -154,12 +154,12 @@ id="LastSignificantUpdateTimeMin" name="LastSignificantUpdateTimeMin" class="form-control datepicker" - placeholder="@L["StartDate"]"> + placeholder="@L["StartDate"].Value"> -
@@ -176,12 +176,12 @@ id="LastCachedTimeMin" name="LastCachedTimeMin" class="form-control datepicker" - placeholder="@L["StartDate"]"> + placeholder="@L["StartDate"].Value"> - @@ -212,4 +212,4 @@ - \ No newline at end of file + diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js index 23203a23f5..29c55502d9 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Documents/index.js @@ -18,17 +18,20 @@ creationTimeMax: getFormattedDate($('#CreationTimeMax')), lastUpdatedTimeMin: getFormattedDate($('#LastUpdatedTimeMin')), lastUpdatedTimeMax: getFormattedDate($('#LastUpdatedTimeMax')), - lastSignificantUpdateTimeMin: getFormattedDate( - $('#LastSignificantUpdateTimeMin') - ), - lastSignificantUpdateTimeMax: getFormattedDate( - $('#LastSignificantUpdateTimeMax') - ), + lastSignificantUpdateTimeMin: getFormattedDate($('#LastSignificantUpdateTimeMin')), + lastSignificantUpdateTimeMax: getFormattedDate($('#LastSignificantUpdateTimeMax')), lastCachedTimeMin: getFormattedDate($('#LastCachedTimeMin')), lastCachedTimeMax: getFormattedDate($('#LastCachedTimeMax')), }; }; + var parseDateToLocaleDateString = function (date) { + var parsedDate = Date.parse(date); + return new Date(parsedDate).toLocaleDateString( + abp.localization.currentCulture.name + ); + }; + var dataTable = $('#DocumentsTable').DataTable( abp.libs.datatables.normalizeConfiguration({ processing: true, @@ -55,9 +58,7 @@ service .removeFromCache(data.record.id) .then(function () { - abp.message.success( - l('RemovedFromCache') - ); + abp.message.success(l('RemovedFromCache')); dataTable.ajax.reload(); }); }, @@ -74,9 +75,7 @@ service .reindex(data.record.id) .then(function () { - abp.message.success( - l('ReindexCompleted') - ); + abp.message.success(l('ReindexCompleted')); dataTable.ajax.reload(); }); }, @@ -112,10 +111,7 @@ return ''; } - var date = Date.parse(creationTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); + return parseDateToLocaleDateString(creationTime); }, }, { @@ -126,10 +122,7 @@ return ''; } - var date = Date.parse(lastUpdatedTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); + return parseDateToLocaleDateString(lastUpdatedTime); }, }, { @@ -140,10 +133,7 @@ return ''; } - var date = Date.parse(lastSignificantUpdateTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); + return parseDateToLocaleDateString(lastSignificantUpdateTime); }, }, { @@ -154,10 +144,7 @@ return ''; } - var date = Date.parse(lastCachedTime); - return new Date(date).toLocaleDateString( - abp.localization.currentCulture.name - ); + return parseDateToLocaleDateString(lastCachedTime); }, }, ], 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 45554eb356..b898dbf6b8 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 @@ -156,8 +156,7 @@ .confirm(l('ReIndexAllProjectConfirmationMessage')) .done(function (accepted) { if (accepted) { - volo.docs.admin.projectsAdmin - .reindexAll() + volo.docs.admin.projectsAdmin.reindexAll() .then(function () { abp.message.success( l('SuccessfullyReIndexAllProject') diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs index d29828ad05..fc2eec1759 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/DocsApplicationAutoMapperProfile.cs @@ -11,10 +11,9 @@ namespace Volo.Docs { CreateMap(); CreateMap(); - CreateMap() - .Ignore(x => x.Project).Ignore(x => x.Contributors); + CreateMap().Ignore(x => x.Project).Ignore(x => x.Contributors); CreateMap(); CreateMap(); } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 6df4c6179e..fe00c41ac6 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -213,8 +213,7 @@ namespace Volo.Docs.Documents input.Version ); - if (!JsonConvertExtensions.TryDeserializeObject(document.Content, - out var documentParameters)) + if (!JsonConvertExtensions.TryDeserializeObject(document.Content,out var documentParameters)) { throw new UserFriendlyException( $"Cannot validate document parameters file '{project.ParametersDocumentName}' for the project {project.Name}."); @@ -257,10 +256,10 @@ namespace Volo.Docs.Documents } var cacheKey = CacheKeyGenerator.GenerateDocumentUpdateInfoCacheKey( - project: project, - documentName: document.Name, - languageCode: document.LanguageCode, - version: document.Version + project, + document.Name, + document.LanguageCode, + document.Version ); await DocumentUpdateCache.SetAsync(cacheKey, new DocumentUpdateInfo @@ -277,9 +276,10 @@ namespace Volo.Docs.Documents protected virtual DocumentWithDetailsDto CreateDocumentWithDetailsDto(Project project, Document document) { var documentDto = ObjectMapper.Map(document); + documentDto.Project = ObjectMapper.Map(project); - documentDto.Contributors = - ObjectMapper.Map, List>(document.Contributors); + documentDto.Contributors = ObjectMapper.Map, List>(document.Contributors); + return documentDto; } @@ -289,8 +289,7 @@ namespace Volo.Docs.Documents Logger.LogInformation($"Not found in the cache. Requesting {documentName} from the source..."); var source = _documentStoreFactory.Create(project.DocumentStoreType); - var sourceDocument = await source.GetDocumentAsync(project, documentName, languageCode, version, - oldDocument?.LastSignificantUpdateTime); + var sourceDocument = await source.GetDocumentAsync(project, documentName, languageCode, version, oldDocument?.LastSignificantUpdateTime); await _documentRepository.DeleteAsync(project.Id, sourceDocument.Name, sourceDocument.LanguageCode, sourceDocument.Version); @@ -299,10 +298,10 @@ namespace Volo.Docs.Documents Logger.LogInformation($"Document retrieved: {documentName}"); var cacheKey = CacheKeyGenerator.GenerateDocumentUpdateInfoCacheKey( - project: project, - documentName: sourceDocument.Name, - languageCode: sourceDocument.LanguageCode, - version: sourceDocument.Version + project, + sourceDocument.Name, + sourceDocument.LanguageCode, + sourceDocument.Version ); await DocumentUpdateCache.SetAsync(cacheKey, new DocumentUpdateInfo @@ -351,12 +350,13 @@ namespace Volo.Docs.Documents private string GetProjectVersionPrefixIfExist(Project project) { - if (GetGithubVersionProviderSource(project) == GithubVersionProviderSource.Branches) + if (GetGithubVersionProviderSource(project) != GithubVersionProviderSource.Branches) { - return project.ExtraProperties["VersionBranchPrefix"].ToString(); + return string.Empty; } - return ""; + return project.ExtraProperties["VersionBranchPrefix"].ToString(); + } private GithubVersionProviderSource GetGithubVersionProviderSource(Project project) diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs index 728840135e..1f5a8d4c91 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Projects/ProjectAppService.cs @@ -125,12 +125,13 @@ namespace Volo.Docs.Projects private string GetProjectVersionPrefixIfExist(Project project) { - if (GetGithubVersionProviderSource(project) == GithubVersionProviderSource.Branches) + if (GetGithubVersionProviderSource(project) != GithubVersionProviderSource.Branches) { - return project.ExtraProperties["VersionBranchPrefix"].ToString(); + return string.Empty; } - return ""; + return project.ExtraProperties["VersionBranchPrefix"].ToString(); + } private GithubVersionProviderSource GetGithubVersionProviderSource(Project project) From 674f1282b60905c3d5033bb2748a9019af900190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 13 Oct 2020 17:09:17 +0300 Subject: [PATCH 6/9] Remove test code from the startup template. --- .../Pages/Index.razor | 23 -------- .../Pages/Index.razor.cs | 57 +------------------ 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index 0f0d1935df..8ae9643f63 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -13,29 +13,6 @@
Congratulations, MyProjectName is successfully running!
- - - UI Message Tests - - - - - - - - - -

Welcome to the Application

@L["LongWelcomeMessage"]

diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.cs index c39cb6f880..3e1570ecc8 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.cs @@ -1,62 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Security.Claims; -using System.Threading.Tasks; -using Blazorise; -using Microsoft.AspNetCore.Components; -using Volo.Abp.AspNetCore.Components.WebAssembly; - -namespace MyCompanyName.MyProjectName.Blazor.Pages +namespace MyCompanyName.MyProjectName.Blazor.Pages { public partial class Index { - private IEnumerable _claims; - - protected override async Task OnInitializedAsync() - { - var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); - if ( authState.User.Identity.IsAuthenticated ) - { - _claims = authState.User.Claims; - } - } - - Task OnInfoTestClicked() - { - return UiMessageService.InfoAsync( "This is the Info message", "Info", options => - { - options.OkButtonIcon = IconName.InfoCircle; - options.OkButtonText = "Hello info"; - } ); - } - - Task OnSuccessTestClicked() - { - return UiMessageService.SuccessAsync( "This is the Success message", "Success" ); - } - - Task OnWarningTestClicked() - { - return UiMessageService.WarnAsync( "This is the Warning message", "Warning" ); - } - - Task OnErrorTestClicked() - { - return UiMessageService.ErrorAsync( "This is the Error message", "Error" ); - } - - async Task OnConfirmTestClicked() - { - if ( await UiMessageService.ConfirmAsync( "Are you sure you want to delete the item?", "Confirm", options => - { - options.CancelButtonText = "Do not delete it"; - options.ConfirmButtonText = "Yes I'm sure"; - } ) ) - { - Console.WriteLine( "Confirmed" ); - } - } - [Inject] IUiMessageService UiMessageService { get; set; } } } From 746bc572d42d949ffe35c4ac35404ef011bfb40d Mon Sep 17 00:00:00 2001 From: bnymncoskuner Date: Tue, 13 Oct 2020 17:42:04 +0300 Subject: [PATCH 7/9] feat: improve home component of app template --- .../angular/src/app/home/home.component.html | 338 +++++++++++++++++- 1 file changed, 325 insertions(+), 13 deletions(-) diff --git a/templates/app/angular/src/app/home/home.component.html b/templates/app/angular/src/app/home/home.component.html index fc7a0a4183..ff311bf22f 100644 --- a/templates/app/angular/src/app/home/home.component.html +++ b/templates/app/angular/src/app/home/home.component.html @@ -1,14 +1,326 @@ -
-
-

{{ '::Welcome' | abpLocalization }}

-
-
-

{{ '::LongWelcomeMessage' | abpLocalization }}

-
-
-
- abp.io - {{ 'AbpAccount::Login' | abpLocalization }} +
+
+ +

{{ '::Welcome' | abpLocalization }}

+ +

{{ '::LongWelcomeMessage' | abpLocalization }}

+ + {{ 'AbpAccount::Login' | abpLocalization }} +
+
+

Let's improve your application!

+

Here are some links to help you get started:

+
+
+
+
+ + + + + +
+
+ + + +

+ + + + +

+
+ + + + +
+
+
+ +
+

Meet the ABP Commercial

+

A Complete Web Application Platform Built on the ABP Framework

+
+ +
+
+

+ ABP Commercial is a platform based + on the open source ABP framework. It provides pre-built application modules, rapid + application development tooling, professional UI themes, premium support and more. +

+ +
+ + + + + + + + + + + +
+
+
+
+ + +
+
+
+ {{ context.title }} +
+

+ + {{ link.label }} +
+
+
+ + +
+
+
+ + + Details +
+
+
+
From 76417a276c302726bd210bc3751ac9bfe274a334 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 13 Oct 2020 18:37:28 +0300 Subject: [PATCH 8/9] fix: exit recursive interface generation when ref is cyclic --- npm/ng-packs/packages/schematics/src/utils/model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index f68aa9b181..f1177d2340 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -134,7 +134,8 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP return _interface.properties .reduce((refs, prop) => { prop.refs.forEach(type => { - if (types[type]?.isEnum || type === _interface.ref) return; + if (types[type]?.isEnum) return; + if (interfaces.some(i => i.ref === type)) return; refs.push(type); }); From 6929337346f8d0a8fbd989175493374d57a42adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levent=20Arman=20=C3=96zak?= Date: Tue, 13 Oct 2020 19:24:36 +0300 Subject: [PATCH 9/9] Update home.component.html --- .../angular/src/app/home/home.component.html | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/templates/app/angular/src/app/home/home.component.html b/templates/app/angular/src/app/home/home.component.html index ff311bf22f..067a74c50f 100644 --- a/templates/app/angular/src/app/home/home.component.html +++ b/templates/app/angular/src/app/home/home.component.html @@ -45,7 +45,6 @@ starterLinkTemplate; context: { $implicit: { - borderLeft: true, title: 'Samples', description: 'See the example projects built with the ABP Framework.', links: [ @@ -64,7 +63,6 @@ starterLinkTemplate; context: { $implicit: { - borderLeft: true, title: 'ABP Community', description: 'Get involved with a vibrant community and become a contributor.', links: [ @@ -148,7 +146,6 @@ label: 'Request a feature' } ], - borderLeft: true, customTemplate: githubButtonsTemplate } } @@ -171,8 +168,7 @@ href: 'https://stackoverflow.com/questions/ask', label: 'Ask a Question' } - ], - borderLeft: true + ] } } " @@ -213,8 +209,7 @@ context: { $implicit: { title: 'Application Modules', - href: 'https://commercial.abp.io/modules?ref=tmpl', - borderLeft: true + href: 'https://commercial.abp.io/modules?ref=tmpl' } } " @@ -226,8 +221,7 @@ context: { $implicit: { title: 'Developer
Tools', - href: 'https://commercial.abp.io/tools?ref=tmpl', - borderLeft: true + href: 'https://commercial.abp.io/tools?ref=tmpl' } } " @@ -239,8 +233,7 @@ context: { $implicit: { title: 'UI
Themes', - href: 'https://commercial.abp.io/themes?ref=tmpl', - borderLeft: true + href: 'https://commercial.abp.io/themes?ref=tmpl' } } " @@ -252,8 +245,7 @@ context: { $implicit: { title: 'Premium Support', - href: 'https://support.abp.io/QA/Questions?ref=tmpl', - borderLeft: true + href: 'https://support.abp.io/QA/Questions?ref=tmpl' } } " @@ -265,8 +257,7 @@ context: { $implicit: { title: 'Additional Services', - href: 'https://commercial.abp.io/additional-services?ref=tmpl', - borderLeft: true + href: 'https://commercial.abp.io/additional-services?ref=tmpl' } } " @@ -290,7 +281,7 @@
-
+
{{ context.title }} @@ -312,7 +303,7 @@ -
+
@@ -324,3 +315,19 @@
+ +