diff --git a/Nucleus.sln b/Nucleus.sln index 3461a55..3145500 100644 --- a/Nucleus.sln +++ b/Nucleus.sln @@ -25,26 +25,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nucleus.Tests.Application", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nucleus.Tests.Web.Api", "test\Nucleus.Tests.Web.Api\Nucleus.Tests.Web.Api.csproj", "{02306886-8DC2-4E72-BF50-CA2EF5626794}" EndProject -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "nucleus-web-vue", "src\nucleus-web-vue\", "{35E30CCF-CC26-4E84-AA31-325042BCBF21}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/localhost_49375" - Debug.AspNetCompiler.PhysicalPath = "src\nucleus-web-vue\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_49375\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/localhost_49375" - Release.AspNetCompiler.PhysicalPath = "src\nucleus-web-vue\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_49375\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "49375" - SlnRelativePath = "src\nucleus-web-vue\" - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nucleus.Web.Vue", "src\Nucleus.Web.Vue\Nucleus.Web.Vue.csproj", "{13C2090F-16B5-49DB-86B8-E320FD977FD2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -88,10 +69,10 @@ Global {02306886-8DC2-4E72-BF50-CA2EF5626794}.Debug|Any CPU.Build.0 = Debug|Any CPU {02306886-8DC2-4E72-BF50-CA2EF5626794}.Release|Any CPU.ActiveCfg = Release|Any CPU {02306886-8DC2-4E72-BF50-CA2EF5626794}.Release|Any CPU.Build.0 = Release|Any CPU - {35E30CCF-CC26-4E84-AA31-325042BCBF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35E30CCF-CC26-4E84-AA31-325042BCBF21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35E30CCF-CC26-4E84-AA31-325042BCBF21}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {35E30CCF-CC26-4E84-AA31-325042BCBF21}.Release|Any CPU.Build.0 = Debug|Any CPU + {13C2090F-16B5-49DB-86B8-E320FD977FD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13C2090F-16B5-49DB-86B8-E320FD977FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13C2090F-16B5-49DB-86B8-E320FD977FD2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13C2090F-16B5-49DB-86B8-E320FD977FD2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -106,7 +87,7 @@ Global {114AFE01-0628-451E-AD9A-5FFEA231022B} = {B7A0D987-5893-493C-A60A-8F1818D931E0} {B842DDCA-1842-49FF-BE41-658AF772ED18} = {B7A0D987-5893-493C-A60A-8F1818D931E0} {02306886-8DC2-4E72-BF50-CA2EF5626794} = {B7A0D987-5893-493C-A60A-8F1818D931E0} - {35E30CCF-CC26-4E84-AA31-325042BCBF21} = {C243FF0E-FA80-4C4C-8B5E-AD681D54E07A} + {13C2090F-16B5-49DB-86B8-E320FD977FD2} = {C243FF0E-FA80-4C4C-8B5E-AD681D54E07A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F0972965-9C8E-4058-BC88-3DFF23CFA05A} diff --git a/README.md b/README.md index 2ae4ed9..adb694d 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,15 @@ # Nucleus -Web API startup template with a Vue Client demo. +Web API startup template with a Vue Client application.

## How to Start? +**NOTE:** Requires Visual Studio 2019 v16.3 or later **for Windows** and Visual Studio 2019 for Mac v8.3 or later **for macOS**. + - Select `Nucleus.Web.Api` project "**Set as Startup Project**" - Open "**Package Manager Console**" and select default project as `src/Nucleus.EntityFramework` - Run `update-database` command to create database. @@ -27,10 +29,6 @@ Web API startup template with a Vue Client demo. Vue Client Demo -### Dashboard - -Vue Client Demo - ### List Pages Vue Client Demo @@ -53,53 +51,57 @@ Web API startup template with a Vue Client demo. ## Adding New Language -- Add json file to store language keys and values to `Nucleus\src\Nucleus.Web.Vue\src\assets\js\locales\tr.json` +- Add json file to store language keys and values to `Nucleus\src\Nucleus.Web.Vue\src\assets\localizations\your_language.json` - Copy `en.json` content and translate the values to target language. -- Add country flag to `Nucleus.Web.Vue\src\assets\images\icons\flags\tr.png`. Get images from http://www.iconarchive.com/show/flag-icons-by-gosquared.html +- Add country flag to `Nucleus.Web.Vue\src\assets\images\icons\flags\your_country.png`. Get images from http://www.iconarchive.com/show/flag-icons-by-gosquared.html - Add language to language selection menu in `Nucleus\src\Nucleus.Web.Vue\src\account\account-layout.vue` and `Nucleus\src\Nucleus.Web.Vue\src\admin\components\menu\top-menu\top-menu.vue` like following **account-layout.vue** ````html - - - + + + + + + + English + + + + Türkçe + + + ```` **top-menu.vue** ````html - - - {{selectedLanguage.languageName}} - arrow_drop_down - + + - + - English - - + English + + - Türkçe - + Türkçe + ```` @@ -118,7 +120,6 @@ Web API startup template with a Vue Client demo. - [ASP.NET Core Test Host](https://www.nuget.org/packages/Microsoft.AspNetCore.TestHost) - [Authorization & Authentication](https://docs.microsoft.com/en-us/aspnet/core/security/?view=aspnetcore-2.1) - [Exception Handling & Logging](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-2.1) -- [Microsoft.CodeCoverage](https://docs.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2017) - [Vue.js](https://vuejs.org/) - [Vue Router](https://router.vuejs.org/) - [Vuetify](https://vuetifyjs.com/en/) diff --git a/src/Nucleus.Application/Dto/Account/ForgotPasswordOutput.cs b/src/Nucleus.Application/Dto/Account/ForgotPasswordOutput.cs new file mode 100644 index 0000000..842c14c --- /dev/null +++ b/src/Nucleus.Application/Dto/Account/ForgotPasswordOutput.cs @@ -0,0 +1,7 @@ +namespace Nucleus.Application.Dto.Account +{ + public class ForgotPasswordOutput + { + public string ResetToken { get; set; } + } +} \ No newline at end of file diff --git a/src/Nucleus.Application/Nucleus.Application.csproj b/src/Nucleus.Application/Nucleus.Application.csproj index fa0e2c9..666fd8f 100644 --- a/src/Nucleus.Application/Nucleus.Application.csproj +++ b/src/Nucleus.Application/Nucleus.Application.csproj @@ -5,9 +5,10 @@ - - - + + + + diff --git a/src/Nucleus.Core/Nucleus.Core.csproj b/src/Nucleus.Core/Nucleus.Core.csproj index 2c20560..19ea745 100644 --- a/src/Nucleus.Core/Nucleus.Core.csproj +++ b/src/Nucleus.Core/Nucleus.Core.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Nucleus.Core/Permissions/DefaultPermissions.cs b/src/Nucleus.Core/Permissions/DefaultPermissions.cs index 3beda83..d3b3dea 100644 --- a/src/Nucleus.Core/Permissions/DefaultPermissions.cs +++ b/src/Nucleus.Core/Permissions/DefaultPermissions.cs @@ -19,6 +19,8 @@ public static List All() RoleCreate, RoleUpdate, RoleDelete + + // add your permission to list }; } @@ -92,6 +94,8 @@ public static List All() Id = new Guid("8F76DE0B-114A-4DF8-A93D-CEC927D06A3C") }; + // add your permissions + // these strings are using on authorize attributes public const string PermissionNameForAdministration = "Permissions_Administration"; public const string PermissionNameForMemberAccess = "Permissions_Member_Access"; @@ -103,5 +107,7 @@ public static List All() public const string PermissionNameForRoleCreate = "Permissions_Role_Create"; public const string PermissionNameForRoleUpdate = "Permissions_Role_Update"; public const string PermissionNameForRoleDelete = "Permissions_Role_Delete"; + + // add your permission names } } diff --git a/src/Nucleus.EntityFramework/Nucleus.EntityFramework.csproj b/src/Nucleus.EntityFramework/Nucleus.EntityFramework.csproj index 3250358..fcf9306 100644 --- a/src/Nucleus.EntityFramework/Nucleus.EntityFramework.csproj +++ b/src/Nucleus.EntityFramework/Nucleus.EntityFramework.csproj @@ -5,10 +5,10 @@ - - - - + + + + diff --git a/src/Nucleus.Utilities/Extensions/PrimitiveTypes/ObjectExtensions.cs b/src/Nucleus.Utilities/Extensions/PrimitiveTypes/ObjectExtensions.cs index b99a52c..7d562d5 100644 --- a/src/Nucleus.Utilities/Extensions/PrimitiveTypes/ObjectExtensions.cs +++ b/src/Nucleus.Utilities/Extensions/PrimitiveTypes/ObjectExtensions.cs @@ -1,5 +1,4 @@ -using System; -using System.Linq; +using System.Linq; using System.Net.Http; using System.Text; using System.Web; @@ -25,7 +24,7 @@ public static string ToQueryString(this object obj) where p.GetValue(obj, null) != null select p.Name + "=" + HttpUtility.UrlEncode(p.GetValue(obj, null).ToString()); - return String.Join("&", properties.ToArray()); + return string.Join("&", properties.ToArray()); } } } diff --git a/src/Nucleus.Utilities/Nucleus.Utilities.csproj b/src/Nucleus.Utilities/Nucleus.Utilities.csproj index 0274e6b..91e5309 100644 --- a/src/Nucleus.Utilities/Nucleus.Utilities.csproj +++ b/src/Nucleus.Utilities/Nucleus.Utilities.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Nucleus.Web.Api/Controller/Account/AccountController.cs b/src/Nucleus.Web.Api/Controller/Account/AccountController.cs index eeac015..8cf56d1 100644 --- a/src/Nucleus.Web.Api/Controller/Account/AccountController.cs +++ b/src/Nucleus.Web.Api/Controller/Account/AccountController.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Nucleus.Application.Dto; using Nucleus.Application.Dto.Account; @@ -26,16 +27,20 @@ public class AccountController : BaseController private readonly JwtTokenConfiguration _jwtTokenConfiguration; private readonly IConfiguration _configuration; private readonly SmtpClient _smtpClient; + readonly ILogger _logger; + public AccountController( UserManager userManager, IOptions jwtTokenConfiguration, - IConfiguration configuration, - SmtpClient smtpClient) + IConfiguration configuration, + SmtpClient smtpClient, + ILogger logger) { _userManager = userManager; _configuration = configuration; _smtpClient = smtpClient; + _logger = logger; _jwtTokenConfiguration = jwtTokenConfiguration.Value; } @@ -116,12 +121,12 @@ public async Task ChangePassword([FromBody] ChangePasswordInput in } [HttpPost("/api/[action]")] - public async Task ForgotPassword([FromBody] ForgotPasswordInput input) + public async Task> ForgotPassword([FromBody] ForgotPasswordInput input) { var user = await FindUserByUserNameOrEmail(input.UserNameOrEmail); if (user == null) { - return BadRequest(new List + return NotFound(new List { new NameValueDto("UserNotFound", "User is not found!") }); @@ -136,9 +141,17 @@ public async Task ForgotPassword([FromBody] ForgotPasswordInput in body: $"Please confirm your account by clicking this link: link" ); message.IsBodyHtml = true; - await _smtpClient.SendMailAsync(message); - - return Ok(); +#if !DEBUG + await _smtpClient.SendMailAsync(message); +#endif + _logger.LogInformation(Environment.NewLine + Environment.NewLine + + "******************* Reset Password Link *******************" + + Environment.NewLine + Environment.NewLine + + callbackUrl + + Environment.NewLine + Environment.NewLine + + "***********************************************************" + + Environment.NewLine); + return Ok(new ForgotPasswordOutput { ResetToken = resetToken }); } [HttpPost("/api/[action]")] @@ -147,7 +160,7 @@ public async Task ResetPassword([FromBody] ResetPasswordInput inpu var user = await FindUserByUserNameOrEmail(input.UserNameOrEmail); if (user == null) { - return BadRequest(new List + return NotFound(new List { new NameValueDto("UserNotFound", "User is not found!") }); @@ -181,7 +194,8 @@ private async Task CreateClaimsIdentityAsync(string userNameOrEm return new ClaimsIdentity(new GenericIdentity(userNameOrEmail, "Token"), new[] { new Claim(JwtRegisteredClaimNames.Sub, userNameOrEmail), - new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()) + new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()), + new Claim(ClaimTypes.NameIdentifier, userToVerify.Id.ToString()) }); } diff --git a/src/Nucleus.Web.Api/Controller/Roles/RolesController.cs b/src/Nucleus.Web.Api/Controller/Roles/RolesController.cs index 5adb956..5f537f1 100644 --- a/src/Nucleus.Web.Api/Controller/Roles/RolesController.cs +++ b/src/Nucleus.Web.Api/Controller/Roles/RolesController.cs @@ -46,7 +46,7 @@ public async Task PostRoles([FromBody]CreateOrUpdateRoleInput inpu if (identityResult.Succeeded) { - return Ok(); + return Created(Url.Action("PostRoles"), identityResult); } return BadRequest(identityResult.Errors.Select(e => new NameValueDto(e.Code, e.Description))); @@ -74,7 +74,7 @@ public async Task DeleteRoles(Guid id) if (identityResult.Succeeded) { - return Ok(); + return NoContent(); } return BadRequest(identityResult.Errors.Select(e => new NameValueDto(e.Code, e.Description))); diff --git a/src/Nucleus.Web.Api/Controller/Users/UsersController.cs b/src/Nucleus.Web.Api/Controller/Users/UsersController.cs index f360fec..cd41931 100644 --- a/src/Nucleus.Web.Api/Controller/Users/UsersController.cs +++ b/src/Nucleus.Web.Api/Controller/Users/UsersController.cs @@ -46,7 +46,7 @@ public async Task PostUsers([FromBody]CreateOrUpdateUserInput inpu if (identityResult.Succeeded) { - return Ok(); + return Created(Url.Action("PostUsers"), identityResult); } return BadRequest(identityResult.Errors.Select(e => new NameValueDto(e.Code, e.Description))); diff --git a/src/Nucleus.Web.Api/Nucleus.Web.Api.csproj b/src/Nucleus.Web.Api/Nucleus.Web.Api.csproj index 281083f..8f8021d 100644 --- a/src/Nucleus.Web.Api/Nucleus.Web.Api.csproj +++ b/src/Nucleus.Web.Api/Nucleus.Web.Api.csproj @@ -13,13 +13,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/src/Nucleus.Web.Api/Program.cs b/src/Nucleus.Web.Api/Program.cs index f10a98a..58230fd 100644 --- a/src/Nucleus.Web.Api/Program.cs +++ b/src/Nucleus.Web.Api/Program.cs @@ -28,8 +28,6 @@ public static int Main(string[] args) try { - Log.Information("Starting web host"); - Log.Information("Starting web host"); var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) diff --git a/src/Nucleus.Web.Api/Startup.cs b/src/Nucleus.Web.Api/Startup.cs index b8944bb..a13d795 100644 --- a/src/Nucleus.Web.Api/Startup.cs +++ b/src/Nucleus.Web.Api/Startup.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -48,6 +49,8 @@ public void ConfigureServices(IServiceCollection services) options.OperationFilter(); }); + + services.AddSingleton(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) diff --git a/src/Nucleus.Web.Api/appsettings.json b/src/Nucleus.Web.Api/appsettings.json index dd19e36..b8f0d74 100644 --- a/src/Nucleus.Web.Api/appsettings.json +++ b/src/Nucleus.Web.Api/appsettings.json @@ -20,9 +20,9 @@ "Smtp": { "Host": "smtp.gmail.com", "Port": 587, - "Username": "mail_username", + "Username": "mail_username@mail.com", "Password": "mail_password", - "EnableSsl": true + "EnableSsl": true } } } \ No newline at end of file diff --git a/src/Nucleus.Web.Core/Controllers/BaseController.cs b/src/Nucleus.Web.Core/Controllers/BaseController.cs index b3af423..531b8d0 100644 --- a/src/Nucleus.Web.Core/Controllers/BaseController.cs +++ b/src/Nucleus.Web.Core/Controllers/BaseController.cs @@ -7,7 +7,5 @@ namespace Nucleus.Web.Core.Controllers [Produces("application/json")] public class BaseController : Controller { - // TODO: Update derived controller's action to return correct HTTP result - // https://hackernoon.com/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9 } } diff --git a/src/Nucleus.Web.Core/Nucleus.Web.Core.csproj b/src/Nucleus.Web.Core/Nucleus.Web.Core.csproj index dc3b1b4..7f82505 100644 --- a/src/Nucleus.Web.Core/Nucleus.Web.Core.csproj +++ b/src/Nucleus.Web.Core/Nucleus.Web.Core.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/nucleus-web-vue/.browserslistrc b/src/Nucleus.Web.Vue/.browserslistrc similarity index 100% rename from src/nucleus-web-vue/.browserslistrc rename to src/Nucleus.Web.Vue/.browserslistrc diff --git a/src/nucleus-web-vue/.eslintrc.js b/src/Nucleus.Web.Vue/.eslintrc.js similarity index 100% rename from src/nucleus-web-vue/.eslintrc.js rename to src/Nucleus.Web.Vue/.eslintrc.js diff --git a/src/nucleus-web-vue/.gitignore b/src/Nucleus.Web.Vue/.gitignore similarity index 100% rename from src/nucleus-web-vue/.gitignore rename to src/Nucleus.Web.Vue/.gitignore diff --git a/src/Nucleus.Web.Vue/Nucleus.Web.Vue.csproj b/src/Nucleus.Web.Vue/Nucleus.Web.Vue.csproj new file mode 100644 index 0000000..bb9ffce --- /dev/null +++ b/src/Nucleus.Web.Vue/Nucleus.Web.Vue.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp3.0 + + + diff --git a/src/Nucleus.Web.Vue/Program.cs b/src/Nucleus.Web.Vue/Program.cs new file mode 100644 index 0000000..a844701 --- /dev/null +++ b/src/Nucleus.Web.Vue/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace Nucleus.Web.Vue +{ + public static class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + private static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/src/Nucleus.Web.Vue/Properties/launchSettings.json b/src/Nucleus.Web.Vue/Properties/launchSettings.json new file mode 100644 index 0000000..c180735 --- /dev/null +++ b/src/Nucleus.Web.Vue/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51281", + "sslPort": 44332 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Nucleus.Web.Vue": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/nucleus-web-vue/README.md b/src/Nucleus.Web.Vue/README.md similarity index 100% rename from src/nucleus-web-vue/README.md rename to src/Nucleus.Web.Vue/README.md diff --git a/src/Nucleus.Web.Vue/Startup.cs b/src/Nucleus.Web.Vue/Startup.cs new file mode 100644 index 0000000..700aa65 --- /dev/null +++ b/src/Nucleus.Web.Vue/Startup.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace Nucleus.Web.Vue +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", async context => + { + await context.Response.WriteAsync("Hello World!"); + }); + }); + } + } +} diff --git a/src/Nucleus.Web.Vue/appsettings.Development.json b/src/Nucleus.Web.Vue/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/src/Nucleus.Web.Vue/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/src/Nucleus.Web.Vue/appsettings.json b/src/Nucleus.Web.Vue/appsettings.json new file mode 100644 index 0000000..d9d9a9b --- /dev/null +++ b/src/Nucleus.Web.Vue/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/src/nucleus-web-vue/babel.config.js b/src/Nucleus.Web.Vue/babel.config.js similarity index 100% rename from src/nucleus-web-vue/babel.config.js rename to src/Nucleus.Web.Vue/babel.config.js diff --git a/src/nucleus-web-vue/package.json b/src/Nucleus.Web.Vue/package.json similarity index 97% rename from src/nucleus-web-vue/package.json rename to src/Nucleus.Web.Vue/package.json index 76377a2..3f95f65 100644 --- a/src/nucleus-web-vue/package.json +++ b/src/Nucleus.Web.Vue/package.json @@ -19,6 +19,7 @@ }, "devDependencies": { "@types/query-string": "^6.3.0", + "@types/node": "^12.7.1", "@vue/cli-plugin-babel": "^3.10.0", "@vue/cli-plugin-eslint": "^3.10.0", "@vue/cli-plugin-typescript": "^3.10.0", diff --git a/src/nucleus-web-vue/postcss.config.js b/src/Nucleus.Web.Vue/postcss.config.js similarity index 100% rename from src/nucleus-web-vue/postcss.config.js rename to src/Nucleus.Web.Vue/postcss.config.js diff --git a/src/nucleus-web-vue/public/favicon.ico b/src/Nucleus.Web.Vue/public/favicon.ico similarity index 100% rename from src/nucleus-web-vue/public/favicon.ico rename to src/Nucleus.Web.Vue/public/favicon.ico diff --git a/src/nucleus-web-vue/public/index.html b/src/Nucleus.Web.Vue/public/index.html similarity index 100% rename from src/nucleus-web-vue/public/index.html rename to src/Nucleus.Web.Vue/public/index.html diff --git a/src/Nucleus.Web.Vue/src/App.js b/src/Nucleus.Web.Vue/src/App.js new file mode 100644 index 0000000..fe90123 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/App.js @@ -0,0 +1,10 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component } from 'vue-property-decorator'; +let AppComponent = class AppComponent extends NucleusComponentBase { +}; +AppComponent = __decorate([ + Component +], AppComponent); +export default AppComponent; +//# sourceMappingURL=App.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/App.js.map b/src/Nucleus.Web.Vue/src/App.js.map new file mode 100644 index 0000000..00d7b25 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/App.js.map @@ -0,0 +1 @@ +{"version":3,"file":"App.js","sourceRoot":"","sources":["App.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,IAAqB,YAAY,GAAjC,MAAqB,YAAa,SAAQ,oBAAoB;CAC7D,CAAA;AADoB,YAAY;IADhC,SAAS;GACW,YAAY,CAChC;eADoB,YAAY"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/App.ts b/src/Nucleus.Web.Vue/src/App.ts similarity index 100% rename from src/nucleus-web-vue/src/App.ts rename to src/Nucleus.Web.Vue/src/App.ts diff --git a/src/nucleus-web-vue/src/App.vue b/src/Nucleus.Web.Vue/src/App.vue similarity index 100% rename from src/nucleus-web-vue/src/App.vue rename to src/Nucleus.Web.Vue/src/App.vue diff --git a/src/Nucleus.Web.Vue/src/account/account-layout.js b/src/Nucleus.Web.Vue/src/account/account-layout.js new file mode 100644 index 0000000..826faec --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/account-layout.js @@ -0,0 +1,30 @@ +import { __decorate } from "tslib"; +import { Component } from 'vue-property-decorator'; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import LanguageStore from '@/stores/language-store'; +let AccountLayoutComponent = class AccountLayoutComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.selectedLanguage = {}; + } + created() { + this.nucleus.auth.removeProps(); + } + beforeMount() { + this.selectedLanguage = LanguageStore.getLanguage(); + } + changeLanguage(languageCode, languageName) { + this.$i18n.locale = languageCode; + this.selectedLanguage = { languageName, languageCode }; + this.$vuetify.lang.current = languageCode; + LanguageStore.setLanguage({ + languageCode, + languageName + }); + } +}; +AccountLayoutComponent = __decorate([ + Component +], AccountLayoutComponent); +export default AccountLayoutComponent; +//# sourceMappingURL=account-layout.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/account/account-layout.js.map b/src/Nucleus.Web.Vue/src/account/account-layout.js.map new file mode 100644 index 0000000..3b4bcd6 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/account-layout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"account-layout.js","sourceRoot":"","sources":["account-layout.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAGpD,IAAqB,sBAAsB,GAA3C,MAAqB,sBAAuB,SAAQ,oBAAoB;IAAxE;;QACW,qBAAgB,GAAG,EAAkB,CAAC;IAoBjD,CAAC;IAlBU,OAAO;QACV,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;IAEM,WAAW;QACd,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;IACxD,CAAC;IAEM,cAAc,CAAC,YAAoB,EAAE,YAAoB;QAC5D,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,EAAE,YAAY,EAAE,YAAY,EAAkB,CAAC;QACvE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;QAE1C,aAAa,CAAC,WAAW,CAAC;YACtB,YAAY;YACZ,YAAY;SACR,CAAC,CAAC;IACd,CAAC;CACJ,CAAA;AArBoB,sBAAsB;IAD1C,SAAS;GACW,sBAAsB,CAqB1C;eArBoB,sBAAsB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/account/account-layout.ts b/src/Nucleus.Web.Vue/src/account/account-layout.ts similarity index 100% rename from src/nucleus-web-vue/src/account/account-layout.ts rename to src/Nucleus.Web.Vue/src/account/account-layout.ts diff --git a/src/nucleus-web-vue/src/account/account-layout.vue b/src/Nucleus.Web.Vue/src/account/account-layout.vue similarity index 100% rename from src/nucleus-web-vue/src/account/account-layout.vue rename to src/Nucleus.Web.Vue/src/account/account-layout.vue diff --git a/src/nucleus-web-vue/src/account/views/login/login.css b/src/Nucleus.Web.Vue/src/account/views/login/login.css similarity index 100% rename from src/nucleus-web-vue/src/account/views/login/login.css rename to src/Nucleus.Web.Vue/src/account/views/login/login.css diff --git a/src/Nucleus.Web.Vue/src/account/views/login/login.js b/src/Nucleus.Web.Vue/src/account/views/login/login.js new file mode 100644 index 0000000..99a6efb --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/login/login.js @@ -0,0 +1,30 @@ +import { __decorate } from "tslib"; +import { Component } from 'vue-property-decorator'; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +let LoginComponent = class LoginComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.loginInput = {}; + this.errors = []; + } + onSubmit() { + if (this.refs.form.validate()) { + this.nucleusService.post('/api/login', this.loginInput) + .then((response) => { + if (!response.isError) { + this.authStore.setToken(response.content.token); + this.$router.push({ path: '/admin/home' }); + } + else { + this.errors = response.errors; + } + }); + } + } +}; +LoginComponent = __decorate([ + Component +], LoginComponent); +export default LoginComponent; +//# sourceMappingURL=login.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/account/views/login/login.js.map b/src/Nucleus.Web.Vue/src/account/views/login/login.js.map new file mode 100644 index 0000000..c85c92a --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/login/login.js.map @@ -0,0 +1 @@ +{"version":3,"file":"login.js","sourceRoot":"","sources":["login.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAG/E,IAAqB,cAAc,GAAnC,MAAqB,cAAe,SAAQ,oBAAoB;IAAhE;;QACW,SAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QACzB,eAAU,GAAG,EAAiB,CAAC;QAC/B,WAAM,GAAoB,EAAE,CAAC;IAexC,CAAC;IAbU,QAAQ;QACX,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YAC3B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAe,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;iBAChE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;oBACnB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBAChD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;iBAC9C;qBAAM;oBACH,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;iBACjC;YACL,CAAC,CAAC,CAAC;SACV;IACL,CAAC;CACJ,CAAA;AAlBoB,cAAc;IADlC,SAAS;GACW,cAAc,CAkBlC;eAlBoB,cAAc"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/account/views/login/login.min.css b/src/Nucleus.Web.Vue/src/account/views/login/login.min.css similarity index 100% rename from src/nucleus-web-vue/src/account/views/login/login.min.css rename to src/Nucleus.Web.Vue/src/account/views/login/login.min.css diff --git a/src/nucleus-web-vue/src/account/views/login/login.scss b/src/Nucleus.Web.Vue/src/account/views/login/login.scss similarity index 100% rename from src/nucleus-web-vue/src/account/views/login/login.scss rename to src/Nucleus.Web.Vue/src/account/views/login/login.scss diff --git a/src/nucleus-web-vue/src/account/views/login/login.ts b/src/Nucleus.Web.Vue/src/account/views/login/login.ts similarity index 100% rename from src/nucleus-web-vue/src/account/views/login/login.ts rename to src/Nucleus.Web.Vue/src/account/views/login/login.ts diff --git a/src/nucleus-web-vue/src/account/views/login/login.vue b/src/Nucleus.Web.Vue/src/account/views/login/login.vue similarity index 100% rename from src/nucleus-web-vue/src/account/views/login/login.vue rename to src/Nucleus.Web.Vue/src/account/views/login/login.vue diff --git a/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.js b/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.js new file mode 100644 index 0000000..cca3ddc --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.js @@ -0,0 +1,31 @@ +import { __decorate } from "tslib"; +import { Component } from 'vue-property-decorator'; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +let ForgotPasswordComponent = class ForgotPasswordComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.forgotPasswordInput = {}; + this.errors = []; + this.isEmailSent = false; + } + onSubmit() { + if (this.refs.form.validate()) { + this.nucleusService.post('/api/forgotPassword', this.forgotPasswordInput) + .then((response) => { + if (!response.isError) { + this.resultMessage = this.$t('EMailSentSuccessfully').toString(); + this.isEmailSent = true; + } + else { + this.errors = response.errors; + } + }); + } + } +}; +ForgotPasswordComponent = __decorate([ + Component +], ForgotPasswordComponent); +export default ForgotPasswordComponent; +//# sourceMappingURL=forgot-password.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.js.map b/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.js.map new file mode 100644 index 0000000..89d56e6 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.js.map @@ -0,0 +1 @@ +{"version":3,"file":"forgot-password.js","sourceRoot":"","sources":["forgot-password.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAG/E,IAAqB,uBAAuB,GAA5C,MAAqB,uBAAwB,SAAQ,oBAAoB;IAAzE;;QACI,SAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QACzB,wBAAmB,GAAG,EAA0B,CAAC;QACjD,WAAM,GAAoB,EAAE,CAAC;QAC7B,gBAAW,GAAG,KAAK,CAAC;IAgBxB,CAAC;IAbG,QAAQ;QACJ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YAC3B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAwB,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC;iBAC3F,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;oBACnB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC;oBACjE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;iBAC3B;qBAAM;oBACH,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;iBACjC;YACL,CAAC,CAAC,CAAC;SACV;IACL,CAAC;CACJ,CAAA;AApBoB,uBAAuB;IAD3C,SAAS;GACW,uBAAuB,CAoB3C;eApBoB,uBAAuB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/account/views/manage/forgot-password.ts b/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.ts similarity index 100% rename from src/nucleus-web-vue/src/account/views/manage/forgot-password.ts rename to src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.ts diff --git a/src/nucleus-web-vue/src/account/views/manage/forgot-password.vue b/src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.vue similarity index 100% rename from src/nucleus-web-vue/src/account/views/manage/forgot-password.vue rename to src/Nucleus.Web.Vue/src/account/views/manage/forgot-password.vue diff --git a/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.js b/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.js new file mode 100644 index 0000000..1fc1ad3 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.js @@ -0,0 +1,32 @@ +import { __decorate } from "tslib"; +import { Component } from 'vue-property-decorator'; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +let ResetPasswordComponent = class ResetPasswordComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.resetPasswordInput = {}; + this.errors = []; + this.isPasswordReset = false; + } + onSubmit() { + if (this.refs.form.validate()) { + this.resetPasswordInput.token = this.$route.query.token.toString(); + this.nucleusService.post('/api/resetPassword', this.resetPasswordInput) + .then((response) => { + if (!response.isError) { + this.resultMessage = this.$t('PasswordResetSuccessful').toString(); + this.isPasswordReset = true; + } + else { + this.errors = response.errors; + } + }); + } + } +}; +ResetPasswordComponent = __decorate([ + Component +], ResetPasswordComponent); +export default ResetPasswordComponent; +//# sourceMappingURL=reset-password.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.js.map b/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.js.map new file mode 100644 index 0000000..beb7e35 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reset-password.js","sourceRoot":"","sources":["reset-password.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAG/E,IAAqB,sBAAsB,GAA3C,MAAqB,sBAAuB,SAAQ,oBAAoB;IAAxE;;QACI,SAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QACzB,uBAAkB,GAAG,EAAyB,CAAC;QAC/C,WAAM,GAAoB,EAAE,CAAC;QAC7B,oBAAe,GAAE,KAAK,CAAC;IAiB3B,CAAC;IAdG,QAAQ;QACJ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YAC3B,IAAI,CAAC,kBAAkB,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAuB,oBAAoB,EAAE,IAAI,CAAC,kBAAkB,CAAC;iBACxF,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;oBACnB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC,QAAQ,EAAE,CAAC;oBACnE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;iBAC/B;qBAAM;oBACH,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;iBACjC;YACL,CAAC,CAAC,CAAC;SACV;IACL,CAAC;CACJ,CAAA;AArBoB,sBAAsB;IAD1C,SAAS;GACW,sBAAsB,CAqB1C;eArBoB,sBAAsB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/account/views/manage/reset-password.ts b/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.ts similarity index 100% rename from src/nucleus-web-vue/src/account/views/manage/reset-password.ts rename to src/Nucleus.Web.Vue/src/account/views/manage/reset-password.ts diff --git a/src/nucleus-web-vue/src/account/views/manage/reset-password.vue b/src/Nucleus.Web.Vue/src/account/views/manage/reset-password.vue similarity index 100% rename from src/nucleus-web-vue/src/account/views/manage/reset-password.vue rename to src/Nucleus.Web.Vue/src/account/views/manage/reset-password.vue diff --git a/src/nucleus-web-vue/src/account/views/register/register.css b/src/Nucleus.Web.Vue/src/account/views/register/register.css similarity index 100% rename from src/nucleus-web-vue/src/account/views/register/register.css rename to src/Nucleus.Web.Vue/src/account/views/register/register.css diff --git a/src/Nucleus.Web.Vue/src/account/views/register/register.js b/src/Nucleus.Web.Vue/src/account/views/register/register.js new file mode 100644 index 0000000..c0a7f90 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/register/register.js @@ -0,0 +1,31 @@ +import { __decorate } from "tslib"; +import { Component } from 'vue-property-decorator'; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +let RegisterComponent = class RegisterComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.registerInput = {}; + this.errors = []; + this.registerComplete = false; + } + onSubmit() { + if (this.refs.form.validate()) { + this.nucleusService.post('/api/register', this.registerInput) + .then((response) => { + if (!response.isError) { + this.resultMessage = this.$t('AccountCreationSuccessful').toString(); + this.registerComplete = true; + } + else { + this.errors = response.errors; + } + }); + } + } +}; +RegisterComponent = __decorate([ + Component +], RegisterComponent); +export default RegisterComponent; +//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/account/views/register/register.js.map b/src/Nucleus.Web.Vue/src/account/views/register/register.js.map new file mode 100644 index 0000000..7281a72 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/account/views/register/register.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register.js","sourceRoot":"","sources":["register.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAG/E,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,oBAAoB;IAAnE;;QACI,SAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QACzB,kBAAa,GAAG,EAAoB,CAAC;QACrC,WAAM,GAAoB,EAAE,CAAC;QAE7B,qBAAgB,GAAG,KAAK,CAAC;IAe7B,CAAC;IAbG,QAAQ;QACJ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YAC3B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAkB,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC;iBACzE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;oBACnB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE,CAAC;oBACrE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;iBAChC;qBAAM;oBACH,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;iBACjC;YACL,CAAC,CAAC,CAAC;SACV;IACL,CAAC;CACJ,CAAA;AApBoB,iBAAiB;IADrC,SAAS;GACW,iBAAiB,CAoBrC;eApBoB,iBAAiB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/account/views/register/register.min.css b/src/Nucleus.Web.Vue/src/account/views/register/register.min.css similarity index 100% rename from src/nucleus-web-vue/src/account/views/register/register.min.css rename to src/Nucleus.Web.Vue/src/account/views/register/register.min.css diff --git a/src/nucleus-web-vue/src/account/views/register/register.scss b/src/Nucleus.Web.Vue/src/account/views/register/register.scss similarity index 100% rename from src/nucleus-web-vue/src/account/views/register/register.scss rename to src/Nucleus.Web.Vue/src/account/views/register/register.scss diff --git a/src/nucleus-web-vue/src/account/views/register/register.ts b/src/Nucleus.Web.Vue/src/account/views/register/register.ts similarity index 100% rename from src/nucleus-web-vue/src/account/views/register/register.ts rename to src/Nucleus.Web.Vue/src/account/views/register/register.ts diff --git a/src/nucleus-web-vue/src/account/views/register/register.vue b/src/Nucleus.Web.Vue/src/account/views/register/register.vue similarity index 100% rename from src/nucleus-web-vue/src/account/views/register/register.vue rename to src/Nucleus.Web.Vue/src/account/views/register/register.vue diff --git a/src/Nucleus.Web.Vue/src/admin/admin-layout.js b/src/Nucleus.Web.Vue/src/admin/admin-layout.js new file mode 100644 index 0000000..ca11cd0 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/admin-layout.js @@ -0,0 +1,18 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component } from 'vue-property-decorator'; +let AdminLayoutComponent = class AdminLayoutComponent extends NucleusComponentBase { + created() { + this.nucleus.auth.fillProps(); + } +}; +AdminLayoutComponent = __decorate([ + Component({ + components: { + AsideMenu: require('@/admin/components/menu/aside-menu/aside-menu.vue').default, + TopMenu: require('@/admin/components/menu/top-menu/top-menu.vue').default + } + }) +], AdminLayoutComponent); +export default AdminLayoutComponent; +//# sourceMappingURL=admin-layout.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/admin-layout.js.map b/src/Nucleus.Web.Vue/src/admin/admin-layout.js.map new file mode 100644 index 0000000..2055075 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/admin-layout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-layout.js","sourceRoot":"","sources":["admin-layout.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQnD,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,oBAAoB;IAC3D,OAAO;QACV,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IAClC,CAAC;CACJ,CAAA;AAJoB,oBAAoB;IANxC,SAAS,CAAC;QACP,UAAU,EAAE;YACR,SAAS,EAAE,OAAO,CAAC,mDAAmD,CAAC,CAAC,OAAO;YAC/E,OAAO,EAAE,OAAO,CAAC,+CAA+C,CAAC,CAAC,OAAO;SAC5E;KACJ,CAAC;GACmB,oBAAoB,CAIxC;eAJoB,oBAAoB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/admin/admin-layout.ts b/src/Nucleus.Web.Vue/src/admin/admin-layout.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/admin-layout.ts rename to src/Nucleus.Web.Vue/src/admin/admin-layout.ts diff --git a/src/nucleus-web-vue/src/admin/admin-layout.vue b/src/Nucleus.Web.Vue/src/admin/admin-layout.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/admin-layout.vue rename to src/Nucleus.Web.Vue/src/admin/admin-layout.vue diff --git a/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.js b/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.js new file mode 100644 index 0000000..1e4a580 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.js @@ -0,0 +1,31 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component } from 'vue-property-decorator'; +let AsideMenuComponent = class AsideMenuComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.drawer = true; + this.isAdmin = false; + } + get mainMenuItems() { + return [ + { icon: 'mdi-home', text: this.$t('Home'), link: '/admin/home' } + ]; + } + get adminMenuItems() { + return [ + { icon: 'mdi-account-multiple', text: this.$t('Users'), link: '/admin/user-list' }, + { icon: 'mdi-briefcase-account', text: this.$t('Roles'), link: '/admin/role-list' } + ]; + } + mounted() { + this.$root.$on('drawerChanged', () => { + this.drawer = !this.drawer; + }); + } +}; +AsideMenuComponent = __decorate([ + Component +], AsideMenuComponent); +export default AsideMenuComponent; +//# sourceMappingURL=aside-menu.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.js.map b/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.js.map new file mode 100644 index 0000000..97c535e --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aside-menu.js","sourceRoot":"","sources":["aside-menu.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,IAAqB,kBAAkB,GAAvC,MAAqB,kBAAmB,SAAQ,oBAAoB;IAApE;;QACI,WAAM,GAAG,IAAI,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;IAqBpB,CAAC;IAnBG,IAAI,aAAa;QACb,OAAO;YACH,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE;SACnE,CAAC;IACN,CAAC;IAED,IAAI,cAAc;QACd,OAAO;YACH,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE;YAClF,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE;SACtF,CAAC;IACN,CAAC;IAED,OAAO;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,EAC1B,GAAG,EAAE;YACD,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/B,CAAC,CAAC,CAAC;IACX,CAAC;CACJ,CAAA;AAvBoB,kBAAkB;IADtC,SAAS;GACW,kBAAkB,CAuBtC;eAvBoB,kBAAkB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/admin/components/menu/aside-menu/aside-menu.ts b/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/components/menu/aside-menu/aside-menu.ts rename to src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.ts diff --git a/src/nucleus-web-vue/src/admin/components/menu/aside-menu/aside-menu.vue b/src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/components/menu/aside-menu/aside-menu.vue rename to src/Nucleus.Web.Vue/src/admin/components/menu/aside-menu/aside-menu.vue diff --git a/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.js b/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.js new file mode 100644 index 0000000..68c8150 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.js @@ -0,0 +1,42 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component } from 'vue-property-decorator'; +import LanguageStore from '@/stores/language-store'; +let TopMenuComponent = class TopMenuComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.drawer = true; + this.selectedLanguage = {}; + } + beforeMount() { + this.selectedLanguage = LanguageStore.getLanguage(); + } + changePasswordDialogChanged(dialog) { + this.$root.$emit('changePasswordDialogChanged', dialog); + } + drawerChanged() { + this.$root.$emit('drawerChanged'); + } + changeLanguage(languageCode, languageName) { + this.$i18n.locale = languageCode; + this.selectedLanguage = { languageName, languageCode }; + this.$vuetify.lang.current = languageCode; + LanguageStore.setLanguage({ + languageCode, + languageName + }); + } + logOut() { + this.authStore.removeToken(); + this.$router.push({ path: '/account/login' }); + } +}; +TopMenuComponent = __decorate([ + Component({ + components: { + ChangePassword: require('@/admin/components/profile/change-password/change-password.vue').default + } + }) +], TopMenuComponent); +export default TopMenuComponent; +//# sourceMappingURL=top-menu.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.js.map b/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.js.map new file mode 100644 index 0000000..dc21d75 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.js.map @@ -0,0 +1 @@ +{"version":3,"file":"top-menu.js","sourceRoot":"","sources":["top-menu.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAOpD,IAAqB,gBAAgB,GAArC,MAAqB,gBAAiB,SAAQ,oBAAoB;IAAlE;;QACW,WAAM,GAAG,IAAI,CAAC;QACd,qBAAgB,GAAG,EAAkB,CAAC;IA6BjD,CAAC;IA3BU,WAAW;QACd,IAAI,CAAC,gBAAgB,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;IACxD,CAAC;IAEM,2BAA2B,CAAC,MAAe;QAC9C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;IAEM,aAAa;QAChB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;IAEM,cAAc,CAAC,YAAoB,EAAE,YAAoB;QAC5D,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,EAAE,YAAY,EAAE,YAAY,EAAkB,CAAC;QACvE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;QAE1C,aAAa,CAAC,WAAW,CAAC;YACtB,YAAY;YACZ,YAAY;SACR,CAAC,CAAC;IACd,CAAC;IAEM,MAAM;QACT,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClD,CAAC;CACJ,CAAA;AA/BoB,gBAAgB;IALpC,SAAS,CAAC;QACP,UAAU,EAAE;YACR,cAAc,EAAE,OAAO,CAAC,gEAAgE,CAAC,CAAC,OAAO;SACpG;KACJ,CAAC;GACmB,gBAAgB,CA+BpC;eA/BoB,gBAAgB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/admin/components/menu/top-menu/top-menu.ts b/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/components/menu/top-menu/top-menu.ts rename to src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.ts diff --git a/src/nucleus-web-vue/src/admin/components/menu/top-menu/top-menu.vue b/src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/components/menu/top-menu/top-menu.vue rename to src/Nucleus.Web.Vue/src/admin/components/menu/top-menu/top-menu.vue diff --git a/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.js b/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.js new file mode 100644 index 0000000..4fef2e0 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.js @@ -0,0 +1,43 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component, Prop } from 'vue-property-decorator'; +let ChangePasswordComponent = class ChangePasswordComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.errors = []; + this.changePasswordInput = {}; + this.dialog = false; + } + mounted() { + this.$root.$on('changePasswordDialogChanged', (dialog) => { + this.dialog = dialog; + }); + } + save() { + if (this.refs.form.validate()) { + this.nucleusService.post('/api/changePassword', this.changePasswordInput) + .then((response) => { + if (!response.isError) { + this.dialog = false; + this.swalToast(2000, 'success', this.$t('Successful').toString()); + this.logOut(); + } + else { + this.errors = response.errors; + } + }); + } + } +}; +__decorate([ + Prop() +], ChangePasswordComponent.prototype, "changePasswordDialog", void 0); +__decorate([ + Prop() +], ChangePasswordComponent.prototype, "logOut", void 0); +ChangePasswordComponent = __decorate([ + Component +], ChangePasswordComponent); +export default ChangePasswordComponent; +//# sourceMappingURL=change-password.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.js.map b/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.js.map new file mode 100644 index 0000000..8a84145 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change-password.js","sourceRoot":"","sources":["change-password.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C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.ts b/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/components/profile/change-password/change-password.ts rename to src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.ts diff --git a/src/nucleus-web-vue/src/admin/components/profile/change-password/change-password.vue b/src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/components/profile/change-password/change-password.vue rename to src/Nucleus.Web.Vue/src/admin/components/profile/change-password/change-password.vue diff --git a/src/Nucleus.Web.Vue/src/admin/views/home/home.js b/src/Nucleus.Web.Vue/src/admin/views/home/home.js new file mode 100644 index 0000000..d77aa06 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/views/home/home.js @@ -0,0 +1,10 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component } from 'vue-property-decorator'; +let HomeComponent = class HomeComponent extends NucleusComponentBase { +}; +HomeComponent = __decorate([ + Component +], HomeComponent); +export default HomeComponent; +//# sourceMappingURL=home.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/views/home/home.js.map b/src/Nucleus.Web.Vue/src/admin/views/home/home.js.map new file mode 100644 index 0000000..ee46933 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/views/home/home.js.map @@ -0,0 +1 @@ +{"version":3,"file":"home.js","sourceRoot":"","sources":["home.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,IAAqB,aAAa,GAAlC,MAAqB,aAAc,SAAQ,oBAAoB;CAE9D,CAAA;AAFoB,aAAa;IADjC,SAAS;GACW,aAAa,CAEjC;eAFoB,aAAa"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/admin/views/home/home.ts b/src/Nucleus.Web.Vue/src/admin/views/home/home.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/views/home/home.ts rename to src/Nucleus.Web.Vue/src/admin/views/home/home.ts diff --git a/src/nucleus-web-vue/src/admin/views/home/home.vue b/src/Nucleus.Web.Vue/src/admin/views/home/home.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/views/home/home.vue rename to src/Nucleus.Web.Vue/src/admin/views/home/home.vue diff --git a/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.js b/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.js new file mode 100644 index 0000000..1f726d9 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.js @@ -0,0 +1,123 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component, Watch } from 'vue-property-decorator'; +import Guid from '@/shared/helpers/guid-helper'; +let RoleListComponent = class RoleListComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.allPermissions = []; + this.errors = []; + this.loading = true; + this.dialog = false; + this.formTitle = ''; + this.options = {}; + this.search = ''; + this.selectAll = false; + this.createOrUpdateRoleInput = { + grantedPermissionIds: [], + role: {} + }; + this.pagedListOfRoleListDto = { + totalCount: 0, + items: [] + }; + } + get headers() { + return [ + { text: this.$t('RoleName'), value: 'name' }, + { text: this.$t('Actions'), value: 'action', sortable: false } + ]; + } + onPaginationChanged() { + this.getRoles(); + } + onSearchChanged() { + this.getRoles(); + } + mounted() { + this.getRoles(); + } + editRole(id) { + this.dialog = true; + this.formTitle = id ? this.$t('EditRole').toString() : this.$t('NewRole').toString(); + this.errors = []; + this.nucleusService.get('/api/roles/' + (id ? id : Guid.empty)) + .then((response) => { + const result = response.content; + this.allPermissions = result.allPermissions; + this.createOrUpdateRoleInput = { + grantedPermissionIds: result.grantedPermissionIds, + role: result.role + }; + }); + } + deleteRole(id) { + this.swalConfirm(this.$t('AreYouSureToDelete').toString()) + .then((result) => { + if (result.value) { + this.nucleusService.delete('/api/roles?id=' + id) + .then((response) => { + if (!response.isError) { + this.swalToast(2000, 'success', this.$t('Successful').toString()); + this.getRoles(); + } + else { + this.swalAlert('error', response.errors.join('
')); + } + }); + } + }); + } + save() { + if (this.refs.form.validate()) { + this.errors = []; + this.nucleusService.postOrPut('/api/roles', this.createOrUpdateRoleInput, this.createOrUpdateRoleInput.role.id) + .then((response) => { + if (!response.isError) { + this.swalToast(2000, 'success', this.$t('Successful').toString()); + this.dialog = false; + this.getRoles(); + } + else { + this.errors = response.errors; + } + }); + } + } + getRoles() { + this.loading = true; + const { sortBy, sortDesc, page, itemsPerPage } = this.options; + const roleListInput = { + filter: this.search, + pageIndex: page - 1, + pageSize: itemsPerPage + }; + if (sortBy.length > 0 && sortBy[0]) { + roleListInput.sortBy = sortBy + ((sortDesc.length > 0 && sortDesc[0]) ? ' desc' : ''); + } + const query = '?' + this.queryString.stringify(roleListInput); + this.nucleusService.get('/api/roles' + query, false).then((response) => { + this.pagedListOfRoleListDto = response.content; + this.loading = false; + }); + } + selectAllPermissions() { + this.createOrUpdateRoleInput.grantedPermissionIds = []; + if (this.selectAll) { + this.createOrUpdateRoleInput.grantedPermissionIds = + (this.allPermissions.map((permissions) => permissions.id)); + } + } +}; +__decorate([ + Watch('options') +], RoleListComponent.prototype, "onPaginationChanged", null); +__decorate([ + Watch('search') +], RoleListComponent.prototype, "onSearchChanged", null); +RoleListComponent = __decorate([ + Component +], RoleListComponent); +export default RoleListComponent; +//# sourceMappingURL=role-list.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.js.map b/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.js.map new file mode 100644 index 0000000..fdd1719 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-list.js","sourceRoot":"","sources":["role-list.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wB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,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAC9D,IAAI,CAAC,cAAc,CAAC,GAAG,CAA8B,YAAY,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChG,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC,OAAsC,CAAC;YAC9E,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,oBAAoB;QAChB,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,GAAG,EAAE,CAAC;QACvD,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,uBAAuB,CAAC,oBAAoB;gBAC5C,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAc,CAAC;SAChF;IACL,CAAC;CACJ,CAAA;AA1FG;IADC,KAAK,CAAC,SAAS,CAAC;4DAGhB;AAGD;IADC,KAAK,CAAC,QAAQ,CAAC;wDAGf;AApCgB,iBAAiB;IADrC,SAAS;GACW,iBAAiB,CAuHrC;eAvHoB,iBAAiB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/admin/views/roles/role-list.ts b/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/views/roles/role-list.ts rename to src/Nucleus.Web.Vue/src/admin/views/roles/role-list.ts diff --git a/src/nucleus-web-vue/src/admin/views/roles/role-list.vue b/src/Nucleus.Web.Vue/src/admin/views/roles/role-list.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/views/roles/role-list.vue rename to src/Nucleus.Web.Vue/src/admin/views/roles/role-list.vue diff --git a/src/Nucleus.Web.Vue/src/admin/views/users/user-list.js b/src/Nucleus.Web.Vue/src/admin/views/users/user-list.js new file mode 100644 index 0000000..0933da1 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/views/users/user-list.js @@ -0,0 +1,125 @@ +import { __decorate } from "tslib"; +import NucleusComponentBase from '@/shared/application/nucleus-component-base'; +import { Component, Watch } from 'vue-property-decorator'; +import Guid from '@/shared/helpers/guid-helper'; +let UserListComponent = class UserListComponent extends NucleusComponentBase { + constructor() { + super(...arguments); + this.refs = this.$refs; + this.loading = true; + this.options = {}; + this.search = ''; + this.dialog = false; + this.formTitle = ''; + this.errors = []; + this.allRoles = []; + this.isEdit = false; + this.selectAll = false; + this.createOrUpdateUserInput = { + grantedRoleIds: [], + user: {} + }; + this.pagedListOfUserListDto = { + totalCount: 0, + items: [] + }; + } + get headers() { + return [ + { text: this.$t('UserName'), value: 'userName' }, + { text: this.$t('Email'), value: 'email' }, + { text: this.$t('Actions'), value: 'action', sortable: false } + ]; + } + onPaginationChanged() { + this.getUsers(); + } + onSearchChanged() { + this.getUsers(); + } + mounted() { + this.getUsers(); + } + editUser(id) { + this.dialog = true; + this.formTitle = id ? this.$t('EditUser').toString() : this.$t('NewUser').toString(); + this.isEdit = id ? true : false; + this.errors = []; + this.nucleusService.get('/api/users/' + (id ? id : Guid.empty)) + .then((response) => { + const result = response.content; + this.allRoles = result.allRoles; + this.createOrUpdateUserInput = { + grantedRoleIds: result.grantedRoleIds, + user: result.user + }; + }); + } + deleteUser(id) { + this.swalConfirm(this.$t('AreYouSureToDelete').toString()) + .then((result) => { + if (result.value) { + this.nucleusService.delete('/api/users?id=' + id) + .then((response) => { + if (!response.isError) { + this.swalToast(2000, 'success', this.$t('Successful').toString()); + this.getUsers(); + } + else { + this.swalAlert('error', response.errors.join('
')); + } + }); + } + }); + } + save() { + if (this.refs.form.validate()) { + this.errors = []; + this.nucleusService.postOrPut('/api/users', this.createOrUpdateUserInput, this.createOrUpdateUserInput.user.id) + .then((response) => { + if (!response.isError) { + this.swalToast(2000, 'success', this.$t('Successful').toString()); + this.dialog = false; + this.getUsers(); + } + else { + this.errors = response.errors; + } + }); + } + } + getUsers() { + this.loading = true; + const { sortBy, sortDesc, page, itemsPerPage } = this.options; + const userListInput = { + filter: this.search, + pageIndex: page - 1, + pageSize: itemsPerPage + }; + if (sortBy.length > 0 && sortBy[0]) { + userListInput.sortBy = sortBy + ((sortDesc.length > 0 && sortDesc[0]) ? ' desc' : ''); + } + const query = '?' + this.queryString.stringify(userListInput); + this.nucleusService.get('/api/users' + query, false).then((response) => { + this.pagedListOfUserListDto = response.content; + this.loading = false; + }); + } + selectAllRoles() { + this.createOrUpdateUserInput.grantedRoleIds = []; + if (this.selectAll) { + this.createOrUpdateUserInput.grantedRoleIds = (this.allRoles.map((roles) => roles.id)); + } + } +}; +__decorate([ + Watch('options') +], UserListComponent.prototype, "onPaginationChanged", null); +__decorate([ + Watch('search') +], UserListComponent.prototype, "onSearchChanged", null); +UserListComponent = __decorate([ + Component +], UserListComponent); +export default UserListComponent; +//# sourceMappingURL=user-list.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/admin/views/users/user-list.js.map b/src/Nucleus.Web.Vue/src/admin/views/users/user-list.js.map new file mode 100644 index 0000000..c56a493 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/admin/views/users/user-list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user-list.js","sourceRoot":"","sources":["user-list.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,IAAI,MAAM,8BAA8B,CAAC;AAGhD,IAAqB,iBAAiB,GAAtC,MAAqB,iBAAkB,SAAQ,oBAAoB;IAAnE;;QACI,SAAI,GAAG,IAAI,CAAC,KAAY,CAAC;QACzB,YAAO,GAAG,IAAI,CAAC;QACf,YAAO,GAAG,EAAE,CAAC;QACb,WAAM,GAAG,EAAE,CAAC;QACZ,WAAM,GAAG,KAAK,CAAC;QACf,cAAS,GAAG,EAAE,CAAC;Q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AAG,CAA8B,YAAY,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChG,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC,OAAsC,CAAC;YAC9E,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,cAAc;QACV,IAAI,CAAC,uBAAuB,CAAC,cAAc,GAAG,EAAE,CAAC;QACjD,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,uBAAuB,CAAC,cAAc,GAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAc,CAAC;SACxG;IACL,CAAC;CACJ,CAAA;AA1FG;IADC,KAAK,CAAC,SAAS,CAAC;4DAGhB;AAGD;IADC,KAAK,CAAC,QAAQ,CAAC;wDAGf;AAtCgB,iBAAiB;IADrC,SAAS;GACW,iBAAiB,CAyHrC;eAzHoB,iBAAiB"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/admin/views/users/user-list.ts b/src/Nucleus.Web.Vue/src/admin/views/users/user-list.ts similarity index 100% rename from src/nucleus-web-vue/src/admin/views/users/user-list.ts rename to src/Nucleus.Web.Vue/src/admin/views/users/user-list.ts diff --git a/src/nucleus-web-vue/src/admin/views/users/user-list.vue b/src/Nucleus.Web.Vue/src/admin/views/users/user-list.vue similarity index 100% rename from src/nucleus-web-vue/src/admin/views/users/user-list.vue rename to src/Nucleus.Web.Vue/src/admin/views/users/user-list.vue diff --git a/src/nucleus-web-vue/src/assets/images/icons/flags/en.png b/src/Nucleus.Web.Vue/src/assets/images/icons/flags/en.png similarity index 100% rename from src/nucleus-web-vue/src/assets/images/icons/flags/en.png rename to src/Nucleus.Web.Vue/src/assets/images/icons/flags/en.png diff --git a/src/nucleus-web-vue/src/assets/images/icons/flags/tr.png b/src/Nucleus.Web.Vue/src/assets/images/icons/flags/tr.png similarity index 100% rename from src/nucleus-web-vue/src/assets/images/icons/flags/tr.png rename to src/Nucleus.Web.Vue/src/assets/images/icons/flags/tr.png diff --git a/src/nucleus-web-vue/src/assets/localizations/en.json b/src/Nucleus.Web.Vue/src/assets/localizations/en.json similarity index 100% rename from src/nucleus-web-vue/src/assets/localizations/en.json rename to src/Nucleus.Web.Vue/src/assets/localizations/en.json diff --git a/src/nucleus-web-vue/src/assets/localizations/tr.json b/src/Nucleus.Web.Vue/src/assets/localizations/tr.json similarity index 100% rename from src/nucleus-web-vue/src/assets/localizations/tr.json rename to src/Nucleus.Web.Vue/src/assets/localizations/tr.json diff --git a/src/nucleus-web-vue/src/assets/sass/site.css b/src/Nucleus.Web.Vue/src/assets/sass/site.css similarity index 100% rename from src/nucleus-web-vue/src/assets/sass/site.css rename to src/Nucleus.Web.Vue/src/assets/sass/site.css diff --git a/src/nucleus-web-vue/src/assets/sass/site.min.css b/src/Nucleus.Web.Vue/src/assets/sass/site.min.css similarity index 100% rename from src/nucleus-web-vue/src/assets/sass/site.min.css rename to src/Nucleus.Web.Vue/src/assets/sass/site.min.css diff --git a/src/nucleus-web-vue/src/assets/sass/site.scss b/src/Nucleus.Web.Vue/src/assets/sass/site.scss similarity index 100% rename from src/nucleus-web-vue/src/assets/sass/site.scss rename to src/Nucleus.Web.Vue/src/assets/sass/site.scss diff --git a/src/Nucleus.Web.Vue/src/main.js b/src/Nucleus.Web.Vue/src/main.js new file mode 100644 index 0000000..18e5ccf --- /dev/null +++ b/src/Nucleus.Web.Vue/src/main.js @@ -0,0 +1,25 @@ +import './assets/sass/site.css'; +import Vue from 'vue'; +import App from './App.vue'; +import router from './router'; +import vuetify from './plugins/vuetify'; +import VueI18n from 'vue-i18n'; +import LanguageStore from '@/stores/language-store'; +Vue.use(VueI18n); +const locales = { + en: require('@/assets/localizations/en.json'), + tr: require('@/assets/localizations/tr.json') +}; +const i18n = new VueI18n({ + locale: LanguageStore.getLanguage().languageCode, + fallbackLocale: 'en', + messages: locales +}); +Vue.config.productionTip = false; +new Vue({ + i18n, + router, + vuetify, + render: h => h(App) +}).$mount('#app'); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/main.js.map b/src/Nucleus.Web.Vue/src/main.js.map new file mode 100644 index 0000000..ef247e5 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAEpD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAEjB,MAAM,OAAO,GAAG;IACZ,EAAE,EAAE,OAAO,CAAC,gCAAgC,CAAC;IAC7C,EAAE,EAAE,OAAO,CAAC,gCAAgC,CAAC;CAChD,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC;IACrB,MAAM,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,YAAY;IAChD,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,OAAO;CACpB,CAAC,CAAC;AAEH,GAAG,CAAC,MAAM,CAAC,aAAa,GAAG,KAAK,CAAC;AAEjC,IAAI,GAAG,CAAC;IACJ,IAAI;IACJ,MAAM;IACN,OAAO;IACP,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;CACtB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/main.ts b/src/Nucleus.Web.Vue/src/main.ts similarity index 100% rename from src/nucleus-web-vue/src/main.ts rename to src/Nucleus.Web.Vue/src/main.ts diff --git a/src/Nucleus.Web.Vue/src/plugins/vuetify.js b/src/Nucleus.Web.Vue/src/plugins/vuetify.js new file mode 100644 index 0000000..3e9d745 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/plugins/vuetify.js @@ -0,0 +1,16 @@ +import Vue from "vue"; +import Vuetify from "vuetify/lib"; +import LanguageStore from '@/stores/language-store'; +Vue.use(Vuetify); +import en from 'vuetify/src/locale/en'; +import tr from 'vuetify/src/locale/tr'; +export default new Vuetify({ + lang: { + locales: { en, tr }, + current: LanguageStore.getLanguage().languageCode, + }, + icons: { + iconfont: "mdi" + } +}); +//# sourceMappingURL=vuetify.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/plugins/vuetify.js.map b/src/Nucleus.Web.Vue/src/plugins/vuetify.js.map new file mode 100644 index 0000000..42939b7 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/plugins/vuetify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vuetify.js","sourceRoot":"","sources":["vuetify.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,aAAa,MAAM,yBAAyB,CAAC;AAEpD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAEjB,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACvC,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEvC,eAAe,IAAI,OAAO,CAAC;IACvB,IAAI,EAAE;QACF,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;QACnB,OAAO,EAAE,aAAa,CAAC,WAAW,EAAE,CAAC,YAAY;KACpD;IACD,KAAK,EAAE;QACH,QAAQ,EAAE,KAAK;KAClB;CACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/plugins/vuetify.ts b/src/Nucleus.Web.Vue/src/plugins/vuetify.ts similarity index 100% rename from src/nucleus-web-vue/src/plugins/vuetify.ts rename to src/Nucleus.Web.Vue/src/plugins/vuetify.ts diff --git a/src/Nucleus.Web.Vue/src/router.js b/src/Nucleus.Web.Vue/src/router.js new file mode 100644 index 0000000..e1c1cc0 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/router.js @@ -0,0 +1,47 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; +import AuthStore from '@/stores/auth-store'; +import accountLayout from '@/account/account-layout.vue'; +import adminLayout from '@/admin/admin-layout.vue'; +Vue.use(VueRouter); +const router = new VueRouter({ + mode: 'history', + routes: [ + { path: '/', redirect: '/admin/home' }, + { + path: '/account', + component: accountLayout, + children: [ + { path: 'login', component: require('@/account/views/login/login.vue').default }, + { path: 'register', component: require('@/account/views/register/register.vue').default }, + { path: 'forgot-password', component: require('@/account/views/manage/forgot-password.vue').default }, + { path: 'reset-password', component: require('@/account/views/manage/reset-password.vue').default } + ] + }, + { + path: '/admin', + component: adminLayout, + meta: { requiresAuth: true }, + children: [ + { path: 'home', component: require('@/admin/views/home/home.vue').default }, + { path: 'user-list', component: require('@/admin/views/users/user-list.vue').default }, + { path: 'role-list', component: require('@/admin/views/roles/role-list.vue').default } + ] + } + ] +}); +router.beforeEach((to, from, next) => { + if (to.matched.some((record) => record.meta.requiresAuth)) { + // this route requires auth, check if logged in + // if not, redirect to login page. + if (!AuthStore.isSignedIn()) { + next({ + path: '/account/login', + query: { redirect: to.fullPath } + }); + } + } + next(); // make sure to always call next()! +}); +export default router; +//# sourceMappingURL=router.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/router.js.map b/src/Nucleus.Web.Vue/src/router.js.map new file mode 100644 index 0000000..e789bd1 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/router.js.map @@ -0,0 +1 @@ +{"version":3,"file":"router.js","sourceRoot":"","sources":["router.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,SAAS,MAAM,Y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AM,CAAC,UAAU,CAAC,CAAC,EAAO,EAAE,IAAS,EAAE,IAAS,EAAE,EAAE;IAChD,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;QAC5D,+CAA+C;QAC/C,kCAAkC;QAClC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE;YACzB,IAAI,CAAC;gBACD,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;aACnC,CAAC,CAAC;SACN;KACJ;IACD,IAAI,EAAE,CAAC,CAAC,mCAAmC;AAC/C,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/router.ts b/src/Nucleus.Web.Vue/src/router.ts similarity index 100% rename from src/nucleus-web-vue/src/router.ts rename to src/Nucleus.Web.Vue/src/router.ts diff --git a/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.js b/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.js new file mode 100644 index 0000000..71c34b2 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.js @@ -0,0 +1,58 @@ +import { __decorate } from "tslib"; +import Vue from 'vue'; +import NucleusService from '@/shared/application/nucleus-service-proxy'; +import QueryString from 'query-string'; +import Nucleus from '@/shared/application/nucleus'; +import Swal from 'sweetalert2'; +import AuthStore from '@/stores/auth-store'; +import { Component } from 'vue-property-decorator'; +let NucleusComponentBase = class NucleusComponentBase extends Vue { + constructor() { + super(...arguments); + this.nucleusService = new NucleusService(); + this.queryString = QueryString; + this.nucleus = Nucleus; + this.authStore = AuthStore; + this.requiredError = (v) => !!v || this.t('RequiredField'); + this.emailError = (v) => /.+@.+/.test(v) || this.t('EmailValidationError'); + } + swalToast(duration, type, title) { + Swal.fire({ + toast: true, + position: 'bottom-end', + showConfirmButton: false, + timer: duration, + type, + title + }); + } + swalConfirm(title) { + return Swal.fire({ + title, + type: 'warning', + showCancelButton: true, + confirmButtonText: this.$t('Yes').toString(), + cancelButtonText: this.$t('No').toString() + }); + } + swalAlert(type, html) { + Swal.fire({ + html, + type, + showConfirmButton: false + }); + } + passwordMatchError(password, passwordRepeat) { + return (password == passwordRepeat) + ? '' + : this.$t('PasswordsMustMatch').toString(); + } + t(key) { + return this.$t(key).toString(); + } +}; +NucleusComponentBase = __decorate([ + Component +], NucleusComponentBase); +export default NucleusComponentBase; +//# sourceMappingURL=nucleus-component-base.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.js.map b/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.js.map new file mode 100644 index 0000000..1de97de --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nucleus-component-base.js","sourceRoot":"","sources":["nucleus-component-base.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,IAAI,MAAM,aAAa,CAAA;AAC9B,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,GAAG;IAArD;;QACc,mBAAc,GAAmB,IAAI,cAAc,EAAE,CAAC;QACtD,gBAAW,GAAG,WAAW,CAAC;QAC1B,YAAO,GAAG,OAAO,CAAC;QAClB,cAAS,GAAG,SAAS,CAAC;QACtB,kBAAa,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAA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diff --git a/src/nucleus-web-vue/src/shared/application/nucleus-component-base.ts b/src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/application/nucleus-component-base.ts rename to src/Nucleus.Web.Vue/src/shared/application/nucleus-component-base.ts diff --git a/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.js b/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.js new file mode 100644 index 0000000..91b696e --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.js @@ -0,0 +1,69 @@ +import AuthStore from '@/stores/auth-store'; +import AppConsts from '@/shared/application/nucleus'; +import Nucleus from '@/shared/application/nucleus'; +import Guid from '@/shared/helpers/guid-helper'; +export default class NucleusService { + static request(method, url, data = '', loadingEnabled = true) { + let isBadRequest = false; + let body = data === '' ? null : data; + const headers = { + Authorization: `Bearer ${AuthStore.getToken()}` + }; + if (data) { + headers['Content-Type'] = 'application/json'; + body = JSON.stringify(data); + } + if (loadingEnabled) { + Nucleus.isLoading = true; + } + return fetch(AppConsts.baseApiUrl + url, ({ + method, + headers, + body + })) + .then((response) => { + isBadRequest = !response.ok; + if (response.status === 401) { + AuthStore.removeToken(); + return { errorMessage: 'Unauthorized request' }; + } + return response.text(); + }) + .then((responseContent) => { + let content; + try { + content = JSON.parse(responseContent); + } + catch (err) { + content = responseContent; + } + const response = { + isError: isBadRequest, + errors: isBadRequest ? content : null, + content: isBadRequest ? null : content + }; + return response; + }).finally(() => { + Nucleus.isLoading = false; + }); + } + get(url, loadingEnabled = true) { + return NucleusService.request('GET', url, '', loadingEnabled); + } + delete(url) { + return NucleusService.request('DELETE', url); + } + put(url, data) { + return NucleusService.request('PUT', url, data); + } + post(url, data) { + return NucleusService.request('POST', url, data); + } + postOrPut(url, data, id) { + if (id && id !== Guid.empty) { + return NucleusService.request('PUT', url, data); + } + return NucleusService.request('POST', url, data); + } +} +//# sourceMappingURL=nucleus-service-proxy.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.js.map b/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.js.map new file mode 100644 index 0000000..b018aae --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nucleus-service-proxy.js","sourceRoot":"","sources":["nucleus-service-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,SAAS,MAAM,8BAA8B,CAAC;AACrD,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,IAAI,MAAM,8BAA8B,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,cAAc;IACvB,MAAM,CAAC,OAAO,CAAI,MAAc,EAAE,GAAW,EAAE,OAAqB,EAAE,EAAE,cAAc,GAAG,IAAI;QAEjG,IAAI,YAAY,GAAG,KAAK,CAAC;QACzB,IAAI,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QACrC,MAAM,OAAO,GAA8B;YACvC,aAAa,EAAE,UAAU,SAAS,CAAC,QAAQ,EAAE,EAAE;SAClD,CAAC;QAEF,IAAI,IAAI,EAAE;YACN,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;YAC7C,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;SAC/B;QAED,IAAI,cAAc,EAAE;YAChB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;SAC5B;QAED,OAAO,KAAK,CAAC,SAAS,CAAC,UAAU,GAAG,GAAG,EACnC,CAAC;YACG,MAAM;YACN,OAAO;YACP,IAAI;SACP,CAAQ,CAAC;aACT,IAAI,CAAC,CAAC,QAAa,EAAE,EAAE;YACpB,YAAY,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,IAAI,QAAQ,CAAC,M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CAAC;IACxD,CAAC;IAED,SAAS,CAAI,GAAW,EAAE,IAAkB,EAAE,EAAsB;QAChE,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE;YACzB,OAAO,cAAc,CAAC,OAAO,CAAI,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,OAAO,CAAI,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;CACJ"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/application/nucleus-service-proxy.ts b/src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/application/nucleus-service-proxy.ts rename to src/Nucleus.Web.Vue/src/shared/application/nucleus-service-proxy.ts diff --git a/src/Nucleus.Web.Vue/src/shared/application/nucleus.js b/src/Nucleus.Web.Vue/src/shared/application/nucleus.js new file mode 100644 index 0000000..3f7531f --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus.js @@ -0,0 +1,27 @@ +import NucleusService from '@/shared/application/nucleus-service-proxy'; +import AuthStore from '@/stores/auth-store'; +const nucleus = { + baseApiUrl: 'https://localhost:44313', + baseClientUrl: 'http://localhost:8080', + isLoading: false, + appVersion: '1.0.0', + auth: { + grantedPermissions: [], + isGranted(permissionName) { + return this.grantedPermissions.filter((p) => p.name == permissionName).length > 0; + }, + removeProps() { + this.grantedPermissions = []; + }, + fillProps() { + const nucleusService = new NucleusService(); + nucleusService.get('/api/permissions?userNameOrEmail=' + AuthStore.getTokenData().sub).then((response) => { + if (!response.isError) { + this.grantedPermissions = response.content; + } + }); + } + } +}; +export default nucleus; +//# sourceMappingURL=nucleus.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/application/nucleus.js.map b/src/Nucleus.Web.Vue/src/shared/application/nucleus.js.map new file mode 100644 index 0000000..baebea4 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nucleus.js","sourceRoot":"","sources":["nucleus.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,MAAM,OAAO,GAAG;IACZ,UAAU,EAAE,yBAAyB;IACrC,aAAa,EAAE,uBAAuB;IACtC,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,EAAE;QACF,kBAAkB,EAAE,EAAsB;QAC1C,SAAS,CAAC,cAAsB;YAC5B,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACtF,CAAC;QACD,WAAW;YACP,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QACjC,CAAC;QACD,SAAS;YACL,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;YAC5C,cAAc,CAAC,GAAG,CACd,mCAAmC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC,GAAG,CACrE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAChB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;oBACnB,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,OAA2B,CAAC;iBAClE;YACL,CAAC,CAAC,CAAC;QACP,CAAC;KACJ;CACJ,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/application/nucleus.ts b/src/Nucleus.Web.Vue/src/shared/application/nucleus.ts similarity index 89% rename from src/nucleus-web-vue/src/shared/application/nucleus.ts rename to src/Nucleus.Web.Vue/src/shared/application/nucleus.ts index 1538a92..0aae8f6 100644 --- a/src/nucleus-web-vue/src/shared/application/nucleus.ts +++ b/src/Nucleus.Web.Vue/src/shared/application/nucleus.ts @@ -18,10 +18,11 @@ const nucleus = { const nucleusService = new NucleusService(); nucleusService.get( '/api/permissions?userNameOrEmail=' + AuthStore.getTokenData().sub - ) - .then((response) => { + ).then((response) => { + if (!response.isError) { this.grantedPermissions = response.content as IPermissionDto[]; - }); + } + }); } } }; diff --git a/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.js b/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.js new file mode 100644 index 0000000..18f6269 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.js @@ -0,0 +1,6 @@ +export default class Guid { + static get empty() { + return '00000000-0000-0000-0000-000000000000'; + } +} +//# sourceMappingURL=guid-helper.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.js.map b/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.js.map new file mode 100644 index 0000000..8dcebdf --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"guid-helper.js","sourceRoot":"","sources":["guid-helper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,IAAI;IACd,MAAM,KAAK,KAAK;QACnB,OAAO,sCAAsC,CAAC;IAClD,CAAC;CACJ"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/helpers/guid-helper.ts b/src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/helpers/guid-helper.ts rename to src/Nucleus.Web.Vue/src/shared/helpers/guid-helper.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.js b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.js new file mode 100644 index 0000000..400707f --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=change-password-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.js.map new file mode 100644 index 0000000..e6feefb --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change-password-input.js","sourceRoot":"","sources":["change-password-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/change-password-input.ts b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/change-password-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/change-password-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.js b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.js new file mode 100644 index 0000000..3d43005 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=change-password-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.js.map new file mode 100644 index 0000000..e70cfed --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change-password-output.js","sourceRoot":"","sources":["change-password-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/change-password-output.ts b/src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/change-password-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/change-password-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.js b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.js new file mode 100644 index 0000000..efe9c5f --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=forgot-password-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.js.map new file mode 100644 index 0000000..21041ba --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"forgot-password-input.js","sourceRoot":"","sources":["forgot-password-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/forgot-password-input.ts b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/forgot-password-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.js b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.js new file mode 100644 index 0000000..112dfc5 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=forgot-password-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.js.map new file mode 100644 index 0000000..f7577ce --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"forgot-password-output.js","sourceRoot":"","sources":["forgot-password-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/forgot-password-output.ts b/src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/forgot-password-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/forgot-password-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/login-input.js b/src/Nucleus.Web.Vue/src/shared/models/account/login-input.js new file mode 100644 index 0000000..d8a2c2b --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/login-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=login-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/login-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/login-input.js.map new file mode 100644 index 0000000..7240207 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/login-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"login-input.js","sourceRoot":"","sources":["login-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/login-input.ts b/src/Nucleus.Web.Vue/src/shared/models/account/login-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/login-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/login-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/login-output.js b/src/Nucleus.Web.Vue/src/shared/models/account/login-output.js new file mode 100644 index 0000000..6cf2e5e --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/login-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=login-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/login-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/login-output.js.map new file mode 100644 index 0000000..43d7e53 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/login-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"login-output.js","sourceRoot":"","sources":["login-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/login-output.ts b/src/Nucleus.Web.Vue/src/shared/models/account/login-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/login-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/login-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/register-input.js b/src/Nucleus.Web.Vue/src/shared/models/account/register-input.js new file mode 100644 index 0000000..9bab984 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/register-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=register-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/register-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/register-input.js.map new file mode 100644 index 0000000..86167c0 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/register-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register-input.js","sourceRoot":"","sources":["register-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/register-input.ts b/src/Nucleus.Web.Vue/src/shared/models/account/register-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/register-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/register-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/register-output.js b/src/Nucleus.Web.Vue/src/shared/models/account/register-output.js new file mode 100644 index 0000000..3e7ccaf --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/register-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=register-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/register-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/register-output.js.map new file mode 100644 index 0000000..830f6db --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/register-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"register-output.js","sourceRoot":"","sources":["register-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/register-output.ts b/src/Nucleus.Web.Vue/src/shared/models/account/register-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/register-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/register-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.js b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.js new file mode 100644 index 0000000..01a689f --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=reset-password-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.js.map new file mode 100644 index 0000000..0d4121b --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reset-password-input.js","sourceRoot":"","sources":["reset-password-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/reset-password-input.ts b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/reset-password-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/reset-password-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.js b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.js new file mode 100644 index 0000000..b9f7713 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=reset-password-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.js.map new file mode 100644 index 0000000..438716c --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reset-password-output.js","sourceRoot":"","sources":["reset-password-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/account/reset-password-output.ts b/src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/account/reset-password-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/account/reset-password-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.js b/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.js new file mode 100644 index 0000000..d6fef1a --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=permission-dto.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.js.map b/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.js.map new file mode 100644 index 0000000..a618a49 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"permission-dto.js","sourceRoot":"","sources":["permission-dto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/permissions/permission-dto.ts b/src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/permissions/permission-dto.ts rename to src/Nucleus.Web.Vue/src/shared/models/permissions/permission-dto.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.js b/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.js new file mode 100644 index 0000000..a0521d8 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=create-or-update-role-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.js.map new file mode 100644 index 0000000..2a1e85e --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"create-or-update-role-input.js","sourceRoot":"","sources":["create-or-update-role-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/roles/create-or-update-role-input.ts b/src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/roles/create-or-update-role-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/roles/create-or-update-role-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.js b/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.js new file mode 100644 index 0000000..ea57e71 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=get-role-for-create-or-update-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.js.map new file mode 100644 index 0000000..84e04f9 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get-role-for-create-or-update-output.js","sourceRoot":"","sources":["get-role-for-create-or-update-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/roles/get-role-for-create-or-update-output.ts b/src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/roles/get-role-for-create-or-update-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/roles/get-role-for-create-or-update-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.js b/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.js new file mode 100644 index 0000000..489529c --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=role-dto.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.js.map b/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.js.map new file mode 100644 index 0000000..8c50cac --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-dto.js","sourceRoot":"","sources":["role-dto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/roles/role-dto.ts b/src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/roles/role-dto.ts rename to src/Nucleus.Web.Vue/src/shared/models/roles/role-dto.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.js b/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.js new file mode 100644 index 0000000..8e5fefd --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=role-list-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.js.map new file mode 100644 index 0000000..8c69957 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-list-output.js","sourceRoot":"","sources":["role-list-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/roles/role-list-output.ts b/src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/roles/role-list-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/roles/role-list-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.js b/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.js new file mode 100644 index 0000000..c49407c --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=change-language-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.js.map new file mode 100644 index 0000000..61ce8d6 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change-language-input.js","sourceRoot":"","sources":["change-language-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/shared/change-language-input.ts b/src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/shared/change-language-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/shared/change-language-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.js b/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.js new file mode 100644 index 0000000..8764653 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=entity-dto.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.js.map b/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.js.map new file mode 100644 index 0000000..e744489 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"entity-dto.js","sourceRoot":"","sources":["entity-dto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/shared/entity-dto.ts b/src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/shared/entity-dto.ts rename to src/Nucleus.Web.Vue/src/shared/models/shared/entity-dto.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.js b/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.js new file mode 100644 index 0000000..cc53665 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=name-value-dto.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.js.map b/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.js.map new file mode 100644 index 0000000..d06a000 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"name-value-dto.js","sourceRoot":"","sources":["name-value-dto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/shared/name-value-dto.ts b/src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/shared/name-value-dto.ts rename to src/Nucleus.Web.Vue/src/shared/models/shared/name-value-dto.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.js b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.js new file mode 100644 index 0000000..5dc8cd5 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=paged-list-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.js.map new file mode 100644 index 0000000..7e1edf1 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"paged-list-input.js","sourceRoot":"","sources":["paged-list-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/shared/paged-list-input.ts b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/shared/paged-list-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/shared/paged-list-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.js b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.js new file mode 100644 index 0000000..affc286 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=paged-list.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.js.map b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.js.map new file mode 100644 index 0000000..a38f82c --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"paged-list.js","sourceRoot":"","sources":["paged-list.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/shared/paged-list.ts b/src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/shared/paged-list.ts rename to src/Nucleus.Web.Vue/src/shared/models/shared/paged-list.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.js b/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.js new file mode 100644 index 0000000..c8282c1 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=rest-response-dto.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.js.map b/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.js.map new file mode 100644 index 0000000..8cfa17e --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rest-response-dto.js","sourceRoot":"","sources":["rest-response-dto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/shared/rest-response-dto.ts b/src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/shared/rest-response-dto.ts rename to src/Nucleus.Web.Vue/src/shared/models/shared/rest-response-dto.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.js b/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.js new file mode 100644 index 0000000..683ab5b --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=create-or-update-user-input.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.js.map b/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.js.map new file mode 100644 index 0000000..7098b02 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.js.map @@ -0,0 +1 @@ +{"version":3,"file":"create-or-update-user-input.js","sourceRoot":"","sources":["create-or-update-user-input.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/users/create-or-update-user-input.ts b/src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/users/create-or-update-user-input.ts rename to src/Nucleus.Web.Vue/src/shared/models/users/create-or-update-user-input.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.js b/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.js new file mode 100644 index 0000000..8ec7e04 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=get-user-for-create-or-update-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.js.map new file mode 100644 index 0000000..38195c1 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get-user-for-create-or-update-output.js","sourceRoot":"","sources":["get-user-for-create-or-update-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/users/get-user-for-create-or-update-output.ts b/src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/users/get-user-for-create-or-update-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/users/get-user-for-create-or-update-output.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.js b/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.js new file mode 100644 index 0000000..ae3e931 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=user-dto.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.js.map b/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.js.map new file mode 100644 index 0000000..a3fe4cb --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user-dto.js","sourceRoot":"","sources":["user-dto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/users/user-dto.ts b/src/Nucleus.Web.Vue/src/shared/models/users/user-dto.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/users/user-dto.ts rename to src/Nucleus.Web.Vue/src/shared/models/users/user-dto.ts diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.js b/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.js new file mode 100644 index 0000000..8589feb --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.js @@ -0,0 +1,2 @@ +"use strict"; +//# sourceMappingURL=user-list-output.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.js.map b/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.js.map new file mode 100644 index 0000000..c47f751 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user-list-output.js","sourceRoot":"","sources":["user-list-output.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/shared/models/users/user-list-output.ts b/src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.ts similarity index 100% rename from src/nucleus-web-vue/src/shared/models/users/user-list-output.ts rename to src/Nucleus.Web.Vue/src/shared/models/users/user-list-output.ts diff --git a/src/nucleus-web-vue/src/shims-tsx.d.ts b/src/Nucleus.Web.Vue/src/shims-tsx.d.ts similarity index 100% rename from src/nucleus-web-vue/src/shims-tsx.d.ts rename to src/Nucleus.Web.Vue/src/shims-tsx.d.ts diff --git a/src/nucleus-web-vue/src/shims-vue.d.ts b/src/Nucleus.Web.Vue/src/shims-vue.d.ts similarity index 100% rename from src/nucleus-web-vue/src/shims-vue.d.ts rename to src/Nucleus.Web.Vue/src/shims-vue.d.ts diff --git a/src/Nucleus.Web.Vue/src/stores/auth-store.js b/src/Nucleus.Web.Vue/src/stores/auth-store.js new file mode 100644 index 0000000..0f8e519 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/stores/auth-store.js @@ -0,0 +1,23 @@ +export default class AuthStore { + static getToken() { + return localStorage.getItem(AuthStore.storageKey); + } + static setToken(token) { + localStorage.setItem(AuthStore.storageKey, token); + } + static removeToken() { + localStorage.removeItem(AuthStore.storageKey); + } + static isSignedIn() { + return !!AuthStore.getToken(); + } + static getTokenData() { + const token = AuthStore.getToken(); + if (token) { + return JSON.parse(atob(token.split('.')[1])); + } + return {}; + } +} +AuthStore.storageKey = 'token'; +//# sourceMappingURL=auth-store.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/stores/auth-store.js.map b/src/Nucleus.Web.Vue/src/stores/auth-store.js.map new file mode 100644 index 0000000..8155bf0 --- /dev/null +++ b/src/Nucleus.Web.Vue/src/stores/auth-store.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth-store.js","sourceRoot":"","sources":["auth-store.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,SAAS;IAGnB,MAAM,CAAC,QAAQ;QAClB,OAAO,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAa;QAChC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,WAAW;QACrB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;IAEM,MAAM,CAAC,UAAU;QACpB,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;IAGM,MAAM,CAAC,YAAY;QACtB,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QACnC,IAAI,KAAK,EAAE;YACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAChD;QAED,OAAO,EAAE,CAAC;IACd,CAAC;;AA1Ba,oBAAU,GAAW,OAAO,CAAC"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/stores/auth-store.ts b/src/Nucleus.Web.Vue/src/stores/auth-store.ts similarity index 100% rename from src/nucleus-web-vue/src/stores/auth-store.ts rename to src/Nucleus.Web.Vue/src/stores/auth-store.ts diff --git a/src/Nucleus.Web.Vue/src/stores/language-store.js b/src/Nucleus.Web.Vue/src/stores/language-store.js new file mode 100644 index 0000000..03bffbe --- /dev/null +++ b/src/Nucleus.Web.Vue/src/stores/language-store.js @@ -0,0 +1,14 @@ +export default class LanguageStore { + static getLanguage() { + return JSON.parse(localStorage.getItem(LanguageStore.storageKey)) || + { languageCode: 'en', languageName: 'English' }; + } + static setLanguage(input) { + localStorage.setItem(LanguageStore.storageKey, JSON.stringify(input)); + } + static removeLanguage() { + localStorage.removeItem(LanguageStore.storageKey); + } +} +LanguageStore.storageKey = 'language'; +//# sourceMappingURL=language-store.js.map \ No newline at end of file diff --git a/src/Nucleus.Web.Vue/src/stores/language-store.js.map b/src/Nucleus.Web.Vue/src/stores/language-store.js.map new file mode 100644 index 0000000..60e84fc --- /dev/null +++ b/src/Nucleus.Web.Vue/src/stores/language-store.js.map @@ -0,0 +1 @@ +{"version":3,"file":"language-store.js","sourceRoot":"","sources":["language-store.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,aAAa;IAGvB,MAAM,CAAC,WAAW;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAW,CAAC;YACtE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAmB,CAAC;IAC1E,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,KAAmB;QACzC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IAEM,MAAM,CAAC,cAAc;QACxB,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;;AAba,wBAAU,GAAW,UAAU,CAAC"} \ No newline at end of file diff --git a/src/nucleus-web-vue/src/stores/language-store.ts b/src/Nucleus.Web.Vue/src/stores/language-store.ts similarity index 100% rename from src/nucleus-web-vue/src/stores/language-store.ts rename to src/Nucleus.Web.Vue/src/stores/language-store.ts diff --git a/src/nucleus-web-vue/tsconfig.json b/src/Nucleus.Web.Vue/tsconfig.json similarity index 95% rename from src/nucleus-web-vue/tsconfig.json rename to src/Nucleus.Web.Vue/tsconfig.json index 1b24213..44c0e64 100644 --- a/src/nucleus-web-vue/tsconfig.json +++ b/src/Nucleus.Web.Vue/tsconfig.json @@ -13,7 +13,8 @@ "baseUrl": ".", "types": [ "webpack-env", - "vuetify" + "vuetify", + "node" ], "paths": { "@/*": [ diff --git a/src/nucleus-web-vue/yarn.lock b/src/Nucleus.Web.Vue/yarn.lock similarity index 99% rename from src/nucleus-web-vue/yarn.lock rename to src/Nucleus.Web.Vue/yarn.lock index 239c453..cdde1b8 100644 --- a/src/nucleus-web-vue/yarn.lock +++ b/src/Nucleus.Web.Vue/yarn.lock @@ -772,6 +772,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.9.tgz#ffeee23afdc19ab16e979338e7b536fdebbbaeaf" integrity sha512-+YB9FtyxXGyD54p8rXwWaN1EWEyar5L58GlGWgtH2I9rGmLGBQcw63+0jw+ujqVavNuO47S1ByAjm9zdHMnskw== +"@types/node@^12.7.1": + version "12.7.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.1.tgz#3b5c3a26393c19b400844ac422bd0f631a94d69d" + integrity sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -3234,16 +3239,16 @@ eslint-scope@^5.0.0: estraverse "^4.1.1" eslint-utils@^1.3.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" - integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + version "1.4.2" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" + integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== dependencies: eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== eslint@^4.19.1: version "4.19.1" diff --git a/test/Nucleus.Tests.Application/Nucleus.Tests.Application.csproj b/test/Nucleus.Tests.Application/Nucleus.Tests.Application.csproj index c40b0f9..0a487a0 100644 --- a/test/Nucleus.Tests.Application/Nucleus.Tests.Application.csproj +++ b/test/Nucleus.Tests.Application/Nucleus.Tests.Application.csproj @@ -5,7 +5,7 @@ - + all diff --git a/test/Nucleus.Tests.Shared/Nucleus.Tests.Shared.csproj b/test/Nucleus.Tests.Shared/Nucleus.Tests.Shared.csproj index 9474f74..e209613 100644 --- a/test/Nucleus.Tests.Shared/Nucleus.Tests.Shared.csproj +++ b/test/Nucleus.Tests.Shared/Nucleus.Tests.Shared.csproj @@ -5,7 +5,7 @@ - + diff --git a/test/Nucleus.Tests.Shared/TestBase.cs b/test/Nucleus.Tests.Shared/TestBase.cs index c720648..9de3048 100644 --- a/test/Nucleus.Tests.Shared/TestBase.cs +++ b/test/Nucleus.Tests.Shared/TestBase.cs @@ -11,7 +11,7 @@ namespace Nucleus.Tests.Shared { public class TestBase { - protected ClaimsPrincipal ContextUser => new ClaimsPrincipal( + protected static ClaimsPrincipal ContextUser => new ClaimsPrincipal( new ClaimsIdentity( new List { @@ -21,7 +21,7 @@ public class TestBase ) ); - protected TestServer TestServer => new TestServer( + protected static TestServer TestServer => new TestServer( new WebHostBuilder() .UseStartup() .UseEnvironment("Test") diff --git a/test/Nucleus.Tests.Shared/appsettings.json b/test/Nucleus.Tests.Shared/appsettings.json index 4adce82..f5d3f1b 100644 --- a/test/Nucleus.Tests.Shared/appsettings.json +++ b/test/Nucleus.Tests.Shared/appsettings.json @@ -5,7 +5,8 @@ "App": { "ServerRootAddress": "http://localhost:44339/", "CorsOrigins": "http://localhost:51327,http://localhost:58900,http://localhost:8080", - "CorsOriginPolicyName": "DefaultCorsPolicy" + "CorsOriginPolicyName": "DefaultCorsPolicy", + "ClientUrl": "http://localhost:8080" }, "Authentication": { "JwtBearer": { @@ -13,5 +14,14 @@ "Issuer": "Nucleus", "Audience": "http://localhost:44339/" } + }, + "Email": { + "Smtp": { + "Host": "smtp.gmail.com", + "Port": 587, + "Username": "mail_username@mail.com", + "Password": "mail_password", + "EnableSsl": true + } } } \ No newline at end of file diff --git a/test/Nucleus.Tests.Web.Api/ApiTestBase.cs b/test/Nucleus.Tests.Web.Api/ApiTestBase.cs index 82f5a5a..4872b3c 100644 --- a/test/Nucleus.Tests.Web.Api/ApiTestBase.cs +++ b/test/Nucleus.Tests.Web.Api/ApiTestBase.cs @@ -16,13 +16,13 @@ public class ApiTestBase : TestBase Password = "123qwe" }; - protected async Task LoginAsAdminUserAsync() + protected static async Task LoginAsAdminUserAsync() { return await TestServer.CreateClient().PostAsync("/api/login", AdminUserLoginViewModel.ToStringContent(Encoding.UTF8, "application/json")); } - protected async Task LoginAsync(string userNameOrEmail, string password) + protected static async Task LoginAsync(string userNameOrEmail, string password) { var adminUserLoginViewModel = new LoginInput { @@ -34,7 +34,7 @@ protected async Task LoginAsync(string userNameOrEmail, str adminUserLoginViewModel.ToStringContent(Encoding.UTF8, "application/json")); } - protected async Task LoginAsAdminUserAndGetTokenAsync() + protected static async Task LoginAsAdminUserAndGetTokenAsync() { var responseLogin = await LoginAsAdminUserAsync(); if (!responseLogin.IsSuccessStatusCode) @@ -46,7 +46,7 @@ protected async Task LoginAsAdminUserAndGetTokenAsync() return loginResult.Token; } - protected async Task LoginAndGetTokenAsync(string userNameOrEmail, string password) + protected static async Task LoginAndGetTokenAsync(string userNameOrEmail, string password) { var responseLogin = await LoginAsync(userNameOrEmail, password); if (!responseLogin.IsSuccessStatusCode) diff --git a/test/Nucleus.Tests.Web.Api/Controllers/AccountControllerTests.cs b/test/Nucleus.Tests.Web.Api/Controllers/AccountControllerTests.cs index 5c3dc69..d416f7b 100644 --- a/test/Nucleus.Tests.Web.Api/Controllers/AccountControllerTests.cs +++ b/test/Nucleus.Tests.Web.Api/Controllers/AccountControllerTests.cs @@ -139,15 +139,55 @@ public async Task Should_Change_Password() } [Fact] - public async Task Should_Get_Granted_Permissions() + public async Task Should_Get_Password_Reset_Token() { - var requestMessage = new HttpRequestMessage(HttpMethod.Get, "/api/permissions?userNameOrEmail=" + DefaultUsers.TestAdmin.UserName); - requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _token); + var testUser = await CreateAndGetTestUserAsync(); + var token = await LoginAndGetTokenAsync(testUser.UserName, "123qwe"); + var input = new ForgotPasswordInput + { + UserNameOrEmail = testUser.Email + }; + + var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/api/forgotPassword"); + requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); + requestMessage.Content = input.ToStringContent(Encoding.UTF8, "application/json"); + var response = await TestServer.CreateClient().SendAsync(requestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); - var permissions = await response.Content.ReadAsAsync>(); - Assert.True(permissions.Any()); + var result = await response.Content.ReadAsAsync(); + Assert.NotNull(result.ResetToken); + } + + [Fact] + public async Task Should_Reset_Password() + { + var testUser = await CreateAndGetTestUserAsync(); + var token = await LoginAndGetTokenAsync(testUser.UserName, "123qwe"); + var input = new ForgotPasswordInput + { + UserNameOrEmail = testUser.Email + }; + + var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/api/forgotPassword"); + requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); + requestMessage.Content = input.ToStringContent(Encoding.UTF8, "application/json"); + var response = await TestServer.CreateClient().SendAsync(requestMessage); + var result = await response.Content.ReadAsAsync(); + + var inputResetPassword = new ResetPasswordInput + { + UserNameOrEmail = testUser.Email, + Token = result.ResetToken, + Password = "aA!123456_123123" + }; + + var requestMessageResetPassword = new HttpRequestMessage(HttpMethod.Post, "/api/resetPassword"); + requestMessageResetPassword.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); + requestMessageResetPassword.Content = inputResetPassword.ToStringContent(Encoding.UTF8, "application/json"); + + var responseResetPassword = await TestServer.CreateClient().SendAsync(requestMessageResetPassword); + Assert.Equal(HttpStatusCode.OK, responseResetPassword.StatusCode); } private async Task CreateAndGetTestUserAsync() diff --git a/test/Nucleus.Tests.Web.Api/Controllers/PermissionsControllerTests.cs b/test/Nucleus.Tests.Web.Api/Controllers/PermissionsControllerTests.cs new file mode 100644 index 0000000..849b8cd --- /dev/null +++ b/test/Nucleus.Tests.Web.Api/Controllers/PermissionsControllerTests.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Nucleus.Application.Permissions.Dto; +using Nucleus.Core.Users; +using Nucleus.EntityFramework; +using Xunit; + +namespace Nucleus.Tests.Web.Api.Controllers +{ + public class PermissionsControllerTests : ApiTestBase + { + private readonly string _token; + + public PermissionsControllerTests() + { + TestServer.Host.Services.GetRequiredService(); + _token = LoginAsAdminUserAndGetTokenAsync().Result; + } + + [Fact] + public async Task Should_Get_Granted_Permissions() + { + var requestMessage = new HttpRequestMessage(HttpMethod.Get, "/api/permissions?userNameOrEmail=" + DefaultUsers.TestAdmin.UserName); + requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _token); + var response = await TestServer.CreateClient().SendAsync(requestMessage); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + var permissions = await response.Content.ReadAsAsync>(); + Assert.True(permissions.Any()); + } + } +} diff --git a/test/Nucleus.Tests.Web.Api/Controllers/RoleControllerTests.cs b/test/Nucleus.Tests.Web.Api/Controllers/RolesControllerTests.cs similarity index 95% rename from test/Nucleus.Tests.Web.Api/Controllers/RoleControllerTests.cs rename to test/Nucleus.Tests.Web.Api/Controllers/RolesControllerTests.cs index 16c9073..8b857a0 100644 --- a/test/Nucleus.Tests.Web.Api/Controllers/RoleControllerTests.cs +++ b/test/Nucleus.Tests.Web.Api/Controllers/RolesControllerTests.cs @@ -18,12 +18,12 @@ namespace Nucleus.Tests.Web.Api.Controllers { - public class RoleControllerTests : ApiTestBase + public class RolesControllerTests : ApiTestBase { private readonly NucleusDbContext _dbContext; private readonly string _token; - public RoleControllerTests() + public RolesControllerTests() { _dbContext = TestServer.Host.Services.GetRequiredService(); _token = LoginAsAdminUserAndGetTokenAsync().Result; @@ -81,7 +81,7 @@ public async Task Should_Create_Role() requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _token); requestMessage.Content = input.ToStringContent(Encoding.UTF8, "application/json"); var responseAddRole = await TestServer.CreateClient().SendAsync(requestMessage); - Assert.Equal(HttpStatusCode.OK, responseAddRole.StatusCode); + Assert.Equal(HttpStatusCode.Created, responseAddRole.StatusCode); var insertedRole = await _dbContext.Roles.FirstAsync(r => r.Name == input.Role.Name); Assert.NotNull(insertedRole); @@ -122,7 +122,7 @@ public async Task Should_Delete_Role() requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _token); requestMessage.Content = new { id = testRole.Id }.ToStringContent(Encoding.UTF8, "application/json"); var responseAddRole = await TestServer.CreateClient().SendAsync(requestMessage); - Assert.Equal(HttpStatusCode.OK, responseAddRole.StatusCode); + Assert.Equal(HttpStatusCode.NoContent, responseAddRole.StatusCode); } private async Task CreateAndGetTestRoleAsync() diff --git a/test/Nucleus.Tests.Web.Api/Controllers/UserControllerTests.cs b/test/Nucleus.Tests.Web.Api/Controllers/UsersControllerTests.cs similarity index 97% rename from test/Nucleus.Tests.Web.Api/Controllers/UserControllerTests.cs rename to test/Nucleus.Tests.Web.Api/Controllers/UsersControllerTests.cs index 6140aa5..3e96865 100644 --- a/test/Nucleus.Tests.Web.Api/Controllers/UserControllerTests.cs +++ b/test/Nucleus.Tests.Web.Api/Controllers/UsersControllerTests.cs @@ -18,12 +18,12 @@ namespace Nucleus.Tests.Web.Api.Controllers { - public class UserControllerTests : ApiTestBase + public class UsersControllerTests : ApiTestBase { private readonly NucleusDbContext _dbContext; private readonly string _token; - public UserControllerTests() + public UsersControllerTests() { _dbContext = TestServer.Host.Services.GetRequiredService(); _token = LoginAsAdminUserAndGetTokenAsync().Result; @@ -83,7 +83,7 @@ public async Task Should_Create_User() requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _token); requestMessage.Content = input.ToStringContent(Encoding.UTF8, "application/json"); var responseAddUser = await TestServer.CreateClient().SendAsync(requestMessage); - Assert.Equal(HttpStatusCode.OK, responseAddUser.StatusCode); + Assert.Equal(HttpStatusCode.Created, responseAddUser.StatusCode); var insertedUser = await _dbContext.Users.FirstAsync(u => u.UserName == input.User.UserName); Assert.NotNull(insertedUser); diff --git a/test/Nucleus.Tests.Web.Api/Nucleus.Tests.Web.Api.csproj b/test/Nucleus.Tests.Web.Api/Nucleus.Tests.Web.Api.csproj index 9342725..39899f6 100644 --- a/test/Nucleus.Tests.Web.Api/Nucleus.Tests.Web.Api.csproj +++ b/test/Nucleus.Tests.Web.Api/Nucleus.Tests.Web.Api.csproj @@ -6,7 +6,7 @@ - + all