From 788b06146884dcc41c065563cb7000a33f854eeb Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Fri, 24 Jan 2020 16:01:59 -0300 Subject: [PATCH 01/47] Correcciones en los textos --- .../Volo/Abp/Localization/Resources/AbpValidation/es.json | 2 +- .../src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/es.json b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/es.json index 25ed44d7ad..87d1316a38 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/es.json +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/es.json @@ -11,7 +11,7 @@ "The {0} field is not a valid phone number.": "{0} no es un número de teléfono válido.", "The field {0} must be between {1} and {2}.": "El campo {0} debe ser entre {1} y {2}.", "The field {0} must match the regular expression '{1}'.": "El campo {0} debe coincidir con la expresión regular '{1}'.", - "The {0} field is required.": "La {0} campo es obligatorio.", + "The {0} field is required.": "El campo {0} es obligatorio.", "The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud máxima de {1}.", "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud mínima de {2} y una longitud máxima de {1}.", "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una dirección URL válida http, https o ftp.", diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json index 4997156c8d..46263a716c 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json @@ -38,8 +38,8 @@ "PagerPrevious": "Anterior", "PagerFirst": "Primero", "PagerLast": "Último", - "PagerInfo": "Mostrando desde _START_ hasta _END_ total _TOTAL_", - "PagerInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros", + "PagerInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros", + "PagerInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros", "PagerInfoFiltered": "(filtrado de un total de _MAX_ registros)", "NoDataAvailableInDatatable": "No hay datos", "PagerShowMenuEntries": "Mostrar _MENU_ registros", From d941b1adeab5a77d49ed9b0601cf2b2e8d20a7f1 Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Fri, 6 Mar 2020 11:07:39 -0300 Subject: [PATCH 02/47] Change special characters to unicode --- .../Volo/Abp/Emailing/Localization/es.json | 23 +++++++++ .../Navigation/Localization/Resource/es.json | 2 +- .../Localization/Resources/AbpUi/es.json | 36 +++++++------- .../Volo/Abp/Validation/Localization/es.json | 48 +++++++++---------- .../TestResources/Base/CountryNames/es.json | 2 +- .../TestResources/Base/Validation/es.json | 4 +- .../Localization/TestResources/Source/es.json | 2 +- 7 files changed, 70 insertions(+), 47 deletions(-) create mode 100644 framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json new file mode 100644 index 0000000000..ae3a29f901 --- /dev/null +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json @@ -0,0 +1,23 @@ +{ + "culture": "es", + "texts": { + "DisplayName:Abp.Mailing.DefaultFromAddress": "Direcci\u00F3n de env\u00EDo", + "DisplayName:Abp.Mailing.DefaultFromDisplayName": "Nombre de env\u00EDo", + "DisplayName:Abp.Mailing.Smtp.Host": "Host", + "DisplayName:Abp.Mailing.Smtp.Port": "Puerto", + "DisplayName:Abp.Mailing.Smtp.UserName": "Nombre de usuario", + "DisplayName:Abp.Mailing.Smtp.Password": "Contrase\\00F1", + "DisplayName:Abp.Mailing.Smtp.Domain": "Dominio", + "DisplayName:Abp.Mailing.Smtp.EnableSsl": "Habilitar SSL", + "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Usar las credenciales por defecto", + "Description:Abp.Mailing.DefaultFromAddress": "La direcci\u00F3n de env\u00EDo por defecto", + "Description:Abp.Mailing.DefaultFromDisplayName": "El nombre de env\u00EDo por defecto", + "Description:Abp.Mailing.Smtp.Host": "El nombre o direcci\u00F3n del host para transacciones SMTP.", + "Description:Abp.Mailing.Smtp.Port": "El puerto usado para transacciones SMTP.", + "Description:Abp.Mailing.Smtp.UserName": "Nombre de usuario asociado a las credenciales.", + "Description:Abp.Mailing.Smtp.Password": "La contraseña del ususario asociado a las credenciales.", + "Description:Abp.Mailing.Smtp.Domain": "El dominio o equipo que valida las credenciales.", + "Description:Abp.Mailing.Smtp.EnableSsl": "Si SmtpClient usa Secure Sockets Layer (SSL) para encriptar la conecci\u00F3n.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Si las credenciales por defecto se env\u00EDan con los request." + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json index ba27a9193c..caa51f8d1d 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json @@ -1,6 +1,6 @@ { "culture": "es", "texts": { - "Menu:Administration": "Administración" + "Menu:Administration": "Administraci\u00F3n" } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json index 46263a716c..4ed8edc8e0 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json @@ -1,20 +1,20 @@ { "culture": "es", "texts": { - "InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", - "ValidationErrorMessage": "Su pedido no es válido!", - "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", - "DefaultErrorMessage": "Ocurrió un error!", - "DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", - "DefaultErrorMessage401": "Usted no ha iniciado sessión!", - "DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", - "DefaultErrorMessage403": "Usted no está autorizado!", - "DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", - "DefaultErrorMessage404": "No se encontró el recurso!", - "DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", + "InternalServerErrorMessage": "Ocurri\u00F3 un error interno en su pedido!", + "ValidationErrorMessage": "Su pedido no es v\u00E1lido!", + "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validaci\u00F3n.", + "DefaultErrorMessage": "Ocurri\u00F3 un error!", + "DefaultErrorMessageDetail": "El servidor no envi\u00F3 el detalle del error.", + "DefaultErrorMessage401": "Usted no ha iniciado sessi\u00F3n!", + "DefaultErrorMessage401Detail": "Debe iniciar sessi\u00F3n para ejecutar esta operaci\u00F3n.", + "DefaultErrorMessage403": "Usted no est\u00E1 autorizado!", + "DefaultErrorMessage403Detail": "Usted no puede hacer esta operaci\u00F3n!", + "DefaultErrorMessage404": "No se encontr\u00F3 el recurso!", + "DefaultErrorMessage404Detail": "El recurso solicitado no se encontr\u00F3 en el servidor!", "EntityNotFoundErrorMessage": "No hay una entidad {0} con el id = {1}!", "Error": "Error", - "AreYouSure": "¿Está seguro?", + "AreYouSure": "¿Est\u00E1 seguro?", "Cancel": "Cancelar", "Yes": "Si", "No": "No", @@ -30,14 +30,14 @@ "Welcome": "Bienvenido", "Login": "Iniciar session", "Register": "Registrarse", - "Logout": "Cerrar sessión", + "Logout": "Cerrar sessi\u00F3n", "Submit": "Enviar", - "Back": "Atrás", + "Back": "Atr\u00E1s", "PagerSearch": "Buscar", "PagerNext": "Siguiente", "PagerPrevious": "Anterior", "PagerFirst": "Primero", - "PagerLast": "Último", + "PagerLast": "\u00DCltimo", "PagerInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros", "PagerInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros", "PagerInfoFiltered": "(filtrado de un total de _MAX_ registros)", @@ -47,12 +47,12 @@ "ChangePassword": "Cambiar contraseña", "PersonalInfo": "My perfil", "AreYouSureYouWantToCancelEditingWarningMessage": "Tiene cambios sin guardar.", - "UnhandledException": "Excepción no controlada!", + "UnhandledException": "Excepci\u00F3n no controlada!", "401Message": "No autorizado", "403Message": "Prohibido", - "404Message": "La página no existe", + "404Message": "La p\u00E1gina no existe", "500Message": "Error interno del servidor", - "GoHomePage": "Ir a la página principal", + "GoHomePage": "Ir a la p\u00E1gina principal", "GoBack": "Atras" } } diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json index 87d1316a38..befab1cba8 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json @@ -2,33 +2,33 @@ "culture": "es", "texts": { "'{0}' and '{1}' do not match.": "'{0} \" y \"{1} \" no coinciden.", - "The {0} field is not a valid credit card number.": "{0} no es un número de tarjeta de crédito.", - "{0} is not valid.": "{0} no es válido.", - "The {0} field is not a valid e-mail address.": "{0} no es una dirección de correo electrónico válida.", - "The {0} field only accepts files with the following extensions: {1}": "{0} campo sólo acepta archivos con las siguientes extensiones: {1}", - "The field {0} must be a string or array type with a maximum length of '{1}'.": "El campo {0} debe ser una cadena o un array con una longitud máxima de '{1}'.", - "The field {0} must be a string or array type with a minimum length of '{1}'.": "El campo {0} debe ser una cadena o un array con una longitud mínima de '{1}'.", - "The {0} field is not a valid phone number.": "{0} no es un número de teléfono válido.", + "The {0} field is not a valid credit card number.": "{0} no es un n\u00FCmero de tarjeta de cr\u00E9dito.", + "{0} is not valid.": "{0} no es v\u00E1lido.", + "The {0} field is not a valid e-mail address.": "{0} no es una direcci\u00F3n de correo electr\u00F3nico v\u00E1lida.", + "The {0} field only accepts files with the following extensions: {1}": "{0} campo s\u00F3lo acepta archivos con las siguientes extensiones: {1}", + "The field {0} must be a string or array type with a maximum length of '{1}'.": "El campo {0} debe ser una cadena o un array con una longitud m\u00E1xima de '{1}'.", + "The field {0} must be a string or array type with a minimum length of '{1}'.": "El campo {0} debe ser una cadena o un array con una longitud m\u00EDnima de '{1}'.", + "The {0} field is not a valid phone number.": "{0} no es un n\u00FCmero de tel\u00E9fono v\u00E1lido.", "The field {0} must be between {1} and {2}.": "El campo {0} debe ser entre {1} y {2}.", - "The field {0} must match the regular expression '{1}'.": "El campo {0} debe coincidir con la expresión regular '{1}'.", + "The field {0} must match the regular expression '{1}'.": "El campo {0} debe coincidir con la expresi\u00F3n regular '{1}'.", "The {0} field is required.": "El campo {0} es obligatorio.", - "The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud máxima de {1}.", - "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud mínima de {2} y una longitud máxima de {1}.", - "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una dirección URL válida http, https o ftp.", - "The field {0} is invalid.": "El campo {0} no es válido.", - "ThisFieldIsNotAValidCreditCardNumber.": "Este campo no es un número de tarjeta de crédito.", - "ThisFieldIsNotValid.": "Este campo no es válido.", - "ThisFieldIsNotAValidEmailAddress.": "Este campo no es una dirección de correo electrónico válida.", - "ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "Este campo sólo acepta archivos con las siguientes extensiones: {0}", - "ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthoOf{0}": "Este campo debe ser una cadena o un array con una longitud máxima de '{0}'.", - "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo debe ser una cadena o un array con una longitud mínima de '{0}'.", - "ThisFieldIsNotAValidPhoneNumber.": "Este campo no es un número de teléfono válido.", + "The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud m\u00E1xima de {1}.", + "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud m\u00EDnima de {2} y una longitud m\u00E1xima de {1}.", + "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una direcci\u00F3n URL v\u00E1lida http, https o ftp.", + "The field {0} is invalid.": "El campo {0} no es v\u00E1lido.", + "ThisFieldIsNotAValidCreditCardNumber.": "Este campo no es un n\u00FCmero de tarjeta de cr\u00E9dito.", + "ThisFieldIsNotValid.": "Este campo no es v\u00E1lido.", + "ThisFieldIsNotAValidEmailAddress.": "Este campo no es una direcci\u00F3n de correo electr\u00F3nico v\u00E1lida.", + "ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}": "Este campo s\u00F3lo acepta archivos con las siguientes extensiones: {0}", + "ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthoOf{0}": "Este campo debe ser una cadena o un array con una longitud m\u00E1xima de '{0}'.", + "ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}": "Este campo debe ser una cadena o un array con una longitud m\u00EDnima de '{0}'.", + "ThisFieldIsNotAValidPhoneNumber.": "Este campo no es un n\u00FCmero de tel\u00E9fono v\u00E1lido.", "ThisFieldMustBeBetween{0}And{1}": "Este campo debe tener un valor entre {0} y {1}.", - "ThisFieldMustMatchTheRegularExpression{0}": "Este campo debe coincidir con la expresión regular '{0}'.", + "ThisFieldMustMatchTheRegularExpression{0}": "Este campo debe coincidir con la expresi\u00F3n regular '{0}'.", "ThisFieldIsRequired.": "Este campo es obligatorio.", - "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Este campo debe ser una cadena de caracteres con una longitud máxima de {0}.", - "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Este campo debe ser una cadena de caracteres con una longitud mínima de {1} y una longitud máxima de {0}.", - "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "Este campo no es una dirección URL válida http, https o ftp.", - "ThisFieldIsInvalid.": "Este campo no es válido." + "ThisFieldMustBeAStringWithAMaximumLengthOf{0}": "Este campo debe ser una cadena de caracteres con una longitud m\u00E1xima de {0}.", + "ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}": "Este campo debe ser una cadena de caracteres con una longitud m\u00EDnima de {1} y una longitud m\u00E1xima de {0}.", + "ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl": "Este campo no es una direcci\u00F3n URL v\u00E1lida http, https o ftp.", + "ThisFieldIsInvalid.": "Este campo no es v\u00E1lido." } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json index d9b29895b8..625ca51545 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json @@ -1,7 +1,7 @@ { "culture": "es", "texts": { - "USA": "Estados unidos de América", + "USA": "Estados unidos de Am\u00E9rica", "Brazil": "Brasil" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json index 04e85b5f12..df5bdbd8f7 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json @@ -1,7 +1,7 @@ { "culture": "es", "texts": { - "ThisFieldIsRequired": "El campo no puede estar vacío", - "MaxLenghtErrorMessage": "El campo puede tener un máximo de '{0}' caracteres" + "ThisFieldIsRequired": "El campo no puede estar vac\u00EDo", + "MaxLenghtErrorMessage": "El campo puede tener un m\u00E1ximo de '{0}' caracteres" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json index 7b68ff6f2c..6b45b36efd 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json @@ -4,7 +4,7 @@ "Hello {0}.": "Hola {0}.", "Car": "Auto", "CarPlural": "Autos", - "MaxLenghtErrorMessage": "El campo puede tener un máximo de '{0}' caracteres", + "MaxLenghtErrorMessage": "El campo puede tener un m\u00E1ximo de '{0}' caracteres", "Universe": "Universo", "FortyTwo": "Curenta y dos" } From 2689af617424c08ca5e24c95dc73f81eb3c69cc7 Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Mon, 23 Mar 2020 13:30:37 -0300 Subject: [PATCH 03/47] Spanish Localization Fixes --- framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj | 9 ++++++++- .../Volo.Abp.Localization/Volo.Abp.Localization.csproj | 7 +++++++ .../Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj | 7 +++++++ framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj | 7 +++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj index be953a1f26..a840763492 100644 --- a/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj +++ b/framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj @@ -25,7 +25,7 @@ - + @@ -35,4 +35,11 @@ + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index 0fd10d94ca..c785de3f18 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -29,4 +29,11 @@ + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj index 5236bf0404..f5272a2c31 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj +++ b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj @@ -23,4 +23,11 @@ + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj index acff7d004b..e11709841d 100644 --- a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj +++ b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj @@ -22,5 +22,12 @@ + + + + all + runtime; build; native; contentfiles; analyzers + + From 64e8590691a464bc5752c01a295c15178608343b Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Mon, 4 May 2020 17:22:37 -0300 Subject: [PATCH 04/47] Ignore package-lock.json --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index eb4dbedfae..9a855fd898 100644 --- a/.gitignore +++ b/.gitignore @@ -293,3 +293,10 @@ samples/MicroserviceDemo/applications/ConsoleClientDemo/Logs/logs.txt modules/docs/app/Volo.DocsTestApp/Logs/logs.txt framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Logs/logs.txt samples/MicroserviceDemo/microservices/TenantManagementService.Host/Logs/logs.txt +/modules/client-simulation/demo/Volo.ClientSimulation.Demo/package-lock.json +/samples/BookStore/src/Acme.BookStore.Web/package-lock.json +/samples/DashboardDemo/src/DashboardDemo.Web/package-lock.json +/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package-lock.json +/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package-lock.json +/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package-lock.json +/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/package-lock.json From 7293ce35c677ead6117a5eefe6eeb1dcca4bdae6 Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Mon, 4 May 2020 19:07:28 -0300 Subject: [PATCH 05/47] Change file to UTF-8 --- .../Volo/Abp/Emailing/Localization/es.json | 16 ++++---- .../Navigation/Localization/Resource/es.json | 2 +- .../Localization/Resources/AbpUi/es.json | 38 +++++++++---------- .../Volo/Abp/Validation/Localization/es.json | 4 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json index ae3a29f901..33c59be8b5 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/es.json @@ -1,23 +1,23 @@ { "culture": "es", "texts": { - "DisplayName:Abp.Mailing.DefaultFromAddress": "Direcci\u00F3n de env\u00EDo", - "DisplayName:Abp.Mailing.DefaultFromDisplayName": "Nombre de env\u00EDo", + "DisplayName:Abp.Mailing.DefaultFromAddress": "Dirección de envío", + "DisplayName:Abp.Mailing.DefaultFromDisplayName": "Nombre de envío", "DisplayName:Abp.Mailing.Smtp.Host": "Host", "DisplayName:Abp.Mailing.Smtp.Port": "Puerto", "DisplayName:Abp.Mailing.Smtp.UserName": "Nombre de usuario", - "DisplayName:Abp.Mailing.Smtp.Password": "Contrase\\00F1", + "DisplayName:Abp.Mailing.Smtp.Password": "Contraseña", "DisplayName:Abp.Mailing.Smtp.Domain": "Dominio", "DisplayName:Abp.Mailing.Smtp.EnableSsl": "Habilitar SSL", "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "Usar las credenciales por defecto", - "Description:Abp.Mailing.DefaultFromAddress": "La direcci\u00F3n de env\u00EDo por defecto", - "Description:Abp.Mailing.DefaultFromDisplayName": "El nombre de env\u00EDo por defecto", - "Description:Abp.Mailing.Smtp.Host": "El nombre o direcci\u00F3n del host para transacciones SMTP.", + "Description:Abp.Mailing.DefaultFromAddress": "La dirección de envío por defecto", + "Description:Abp.Mailing.DefaultFromDisplayName": "El nombre de envío por defecto", + "Description:Abp.Mailing.Smtp.Host": "El nombre o dirección del host para transacciones SMTP.", "Description:Abp.Mailing.Smtp.Port": "El puerto usado para transacciones SMTP.", "Description:Abp.Mailing.Smtp.UserName": "Nombre de usuario asociado a las credenciales.", "Description:Abp.Mailing.Smtp.Password": "La contraseña del ususario asociado a las credenciales.", "Description:Abp.Mailing.Smtp.Domain": "El dominio o equipo que valida las credenciales.", - "Description:Abp.Mailing.Smtp.EnableSsl": "Si SmtpClient usa Secure Sockets Layer (SSL) para encriptar la conecci\u00F3n.", - "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Si las credenciales por defecto se env\u00EDan con los request." + "Description:Abp.Mailing.Smtp.EnableSsl": "Si SmtpClient usa Secure Sockets Layer (SSL) para encriptar la conección.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "Si las credenciales por defecto se envían con los request." } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json index caa51f8d1d..0fc6660fac 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/es.json @@ -1,6 +1,6 @@ { "culture": "es", "texts": { - "Menu:Administration": "Administraci\u00F3n" + "Menu:Administration": "Administración" } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json index b52c56510b..be137f013b 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/es.json @@ -1,20 +1,20 @@ { "culture": "es", "texts": { - "InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", - "ValidationErrorMessage": "Su pedido no es válido!", - "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", - "DefaultErrorMessage": "Ocurrió un error!", - "DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", - "DefaultErrorMessage401": "Usted no ha iniciado sessión!", - "DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", - "DefaultErrorMessage403": "Usted no está autorizado!", - "DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", - "DefaultErrorMessage404": "No se encontró el recurso!", - "DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", + "InternalServerErrorMessage": "Ocurrió un error interno en su pedido!", + "ValidationErrorMessage": "Su pedido no es válido!", + "ValidationNarrativeErrorMessageTitle": "Los siguientes errores se encontraton durante la validación.", + "DefaultErrorMessage": "Ocurrió un error!", + "DefaultErrorMessageDetail": "El servidor no envió el detalle del error.", + "DefaultErrorMessage401": "Usted no ha iniciado sessión!", + "DefaultErrorMessage401Detail": "Debe iniciar sessión para ejecutar esta operación.", + "DefaultErrorMessage403": "Usted no está autorizado!", + "DefaultErrorMessage403Detail": "Usted no puede hacer esta operación!", + "DefaultErrorMessage404": "No se encontró el recurso!", + "DefaultErrorMessage404Detail": "El recurso solicitado no se encontró en el servidor!", "EntityNotFoundErrorMessage": "No hay una entidad {0} con el id = {1}!", "Error": "Error", - "AreYouSure": "¿Está seguro?", + "AreYouSure": "¿Está seguro?", "Cancel": "Cancelar", "Yes": "Si", "No": "No", @@ -30,14 +30,14 @@ "Welcome": "Bienvenido", "Login": "Iniciar session", "Register": "Registrarse", - "Logout": "Cerrar sessión", + "Logout": "Cerrar sessión", "Submit": "Enviar", - "Back": "Atrás", + "Back": "Atrás", "PagerSearch": "Buscar", "PagerNext": "Siguiente", "PagerPrevious": "Anterior", "PagerFirst": "Primero", - "PagerLast": "Último", + "PagerLast": "Último", "PagerInfo": "Mostrando desde _START_ hasta _END_ total _TOTAL_", "PagerInfo{0}{1}{2}": "Mostrando desde {0} hasta {1} total {2}", "PagerInfoEmpty": "Mostrando desde 0 hasta 0 de 0 registros", @@ -45,15 +45,15 @@ "NoDataAvailableInDatatable": "No hay datos", "PagerShowMenuEntries": "Mostrar _MENU_ registros", "DatatableActionDropdownDefaultText": "Acciones", - "ChangePassword": "Cambiar contraseña", + "ChangePassword": "Cambiar contraseña", "PersonalInfo": "My perfil", "AreYouSureYouWantToCancelEditingWarningMessage": "Tiene cambios sin guardar.", - "UnhandledException": "Excepción no controlada!", + "UnhandledException": "Excepción no controlada!", "401Message": "No autorizado", "403Message": "Prohibido", - "404Message": "La página no existe", + "404Message": "La página no existe", "500Message": "Error interno del servidor", - "GoHomePage": "Ir a la página principal", + "GoHomePage": "Ir a la página principal", "GoBack": "Atras" } } diff --git a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json index 1615d7db42..26097e0e87 100644 --- a/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json +++ b/framework/src/Volo.Abp.Validation/Volo/Abp/Validation/Localization/es.json @@ -1,4 +1,4 @@ -{ +{ "culture": "es", "texts": { "'{0}' and '{1}' do not match.": "'{0} \" y \"{1} \" no coinciden.", @@ -11,7 +11,7 @@ "The {0} field is not a valid phone number.": "{0} no es un número de teléfono válido.", "The field {0} must be between {1} and {2}.": "El campo {0} debe ser entre {1} y {2}.", "The field {0} must match the regular expression '{1}'.": "El campo {0} no coincide con el formato solicitado.", - "The {0} field is required.": "La {0} campo es obligatorio.", + "The {0} field is required.": "El {0} campo es obligatorio.", "The field {0} must be a string with a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud máxima de {1}.", "The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.": "El campo {0} debe ser una cadena con una longitud mínima de {2} y una longitud máxima de {1}.", "The {0} field is not a valid fully-qualified http, https, or ftp URL.": "El campo {0} no es una dirección URL válida http, https o ftp.", From 7f52cb3e09baa31cad987c9596d6a1f8ea52d48a Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Tue, 5 May 2020 12:31:36 -0300 Subject: [PATCH 06/47] Spanish localization for Account Module --- .../Account/Localization/Resources/es.json | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json new file mode 100644 index 0000000000..43554b2311 --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/es.json @@ -0,0 +1,45 @@ +{ + "culture": "es", + "texts": { + "UserName": "Nombre de usuario", + "EmailAddress": "Dirección de correo electrónico", + "UserNameOrEmailAddress": "Nombre de usuario o dirección de correo electrónico", + "Password": "Contraseña", + "RememberMe": "Recuérdame", + "UseAnotherServiceToLogin": "Usar otro servicio para iniciar sesión", + "UserLockedOutMessage": "La cuenta de usuario ha sido bloqueada debido a los intentos de inicio de sesión no válidos. Por favor, espere unos minutos y vuelve a intentarlo.", + "InvalidUserNameOrPassword": "El nombre de usuario o la contraseña no son válidos", + "LoginIsNotAllowed": "No está permitido el inicio de sesión! Usted tendrá que confirmar su correo electrónico o número de teléfono.", + "SelfRegistrationDisabledMessage": "El autoregistro de usuario está deshabilitado para esta aplicación. Póngase en contacto con el administrador de la aplicación para registrar un nuevo usuario.", + "LocalLoginDisabledMessage": "No está habilitado el login local para esta aplicación.", + "Login": "Iniciar sesión", + "Cancel": "Cancelar", + "Register": "Registrarse", + "AreYouANewUser": "¿Usted es un usuario nuevo?", + "AlreadyRegistered": "¿Está registrado en esta aplicación?", + "InvalidLoginRequest": "Solicitud de inicio de sesión no válido", + "ThereAreNoLoginSchemesConfiguredForThisClient": "No hay ningún esquema de inicio de sesión configurado para este cliente.", + "LogInUsingYourProviderAccount": "Inicia sesión con tu cuenta de {0} ", + "DisplayName:CurrentPassword": "Contraseña actual", + "DisplayName:NewPassword": "Nueva contraseña", + "DisplayName:NewPasswordConfirm": "Confirmar nueva contraseña", + "PasswordChangedMessage": "Su contraseña ha sido cambiada con éxito.", + "DisplayName:UserName": "Nombre de usuario", + "DisplayName:Email": "Correo electrónico", + "DisplayName:Name": "Nombre", + "DisplayName:Surname": "Apellido", + "DisplayName:Password": "Contraseña", + "DisplayName:EmailAddress": "Dirección de correo electrónico", + "DisplayName:PhoneNumber": "Número de teléfono", + "PersonalSettings": "Configuración Personal", + "PersonalSettingsSaved": "Ajustes personales guardados", + "PasswordChanged": "Cambiar la contraseña", + "NewPasswordConfirmFailed": "Por favor, confirme la nueva contraseña.", + "Manage": "Administrar", + "ManageYourProfile": "Gestionar su perfil", + "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "Habilitar el registro de usuario", + "Description:Abp.Account.IsSelfRegistrationEnabled": "Si está habilitado los usuarios pueden crear una cuenta mediante el registro automático.", + "DisplayName:Abp.Account.EnableLocalLogin": "Habilitar cuenta local", + "Description:Abp.Account.EnableLocalLogin": "Indica que el servidor permite iniciar sessión con una cuenta local." + } +} \ No newline at end of file From 0c84e24ffba5dbb8c3da83e25153745c23934916 Mon Sep 17 00:00:00 2001 From: ChangYinShung Date: Tue, 5 May 2020 23:58:57 +0800 Subject: [PATCH 07/47] Update Emailing localized for zh-hant --- .../Volo/Abp/Emailing/Localization/zh-Hant.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json index a66a6d2ff8..2bf2fa5240 100644 --- a/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json +++ b/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Localization/zh-Hant.json @@ -10,14 +10,16 @@ "DisplayName:Abp.Mailing.Smtp.Domain": "網域", "DisplayName:Abp.Mailing.Smtp.EnableSsl": "啟用SSL", "DisplayName:Abp.Mailing.Smtp.UseDefaultCredentials": "使用預設憑證", - "Description:Abp.Mailing.DefaultFromAddress": "預設的發信者地址.", - "Description:Abp.Mailing.DefaultFromDisplayName": "預設的發信者名稱.", - "Description:Abp.Mailing.Smtp.Host": "SMTP 服務的主機名稱或主機IP位址.", + "Description:Abp.Mailing.DefaultFromAddress": "預設發信者地址.", + "Description:Abp.Mailing.DefaultFromDisplayName": "預設發信者名稱.", + "Description:Abp.Mailing.Smtp.Host": "SMTP 服務的主機名稱或IP位址.", "Description:Abp.Mailing.Smtp.Port": "SMTP 服務的埠號.", "Description:Abp.Mailing.Smtp.UserName": "憑證使用者名稱.", "Description:Abp.Mailing.Smtp.Password": "憑證使用者密碼.", - "Description:Abp.Mailing.Smtp.Domain": "驗證憑證的網域名稱或電腦名稱.", - "Description:Abp.Mailing.Smtp.EnableSsl": "設定 SmtpClient 是否使用安全通訊協定.", - "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "設定是否使用預設憑證." + "Description:Abp.Mailing.Smtp.Domain": "驗證憑證的網域或電腦名稱.", + "Description:Abp.Mailing.Smtp.EnableSsl": "指定 SmtpClient 是否使用安全通訊(SSL)協定.", + "Description:Abp.Mailing.Smtp.UseDefaultCredentials": "設定是否使用預設憑證.", + "TextTemplate:StandardEmailTemplates.Layout": "預設的電子郵件樣式", + "TextTemplate:StandardEmailTemplates.Message": "電子郵件內的文字訊息" } -} \ No newline at end of file +} From 281008fb64daeb77b7620d5f3138e0fda9985eeb Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 7 May 2020 09:59:58 +0200 Subject: [PATCH 08/47] Added onOpen callback, to trigger when the modal opens. --- .../bootstrap/modal-manager.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js index 3998f2df7f..21a8e0ce21 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js @@ -1,4 +1,4 @@ -/** +/** * TODO: Document & prepare typescript definitions * TODO: Refactor & test more */ @@ -49,6 +49,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f var _publicApi = null; var _args = null; + var _onOpenCallbacks = new CallbackList(); var _onCloseCallbacks = new CallbackList(); var _onResultCallbacks = new CallbackList(); @@ -106,6 +107,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f } $firstVisibleInput.focus(); + _onOpenCallbacks.triggerAll(_publicApi); }); var modalClass = abp.modals[options.modalClass]; @@ -147,6 +149,10 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f _$modal.modal('hide'); }; + var _onOpen = function (onOpenCallback) { + _onOpenCallbacks.add(onOpenCallback); + }; + var _onClose = function (onCloseCallback) { _onCloseCallbacks.add(onCloseCallback); }; @@ -188,6 +194,8 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f _onResultCallbacks.triggerAll(_publicApi, arguments); }, + onOpen: _onOpen, + onClose: _onClose, onResult: _onResult @@ -198,4 +206,4 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f }; })(); -})(jQuery); \ No newline at end of file +})(jQuery); From 1a23032c8745a6577a71d87ede57fa6a922e88d1 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 7 May 2020 22:01:33 +0800 Subject: [PATCH 09/47] Add multiple StaticWebAssetsFileProvide --- .../VirtualFileSystem/WebContentFileProvider.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs index 4fab6d0001..898eae546f 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/WebContentFileProvider.cs @@ -99,17 +99,14 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem _virtualFileProvider }; - if (_hostingEnvironment.IsDevelopment() && + if (_hostingEnvironment.IsDevelopment() && _hostingEnvironment.WebRootFileProvider is CompositeFileProvider compositeFileProvider) { - var staticWebAssetsFileProvider = compositeFileProvider + var staticWebAssetsFileProviders = compositeFileProvider .FileProviders - .FirstOrDefault(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")); + .Where(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")).ToList(); - if (staticWebAssetsFileProvider != null) - { - fileProviders.Add(staticWebAssetsFileProvider); - } + fileProviders.AddRange(staticWebAssetsFileProviders); } return new CompositeFileProvider( @@ -127,4 +124,4 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem return Options.AllowedExtraWebContentFileExtensions.Any(e => path.EndsWith(e, StringComparison.OrdinalIgnoreCase)); } } -} \ No newline at end of file +} From 748ec67c49a645c7f4ac6e85e6c506e095c3a5a5 Mon Sep 17 00:00:00 2001 From: xyfy Date: Fri, 8 May 2020 15:17:51 +0800 Subject: [PATCH 10/47] Update Customizing-Application-Modules-Overriding-Services.md the manager has a new construct define --- ...Application-Modules-Overriding-Services.md | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 7f0c0502ea..8d64b031ec 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -106,30 +106,32 @@ You could completely **re-write** the entire business logic for a user creation [ExposeServices(typeof(IdentityUserManager))] public class MyIdentityUserManager : IdentityUserManager { - public MyIdentityUserManager( - IdentityUserStore store, - IOptions optionsAccessor, - IPasswordHasher passwordHasher, - IEnumerable> userValidators, - IEnumerable> passwordValidators, - ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, - IServiceProvider services, - ILogger logger, - ICancellationTokenProvider cancellationTokenProvider - ) : base( - store, - optionsAccessor, - passwordHasher, - userValidators, - passwordValidators, - keyNormalizer, - errors, - services, - logger, - cancellationTokenProvider) - { - } + public MyIdentityUserManager( + IdentityUserStore store, + IIdentityRoleRepository roleRepository, + IIdentityUserRepository userRepository, + IOptions optionsAccessor, + IPasswordHasher passwordHasher, + IEnumerable> userValidators, + IEnumerable> passwordValidators, + ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, + IServiceProvider services, + ILogger logger, + ICancellationTokenProvider cancellationTokenProvider) : + base(store, + roleRepository, + userRepository, + optionsAccessor, + passwordHasher, + userValidators, + passwordValidators, + keyNormalizer, + errors, + services, + logger, + cancellationTokenProvider) + { + } public override async Task CreateAsync(IdentityUser user) { From f13630d73b2cc0ec3de320885ddb4abb98bfadbc Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 8 May 2020 13:34:55 +0300 Subject: [PATCH 11/47] Update Azure-Active-Directory-Authentication-MVC.md added azureAD 2 more error solutions on FAQ --- ...ure-Active-Directory-Authentication-MVC.md | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 10b1e05a4a..1e61ac7632 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -171,19 +171,32 @@ You can find the source code of the completed example [here](https://github.com/ your **Redirect URI** of your application in azure portal must be with domain like `https://localhost:44320/signin-azuread-oidc`, not only `/signin-azuread-oidc`. +* Help! I keep getting ***AADSTS700051: The response_type 'token' is not enabled for the application.*** error! + + * This error occurs when you request **token** (access token) along with **id_token** without enabling Access tokens on Azure portal app registrations. Simply tick **Access tokens** checkbox located on top of ID tokens to be able to request token aswell. + * Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! - * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add - + * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add + ````csharp options.Scope.Add("email"); ```` - + to your openid configuration. +* Help! I keep getting ***AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret*** error! + + * This error occurs when you request **code** along with **id_token**. You need to add **client secret** on azure portal app registrations, under **Certificates & secrets** menu. Afterwards, you need to add openid configuration option like: + + ````csharp + options.ClientSecret = "Value of your secret on azure portal"; + ```` + * How can I **debug/watch** which claims I get before they get mapped? + * You can add a simple event under openid configuration to debug before mapping like: ````csharp @@ -194,7 +207,6 @@ You can find the source code of the completed example [here](https://github.com/ }); ```` - ## See Also * [How to Customize the Login Page for MVC / Razor Page Applications](Customize-Login-Page-MVC.md). From 78bb3112cecf30c908be27d2a5c51cfa4bb6b2d5 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 8 May 2020 13:38:47 +0300 Subject: [PATCH 12/47] Update Azure-Active-Directory-Authentication-MVC.md clumped AzureAD errors --- ...ure-Active-Directory-Authentication-MVC.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 1e61ac7632..5891a764e0 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -158,6 +158,17 @@ You can find the source code of the completed example [here](https://github.com/ ```` +* Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! + + +* This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add + + ````csharp + options.Scope.Add("email"); + ```` + + to your openid configuration. + * Help! I keep getting ***AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application*** error! * If you set your **CallbackPath** in appsettings as: @@ -175,17 +186,6 @@ You can find the source code of the completed example [here](https://github.com/ * This error occurs when you request **token** (access token) along with **id_token** without enabling Access tokens on Azure portal app registrations. Simply tick **Access tokens** checkbox located on top of ID tokens to be able to request token aswell. -* Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! - - - * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add - - ````csharp - options.Scope.Add("email"); - ```` - - to your openid configuration. - * Help! I keep getting ***AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret*** error! * This error occurs when you request **code** along with **id_token**. You need to add **client secret** on azure portal app registrations, under **Certificates & secrets** menu. Afterwards, you need to add openid configuration option like: From 497525d528a7fe7d0978ab5820e3a3f648787f33 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 8 May 2020 13:45:01 +0300 Subject: [PATCH 13/47] Update Azure-Active-Directory-Authentication-MVC.md empty space fix --- .../Azure-Active-Directory-Authentication-MVC.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 5891a764e0..349fd6ee68 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -158,15 +158,15 @@ You can find the source code of the completed example [here](https://github.com/ ```` -* Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! +* Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add - ````csharp - options.Scope.Add("email"); - ```` - + ````csharp + options.Scope.Add("email"); + ```` + to your openid configuration. * Help! I keep getting ***AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application*** error! From c2d06d734b7b901152129cca8fe6a5028f20f3e4 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 8 May 2020 13:53:19 +0300 Subject: [PATCH 14/47] Update Azure-Active-Directory-Authentication-MVC.md typora typos fix --- ...ure-Active-Directory-Authentication-MVC.md | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 349fd6ee68..428db9f4c0 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -1,3 +1,11 @@ + + + + + + + + # How to Use the Azure Active Directory Authentication for MVC / Razor Page Applications This guide demonstrates how to integrate AzureAD to an ABP application that enables users to sign in using OAuth 2.0 with credentials from **Azure Active Directory**. @@ -161,14 +169,14 @@ You can find the source code of the completed example [here](https://github.com/ * Help! I am getting ***System.ArgumentNullException: Value cannot be null. (Parameter 'userName')*** error! -* This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add + * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add - ````csharp + ````csharp options.Scope.Add("email"); - ```` - - to your openid configuration. - + ```` + + to your openid configuration. + * Help! I keep getting ***AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application*** error! * If you set your **CallbackPath** in appsettings as: @@ -197,15 +205,15 @@ You can find the source code of the completed example [here](https://github.com/ * How can I **debug/watch** which claims I get before they get mapped? - * You can add a simple event under openid configuration to debug before mapping like: + * You can add a simple event under openid configuration to debug before mapping like: - ````csharp - options.Events.OnTokenValidated = (async context => - { - var claimsFromOidcProvider = context.Principal.Claims.ToList(); - await Task.CompletedTask; - }); - ```` + ````csharp + options.Events.OnTokenValidated = (async context => + { + var claimsFromOidcProvider = context.Principal.Claims.ToList(); + await Task.CompletedTask; + }); + ```` ## See Also From 8da0851b12718621e43d575cf201147d2bc55907 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 8 May 2020 14:00:31 +0300 Subject: [PATCH 15/47] Update Azure-Active-Directory-Authentication-MVC.md notepad fix of mistakes --- ...ure-Active-Directory-Authentication-MVC.md | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 428db9f4c0..8b31689795 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -1,11 +1,3 @@ - - - - - - - - # How to Use the Azure Active Directory Authentication for MVC / Razor Page Applications This guide demonstrates how to integrate AzureAD to an ABP application that enables users to sign in using OAuth 2.0 with credentials from **Azure Active Directory**. @@ -188,7 +180,7 @@ You can find the source code of the completed example [here](https://github.com/ } ```` - your **Redirect URI** of your application in azure portal must be with domain like `https://localhost:44320/signin-azuread-oidc`, not only `/signin-azuread-oidc`. + your **Redirect URI** of your application in azure portal must be with domain like `https://localhost:44320/signin-azuread-oidc`, not only `/signin-azuread-oidc`. * Help! I keep getting ***AADSTS700051: The response_type 'token' is not enabled for the application.*** error! @@ -204,16 +196,15 @@ You can find the source code of the completed example [here](https://github.com/ * How can I **debug/watch** which claims I get before they get mapped? + * You can add a simple event under openid configuration to debug before mapping like: - * You can add a simple event under openid configuration to debug before mapping like: - - ````csharp - options.Events.OnTokenValidated = (async context => - { - var claimsFromOidcProvider = context.Principal.Claims.ToList(); - await Task.CompletedTask; - }); - ```` + ````csharp + options.Events.OnTokenValidated = (async context => + { + var claimsFromOidcProvider = context.Principal.Claims.ToList(); + await Task.CompletedTask; + }); + ```` ## See Also From c93cb3500c801293ed579593781a364f0c81be05 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 8 May 2020 14:02:57 +0300 Subject: [PATCH 16/47] Update Azure-Active-Directory-Authentication-MVC.md empty space fix --- docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md index 8b31689795..434d5f8bac 100644 --- a/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md +++ b/docs/en/How-To/Azure-Active-Directory-Authentication-MVC.md @@ -163,9 +163,9 @@ You can find the source code of the completed example [here](https://github.com/ * This occurs when you use Azure Authority **v2.0 endpoint** without requesting `email` scope. [Abp checks unique email to create user](https://github.com/abpframework/abp/blob/037ef9abe024c03c1f89ab6c933710bcfe3f5c93/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L208). Simply add - ````csharp - options.Scope.Add("email"); - ```` + ````csharp + options.Scope.Add("email"); + ```` to your openid configuration. From c8b78824fa844cc4b2c7ef47cd3ce2b236bd4fcb Mon Sep 17 00:00:00 2001 From: Alper Ebicoglu Date: Fri, 8 May 2020 14:34:22 +0300 Subject: [PATCH 17/47] Refactor AbpIoSourceCodeStore --- .../Cli/ProjectBuilding/AbpIoSourceCodeStore.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs index ccc0b0e62d..66843bea4f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs @@ -54,14 +54,8 @@ namespace Volo.Abp.Cli.ProjectBuilding string templateSource = null) { DirectoryHelper.CreateIfNotExists(CliPaths.TemplateCache); + var latestVersion = await GetLatestSourceCodeVersionAsync(name, type); - string latestVersion; - -#if DEBUG - latestVersion = await GetLatestSourceCodeVersionAsync(name, type, $"{CliUrls.WwwAbpIoProduction}api/download/{type}/get-version/"); -#else - latestVersion = await GetLatestSourceCodeVersionAsync(name, type); -#endif if (version == null) { if (latestVersion == null) @@ -84,13 +78,7 @@ namespace Volo.Abp.Cli.ProjectBuilding version = latestVersion; } - string nugetVersion; - -#if DEBUG - nugetVersion = version; -#else - nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version; -#endif + var nugetVersion = (await GetTemplateNugetVersionAsync(name, type, version)) ?? version; if (!string.IsNullOrWhiteSpace(templateSource) && !IsNetworkSource(templateSource)) { From 6c934e53e6f1773a8782ae4084b3c38e69fcfc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 May 2020 01:08:52 +0300 Subject: [PATCH 18/47] Resolved #3880: Obsolete app.UseMvcWithDefaultRouteAndArea() and introduce app.UseConfiguredEndpoints(). --- ...pNetCoreMvcApplicationBuilderExtensions.cs | 10 +--- .../AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs | 12 +++++ ...tCoreMvcConventionalDependencyRegistrar.cs | 9 +++- ...pAspNetCoreApplicationBuilderExtensions.cs | 47 +++++++++++++++++++ .../Routing/AbpEndpointRouterOptions.cs | 15 ++++++ .../Routing/EndpointRouteBuilderContext.cs | 18 +++++++ 6 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs create mode 100644 framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs create mode 100644 framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs index 9a19337c5f..daa5183709 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Microsoft/AspNetCore/Builder/AbpAspNetCoreMvcApplicationBuilderExtensions.cs @@ -15,18 +15,12 @@ namespace Microsoft.AspNetCore.Builder /// The . /// Additional action to configure routes /// A reference to this instance after the operation has completed. + [Obsolete("Use app.UseConfiguredEndpoints(...) extension method instead!")] public static IApplicationBuilder UseMvcWithDefaultRouteAndArea( this IApplicationBuilder app, Action additionalConfigurationAction = null) { - return app.UseEndpoints(endpoints => - { - endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}"); - endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); - endpoints.MapRazorPages(); - - additionalConfigurationAction?.Invoke(endpoints); - }); + return app.UseConfiguredEndpoints(additionalConfigurationAction); } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index 00ba8423b3..ee81e0a22e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -13,10 +13,12 @@ using System.Collections.Generic; using System.Linq; using System.Net; using System.Reflection; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; +using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Localization; using Volo.Abp.ApiVersioning; @@ -165,6 +167,16 @@ namespace Volo.Abp.AspNetCore.Mvc { mvcOptions.AddAbp(context.Services); }); + + Configure(options => + { + options.EndpointConfigureActions.Add(context => + { + context.Endpoints.MapControllerRoute("defaultWithArea", "{area}/{controller=Home}/{action=Index}/{id?}"); + context.Endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}"); + context.Endpoints.MapRazorPages(); + }); + }); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs index 526470b3ad..2ef536db4d 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DependencyInjection/AbpAspNetCoreMvcConventionalDependencyRegistrar.cs @@ -29,8 +29,13 @@ namespace Volo.Abp.AspNetCore.Mvc.DependencyInjection foreach (var serviceType in serviceTypes) { - var serviceDescriptor = ServiceDescriptor.Describe(serviceType, type, lifeTime); - services.Add(serviceDescriptor); + services.Add( + ServiceDescriptor.Describe( + serviceType, + type, + lifeTime + ) + ); } } diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs new file mode 100644 index 0000000000..1ce443c37f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs @@ -0,0 +1,47 @@ +using System; +using System.Linq; +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace Microsoft.AspNetCore.Builder +{ + public static class AbpAspNetCoreApplicationBuilderExtensions + { + /// + /// Maps endpoints configured with the . + /// It internally uses the standard app.UseEndpoints(...) method. + /// + /// The application builder + /// Additional (and optional) endpoint configuration + /// + public static IApplicationBuilder UseConfiguredEndpoints( + this IApplicationBuilder app, + Action additionalConfigurationAction = null) + { + var options = app.ApplicationServices + .GetRequiredService>() + .Value; + + if (!options.EndpointConfigureActions.Any()) + { + return app; + } + + return app.UseEndpoints(endpoints => + { + using (var scope = app.ApplicationServices.CreateScope()) + { + var context = new EndpointRouteBuilderContext(endpoints, scope.ServiceProvider); + + foreach (var configureAction in options.EndpointConfigureActions) + { + configureAction(context); + } + + additionalConfigurationAction?.Invoke(endpoints); + } + }); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs new file mode 100644 index 0000000000..85c81a7949 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/AbpEndpointRouterOptions.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Routing +{ + public class AbpEndpointRouterOptions + { + public List> EndpointConfigureActions { get; } + + public AbpEndpointRouterOptions() + { + EndpointConfigureActions = new List>(); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs new file mode 100644 index 0000000000..80f25d2d38 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Routing/EndpointRouteBuilderContext.cs @@ -0,0 +1,18 @@ +using System; + +namespace Microsoft.AspNetCore.Routing +{ + public class EndpointRouteBuilderContext + { + public IEndpointRouteBuilder Endpoints { get; } + public IServiceProvider ScopeServiceProvider { get; } + + public EndpointRouteBuilderContext( + IEndpointRouteBuilder endpoints, + IServiceProvider scopeServiceProvider) + { + Endpoints = endpoints; + ScopeServiceProvider = scopeServiceProvider; + } + } +} \ No newline at end of file From 2d4ab63deb3e272fb65c54b76001ee61e553147c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 May 2020 01:16:56 +0300 Subject: [PATCH 19/47] #2747: Initial SignalR Package --- framework/Volo.Abp.sln | 9 +- .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 +++++ .../Properties/launchSettings.json | 27 ++++ .../Volo.Abp.AspNetCore.SignalR.csproj | 23 ++++ .../SignalR/AbpAspNetCoreSignalRModule.cs | 115 ++++++++++++++++++ .../AbpSignalRConventionalRegistrar.cs | 43 +++++++ .../AspNetCore/SignalR/AbpSignalROptions.cs | 14 +++ .../Volo/Abp/AspNetCore/SignalR/HubConfig.cs | 43 +++++++ .../AspNetCore/SignalR/HubRouteAttribute.cs | 33 +++++ nupkg/common.ps1 | 1 + 11 files changed, 340 insertions(+), 1 deletion(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index 5d6f3e99a2..3ff151439f 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -283,7 +283,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TextTemplating", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TextTemplating.Tests", "test\Volo.Abp.TextTemplating.Tests\Volo.Abp.TextTemplating.Tests.csproj", "{251C7FD3-D313-4BCE-8068-352EC7EEA275}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Validation.Abstractions", "src\Volo.Abp.Validation.Abstractions\Volo.Abp.Validation.Abstractions.csproj", "{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Validation.Abstractions", "src\Volo.Abp.Validation.Abstractions\Volo.Abp.Validation.Abstractions.csproj", "{FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.SignalR", "src\Volo.Abp.AspNetCore.SignalR\Volo.Abp.AspNetCore.SignalR.csproj", "{B64FCE08-E9D2-4984-BF12-FE199F257416}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -847,6 +849,10 @@ Global {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Debug|Any CPU.Build.0 = Debug|Any CPU {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Release|Any CPU.ActiveCfg = Release|Any CPU {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3}.Release|Any CPU.Build.0 = Release|Any CPU + {B64FCE08-E9D2-4984-BF12-FE199F257416}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B64FCE08-E9D2-4984-BF12-FE199F257416}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B64FCE08-E9D2-4984-BF12-FE199F257416}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B64FCE08-E9D2-4984-BF12-FE199F257416}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -991,6 +997,7 @@ Global {9E53F91F-EACD-4191-A487-E727741F1311} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {251C7FD3-D313-4BCE-8068-352EC7EEA275} = {447C8A77-E5F0-4538-8687-7383196D04EA} {FA5D1D6A-2A05-4A3D-99C1-2B6C1D1F99A3} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {B64FCE08-E9D2-4984-BF12-FE199F257416} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml new file mode 100644 index 0000000000..be0de3a908 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json b/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json new file mode 100644 index 0000000000..418c7f2621 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53900/", + "sslPort": 44362 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.SignalR": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj new file mode 100644 index 0000000000..f4c833cb90 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo.Abp.AspNetCore.SignalR.csproj @@ -0,0 +1,23 @@ + + + + + + + netcoreapp3.1 + Volo.Abp.AspNetCore.SignalR + Volo.Abp.AspNetCore.SignalR + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + true + Library + + + + + + + + diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs new file mode 100644 index 0000000000..e26de184af --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http.Connections; +using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AspNetCore.SignalR +{ + [DependsOn( + typeof(AbpAspNetCoreModule) + )] + public class AbpAspNetCoreSignalRModule : AbpModule + { + private static readonly MethodInfo MapHubGenericMethodInfo = + typeof(AbpAspNetCoreSignalRModule) + .GetMethod("MapHub", BindingFlags.Static | BindingFlags.NonPublic); + + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddConventionalRegistrar(new AbpSignalRConventionalRegistrar()); + + AutoAddHubTypes(context.Services); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddSignalR(); + + Configure(options => + { + options.EndpointConfigureActions.Add(endpointContext => + { + var signalROptions = endpointContext + .ScopeServiceProvider + .GetRequiredService>() + .Value; + + foreach (var hubConfig in signalROptions.Hubs) + { + MapHubType( + hubConfig.HubType, + endpointContext.Endpoints, + hubConfig.RoutePattern, + opts => + { + foreach (var configureAction in hubConfig.ConfigureActions) + { + configureAction(opts); + } + } + ); + } + }); + }); + } + + private void AutoAddHubTypes(IServiceCollection services) + { + var hubTypes = new List(); + + services.OnRegistred(context => + { + if (typeof(Hub).IsAssignableFrom(context.ImplementationType)) + { + hubTypes.Add(context.ImplementationType); + } + }); + + services.Configure(options => + { + foreach (var hubType in hubTypes) + { + options.Hubs.Add(HubConfig.Create(hubType)); + } + }); + } + + private void MapHubType( + Type hubType, + IEndpointRouteBuilder endpoints, + string pattern, + Action configureOptions) + { + MapHubGenericMethodInfo + .MakeGenericMethod(hubType) + .Invoke( + this, + new object[] + { + endpoints, + pattern, + configureOptions + } + ); + } + + // ReSharper disable once UnusedMember.Local (used via reflection) + private static void MapHub( + IEndpointRouteBuilder endpoints, + string pattern, + Action configureOptions) + where THub : Hub + { + endpoints.MapHub( + pattern, + configureOptions + ); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs new file mode 100644 index 0000000000..9dcb46d6bc --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRConventionalRegistrar.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.SignalR +{ + public class AbpSignalRConventionalRegistrar : ConventionalRegistrarBase + { + public override void AddType(IServiceCollection services, Type type) + { + if (IsConventionalRegistrationDisabled(type)) + { + return; + } + + if (!IsHub(type)) + { + return; + } + + var serviceTypes = ExposedServiceExplorer.GetExposedServices(type); + + TriggerServiceExposing(services, type, serviceTypes); + + foreach (var serviceType in serviceTypes) + { + services.Add( + ServiceDescriptor.Describe( + serviceType, + type, + ServiceLifetime.Transient + ) + ); + } + } + + private static bool IsHub(Type type) + { + return typeof(Hub).IsAssignableFrom(type); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs new file mode 100644 index 0000000000..c0a07a2ea3 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalROptions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.SignalR +{ + public class AbpSignalROptions + { + public List Hubs { get; } + + public AbpSignalROptions() + { + Hubs = new List(); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs new file mode 100644 index 0000000000..59c9342fce --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubConfig.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using JetBrains.Annotations; +using Microsoft.AspNetCore.Http.Connections; +using Microsoft.AspNetCore.SignalR; + +namespace Volo.Abp.AspNetCore.SignalR +{ + public class HubConfig + { + [NotNull] + public Type HubType { get; } + + [NotNull] + public string RoutePattern { get; set; } + + [NotNull] + public List> ConfigureActions { get; set; } + + public HubConfig( + [NotNull] Type hubType, + [NotNull] string routePattern) + { + HubType = Check.NotNull(hubType, nameof(hubType)); + RoutePattern = Check.NotNullOrWhiteSpace(routePattern, nameof(routePattern)); + ConfigureActions = new List>(); + } + + public static HubConfig Create() + where THub : Hub + { + return Create(typeof(THub)); + } + + public static HubConfig Create(Type hubType) + { + return new HubConfig( + hubType, + HubRouteAttribute.GetRoutePattern(hubType) + ); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs new file mode 100644 index 0000000000..5de916a89d --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/HubRouteAttribute.cs @@ -0,0 +1,33 @@ +using System; +using System.Reflection; +using Microsoft.AspNetCore.SignalR; + +namespace Volo.Abp.AspNetCore.SignalR +{ + public class HubRouteAttribute : Attribute + { + public string RoutePattern { get; set; } + + public HubRouteAttribute(string routePattern) + { + RoutePattern = routePattern; + } + + public static string GetRoutePattern() + where THub : Hub + { + return GetRoutePattern(typeof(THub)); + } + + public static string GetRoutePattern(Type hubType) + { + var routeAttribute = hubType.GetSingleAttributeOrNull(); + if (routeAttribute != null) + { + return routeAttribute.RoutePattern; + } + + return "/signalr-hubs/" + hubType.Name.RemovePostFix("Hub").ToKebabCase(); + } + } +} \ No newline at end of file diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index 6dfe0041aa..661f630a0b 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -41,6 +41,7 @@ $projects = ( "framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", "framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets", "framework/src/Volo.Abp.AspNetCore.Serilog", + "framework/src/Volo.Abp.AspNetCore.SignalR", "framework/src/Volo.Abp.AspNetCore.TestBase", "framework/src/Volo.Abp.Auditing", "framework/src/Volo.Abp.Authorization", From 0ee2783933371ccd1c13db97a1db1dc3cbd78a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 May 2020 01:45:43 +0300 Subject: [PATCH 20/47] Create AbpHub and AbpSignalRUserIdProvider --- .../Volo/Abp/AspNetCore/Mvc/AbpController.cs | 6 +- .../Volo/Abp/AspNetCore/SignalR/AbpHub.cs | 135 ++++++++++++++++++ .../SignalR/AbpSignalRUserIdProvider.cs | 21 +++ 3 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs create mode 100644 framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs index c3e5c61f36..2a3a25373e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs @@ -75,6 +75,9 @@ namespace Volo.Abp.AspNetCore.Mvc public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); private ILoggerFactory _loggerFactory; + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); private ICurrentUser _currentUser; @@ -118,8 +121,5 @@ namespace Volo.Abp.AspNetCore.Mvc { ModelValidator?.Validate(ModelState); } - - protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); } } diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs new file mode 100644 index 0000000000..a1dc1437ea --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs @@ -0,0 +1,135 @@ +using System; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Timing; +using Volo.Abp.Users; + +namespace Volo.Abp.AspNetCore.SignalR +{ + public abstract class AbpHub : Hub + { + public IServiceProvider ServiceProvider { get; set; } + protected readonly object ServiceProviderLock = new object(); + + protected TService LazyGetRequiredService(ref TService reference) + => LazyGetRequiredService(typeof(TService), ref reference); + + protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference) + { + if (reference == null) + { + lock (ServiceProviderLock) + { + if (reference == null) + { + reference = (TRef)ServiceProvider.GetRequiredService(serviceType); + } + } + } + + return reference; + } + + public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + private ILoggerFactory _loggerFactory; + + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + + public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + private ICurrentUser _currentUser; + + public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + private ICurrentTenant _currentTenant; + + public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + private IAuthorizationService _authorizationService; + + public IClock Clock => LazyGetRequiredService(ref _clock); + private IClock _clock; + + public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + private IStringLocalizerFactory _stringLocalizerFactory; + + public IStringLocalizer L => _localizer ?? (_localizer = StringLocalizerFactory.Create(LocalizationResource)); + private IStringLocalizer _localizer; + + protected Type LocalizationResource + { + get => _localizationResource; + set + { + _localizationResource = value; + _localizer = null; + } + } + private Type _localizationResource = typeof(DefaultResource); + } + + public abstract class AbpHub : Hub + where T : class + { + public IServiceProvider ServiceProvider { get; set; } + protected readonly object ServiceProviderLock = new object(); + + protected TService LazyGetRequiredService(ref TService reference) + => LazyGetRequiredService(typeof(TService), ref reference); + + protected TRef LazyGetRequiredService(Type serviceType, ref TRef reference) + { + if (reference == null) + { + lock (ServiceProviderLock) + { + if (reference == null) + { + reference = (TRef)ServiceProvider.GetRequiredService(serviceType); + } + } + } + + return reference; + } + + public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + private ILoggerFactory _loggerFactory; + + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + + public ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser); + private ICurrentUser _currentUser; + + public ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant); + private ICurrentTenant _currentTenant; + + public IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService); + private IAuthorizationService _authorizationService; + + public IClock Clock => LazyGetRequiredService(ref _clock); + private IClock _clock; + + public IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory); + private IStringLocalizerFactory _stringLocalizerFactory; + + public IStringLocalizer L => _localizer ?? (_localizer = StringLocalizerFactory.Create(LocalizationResource)); + private IStringLocalizer _localizer; + + protected Type LocalizationResource + { + get => _localizationResource; + set + { + _localizationResource = value; + _localizer = null; + } + } + private Type _localizationResource = typeof(DefaultResource); + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs new file mode 100644 index 0000000000..10d986933d --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpSignalRUserIdProvider.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.SignalR; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Users; + +namespace Volo.Abp.AspNetCore.SignalR +{ + public class AbpSignalRUserIdProvider : IUserIdProvider, ITransientDependency + { + public ICurrentUser CurrentUser { get; } + + public AbpSignalRUserIdProvider(ICurrentUser currentUser) + { + CurrentUser = currentUser; + } + + public virtual string GetUserId(HubConnectionContext connection) + { + return CurrentUser.Id?.ToString(); + } + } +} From 78e396a27b8a4e9c2d69880fae5ad9b3b306c5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 9 May 2020 22:29:12 +0300 Subject: [PATCH 21/47] Update UnitOfWorkManager.cs --- framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs index 479cf45117..0a1fcc7a9f 100644 --- a/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs +++ b/framework/src/Volo.Abp.Uow/Volo/Abp/Uow/UnitOfWorkManager.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; namespace Volo.Abp.Uow From f046da48bf830bed37cf0a078bcdee48128f1707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 10 May 2020 01:19:01 +0300 Subject: [PATCH 22/47] Added SignalR script contributor and the NPM package. --- .../SignalR/SignalRBrowserScriptContributor.cs | 16 ++++++++++++++++ npm/packs/signalr/abp.resourcemapping.js | 5 +++++ npm/packs/signalr/package.json | 12 ++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs create mode 100644 npm/packs/signalr/abp.resourcemapping.js create mode 100644 npm/packs/signalr/package.json diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs new file mode 100644 index 0000000000..736ffdb986 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/SignalR/SignalRBrowserScriptContributor.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Packages.Core; +using Volo.Abp.Modularity; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.SignalR +{ + [DependsOn(typeof(CoreScriptContributor))] + public class SignalRBrowserScriptContributor : BundleContributor + { + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("/libs/signalr/browser/signalr.js"); + } + } +} \ No newline at end of file diff --git a/npm/packs/signalr/abp.resourcemapping.js b/npm/packs/signalr/abp.resourcemapping.js new file mode 100644 index 0000000000..69ef9ca16a --- /dev/null +++ b/npm/packs/signalr/abp.resourcemapping.js @@ -0,0 +1,5 @@ +module.exports = { + mappings: { + "@node_modules/@microsoft/signalr/dist/browser/*.*": "@libs/signalr/browser/" + } +} \ No newline at end of file diff --git a/npm/packs/signalr/package.json b/npm/packs/signalr/package.json new file mode 100644 index 0000000000..67ac59402c --- /dev/null +++ b/npm/packs/signalr/package.json @@ -0,0 +1,12 @@ +{ + "version": "2.7.0", + "name": "@abp/signalr", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@abp/core": "^2.7.0", + "@microsoft/signalr": "^3.1.3" + }, + "gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd" +} From d146f232ab7f687adae202c6fa8df61ff12a1875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 10 May 2020 02:55:26 +0300 Subject: [PATCH 23/47] Change UseMvcWithDefaultRouteAndArea with UseConfiguredEndpoints --- docs/cs/Getting-Started-AspNetCore-Application.md | 2 +- docs/en/Getting-Started-AspNetCore-Application.md | 2 +- docs/en/Samples/Microservice-Demo.md | 2 +- docs/zh-Hans/Samples/Microservice-Demo.md | 2 +- .../Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs | 2 +- .../AbpAspNetCoreMvcUiBootstrapDemoModule.cs | 2 +- .../AbpAspNetCoreMvcUiThemeBasicDemoModule.cs | 2 +- .../Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs | 2 +- .../Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs | 2 +- .../blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs | 2 +- .../Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs | 2 +- modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs | 2 +- .../applications/AuthServer.Host/AuthServerHostModule.cs | 2 +- .../BackendAdminApp.Host/BackendAdminAppHostModule.cs | 2 +- .../applications/PublicWebSite.Host/PublicWebSiteHostModule.cs | 2 +- .../BackendAdminAppGatewayHostModule.cs | 2 +- .../gateways/InternalGateway.Host/InternalGatewayHostModule.cs | 2 +- .../PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs | 2 +- .../BloggingService.Host/BloggingServiceHostModule.cs | 2 +- .../IdentityService.Host/IdentityServiceHostModule.cs | 2 +- .../ProductService.Host/ProductServiceHostModule.cs | 2 +- .../TenantManagementServiceHostModule.cs | 2 +- .../MyProjectNameHttpApiHostModule.cs | 2 +- .../MyProjectNameHttpApiHostModule.cs | 2 +- .../MyProjectNameIdentityServerModule.cs | 2 +- .../MyProjectNameWebModule.cs | 2 +- .../MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs | 2 +- .../MyProjectNameWebTestModule.cs | 2 +- .../MyProjectNameHttpApiHostModule.cs | 2 +- .../MyProjectNameIdentityServerModule.cs | 2 +- .../MyProjectNameWebHostModule.cs | 2 +- .../MyProjectNameWebUnifiedModule.cs | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/cs/Getting-Started-AspNetCore-Application.md b/docs/cs/Getting-Started-AspNetCore-Application.md index 2e8ea1a343..877976d037 100644 --- a/docs/cs/Getting-Started-AspNetCore-Application.md +++ b/docs/cs/Getting-Started-AspNetCore-Application.md @@ -57,7 +57,7 @@ namespace BasicAspNetCoreApplication app.UseStaticFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/docs/en/Getting-Started-AspNetCore-Application.md b/docs/en/Getting-Started-AspNetCore-Application.md index b78ce1b9cf..9698b1dfb0 100644 --- a/docs/en/Getting-Started-AspNetCore-Application.md +++ b/docs/en/Getting-Started-AspNetCore-Application.md @@ -57,7 +57,7 @@ namespace BasicAspNetCoreApplication app.UseStaticFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/docs/en/Samples/Microservice-Demo.md b/docs/en/Samples/Microservice-Demo.md index 567d043ef9..25eaf68055 100644 --- a/docs/en/Samples/Microservice-Demo.md +++ b/docs/en/Samples/Microservice-Demo.md @@ -552,7 +552,7 @@ app.MapWhen(ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx.Request.Path.ToString().StartsWith("/Abp/"), app2 => { - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); }); app.UseOcelot().Wait(); diff --git a/docs/zh-Hans/Samples/Microservice-Demo.md b/docs/zh-Hans/Samples/Microservice-Demo.md index 40cb42cda6..b0134eddde 100644 --- a/docs/zh-Hans/Samples/Microservice-Demo.md +++ b/docs/zh-Hans/Samples/Microservice-Demo.md @@ -553,7 +553,7 @@ app.MapWhen(ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx.Request.Path.ToString().StartsWith("/Abp/"), app2 => { - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); }); app.UseOcelot().Wait(); diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs index 39b7d9af5f..90930abc6d 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs @@ -95,7 +95,7 @@ namespace Volo.Abp.AspNetCore.Mvc app.UseAuthorization(); app.UseAuditing(); app.UseUnitOfWork(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs index e14e2336d9..90780d3687 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/AbpAspNetCoreMvcUiBootstrapDemoModule.cs @@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo app.UseRouting(); app.UseVirtualFiles(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs index 758985bb27..9af261e3c8 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/AbpAspNetCoreMvcUiThemeBasicDemoModule.cs @@ -57,7 +57,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo app.UseVirtualFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs index b06a90bcfa..4e28d77a0a 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Versioning.Tests/Volo/Abp/AspNetCore/Mvc/Versioning/AbpAspNetCoreMvcVersioningTestModule.cs @@ -67,7 +67,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Versioning { var app = context.GetApplicationBuilder(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs index 557288cd7d..8c7ed40dc7 100644 --- a/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs +++ b/framework/test/Volo.Abp.AspNetCore.Serilog.Tests/Volo/Abp/AspNetCore/App/AbpSerilogTestModule.cs @@ -33,7 +33,7 @@ namespace Volo.Abp.AspNetCore.App app.UseMultiTenancy(); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs index dbaefdc1a5..8d57cb8aee 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs @@ -158,7 +158,7 @@ namespace Volo.BloggingTestApp app.UseRequestLocalization(app.ApplicationServices.GetRequiredService>().Value); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); using (var scope = context.ServiceProvider.CreateScope()) diff --git a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs index afc29ccb3f..2c3fae2dff 100644 --- a/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs +++ b/modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs @@ -42,7 +42,7 @@ namespace Volo.ClientSimulation.Demo app.UseVirtualFiles(); app.UseRouting(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs index 0c8e5354b6..d9673269b3 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs +++ b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs @@ -167,7 +167,7 @@ namespace VoloDocs.Web //app.UseMiddleware(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); using (var scope = context.ServiceProvider.CreateScope()) { diff --git a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs index 8a132b2cac..08b6689cea 100644 --- a/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs +++ b/samples/MicroserviceDemo/applications/AuthServer.Host/AuthServerHostModule.cs @@ -102,7 +102,7 @@ namespace AuthServer.Host app.UseIdentityServer(); app.UseAbpRequestLocalization(); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => diff --git a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs index d6c076cea3..b0aba5af53 100644 --- a/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs +++ b/samples/MicroserviceDemo/applications/BackendAdminApp.Host/BackendAdminAppHostModule.cs @@ -130,7 +130,7 @@ namespace BackendAdminApp.Host { options.SwaggerEndpoint("/swagger/v1/swagger.json", "Backend Admin Application API"); }); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs index a7e236e2d2..bc0bb83021 100644 --- a/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs +++ b/samples/MicroserviceDemo/applications/PublicWebSite.Host/PublicWebSiteHostModule.cs @@ -103,7 +103,7 @@ namespace PublicWebSite.Host } app.UseAuthorization(); app.UseAbpRequestLocalization(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs index c2e7150d96..7edcd7f29a 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs @@ -141,7 +141,7 @@ namespace BackendAdminAppGateway.Host app2 => { app2.UseRouting(); - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); } ); diff --git a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs index fd72854c6b..dcad85fa57 100644 --- a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs @@ -122,7 +122,7 @@ namespace InternalGateway.Host app2 => { app2.UseRouting(); - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); } ); diff --git a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs index 85abd1211c..2bd570d56d 100644 --- a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs @@ -116,7 +116,7 @@ namespace PublicWebSiteGateway.Host app2 => { app2.UseRouting(); - app2.UseMvcWithDefaultRouteAndArea(); + app2.UseConfiguredEndpoints(); } ); diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs index 4c5b7b6d3b..dc87e7c71e 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs @@ -145,7 +145,7 @@ namespace BloggingService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Blogging Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => diff --git a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs index 7cc864b4bb..71858d497a 100644 --- a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs @@ -126,7 +126,7 @@ namespace IdentityService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs index e03cf26182..d3b370df0c 100644 --- a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs @@ -129,7 +129,7 @@ namespace ProductService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Product Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => diff --git a/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs b/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs index b60daf710e..2952fe65c3 100644 --- a/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs @@ -130,7 +130,7 @@ namespace TenantManagementService.Host options.SwaggerEndpoint("/swagger/v1/swagger.json", "Tenant Management Service API"); }); app.UseAuditing(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index edbece71e0..671d0edbb2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -183,7 +183,7 @@ namespace MyCompanyName.MyProjectName app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs index ad2df2e528..7a40f2eef5 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyProjectNameHttpApiHostModule.cs @@ -188,7 +188,7 @@ namespace MyCompanyName.MyProjectName app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index f7ef3f23eb..0a87b21a31 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -164,7 +164,7 @@ namespace MyCompanyName.MyProjectName app.UseAbpRequestLocalization(); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs index 66273114fb..7419ff4a7d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs @@ -246,7 +246,7 @@ namespace MyCompanyName.MyProjectName.Web app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 4a588d4945..0b2fe70094 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -221,7 +221,7 @@ namespace MyCompanyName.MyProjectName.Web }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs index f3998e71dc..20f7e793c2 100644 --- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs +++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.Web.Tests/MyProjectNameWebTestModule.cs @@ -107,7 +107,7 @@ namespace MyCompanyName.MyProjectName } }); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index bb63eed520..f961f2a1f8 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -171,7 +171,7 @@ namespace MyCompanyName.MyProjectName }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 1085d796f5..6e66cc7500 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -194,7 +194,7 @@ namespace MyCompanyName.MyProjectName }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); SeedData(context); } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs index 8576829c5d..385b840e75 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs @@ -253,7 +253,7 @@ namespace MyCompanyName.MyProjectName app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); } } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs index c7daebdc7b..a3480fa8cf 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs @@ -142,7 +142,7 @@ namespace MyCompanyName.MyProjectName app.UseAbpRequestLocalization(); app.UseAuditing(); app.UseAbpSerilogEnrichers(); - app.UseMvcWithDefaultRouteAndArea(); + app.UseConfiguredEndpoints(); using (var scope = context.ServiceProvider.CreateScope()) { From dc43ee05dfd95aa134e10a143812be5f8376c602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sun, 10 May 2020 20:02:31 +0300 Subject: [PATCH 24/47] Make ObjectExtensionManager.Instance protected set! --- .../Volo/Abp/ObjectExtending/ObjectExtensionManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs index 2b0ce8977d..fcc6fddbd0 100644 --- a/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs +++ b/framework/src/Volo.Abp.ObjectExtending/Volo/Abp/ObjectExtending/ObjectExtensionManager.cs @@ -9,7 +9,7 @@ namespace Volo.Abp.ObjectExtending { public class ObjectExtensionManager { - public static ObjectExtensionManager Instance { get; set; } = new ObjectExtensionManager(); + public static ObjectExtensionManager Instance { get; protected set; } = new ObjectExtensionManager(); [NotNull] public ConcurrentDictionary Configuration { get; } From 4ff5323c3c597f13a65a269774832d3041580276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 11 May 2020 00:35:32 +0300 Subject: [PATCH 25/47] Update Customizing-Application-Modules-Overriding-Services.md --- .../en/Customizing-Application-Modules-Overriding-Services.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 7f0c0502ea..6f7e79ebf4 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -112,8 +112,8 @@ public class MyIdentityUserManager : IdentityUserManager IPasswordHasher passwordHasher, IEnumerable> userValidators, IEnumerable> passwordValidators, - ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, + ILookupNormalizer keyNormalizer, + IdentityErrorDescriber errors, IServiceProvider services, ILogger logger, ICancellationTokenProvider cancellationTokenProvider From 568da4a0104abad9f631b4cc309eb4776f68e3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 11 May 2020 00:36:14 +0300 Subject: [PATCH 26/47] Revert "Update Customizing-Application-Modules-Overriding-Services.md" This reverts commit 4ff5323c3c597f13a65a269774832d3041580276. --- .../en/Customizing-Application-Modules-Overriding-Services.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 6f7e79ebf4..7f0c0502ea 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -112,8 +112,8 @@ public class MyIdentityUserManager : IdentityUserManager IPasswordHasher passwordHasher, IEnumerable> userValidators, IEnumerable> passwordValidators, - ILookupNormalizer keyNormalizer, - IdentityErrorDescriber errors, + ILookupNormalizer keyNormalizer, + IdentityErrorDescriber errors, IServiceProvider services, ILogger logger, ICancellationTokenProvider cancellationTokenProvider From cf0f9cfb323c7826956c9e586dc43ad6e3927917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 11 May 2020 00:36:56 +0300 Subject: [PATCH 27/47] Update Customizing-Application-Modules-Overriding-Services.md --- docs/en/Customizing-Application-Modules-Overriding-Services.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 8d64b031ec..b9890b3aca 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -114,7 +114,8 @@ public class MyIdentityUserManager : IdentityUserManager IPasswordHasher passwordHasher, IEnumerable> userValidators, IEnumerable> passwordValidators, - ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, + ILookupNormalizer keyNormalizer, + IdentityErrorDescriber errors, IServiceProvider services, ILogger logger, ICancellationTokenProvider cancellationTokenProvider) : From dafe19fa1e8c421896cde77be8e79819a15c00ac Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 11 May 2020 02:09:06 +0300 Subject: [PATCH 28/47] fix(core): condition bug resolves #3886 --- npm/ng-packs/packages/core/src/lib/states/config.state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts index af706586bb..546b3d0b1e 100644 --- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts @@ -324,7 +324,7 @@ function patchRouteDeep( ): ABP.FullRoute[] { routes = routes.map(route => { if (route.name === name) { - newValue.url = `${parentUrl}/${(!newValue.path && newValue.path === '' + newValue.url = `${parentUrl}/${(!newValue.path || newValue.path === '' ? route.path : newValue.path) || ''}`; From 8a235cb25cdd8957716035f10318fcb9abf80efa Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 11 May 2020 02:09:06 +0300 Subject: [PATCH 29/47] fix(core): condition bug resolves #3886 --- npm/ng-packs/packages/core/src/lib/states/config.state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/core/src/lib/states/config.state.ts b/npm/ng-packs/packages/core/src/lib/states/config.state.ts index af706586bb..546b3d0b1e 100644 --- a/npm/ng-packs/packages/core/src/lib/states/config.state.ts +++ b/npm/ng-packs/packages/core/src/lib/states/config.state.ts @@ -324,7 +324,7 @@ function patchRouteDeep( ): ABP.FullRoute[] { routes = routes.map(route => { if (route.name === name) { - newValue.url = `${parentUrl}/${(!newValue.path && newValue.path === '' + newValue.url = `${parentUrl}/${(!newValue.path || newValue.path === '' ? route.path : newValue.path) || ''}`; From 70a6c50fa3f8e202c9bb1f6b2e917e6cef3f72ff Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 May 2020 13:19:21 +0800 Subject: [PATCH 30/47] Upgrade IdentityServer4 to 3.1.3. --- .../Volo.Abp.IdentityServer.Domain.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj index 3ad4d2bb05..0fbb06c694 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo.Abp.IdentityServer.Domain.csproj @@ -25,8 +25,8 @@ - - + + From 7eadf380d4146bb0a43fcdb958f784085ece2ad5 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 May 2020 13:28:30 +0800 Subject: [PATCH 31/47] Add dependency of @abp/clipboard in @abp/prismjs package. Resolve #3861 --- npm/packs/prismjs/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/packs/prismjs/package.json b/npm/packs/prismjs/package.json index 1c53989fe5..ea92abe767 100644 --- a/npm/packs/prismjs/package.json +++ b/npm/packs/prismjs/package.json @@ -6,6 +6,7 @@ }, "dependencies": { "@abp/core": "^2.7.0", + "@abp/clipboard": "^2.7.0", "prismjs": "^1.17.1" }, "gitHead": "0ea3895f3b0b489e3ea81fc88f8f0896b22b61bd" From 82e35727c412f95173c5ba3f938d656c344e5bbd Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 May 2020 14:15:45 +0800 Subject: [PATCH 32/47] Add error page in template projects. --- .../MyProjectNameHttpApiHostModule.cs | 11 +++++++++++ .../MyProjectNameWebModule.cs | 3 +-- .../MyProjectNameWebModule.cs | 4 ++-- .../MyProjectNameHttpApiHostModule.cs | 10 +++++++++- .../MyProjectNameIdentityServerModule.cs | 10 +++++++++- .../MyProjectNameWebUnifiedModule.cs | 3 ++- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index 671d0edbb2..2526aec04d 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -15,6 +15,7 @@ using Microsoft.OpenApi.Models; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching; @@ -162,6 +163,16 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); + } app.UseCorrelationId(); app.UseVirtualFiles(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs index 7419ff4a7d..0809a70cc4 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs @@ -213,8 +213,6 @@ namespace MyCompanyName.MyProjectName.Web var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); - app.UseCorrelationId(); - if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); @@ -224,6 +222,7 @@ namespace MyCompanyName.MyProjectName.Web app.UseErrorPage(); } + app.UseCorrelationId(); app.UseVirtualFiles(); app.UseRouting(); app.UseAuthentication(); diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs index 0b2fe70094..8330951dfc 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs @@ -192,8 +192,6 @@ namespace MyCompanyName.MyProjectName.Web var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); - app.UseCorrelationId(); - if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); @@ -202,6 +200,8 @@ namespace MyCompanyName.MyProjectName.Web { app.UseErrorPage(); } + + app.UseCorrelationId(); app.UseVirtualFiles(); app.UseRouting(); app.UseAuthentication(); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs index f961f2a1f8..e425512797 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs @@ -15,6 +15,7 @@ using Swashbuckle.AspNetCore.Swagger; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -147,11 +148,18 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); - if (!context.GetEnvironment().IsDevelopment()) + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); app.UseHsts(); } + app.UseHttpsRedirection(); app.UseCorrelationId(); app.UseVirtualFiles(); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs index 6e66cc7500..9d0cb8397c 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs @@ -17,6 +17,7 @@ using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; @@ -168,11 +169,18 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); - if (!context.GetEnvironment().IsDevelopment()) + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); app.UseHsts(); } + app.UseHttpsRedirection(); app.UseCorrelationId(); app.UseVirtualFiles(); diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs index a3480fa8cf..48b0667350 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs @@ -112,8 +112,9 @@ namespace MyCompanyName.MyProjectName public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); - if (context.GetEnvironment().IsDevelopment()) + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } From db08d6a1af97535c535c9d0a0a099931a5549932 Mon Sep 17 00:00:00 2001 From: Arkat Erol Date: Mon, 11 May 2020 13:02:44 +0300 Subject: [PATCH 33/47] generate-proxy improvements --- .../Abp/Cli/Commands/GenerateProxyCommand.cs | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index 5c732f6873..667aa77757 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -21,6 +21,7 @@ namespace Volo.Abp.Cli.Commands public static Dictionary> propertyList = new Dictionary>(); public ILogger Logger { get; set; } public static string outputPrefix = "src/app"; + public static string output = ""; protected TemplateProjectBuilder TemplateProjectBuilder { get; } @@ -57,6 +58,12 @@ namespace Volo.Abp.Cli.Commands var uiFramework = GetUiFramework(commandLineArgs); + output = commandLineArgs.Options.GetOrNull(Options.Output.Short, Options.Output.Long); + if (!string.IsNullOrWhiteSpace(output) && !(output.EndsWith("/") || output.EndsWith("\\"))) + { + output += "/"; + } + WebClient client = new WebClient(); string json = ""; try @@ -99,7 +106,10 @@ namespace Volo.Abp.Cli.Commands var rootPath = moduleItem.Key; var apiName = apiNameList.Where(p => p.Key == rootPath).Select(p => p.Value).FirstOrDefault(); - Logger.LogInformation($"{rootPath} directory is creating"); + if (rootPath != "app") + { + Logger.LogInformation($"{rootPath} directory is creating"); + } if (rootPath == "app") { @@ -110,7 +120,7 @@ namespace Volo.Abp.Cli.Commands outputPrefix = "src/app"; } - Directory.CreateDirectory($"{outputPrefix}/{rootPath}"); + Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}"); foreach (var controller in moduleValue.Root.ToList().Select(item => item.First)) { @@ -140,8 +150,8 @@ namespace Volo.Abp.Cli.Commands var controllerPathName = controllerName.ToLower().Replace("controller", ""); controllerPathName = (controllerPathName.StartsWith(rootPath)) ? controllerPathName.Substring(rootPath.Length) : controllerPathName; - Directory.CreateDirectory($"{outputPrefix}/{rootPath}/{controllerPathName}/models"); - Directory.CreateDirectory($"{outputPrefix}/{rootPath}/{controllerPathName}/services"); + Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models"); + Directory.CreateDirectory(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services"); foreach (var actionItem in controller["actions"]) { @@ -240,7 +250,7 @@ namespace Volo.Abp.Cli.Commands foreach (var parameterItem in parameterModel.OrderBy(p => p.DisplayOrder)) { var parameterItemModelName = parameterItem.Type.PascalToKebabCase() + ".ts"; - var parameterItemModelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{parameterItemModelName}"; + var parameterItemModelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{parameterItemModelName}"; if (parameterItem.BindingSourceId == "body" && !File.Exists(parameterItemModelPath)) { parameterItem.Type = "any"; @@ -277,7 +287,7 @@ namespace Volo.Abp.Cli.Commands var secondType = secondTypeArray[secondTypeArray.Length - 1].TrimEnd('>'); var secondTypeModelName = secondType.PascalToKebabCase() + ".ts"; - var secondTypeModelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{secondTypeModelName}"; + var secondTypeModelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{secondTypeModelName}"; if (firstType == "List" && !File.Exists(secondTypeModelPath)) { secondType = "any"; @@ -374,7 +384,7 @@ namespace Volo.Abp.Cli.Commands serviceFileText.AppendLine("}"); serviceFileText.Replace("[controllerName]", controllerName); - File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/services/{controllerServiceName}", serviceFileText.ToString()); + File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services/{controllerServiceName}", serviceFileText.ToString()); @@ -385,7 +395,7 @@ namespace Volo.Abp.Cli.Commands serviceIndexFileText.AppendLine($"export * from './{serviceIndexItem}';"); } - File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/services/index.ts", serviceIndexFileText.ToString()); + File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/services/index.ts", serviceIndexFileText.ToString()); if (modelIndexList.Count > 0) { @@ -396,7 +406,7 @@ namespace Volo.Abp.Cli.Commands modelIndexFileText.AppendLine($"export * from './{modelIndexItem}';"); } - File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/models/index.ts", modelIndexFileText.ToString()); + File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/index.ts", modelIndexFileText.ToString()); } } } @@ -467,6 +477,7 @@ namespace Volo.Abp.Cli.Commands || returnValueType.Contains("ActionResult") || returnValueType.Contains("IStringValueType") || returnValueType.Contains("IValueValidator") + || returnValueType.Contains("Guid") ) { return null; @@ -483,7 +494,7 @@ namespace Volo.Abp.Cli.Commands var typeModelName = typeName.Replace("<", "").Replace(">", "").Replace("?", "").PascalToKebabCase() + ".ts"; - var path = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}"; + var path = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}"; var modelFileText = new StringBuilder(); @@ -513,7 +524,9 @@ namespace Volo.Abp.Cli.Commands baseTypeName = "string"; } + modelFileText.AppendLine(Environment.NewLine); modelFileText.AppendLine($"import {{ {baseTypeName} }} from '{baseTypeKebabCase}';"); + extends = "extends " + (!string.IsNullOrWhiteSpace(customBaseTypeName) ? customBaseTypeName : baseTypeName); var modelIndex = CreateType(data, baseType, rootPath, modelIndexList, controllerPathName); @@ -582,7 +595,7 @@ namespace Volo.Abp.Cli.Commands ) { var typeSimpleModelName = typeSimple.PascalToKebabCase() + ".ts"; - var modelPath = $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeSimpleModelName}"; + var modelPath = output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeSimpleModelName}"; if (!File.Exists(modelPath)) { typeSimple = "any" + (typeSimple.Contains("[]") ? "[]" : ""); @@ -601,14 +614,13 @@ namespace Volo.Abp.Cli.Commands var propertyType = propertyTypeSplit[propertyTypeSplit.Length - 1]; var propertyTypeKebabCase = propertyType.PascalToKebabCase(); - if (File.Exists($"{outputPrefix}/{rootPath}/{controllerPathName}/models/{propertyTypeKebabCase}.ts")) + if (File.Exists(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{propertyTypeKebabCase}.ts")) { from = "./" + propertyTypeKebabCase; } - - modelFileText.Insert(0, ""); + modelFileText.Insert(0, $"import {{ {propertyType} }} from '{from}';"); - modelFileText.Insert(0, ""); + modelFileText.Insert(0, Environment.NewLine); modelIndexList.Add(modelIndex); } @@ -651,7 +663,7 @@ namespace Volo.Abp.Cli.Commands modelFileText.AppendLine("}"); } - File.WriteAllText($"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}", modelFileText.ToString()); + File.WriteAllText(output + $"{outputPrefix}/{rootPath}/{controllerPathName}/models/{typeModelName}", modelFileText.ToString()); return typeModelName.Replace(".ts", ""); } @@ -758,6 +770,11 @@ namespace Volo.Abp.Cli.Commands public const string Short = "u"; public const string Long = "ui"; } + public static class Output + { + public const string Short = "o"; + public const string Long = "out"; + } } } From 54e9eb5ef8211067885f8dd19fda2aa29418af19 Mon Sep 17 00:00:00 2001 From: xyfy Date: Mon, 11 May 2020 18:07:10 +0800 Subject: [PATCH 34/47] Update Index.md --- docs/zh-Hans/Modules/Index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh-Hans/Modules/Index.md b/docs/zh-Hans/Modules/Index.md index fb07b5b001..fa7b063004 100644 --- a/docs/zh-Hans/Modules/Index.md +++ b/docs/zh-Hans/Modules/Index.md @@ -28,4 +28,4 @@ ABP是一个 **模块化的应用程序框架** 由十多个 **nuget packages** ## 商业应用模块 -[ABP商业](https://commercial.abp.io/)许可证在ABP框架上提供了额外的预构建应用程序模块. 参见ABP商业版提供的[模块列表](https://commercial.abp.io/module). +[ABP商业](https://commercial.abp.io/)许可证在ABP框架上提供了额外的预构建应用程序模块. 参见ABP商业版提供的[模块列表](https://commercial.abp.io/modules). From 7fbf91b20beb40f8444f89d0bd98c0de2e56a4d8 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 11 May 2020 14:25:30 +0300 Subject: [PATCH 35/47] blogging: dont show comment count on index page --- .../Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml index 5a8f9bd694..61d9827c47 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml @@ -59,8 +59,8 @@
@post.Writer.UserName @ConvertDatetimeToTimeAgo(post.CreationTime)
@L["WiewsWithCount", post.ReadCount] - | - @L["CommentWithCount", post.CommentCount] + @*| + @L["CommentWithCount", post.CommentCount]*@
@@ -116,8 +116,8 @@
@post.Writer.UserName @ConvertDatetimeToTimeAgo(post.CreationTime)
} @L["WiewsWithCount", post.ReadCount] - | - @L["CommentWithCount", post.CommentCount] + @*| + @L["CommentWithCount", post.CommentCount]*@ @@ -177,8 +177,8 @@
@post.Writer.UserName @ConvertDatetimeToTimeAgo(post.CreationTime)
@L["WiewsWithCount", post.ReadCount] - | - @L["CommentWithCount", post.CommentCount] + @*| + @L["CommentWithCount", post.CommentCount]*@
From d3e7a50f9f52f2b03547ea4a720b3aceff78df91 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 11 May 2020 19:51:03 +0800 Subject: [PATCH 36/47] Add AbpAspNetCoreMvcModule to microservices host module dependencies --- .../BloggingService.Host/BloggingServiceHostModule.cs | 2 ++ .../IdentityService.Host/IdentityServiceHostModule.cs | 2 ++ .../ProductService.Host/ProductServiceHostModule.cs | 2 ++ .../TenantManagementServiceHostModule.cs | 2 ++ 4 files changed, 8 insertions(+) diff --git a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs index dc87e7c71e..692d4c3d61 100644 --- a/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/BloggingService.Host/BloggingServiceHostModule.cs @@ -13,6 +13,7 @@ using MsDemo.Shared; using Swashbuckle.AspNetCore.Swagger; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -40,6 +41,7 @@ namespace BloggingService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), diff --git a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs index 71858d497a..982f4c09af 100644 --- a/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/IdentityService.Host/IdentityServiceHostModule.cs @@ -9,6 +9,7 @@ using Microsoft.OpenApi.Models; using MsDemo.Shared; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -29,6 +30,7 @@ namespace IdentityService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), diff --git a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs index d3b370df0c..44e23eeb78 100644 --- a/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/ProductService.Host/ProductServiceHostModule.cs @@ -12,6 +12,7 @@ using MsDemo.Shared; using Swashbuckle.AspNetCore.Swagger; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -32,6 +33,7 @@ namespace ProductService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), diff --git a/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs b/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs index 2952fe65c3..f9a818234f 100644 --- a/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs +++ b/samples/MicroserviceDemo/microservices/TenantManagementService.Host/TenantManagementServiceHostModule.cs @@ -9,6 +9,7 @@ using MsDemo.Shared; using StackExchange.Redis; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Auditing; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; @@ -29,6 +30,7 @@ namespace TenantManagementService.Host { [DependsOn( typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMvcModule), typeof(AbpEventBusRabbitMqModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), From 74fb8d2e737aee2a117320682eb731cc2ac06015 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 11 May 2020 22:18:41 +0800 Subject: [PATCH 37/47] Add Email property to CurrentUserDto. --- .../Mvc/ApplicationConfigurations/CurrentUserDto.cs | 4 +++- .../AbpApplicationConfigurationAppService.cs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs index 702af56dba..2197d7b08e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Contracts/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/CurrentUserDto.cs @@ -12,5 +12,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations public Guid? TenantId { get; set; } public string UserName { get; set; } + + public string Email { get; set; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs index 98fd94882d..a68a38b274 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs @@ -107,7 +107,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations IsAuthenticated = _currentUser.IsAuthenticated, Id = _currentUser.Id, TenantId = _currentUser.TenantId, - UserName = _currentUser.UserName + UserName = _currentUser.UserName, + Email = _currentUser.Email }; } @@ -226,4 +227,4 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations return result; } } -} \ No newline at end of file +} From 79219e39babc85f140e0ba5b6d7eaf66a9d2aed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ak=C4=B1n=20Sabri=20=C3=87am?= Date: Mon, 11 May 2020 17:19:19 +0300 Subject: [PATCH 38/47] added disctount request localization keys for abpio admin project --- .../Admin/Localization/Resources/en.json | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json index d0d829bbf3..14a4eb345c 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json @@ -3,6 +3,12 @@ "texts": { "Permission:Organizations": "Organizations", "Permission:Manage": "Manage Organizations", + "Permission:DiscountRequests": "Discount Requests", + "Permission:DiscountManage": "Manage Discount Requests", + "Permission:Disable": "Disable", + "Permission:Enable": "Enable", + "Permission:EnableSendEmail": "Enable Send Email", + "Permission:SendEmail": "Send Email", "Permission:NpmPackages": "NPM Packages", "Permission:NugetPackages": "Nuget Packages", "Permission:Maintenance": "Maintenance", @@ -19,6 +25,7 @@ "Menu:Organizations": "Organizations", "Menu:Accounting": "Accounting", "Menu:Packages": "Packages", + "Menu:DiscountRequests": "Discount Requests", "NpmPackageDeletionWarningMessage": "This NPM Package will be deleted. Do you confirm that?", "NugetPackageDeletionWarningMessage": "This Nuget Package will be deleted. Do you confirm that?", "ModuleDeletionWarningMessage": "This Module will be deleted. Do you confirm that?", @@ -119,6 +126,27 @@ "TotalPrice": "Total Price", "Generate": "Generate", "MissingQuantityField": "The quantity field is required!", - "MissingPriceField": "The Price field is required!" + "MissingPriceField": "The Price field is required!", + "CodeUsageStatus": "Code Usage Status", + "Country": "Country", + "DeveloperCount": "Developer Count", + "RequestCode": "Request Code", + "WebSite": "Web Site", + "GithubUsername": "Github Username", + "PhoneNumber": "Phone Number", + "ProjectDescription": "Project Description", + "Referrer": "Referrer", + "DiscountRequests": "Discount Request", + "Copylink": "Copy Link", + "Disable": "Disable", + "Enable": "Enable", + "EnableSendEmail": "Enable Send Email", + "SendEmail": "Send Email", + "SuccessfullyDisabled": "Successfully Disabled", + "SuccessfullyEnabled": "Successfully Enabled", + "EmailSent": "Email Sent", + "SuccessfullySent": "Successfully Sent", + "SuccessfullyDeleted": "Successfully Deleted", + "DiscountRequestDeletionWarningMessage": "Discount request will be deleted" } } \ No newline at end of file From 519e6d7ffdf98d98d8a9390ac34074787bb1478f Mon Sep 17 00:00:00 2001 From: Luis Pignataro Date: Mon, 11 May 2020 16:12:06 -0300 Subject: [PATCH 39/47] Resolve some errors for maliming check --- .../Volo.Abp.Localization/Volo.Abp.Localization.csproj | 8 -------- .../Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj | 7 ------- framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj | 7 ------- .../Localization/TestResources/Base/CountryNames/es.json | 4 ++-- .../Localization/TestResources/Base/Validation/es.json | 6 +++--- .../Volo/Abp/Localization/TestResources/Source/es.json | 4 ++-- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index c785de3f18..88c3bf0e81 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -28,12 +28,4 @@ - - - - all - runtime; build; native; contentfiles; analyzers - - - diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj index f5272a2c31..5236bf0404 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj +++ b/framework/src/Volo.Abp.UI.Navigation/Volo.Abp.UI.Navigation.csproj @@ -23,11 +23,4 @@ - - - all - runtime; build; native; contentfiles; analyzers - - - diff --git a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj index e11709841d..acff7d004b 100644 --- a/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj +++ b/framework/src/Volo.Abp.UI/Volo.Abp.UI.csproj @@ -22,12 +22,5 @@ - - - - all - runtime; build; native; contentfiles; analyzers - - diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json index 625ca51545..13a6c2db61 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/es.json @@ -1,7 +1,7 @@ -{ +{ "culture": "es", "texts": { - "USA": "Estados unidos de Am\u00E9rica", + "USA": "Estados unidos de América", "Brazil": "Brasil" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json index df5bdbd8f7..a83091e2c8 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/es.json @@ -1,7 +1,7 @@ -{ +{ "culture": "es", "texts": { - "ThisFieldIsRequired": "El campo no puede estar vac\u00EDo", - "MaxLenghtErrorMessage": "El campo puede tener un m\u00E1ximo de '{0}' caracteres" + "ThisFieldIsRequired": "El campo no puede estar vacío", + "MaxLenghtErrorMessage": "El campo puede tener un máximo de '{0}' caracteres" } } \ No newline at end of file diff --git a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json index 6b45b36efd..f68ed052c3 100644 --- a/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json +++ b/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/es.json @@ -1,10 +1,10 @@ -{ +{ "culture": "es", "texts": { "Hello {0}.": "Hola {0}.", "Car": "Auto", "CarPlural": "Autos", - "MaxLenghtErrorMessage": "El campo puede tener un m\u00E1ximo de '{0}' caracteres", + "MaxLenghtErrorMessage": "El campo puede tener un máximo de '{0}' caracteres", "Universe": "Universo", "FortyTwo": "Curenta y dos" } From 669592ac5c45ae8510144249e8c2b032e8db5c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 11 May 2020 22:54:33 +0300 Subject: [PATCH 40/47] Created samples index document --- ...tributed-Event-Bus-RabbitMQ-Integration.md | 3 ++ docs/en/Samples/Index.md | 50 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md create mode 100644 docs/en/Samples/Index.md diff --git a/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md new file mode 100644 index 0000000000..dc3d5c172f --- /dev/null +++ b/docs/en/Distributed-Event-Bus-RabbitMQ-Integration.md @@ -0,0 +1,3 @@ +# Distributed Event Bus RabbitMQ Integration + +TODO \ No newline at end of file diff --git a/docs/en/Samples/Index.md b/docs/en/Samples/Index.md new file mode 100644 index 0000000000..bddbd6eaae --- /dev/null +++ b/docs/en/Samples/Index.md @@ -0,0 +1,50 @@ +# Sample Applications + +Here, a list of official samples built with the ABP Framework. Most of these samples are located under the [abpframework/abp-samples](https://github.com/abpframework/abp-samples) GitHub repository. + +### Microservice Demo + +A complete solution to demonstrate how to build systems based on the microservice architecture. + +* [The complete documentation for this sample](Microservice-Demo.md) +* [Source code](https://github.com/abpframework/abp/tree/dev/samples/MicroserviceDemo) +* [Microservice architecture document](../Microservice-Architecture.md) + +### Book Store + +A simple CRUD application to show basic principles of developing an application with the ABP Framework. The same sample was implemented with different technologies: + +* **Book Store: Razor Pages UI & Entity Framework Core** + + * [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC) + * [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore) + +* **Book Store: Angular UI & MongoDB** + + * [Tutorial](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=NG) + * [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Angular-MongoDb) + +* **Book Store: Modular application (Razor Pages UI & EF Core)** + + * [Source code](https://github.com/abpframework/abp-samples/tree/master/BookStore-Modular) + +While there is no Razor Pages & MongoDB combination, you can check both documents to understand it since DB & UI selection don't effect each other. + +### Other Samples + +* **Entity Framework Migrations**: A solution to demonstrate how to split your application into multiple databases each database contains different modules. + * [Source code](https://github.com/abpframework/abp-samples/tree/master/DashboardDemo) + * [EF Core database migrations document](../Entity-Framework-Core-Migrations.md) +* **Dashboard Demo**: A simple application to show how to use the widget system for the ASP.NET Core MVC UI. + * [Source code](https://github.com/abpframework/abp-samples/tree/master/DashboardDemo) + * [Widget documentation](../UI/AspNetCore/Widgets.md) +* **RabbitMQ Event Bus Demo**: A solution consists of two applications communicating to each other via distributed events with RabbitMQ integration. + * [Source code](https://github.com/abpframework/abp-samples/tree/master/RabbitMqEventBus) + * [Distributed event bus document](../Distributed-Event-Bus.md) + * [RabbitMQ distributed event bus integration document](../Distributed-Event-Bus-RabbitMQ-Integration.md) +* **Authentication Customization**: A solution to show how to customize the authentication for ASP.NET Core MVC / Razor Pages applications. + * [Source code](https://github.com/abpframework/abp-samples/tree/master/aspnet-core/Authentication-Customization) + * Related "[How To](../How-To/Index.md)" documents: + * [Azure Active Directory Authentication](../How-To/Azure-Active-Directory-Authentication-MVC.md) + * [Customize the Login Page](../How-To/Customize-Login-Page-MVC.md) + * [Customize the SignIn Manager](../How-To/Customize-SignIn-Manager.md) \ No newline at end of file From 3f2bc3ffcf94a85b478d94e9d3299b5c94264b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 11 May 2020 22:57:02 +0300 Subject: [PATCH 41/47] Added All Samples to the doc nav --- docs/en/docs-nav.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index c0515c18de..430fdf6b47 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -505,6 +505,10 @@ { "text": "Samples", "items": [ + { + "text": "All Samples", + "path": "Samples/Index.md" + }, { "text": "Microservice Demo", "path": "Samples/Microservice-Demo.md" From c61ef6c428de723483ac7c83576dfa0ee0e513a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 11 May 2020 23:35:44 +0300 Subject: [PATCH 42/47] Added empty samples --- docs/en/Samples/Index.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/en/Samples/Index.md b/docs/en/Samples/Index.md index bddbd6eaae..0c9ce68886 100644 --- a/docs/en/Samples/Index.md +++ b/docs/en/Samples/Index.md @@ -47,4 +47,10 @@ While there is no Razor Pages & MongoDB combination, you can check both document * Related "[How To](../How-To/Index.md)" documents: * [Azure Active Directory Authentication](../How-To/Azure-Active-Directory-Authentication-MVC.md) * [Customize the Login Page](../How-To/Customize-Login-Page-MVC.md) - * [Customize the SignIn Manager](../How-To/Customize-SignIn-Manager.md) \ No newline at end of file + * [Customize the SignIn Manager](../How-To/Customize-SignIn-Manager.md) +* **Empty ASP.NET Core Application**: The most basic ASP.NET Core application with the ABP Framework installed. + * [Source code](https://github.com/abpframework/abp-samples/tree/master/BasicAspNetCoreApplication) + * [Documentation](../Getting-Started-AspNetCore-Application.md) +* **Empty Console Application**: The most basic console application with the ABP Framework installed. + * [Source code](https://github.com/abpframework/abp-samples/tree/master/BasicConsoleApplication) + * [Documentation](../Getting-Started-Console-Application.md) \ No newline at end of file From cae569f9c390ad53e7bb70236e50b328dbb4fe92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 12 May 2020 01:16:48 +0300 Subject: [PATCH 43/47] Resolved #3909: Deprecate UsePostgreSql() and rename it to UseNpgsql() for the Volo.Abp.EntityFrameworkCore.PostgreSql package. --- docs/cs/Entity-Framework-Core-PostgreSQL.md | 4 +-- docs/en/Entity-Framework-Core-PostgreSQL.md | 4 +-- .../Entity-Framework-Core-PostgreSQL.md | 4 +-- ...onfigurationContextPostgreSqlExtensions.cs | 8 ++++++ ...AbpDbContextOptionsPostgreSqlExtensions.cs | 27 +++++++++++++++++-- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/docs/cs/Entity-Framework-Core-PostgreSQL.md b/docs/cs/Entity-Framework-Core-PostgreSQL.md index 3a39c7485d..e09880c37c 100644 --- a/docs/cs/Entity-Framework-Core-PostgreSQL.md +++ b/docs/cs/Entity-Framework-Core-PostgreSQL.md @@ -10,9 +10,9 @@ Projekt `.EntityFrameworkCore` v řešení závisí na NuGet balíku [Volo.Abp.E Najděte třídu ***YourProjectName*EntityFrameworkCoreModule** v projektu `.EntityFrameworkCore`, odstraňte `typeof(AbpEntityFrameworkCoreSqlServerModule)` z atributu `DependsOn`, přidejte `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (také nahraďte `using Volo.Abp.EntityFrameworkCore.SqlServer;` za `using Volo.Abp.EntityFrameworkCore.PostgreSql;`). -## UsePostgreSql() +## UseNpgsql() -Najděte volání `UseSqlServer()` v *YourProjectName*EntityFrameworkCoreModule.cs uvnitř projektu `.EntityFrameworkCore` a nahraďte za `UsePostgreSql()`. +Najděte volání `UseSqlServer()` v *YourProjectName*EntityFrameworkCoreModule.cs uvnitř projektu `.EntityFrameworkCore` a nahraďte za `UseNpgsql()`. Najděte volání `UseSqlServer()` v *YourProjectName*MigrationsDbContextFactory.cs uvnitř projektu `.EntityFrameworkCore.DbMigrations` a nahraďte za `UseNpgsql()`. diff --git a/docs/en/Entity-Framework-Core-PostgreSQL.md b/docs/en/Entity-Framework-Core-PostgreSQL.md index 328ca4d416..4c6099b809 100644 --- a/docs/en/Entity-Framework-Core-PostgreSQL.md +++ b/docs/en/Entity-Framework-Core-PostgreSQL.md @@ -10,9 +10,9 @@ This document explains how to switch to the **PostgreSQL** database provider for Find ***YourProjectName*EntityFrameworkCoreModule** class inside the `.EntityFrameworkCore` project, remove `typeof(AbpEntityFrameworkCoreSqlServerModule)` from the `DependsOn` attribute, add `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (also replace `using Volo.Abp.EntityFrameworkCore.SqlServer;` with `using Volo.Abp.EntityFrameworkCore.PostgreSql;`). -## UsePostgreSql() +## UseNpgsql() -Find `UseSqlServer()` call in *YourProjectName*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project and replace with `UsePostgreSql()`. +Find `UseSqlServer()` call in *YourProjectName*EntityFrameworkCoreModule.cs inside the `.EntityFrameworkCore` project and replace with `UseNpgsql()`. Find `UseSqlServer()` call in *YourProjectName*MigrationsDbContextFactory.cs inside the `.EntityFrameworkCore.DbMigrations` project and replace with `UseNpgsql()`. diff --git a/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md b/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md index 08f8f405d1..350cff65b0 100644 --- a/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md +++ b/docs/zh-Hans/Entity-Framework-Core-PostgreSQL.md @@ -10,9 +10,9 @@ 在 `.EntityFrameworkCore` 项目中找到 **YourProjectName*EntityFrameworkCoreModule** 类, 删除 `DependsOn` attribute 上的`typeof(AbpEntityFrameworkCoreSqlServerModule)`, 添加 `typeof(AbpEntityFrameworkCorePostgreSqlModule)` (或者替换 `using Volo.Abp.EntityFrameworkCore.SqlServer;` 为 `using Volo.Abp.EntityFrameworkCore.PostgreSql;`). -## UsePostgreSql() +## UseNpgsql() -查找你的解决方案中 `UseSqlServer()`调用,替换为 `UsePostgreSql()`. 检查下列文件: +查找你的解决方案中 `UseSqlServer()`调用,替换为 `UseNpgsql()`. 检查下列文件: * `.EntityFrameworkCore` 项目中的*YourProjectName*EntityFrameworkCoreModule.cs. * `.EntityFrameworkCore` 项目中的*YourProjectName*MigrationsDbContextFactory.cs. diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs index 1f86dfa480..9ab28dddcb 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextConfigurationContextPostgreSqlExtensions.cs @@ -8,9 +8,17 @@ namespace Volo.Abp.EntityFrameworkCore { public static class AbpDbContextConfigurationContextPostgreSqlExtensions { + [Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")] public static DbContextOptionsBuilder UsePostgreSql( [NotNull] this AbpDbContextConfigurationContext context, [CanBeNull] Action postgreSqlOptionsAction = null) + { + return context.UseNpgsql(postgreSqlOptionsAction); + } + + public static DbContextOptionsBuilder UseNpgsql( + [NotNull] this AbpDbContextConfigurationContext context, + [CanBeNull] Action postgreSqlOptionsAction = null) { if (context.ExistingConnection != null) { diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs index 47967de15d..5fd6d0d6b9 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore.PostgreSql/Volo/Abp/EntityFrameworkCore/AbpDbContextOptionsPostgreSqlExtensions.cs @@ -6,16 +6,18 @@ namespace Volo.Abp.EntityFrameworkCore { public static class AbpDbContextOptionsPostgreSqlExtensions { + [Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")] public static void UsePostgreSql( [NotNull] this AbpDbContextOptions options, [CanBeNull] Action postgreSqlOptionsAction = null) { options.Configure(context => { - context.UsePostgreSql(postgreSqlOptionsAction); + context.UseNpgsql(postgreSqlOptionsAction); }); } + [Obsolete("Use 'UseNpgsql(...)' method instead. This will be removed in future versions.")] public static void UsePostgreSql( [NotNull] this AbpDbContextOptions options, [CanBeNull] Action postgreSqlOptionsAction = null) @@ -23,7 +25,28 @@ namespace Volo.Abp.EntityFrameworkCore { options.Configure(context => { - context.UsePostgreSql(postgreSqlOptionsAction); + context.UseNpgsql(postgreSqlOptionsAction); + }); + } + + public static void UseNpgsql( + [NotNull] this AbpDbContextOptions options, + [CanBeNull] Action postgreSqlOptionsAction = null) + { + options.Configure(context => + { + context.UseNpgsql(postgreSqlOptionsAction); + }); + } + + public static void UseNpgsql( + [NotNull] this AbpDbContextOptions options, + [CanBeNull] Action postgreSqlOptionsAction = null) + where TDbContext : AbpDbContext + { + options.Configure(context => + { + context.UseNpgsql(postgreSqlOptionsAction); }); } } From e85498d597e809f3af1549fc95e17aa14f6094f9 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 12 May 2020 14:01:56 +0300 Subject: [PATCH 44/47] refactor(ci): add force-publish to lerna version command --- npm/ng-packs/scripts/publish.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/scripts/publish.ts b/npm/ng-packs/scripts/publish.ts index 5570602813..9228a752ca 100644 --- a/npm/ng-packs/scripts/publish.ts +++ b/npm/ng-packs/scripts/publish.ts @@ -28,7 +28,15 @@ const publish = async () => { await execa( 'yarn', - ['lerna', 'version', program.nextVersion, '--yes', '--no-commit-hooks', '--skip-git'], + [ + 'lerna', + 'version', + program.nextVersion, + '--yes', + '--no-commit-hooks', + '--skip-git', + '--force-publish', + ], { stdout: 'inherit', cwd: '../' }, ); From 48ac4d2bb7010af56323746cee02dcd59d5156e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 12 May 2020 15:03:14 +0300 Subject: [PATCH 45/47] #3915: Check if in lock --- .../LocalizedTemplateContentReaderFactory.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs index b30e5771f4..092815ff6e 100644 --- a/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs +++ b/framework/src/Volo.Abp.TextTemplating/Volo/Abp/TextTemplating/VirtualFiles/LocalizedTemplateContentReaderFactory.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -42,12 +41,18 @@ namespace Volo.Abp.TextTemplating.VirtualFiles } finally { - _lock.ExitWriteLock(); + if (_lock.IsWriteLockHeld) + { + _lock.ExitWriteLock(); + } } } finally { - _lock.ExitUpgradeableReadLock(); + if (_lock.IsUpgradeableReadLockHeld) + { + _lock.ExitUpgradeableReadLock(); + } } } From 7246b227bed0fcd93e083e4a0ce4bb5a937c7053 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 12 May 2020 16:34:10 +0300 Subject: [PATCH 46/47] feat(core): add email property to current user type --- .../packages/core/src/lib/models/application-configuration.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts b/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts index 0a4377f4d2..b52afe9faf 100644 --- a/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts +++ b/npm/ng-packs/packages/core/src/lib/models/application-configuration.ts @@ -66,5 +66,6 @@ export namespace ApplicationConfiguration { id: string; tenantId: string; userName: string; + email: string; } } From 11a73493cee432ba7abab620d9969f4e76af5645 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Tue, 12 May 2020 16:58:32 +0300 Subject: [PATCH 47/47] test: fix testing erros --- .../packages/core/src/lib/tests/config-state.service.spec.ts | 1 + npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts index d019bda84b..17de9efb9e 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts @@ -122,6 +122,7 @@ const CONFIG_STATE_DATA = { id: null, tenantId: null, userName: null, + email: null, }, features: { values: {}, diff --git a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts index 3df3abc63e..aa3740218c 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts @@ -146,6 +146,7 @@ export const CONFIG_STATE_DATA = { id: null, tenantId: null, userName: null, + email: null, }, features: { values: {},