Skip to content

Commit c834e5c

Browse files
authored
Damienbod/2-3-Multi-Tenant Nuget, Bootstrap4 update (#412)
* Updating styles, using in-memory to reverse when complete * styles * Updating views * updating the layout * improving layout * styling * reset in memory db * dotnet format
1 parent 0549d3d commit c834e5c

File tree

73 files changed

+39946
-24063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+39946
-24063
lines changed

2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/HomeController.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -79,7 +79,13 @@ public IActionResult UnauthorizedTenant()
7979
{
8080
return View();
8181
}
82+
83+
public IActionResult Privacy()
84+
{
85+
return View();
86+
}
8287

88+
[AllowAnonymous]
8389
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8490
public IActionResult Error()
8591
{

2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/OnboardingController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/TodoListController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Models/AuthorizedTenant.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Services/IMSGraphService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Services/ITodoItemService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Services/MSGraphService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

2-WebApp-graph-user/2-3-Multi-Tenant/Services/TodoItemService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -113,8 +113,8 @@ public async Task Delete(int id, ClaimsPrincipal user)
113113
sampleDbContext.TodoItems.Remove(todoItem);
114114
await sampleDbContext.SaveChangesAsync();
115115
}
116-
}
117-
116+
}
117+
118118
private bool IsAuthorizedToModify(int itemId, ClaimsPrincipal user)
119119
{
120120
var tenantId = user.GetTenantId();

2-WebApp-graph-user/2-3-Multi-Tenant/Startup.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public void ConfigureServices(IServiceCollection services)
8686
};
8787
})
8888
.EnableTokenAcquisitionToCallDownstreamApi(
89-
options =>
90-
{
91-
Configuration.Bind("AzureAd", options);
92-
},
89+
options =>
90+
{
91+
Configuration.Bind("AzureAd", options);
92+
},
9393
new string[] { GraphScope.UserReadAll })
9494
.AddInMemoryTokenCaches();
9595

2-WebApp-graph-user/2-3-Multi-Tenant/Utils/UnauthorizedTenantException.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
The MIT License (MIT)
33
4-
Copyright (c) 2018 Microsoft Corporation
4+
Copyright (c) 2020 Microsoft Corporation
55
66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -28,7 +28,7 @@ namespace WebApp_OpenIDConnect_DotNet.Utils
2828
{
2929
public class UnauthorizedTenantException : UnauthorizedAccessException
3030
{
31-
public UnauthorizedTenantException():base() { }
32-
public UnauthorizedTenantException(string message):base(message) { }
31+
public UnauthorizedTenantException() : base() { }
32+
public UnauthorizedTenantException(string message) : base(message) { }
3333
}
3434
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@{
2-
ViewData["Title"] = "Privacy Policy";
3-
}
4-
<h2>@ViewData["Title"]</h2>
5-
6-
<p>Use this page to detail your site's privacy policy.</p>
1+
@{
2+
ViewData["Title"] = "Privacy Policy";
3+
}
4+
<h1>@ViewData["Title"]</h1>
5+
6+
<p>Use this page to detail your site's privacy policy.</p>

2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/_CookieConsentPartial.cshtml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 40 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,53 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>@ViewData["Title"] - WebApp Multi-Tenant SaaS</title>
7-
8-
<environment include="Development">
9-
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
10-
<link rel="stylesheet" href="~/css/site.css" />
11-
</environment>
12-
<environment exclude="Development">
13-
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
14-
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
15-
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
16-
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
17-
</environment>
6+
<title>@ViewData["Title"] - WebApp Multi-Tenant SaaS</title>
7+
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
8+
<link rel="stylesheet" href="~/css/site.css" />
189
</head>
1910
<body>
20-
<nav class="navbar navbar-inverse navbar-fixed-top">
21-
<div class="container">
22-
<div class="navbar-header">
23-
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
24-
<span class="sr-only">Toggle navigation</span>
25-
<span class="icon-bar"></span>
26-
<span class="icon-bar"></span>
27-
<span class="icon-bar"></span>
11+
<header>
12+
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
13+
<div class="container">
14+
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">WebApp Multi-Tenant SaaS</a>
15+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
16+
aria-expanded="false" aria-label="Toggle navigation">
17+
<span class="navbar-toggler-icon"></span>
2818
</button>
29-
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">WebApp Multi-Tenant SaaS</a>
19+
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
20+
<partial name="_LoginPartial" />
21+
<ul class="navbar-nav flex-grow-1">
22+
<li class="nav-item">
23+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
24+
</li>
25+
<li class="nav-item">
26+
<a class="nav-link text-dark" asp-area="" asp-controller="TodoList" asp-action="Index">Todo List</a>
27+
</li>
28+
<li class="nav-item">
29+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
30+
</li>
31+
</ul>
32+
</div>
3033
</div>
31-
<div class="navbar-collapse collapse">
32-
<ul class="nav navbar-nav">
33-
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
34-
<li><a asp-area="" asp-controller="TodoList" asp-action="Index">Todo List</a></li>
35-
</ul>
36-
<partial name="_LoginPartial" />
37-
</div>
38-
</div>
39-
</nav>
34+
</nav>
35+
</header>
4036

41-
<partial name="_CookieConsentPartial" />
42-
43-
<div class="container body-content">
44-
@RenderBody()
45-
<hr />
46-
<footer>
47-
<p>&copy; 2019 - WebApp Multi-Tenant SaaS</p>
48-
</footer>
37+
<div class="container">
38+
<main role="main" class="pb-3">
39+
@RenderBody()
40+
</main>
4941
</div>
5042

51-
<environment include="Development">
52-
<script src="~/lib/jquery/dist/jquery.js"></script>
53-
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
54-
<script src="~/js/site.js" asp-append-version="true"></script>
55-
</environment>
56-
<environment exclude="Development">
57-
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
58-
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
59-
asp-fallback-test="window.jQuery"
60-
crossorigin="anonymous"
61-
integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT">
62-
</script>
63-
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"
64-
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
65-
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
66-
crossorigin="anonymous"
67-
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa">
68-
</script>
69-
<script src="~/js/site.min.js" asp-append-version="true"></script>
70-
</environment>
71-
72-
@RenderSection("Scripts", required: false)
43+
<footer class="border-top footer text-muted">
44+
<div class="container">
45+
&copy; 2020 - WebApp Multi-Tenant SaaS - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
46+
</div>
47+
</footer>
48+
<script src="~/lib/jquery/dist/jquery.min.js"></script>
49+
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
50+
<script src="~/js/site.js" asp-append-version="true"></script>
51+
@await RenderSectionAsync("Scripts", required: false)
7352
</body>
7453
</html>
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
@using System.Security.Principal
2-
@using Microsoft.Identity.Web
3-
@if (User.Identity.IsAuthenticated)
4-
{
5-
<ul class="nav navbar-nav navbar-right">
6-
<li class="navbar-text">Hello @User.GetDisplayName()!</li>
7-
<li><a asp-area="MicrosoftIdentity" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
8-
</ul>
9-
}
10-
else
11-
{
12-
<ul class="nav navbar-nav navbar-right">
13-
<li><a asp-area="" asp-controller="Onboarding" asp-action="Signup">Onboard</a></li>
14-
<li><a asp-area="MicrosoftIdentity" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
15-
</ul>
16-
}
1+
@using System.Security.Principal
2+
3+
<ul class="navbar-nav">
4+
@if (User.Identity.IsAuthenticated)
5+
{
6+
<li class="nav-item">
7+
<span class="navbar-text text-dark">Hello @User.Identity.Name!</span>
8+
</li>
9+
<li class="nav-item">
10+
<a class="nav-link text-dark" asp-area="MicrosoftIdentity" asp-controller="Account" asp-action="SignOut">Sign out</a>
11+
</li>
12+
}
13+
else
14+
{
15+
<li class="nav-item">
16+
<a class="nav-link text-dark" asp-area="" asp-controller="Onboarding" asp-action="Signup">Onboard</a>
17+
</li>
18+
<li class="nav-item">
19+
<a class="nav-link text-dark" asp-area="MicrosoftIdentity" asp-controller="Account" asp-action="SignIn">Sign in</a>
20+
</li>
21+
}
22+
</ul>
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
1-
<environment include="Development">
2-
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
3-
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
4-
</environment>
5-
<environment exclude="Development">
6-
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.17.0/jquery.validate.min.js"
7-
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
8-
asp-fallback-test="window.jQuery && window.jQuery.validator"
9-
crossorigin="anonymous"
10-
integrity="sha384-rZfj/ogBloos6wzLGpPkkOr/gpkBNLZ6b6yLy4o+ok+t/SAKlL5mvXLr0OXNi1Hp">
11-
</script>
12-
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.9/jquery.validate.unobtrusive.min.js"
13-
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
14-
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
15-
crossorigin="anonymous"
16-
integrity="sha384-ifv0TYDWxBHzvAk2Z0n8R434FL1Rlv/Av18DXE43N/1rvHyOG4izKst0f2iSLdds">
17-
</script>
18-
</environment>
1+
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
2+
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

0 commit comments

Comments
 (0)