Permalink
Browse files

Adding angular 6 project back. Login works

  • Loading branch information...
ehelin committed Oct 6, 2018
1 parent d223233 commit 4fac0100907e4627863d4388b816b497b314b7c0
Showing with 66,135 additions and 0 deletions.
  1. +6 −0 TgimbaNetCore.sln
  2. +1 −0 TgimbaNetCoreWebAngular6/.editorconfig
  3. +39 −0 TgimbaNetCoreWebAngular6/.gitignore
  4. +22 −0 TgimbaNetCoreWebAngular6/Controllers/BaseController.cs
  5. +55 −0 TgimbaNetCoreWebAngular6/Controllers/HomeController.cs
  6. +24 −0 TgimbaNetCoreWebAngular6/Program.cs
  7. +27 −0 TgimbaNetCoreWebAngular6/Properties/launchSettings.json
  8. +27 −0 TgimbaNetCoreWebAngular6/README.md
  9. +77 −0 TgimbaNetCoreWebAngular6/Startup.cs
  10. +18 −0 TgimbaNetCoreWebAngular6/TgimbaNetCoreWebAngular6.csproj
  11. +24 −0 TgimbaNetCoreWebAngular6/WebClient.cs
  12. +127 −0 TgimbaNetCoreWebAngular6/angular.json
  13. +9 −0 TgimbaNetCoreWebAngular6/appsettings.Development.json
  14. +8 −0 TgimbaNetCoreWebAngular6/appsettings.json
  15. +28 −0 TgimbaNetCoreWebAngular6/e2e/protractor.conf.js
  16. +14 −0 TgimbaNetCoreWebAngular6/e2e/src/app.e2e-spec.ts
  17. +11 −0 TgimbaNetCoreWebAngular6/e2e/src/app.po.ts
  18. +13 −0 TgimbaNetCoreWebAngular6/e2e/tsconfig.e2e.json
  19. +10,382 −0 TgimbaNetCoreWebAngular6/package-lock.json
  20. +48 −0 TgimbaNetCoreWebAngular6/package.json
  21. 0 TgimbaNetCoreWebAngular6/src/app/app.component.css
  22. +21 −0 TgimbaNetCoreWebAngular6/src/app/app.component.html
  23. +27 −0 TgimbaNetCoreWebAngular6/src/app/app.component.spec.ts
  24. +53 −0 TgimbaNetCoreWebAngular6/src/app/app.component.ts
  25. +21 −0 TgimbaNetCoreWebAngular6/src/app/app.module.ts
  26. 0 TgimbaNetCoreWebAngular6/src/assets/.gitkeep
  27. +11 −0 TgimbaNetCoreWebAngular6/src/browserslist
  28. +3 −0 TgimbaNetCoreWebAngular6/src/environments/environment.prod.ts
  29. +16 −0 TgimbaNetCoreWebAngular6/src/environments/environment.ts
  30. BIN TgimbaNetCoreWebAngular6/src/favicon.ico
  31. +14 −0 TgimbaNetCoreWebAngular6/src/index.html
  32. +31 −0 TgimbaNetCoreWebAngular6/src/karma.conf.js
  33. +13 −0 TgimbaNetCoreWebAngular6/src/main.ts
  34. +80 −0 TgimbaNetCoreWebAngular6/src/polyfills.ts
  35. +1 −0 TgimbaNetCoreWebAngular6/src/styles.css
  36. +20 −0 TgimbaNetCoreWebAngular6/src/test.ts
  37. +11 −0 TgimbaNetCoreWebAngular6/src/tsconfig.app.json
  38. +18 −0 TgimbaNetCoreWebAngular6/src/tsconfig.spec.json
  39. +17 −0 TgimbaNetCoreWebAngular6/src/tslint.json
  40. +21 −0 TgimbaNetCoreWebAngular6/tsconfig.json
  41. +131 −0 TgimbaNetCoreWebAngular6/tslint.json
  42. +346 −0 TgimbaNetCoreWebAngular6/wwwroot/3rdpartylicenses.txt
  43. BIN TgimbaNetCoreWebAngular6/wwwroot/favicon.ico
  44. +14 −0 TgimbaNetCoreWebAngular6/wwwroot/index.html
  45. +296 −0 TgimbaNetCoreWebAngular6/wwwroot/main.js
  46. +1 −0 TgimbaNetCoreWebAngular6/wwwroot/main.js.map
  47. +5,482 −0 TgimbaNetCoreWebAngular6/wwwroot/polyfills.js
  48. +1 −0 TgimbaNetCoreWebAngular6/wwwroot/polyfills.js.map
  49. +154 −0 TgimbaNetCoreWebAngular6/wwwroot/runtime.js
  50. +1 −0 TgimbaNetCoreWebAngular6/wwwroot/runtime.js.map
  51. +548 −0 TgimbaNetCoreWebAngular6/wwwroot/styles.js
  52. +1 −0 TgimbaNetCoreWebAngular6/wwwroot/styles.js.map
  53. +47,821 −0 TgimbaNetCoreWebAngular6/wwwroot/vendor.js
  54. +1 −0 TgimbaNetCoreWebAngular6/wwwroot/vendor.js.map
View
@@ -30,6 +30,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestsShared", "TestShared\T
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestJavaScriptV2", "TestJavaScriptV2\TestJavaScriptV2.csproj", "{234F724E-F026-4475-BBFB-924E4F7D4586}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TgimbaNetCoreWebAngular6", "TgimbaNetCoreWebAngular6\TgimbaNetCoreWebAngular6.csproj", "{69050356-4AAB-43EA-90BC-FDF6E2775335}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -72,6 +74,10 @@ Global
{234F724E-F026-4475-BBFB-924E4F7D4586}.Debug|Any CPU.Build.0 = Debug|Any CPU
{234F724E-F026-4475-BBFB-924E4F7D4586}.Release|Any CPU.ActiveCfg = Release|Any CPU
{234F724E-F026-4475-BBFB-924E4F7D4586}.Release|Any CPU.Build.0 = Release|Any CPU
{69050356-4AAB-43EA-90BC-FDF6E2775335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69050356-4AAB-43EA-90BC-FDF6E2775335}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69050356-4AAB-43EA-90BC-FDF6E2775335}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69050356-4AAB-43EA-90BC-FDF6E2775335}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -0,0 +1 @@
@@ -0,0 +1,39 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
@@ -0,0 +1,22 @@
using System;
//using System.Collections.Generic;
//using System.Diagnostics;
//using System.Linq;
//using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
//using TgimbaNetCoreWeb.Models;
using API;
using Shared.interfaces;
namespace TgimbaNetCoreWeb.Controllers
{
public class BaseController : Controller
{
protected ITgimbaService service = null;
public BaseController(ITgimbaService service)
{
this.service = service;
}
}
}
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Shared.interfaces;
namespace TgimbaNetCoreWeb.Controllers
{
public class HomeController : BaseController
{
public HomeController(ITgimbaService service)
: base(service) { }
public IActionResult Index()
{
return View();
}
public IActionResult HtmlVanillaJsIndex()
{
return View();
}
[HttpPost]
public string Login([FromQuery] string encodedUser, string encodedPass)
{
WebClient client = new WebClient(this.service);
string token = client.Login(encodedUser, encodedPass);
return token;
}
public IActionResult About()
{
ViewData["Message"] = "Your application description page.";
return View();
}
public IActionResult Contact()
{
ViewData["Message"] = "Your contact page.";
return View();
}
public IActionResult Privacy()
{
return View();
}
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace TgimbaNetCoreWeb
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:62356",
"sslPort": 44367
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"TgimbaNetCoreWeb": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@@ -0,0 +1,27 @@
# TgimbaNetCoreWeb
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.2.3.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Shared.interfaces;
using API;
namespace TgimbaNetCoreWeb
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ITgimbaService>(new TgimbaService());
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
//app.UseHttpsRedirection();
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "welcome",
template: "{controller=Welcome}/{action=Index}/{id?}");
routes.MapRoute(
name: "vanillaJsEntry",
template: "{controller=Home}/{action=HtmlVanillaJsIndex}/{id?}");
});
}
}
}
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<PostBuildEvent>ng build --aot</PostBuildEvent>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\API\API.csproj" />
<ProjectReference Include="..\Shared\Shared.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,24 @@
using Shared.interfaces;
using Microsoft.AspNetCore.Mvc;
namespace TgimbaNetCoreWeb
{
public class WebClient
{
private ITgimbaService service = null;
public WebClient(ITgimbaService service)
{
this.service = service;
}
public string Login(string encodedUser, string encodedPass)
{
string token = string.Empty;
token = service.ProcessUser(encodedUser, encodedPass);
return token;
}
}
}
Oops, something went wrong.

0 comments on commit 4fac010

Please sign in to comment.