Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
d6795ce
Base models for Website objects
DaniTakacs Jun 23, 2020
1a6bb51
Flight ToJson added
DaniTakacs Jun 23, 2020
8f89b92
FlightSharp API removed
DaniTakacs Jun 23, 2020
3d13ef6
add ApiService, currently gets one flight params(destination, numOfFl…
oliverGal-05 Jun 23, 2020
a7fcc1d
refact SetFlight in ApiService
oliverGal-05 Jun 23, 2020
7e1e7df
test for FlightApiService, getallFromTo
Rhyvan Jun 29, 2020
7dabbd5
modify backend to be usable by test
Rhyvan Jun 29, 2020
744c4c6
refactor FlightApiService to use DI test
Rhyvan Jun 29, 2020
06d7824
Refactor (Fligt)ApiService: add parameter, and rename Class
Rhyvan Jun 29, 2020
ea6df17
Merge pull request #1 from DaniTakacs/Test/API
Rhyvan Jun 30, 2020
e22926d
Add ClientService interface and implementation
Rhyvan Jun 30, 2020
1e96f00
Decouple ClientService and FlightApiService
Rhyvan Jun 30, 2020
5b0ad22
Refactor test to fit the new changes
Rhyvan Jun 30, 2020
22c10d2
Merge pull request #2 from DaniTakacs/feature/decouple
Rhyvan Jun 30, 2020
3625ecd
IFlightService interface added
DaniTakacs Jun 30, 2020
048c079
Merge branch 'feature-sorting' into develop
DaniTakacs Jun 30, 2020
f02db3b
Merge pull request #3 from DaniTakacs/develop
DaniTakacs Jun 30, 2020
9cb0fd1
Fixing the issues after merging
DaniTakacs Jun 30, 2020
3f817ff
fix, and add FlightApiService interface
Rhyvan Jun 30, 2020
b23af8a
Some badly handled commit reset.
Rhyvan Jun 30, 2020
a972429
basic search, base html, base Get in APIController, responds with fli…
oliverGal-05 Jun 30, 2020
36f16f1
little css for search.html
oliverGal-05 Jun 30, 2020
ac8c216
Register Session and add CartController
Rhyvan Jun 30, 2020
f6129c8
frontend input validation (only 3 char long airport codes, can not co…
oliverGal-05 Jun 30, 2020
b830756
Add new methods to Cart, add Ticket class
Rhyvan Jun 30, 2020
8ea94b1
Flight implements IEquatable, add Expiration property
Rhyvan Jun 30, 2020
3304cb3
add Model.Cart Tests
Rhyvan Jun 30, 2020
aa28364
GetFlights overloads added ( currency, currency + maxPrice)
DaniTakacs Jul 1, 2020
1e8734d
Merge branch 'GetCheapFlights' into feature-sorting
DaniTakacs Jul 1, 2020
8678494
Merge pull request #4 from DaniTakacs/feature-sorting
DaniTakacs Jul 1, 2020
d7cf78e
Add Post method to CartController and SessionService for testing
Rhyvan Jul 1, 2020
010f0b2
Refactor model classes' constructor (Cart, Ticket)
Rhyvan Jul 1, 2020
ebe4c6b
Add tests for CartController
Rhyvan Jul 1, 2020
6e8865c
fetch instead of xmlhttp request, search.js got the response from the…
oliverGal-05 Jul 1, 2020
0e13350
Merge pull request #5 from DaniTakacs/feature/customerapi
Rhyvan Jul 1, 2020
7b40e6b
show search result (needs refactor)
oliverGal-05 Jul 1, 2020
a15ab4a
add btn in each row, storin data in data-attribue
oliverGal-05 Jul 1, 2020
2a1f39d
del unused stuff
oliverGal-05 Jul 1, 2020
125ccbb
Add Buttons try to send postrequest with Ticket data in json
oliverGal-05 Jul 1, 2020
d897ed4
minimalis commenting, bug at sending POST
oliverGal-05 Jul 1, 2020
aa54cd9
addeventlistener bug solved
oliverGal-05 Jul 1, 2020
4d13b8c
Add view to CartController
Rhyvan Jul 1, 2020
d9120e0
fix typo in CartControllerTest
Rhyvan Jul 1, 2020
02afdc3
merged dev
oliverGal-05 Jul 1, 2020
c80f27f
method receiving post req must be fix
oliverGal-05 Jul 1, 2020
84dc7ca
idk
oliverGal-05 Jul 1, 2020
c85d2ee
have to parse data after receiving from postreq (CartController)
oliverGal-05 Jul 2, 2020
a9f538f
add View to Cart
Rhyvan Jul 2, 2020
4afefc8
Modify CartController to have view
Rhyvan Jul 2, 2020
d3a2980
Modify Startup.cs Config to be able to store session
Rhyvan Jul 2, 2020
c5e9aaa
Fix Models.Cart, Tickets property set to public, to be able to deseri…
Rhyvan Jul 2, 2020
c58e46f
Add data annotations to Models.Flight
Rhyvan Jul 2, 2020
2110e79
resolve merge conflicts
Rhyvan Jul 2, 2020
0fc1d49
rename Controllers.CartController route
Rhyvan Jul 2, 2020
8a0fd3d
Remove nullable value type from Models.Flight (System.Text.Json canno…
Rhyvan Jul 2, 2020
0199b90
Remove unnecessary method
Rhyvan Jul 2, 2020
582a3ec
cshtml instead of html, still using js
oliverGal-05 Jul 2, 2020
dd2a754
cart controller route modified to Home/api te be able to receive requ…
oliverGal-05 Jul 2, 2020
0d9f2c7
Refactor Models.Cart (AsReadonly wrapper was unnecessary)
Rhyvan Jul 2, 2020
06bcfce
add session save in CartController, refactor returning values
Rhyvan Jul 2, 2020
bd30207
refactor search.js to send proper JSON
Rhyvan Jul 2, 2020
a1a4793
Refactor CartController Tests' expected results
Rhyvan Jul 2, 2020
72f0489
merge dev int this branch
oliverGal-05 Jul 2, 2020
0902383
route change
oliverGal-05 Jul 2, 2020
34ef4d7
Cart.js added
DaniTakacs Jul 2, 2020
9fb1b2e
trying to solve add to cart
oliverGal-05 Jul 2, 2020
51be3b6
AddFlight - add to cart working
oliverGal-05 Jul 2, 2020
bc809b0
set origin and destination for flights
oliverGal-05 Jul 2, 2020
2215339
Add item adds an empty item
DaniTakacs Jul 2, 2020
ce7295d
Cart add work in progress
DaniTakacs Jul 2, 2020
4762339
Set Cart value in Session upon Index load
Rhyvan Jul 2, 2020
d77ce60
Restore CartController to its former glory (tests
Rhyvan Jul 2, 2020
180aa26
Merge branch 'develop' of https://github.com/DaniTakacs/FlightSharp i…
Rhyvan Jul 2, 2020
9658ddf
small design changes
oliverGal-05 Jul 2, 2020
0d5d432
Merge branch 'develop' of https://github.com/DaniTakacs/FlightSharp i…
oliverGal-05 Jul 2, 2020
f2a40ce
Merged dev into cartJS
Rhyvan Jul 2, 2020
0df3a41
search with price property too
oliverGal-05 Jul 2, 2020
953999b
only number in pricelimit
oliverGal-05 Jul 2, 2020
63207cd
if pricelimit starts with 0 then return whole flightslist
oliverGal-05 Jul 2, 2020
318c7ed
clear search results shown in prev search
oliverGal-05 Jul 2, 2020
930c017
Rewrite entire Cart.js, handles plus-minus item
Rhyvan Jul 2, 2020
5262f38
Item can be deleted from cart. (JS + View)
Rhyvan Jul 2, 2020
42f5613
Add new route to CartController for deleting Flights from Cart.
Rhyvan Jul 2, 2020
f2f1ce2
Solve merge conflicts
Rhyvan Jul 2, 2020
1782ae9
Merge pull request #7 from DaniTakacs/cartJS
Rhyvan Jul 2, 2020
ccae830
index welcome changed
oliverGal-05 Jul 3, 2020
8d63a56
Register/login working with Identity
DaniTakacs Aug 27, 2020
3e4ef2b
Merge pull request #8 from DaniTakacs/userHandling
DaniTakacs Aug 27, 2020
22cc95e
extend IdentityUser and create migration
Rhyvan Sep 7, 2020
b6a4208
renamed IdentityUser to ApplicationUser in razor pages
Rhyvan Sep 7, 2020
e02a30f
Merge pull request #10 from DaniTakacs/feature/extendIdentityUser
oliverGal-05 Sep 8, 2020
9b74dd6
add Profile page (cshtml, css, js, controller)
oliverGal-05 Sep 8, 2020
835dee8
New minimalistic pastel design
DaniTakacs Sep 8, 2020
7da1d8d
Search styling finished
DaniTakacs Sep 8, 2020
bf00976
Carty styling finished
DaniTakacs Sep 8, 2020
eb9af25
User profile initial style
DaniTakacs Sep 8, 2020
339d18b
profile page loads the current logged in person's info
oliverGal-05 Sep 9, 2020
248896f
Date formatting, Search results table styling
DaniTakacs Sep 9, 2020
530e185
profile editable, db saves the changes
oliverGal-05 Sep 9, 2020
e8dc201
Background img removed from all but index
DaniTakacs Sep 9, 2020
9c07a01
Darker background color
DaniTakacs Sep 10, 2020
d9060f5
Merge pull request #11 from DaniTakacs/editProfile
DaniTakacs Sep 10, 2020
9c2540d
Add webshop models to EF with migration
Rhyvan Sep 10, 2020
0f44ad8
Include handle of Identity and EF query in CartController with session
Rhyvan Sep 10, 2020
625f127
Merge branch 'develop' into mergeDevToCartAPI
Rhyvan Sep 10, 2020
64bd513
Merge remote-tracking branch 'origin/design' into mergeDevToCartAPI
Rhyvan Sep 10, 2020
ca7e7c4
Merge pull request #13 from DaniTakacs/mergeDevToCartAPI
DaniTakacs Sep 11, 2020
bb8008a
fix json serialization FLight to FlightVM
Rhyvan Sep 11, 2020
e821ada
Merge branch 'develop' of https://github.com/DaniTakacs/FlightSharp i…
Rhyvan Sep 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions FlightSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightSharpAPI", "FlightSharpAPI\FlightSharpAPI.csproj", "{6EFCB0B8-ACA6-40FD-8221-1B86D78A72E3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlightSharpWebSite", "FlightSharpWebSite\FlightSharpWebSite.csproj", "{24EF34D2-BC6E-44B8-914E-4FE95347D698}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlightSharpWebSite", "FlightSharpWebSite\FlightSharpWebSite.csproj", "{24EF34D2-BC6E-44B8-914E-4FE95347D698}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlightSharpWebSiteTests", "FlightSharpWebSiteTests\FlightSharpWebSiteTests.csproj", "{C2C87933-A2C4-46B4-8770-151CED8CE9AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6EFCB0B8-ACA6-40FD-8221-1B86D78A72E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EFCB0B8-ACA6-40FD-8221-1B86D78A72E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EFCB0B8-ACA6-40FD-8221-1B86D78A72E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EFCB0B8-ACA6-40FD-8221-1B86D78A72E3}.Release|Any CPU.Build.0 = Release|Any CPU
{24EF34D2-BC6E-44B8-914E-4FE95347D698}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24EF34D2-BC6E-44B8-914E-4FE95347D698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24EF34D2-BC6E-44B8-914E-4FE95347D698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24EF34D2-BC6E-44B8-914E-4FE95347D698}.Release|Any CPU.Build.0 = Release|Any CPU
{C2C87933-A2C4-46B4-8770-151CED8CE9AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2C87933-A2C4-46B4-8770-151CED8CE9AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2C87933-A2C4-46B4-8770-151CED8CE9AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2C87933-A2C4-46B4-8770-151CED8CE9AC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
25 changes: 25 additions & 0 deletions FlightSharpWebSite/Areas/Identity/Data/ApplicationUser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using FlightSharpWebSite.Models;
using Microsoft.AspNetCore.Identity;

namespace FlightSharpWebSite.Areas.Identity.Data
{
public class ApplicationUser : IdentityUser
{
[MaxLength(10)]
public string FirstName { get; set; }
[MaxLength(15)]
public string LastName { get; set; }

[MaxLength(15)]
public string AccountName { get; set; }
public UserAddress UserAddress { get; set; }

public Cart Cart { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using FlightSharpWebSite.Areas.Identity.Data;
using FlightSharpWebSite.Models;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace FlightSharpWebSite.Data
{
public class FlightSharpWebSiteContext : IdentityDbContext<ApplicationUser>
{
public FlightSharpWebSiteContext(DbContextOptions<FlightSharpWebSiteContext> options)
: base(options)
{
}

public DbSet<Cart> Cart { get; set; }
public DbSet<Ticket> Tickets {get; set;}
public DbSet<Flight> Flights { get; set; }

protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// Customize the ASP.NET Identity model and override the defaults if needed.
// For example, you can rename the ASP.NET Identity table names and more.
// Add your customizations after calling base.OnModelCreating(builder);

builder.Entity<ApplicationUser>()
.HasOne(appUser => appUser.UserAddress)
.WithOne(address => address.ApplicationUser)
.HasForeignKey<UserAddress>(u => u.UserAddressId);

builder.Entity<Cart>()
.HasOne(c => c.ApplicationUser)
.WithOne(a => a.Cart)
.HasForeignKey<Cart>(c => c.CartId);

builder.Entity<Cart>()
.HasMany(c => c.Tickets)
.WithOne(t => t.Cart);

builder.Entity<Ticket>()
.HasOne(t => t.Flight)
.WithOne(f => f.Ticket)
.HasForeignKey<Flight>(f => f.FlightId);

}
}
}
20 changes: 20 additions & 0 deletions FlightSharpWebSite/Areas/Identity/IdentityHostingStartup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

[assembly: HostingStartup(typeof(FlightSharpWebSite.Areas.Identity.IdentityHostingStartup))]
namespace FlightSharpWebSite.Areas.Identity
{
public class IdentityHostingStartup : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
builder.ConfigureServices((context, services) => {
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@page
@model AccessDeniedModel
@{
ViewData["Title"] = "Access denied";
}

<header>
<h1 class="text-danger">@ViewData["Title"]</h1>
<p class="text-danger">You do not have access to this resource.</p>
</header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace FlightSharpWebSite.Areas.Identity.Pages.Account
{
public class AccessDeniedModel : PageModel
{
public void OnGet()
{

}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@page
@model ConfirmEmailModel
@{
ViewData["Title"] = "Confirm email";
}

<h1>@ViewData["Title"]</h1>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FlightSharpWebSite.Areas.Identity.Data;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;

namespace FlightSharpWebSite.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ConfirmEmailModel : PageModel
{
private readonly UserManager<ApplicationUser> _userManager;

public ConfirmEmailModel(UserManager<ApplicationUser> userManager)
{
_userManager = userManager;
}

[TempData]
public string StatusMessage { get; set; }

public async Task<IActionResult> OnGetAsync(string userId, string code)
{
if (userId == null || code == null)
{
return RedirectToPage("/Index");
}

var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound($"Unable to load user with ID '{userId}'.");
}

code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await _userManager.ConfirmEmailAsync(user, code);
StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email.";
return Page();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@page
@model ConfirmEmailChangeModel
@{
ViewData["Title"] = "Confirm email change";
}

<h1>@ViewData["Title"]</h1>
<partial name="_StatusMessage" model="Model.StatusMessage" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FlightSharpWebSite.Areas.Identity.Data;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;

namespace FlightSharpWebSite.Areas.Identity.Pages.Account
{
[AllowAnonymous]
public class ConfirmEmailChangeModel : PageModel
{
private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager;

public ConfirmEmailChangeModel(UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}

[TempData]
public string StatusMessage { get; set; }

public async Task<IActionResult> OnGetAsync(string userId, string email, string code)
{
if (userId == null || email == null || code == null)
{
return RedirectToPage("/Index");
}

var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound($"Unable to load user with ID '{userId}'.");
}

code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await _userManager.ChangeEmailAsync(user, email, code);
if (!result.Succeeded)
{
StatusMessage = "Error changing email.";
return Page();
}

// In our UI email and user name are one and the same, so when we update the email
// we need to update the user name.
var setUserNameResult = await _userManager.SetUserNameAsync(user, email);
if (!setUserNameResult.Succeeded)
{
StatusMessage = "Error changing user name.";
return Page();
}

await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Thank you for confirming your email change.";
return Page();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@page
@model ExternalLoginModel
@{
ViewData["Title"] = "Register";
}

<h1>@ViewData["Title"]</h1>
<h4 id="external-login-title">Associate your @Model.ProviderDisplayName account.</h4>
<hr />

<p id="external-login-description" class="text-info">
You've successfully authenticated with <strong>@Model.ProviderDisplayName</strong>.
Please enter an email address for this site below and click the Register button to finish
logging in.
</p>

<div class="row">
<div class="col-md-4">
<form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.Email"></label>
<input asp-for="Input.Email" class="form-control" />
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Register</button>
</form>
</div>
</div>

@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
Loading