Skip to content

Commit 536c084

Browse files
committed
codeRR v1.1-beta01
1 parent c3934fd commit 536c084

File tree

27 files changed

+158
-573
lines changed

27 files changed

+158
-573
lines changed

src/Server/Coderr.Server.App/Modules/Messaging/Commands/DotNetSmtpSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void IConfigurationSection.Load(IDictionary<string, string> items)
5757
AccountPassword = items.GetString("AccountPassword", "");
5858
SmtpHost = items.GetString("SmtpHost");
5959
PortNumber = items.GetInteger("PortNumber");
60-
UseSsl = items.GetBoolean("UseSsl");
60+
UseSsl = items.GetBoolean("UseSSL");
6161
}
6262
}
6363
}

src/Server/Coderr.Server.Infrastructure/Configuration/Database/DatabaseStore.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ public override T Load<T>()
5050
var items = new Dictionary<string, string>();
5151
while (reader.Read())
5252
{
53-
items[reader.GetString(0)] = reader.GetString(1);
53+
var name = reader.GetString(0);
54+
var dbValue = reader.GetValue(1);
55+
var value = dbValue is DBNull ? null : (string) dbValue;
56+
items[name] = value;
5457
}
5558

5659
if (items.Count == 0)

src/Server/Coderr.Server.SqlServer/SqlServerTools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void CheckConnectionString(string connectionString)
8080
else
8181
connectionString = connectionString.Substring(0, pos) + "1" + connectionString.Substring(endPos);
8282
}
83-
83+
SqlConnection.ClearAllPools();
8484
var con = new SqlConnection(connectionString);
8585
con.Open();
8686
}

src/Server/Coderr.Server.Web/Areas/Admin/Views/Home/ErrorTracking.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
<div class="form-group disabled suboption">
1818
@Html.LabelFor(x => x.ContactEmail, new {@class = "control-label"})
19-
@Html.TextBoxFor(x => x.ContactEmail, new {@class = "form-control", disabled = ""})
19+
@Html.TextBoxFor(x => x.ContactEmail, new {@class = "form-control"})
2020
<small>Email address that we may contact if we need any further information (will also receive notifications when your errors have been corrected).</small>
2121
</div>
2222
<br/>

src/Server/Coderr.Server.Web/Areas/Admin/Views/Shared/_Layout.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>@ViewBag.Title - codeRR</title>
8-
<link href="/Content/bootstrap.min.css" rel="stylesheet" type="text/css">
8+
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css">
99
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
1010
@Styles.Render("~/Content/css")
1111
@Scripts.Render("~/bundles/modernizr")
@@ -14,7 +14,7 @@
1414
<body>
1515
<div class="navbar navbar-dark bg-dark">
1616
<div class="container">
17-
<span class="navbar-brand">codeRR - Admin area</span>
17+
<span class="navbar-brand">codeRR - Administration area</span>
1818
<span>
1919
<a href="@Url.Content("~/#")">
2020
<span class="fa fa-2x fa-home text-warning"></span>

src/Server/Coderr.Server.Web/Areas/Admin/Views/Sql/Index.cshtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h2>Database configuration</h2>
88

99
<p>
10-
It's time to to configure the database. To do that you need
10+
It's time to configure the database. To do that you need
1111
to start by specifying which database to use. We expect that you have created
1212
a database and configured an account for it.
1313
</p>
@@ -35,7 +35,7 @@
3535
</em>
3636
</p>
3737
<h3>Example</h3>
38-
<pre><code>Data Source=(localdb)\ProjectsV12;Initial Catalog=codeRR;Integrated Security=True;Connect Timeout=30;</code></pre>
38+
<pre><code>Data Source=yourDbServer;Initial Catalog=codeRR;Integrated Security=True;Connect Timeout=30;</code></pre>
3939
</div>
4040
</div>
4141
</div>
@@ -44,6 +44,7 @@
4444
{
4545

4646
<script type="text/javascript">
47+
$('[data-name="nextLink"]').prop('disabled', 'true');
4748
$('#saveButton')
4849
.click(function(e) {
4950
e.preventDefault();
@@ -52,13 +53,14 @@
5253
.getJSON(
5354
'@Url.RouteUrl(new {Area = "Installation", Controller = "Sql", Action = "Validate"})/?connectionString=' + conStr)
5455
.done(function(data) {
55-
if (data.result == "fail") {
56+
if (data.result === "fail") {
5657
$('#error').text(data.reason).show();
5758
} else {
5859
$('#error').hide();
5960
$("#testConnection").removeClass("btn-primary");
6061
$('#saveButton').removeAttr("disabled").addClass("btn-primary");
6162
humane.log("Connection was successful. Click on the Next button to continue.");
63+
$('[data-name="nextLink"]').prop('disabled', 'false');
6264
}
6365
});
6466
});

src/Server/Coderr.Server.Web/Areas/Installation/Controllers/SqlController.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,25 @@
55

66
namespace codeRR.Server.Web.Areas.Installation.Controllers
77
{
8-
[OutputCache(Duration = 0, NoStore = true)]
98
public class SqlController : Controller
109
{
10+
private static int _counter;
11+
1112
[HttpPost]
13+
[OutputCache(Duration = 0, NoStore = true)]
1214
public ActionResult Connection()
1315
{
1416
return RedirectToAction("Tables");
1517
}
1618

19+
[OutputCache(Duration = 0, NoStore = true)]
1720
public ActionResult Index()
1821
{
1922
var constr = ConfigurationManager.ConnectionStrings["Db"];
2023
if (!string.IsNullOrEmpty(constr?.ConnectionString))
24+
{
2125
ViewBag.ConnectionString = constr.ConnectionString ?? "";
26+
}
2227
else
2328
{
2429
ViewBag.ConnectionString = "";
@@ -30,11 +35,14 @@ public ActionResult Index()
3035
}
3136

3237
[HttpGet]
38+
[OutputCache(Duration = 0, NoStore = true)]
3339
public ActionResult Tables()
3440
{
3541
ViewBag.GotException = false;
3642
if (SetupTools.DbTools.GotUpToDateTables())
43+
{
3744
ViewBag.GotTables = true;
45+
}
3846
else
3947
{
4048
ViewBag.GotTables = false;
@@ -44,6 +52,7 @@ public ActionResult Tables()
4452
}
4553

4654
[HttpPost]
55+
[OutputCache(Duration = 0, NoStore = true)]
4756
public ActionResult Tables(string go)
4857
{
4958
try
@@ -63,6 +72,7 @@ public ActionResult Tables(string go)
6372
//return RedirectToRoute(new {Area = "Installation", Controller = "Setup", Action = "Done"});
6473
}
6574

75+
[OutputCache(Duration = 0, NoStore = true)]
6676
public ActionResult Validate()
6777
{
6878
try
@@ -77,7 +87,12 @@ public ActionResult Validate()
7787
.Replace("\"", "\\\"")
7888
.Replace("\r", "")
7989
.Replace("\n", "\\n");
80-
return Content(@"{ ""result"": ""fail"", ""reason"": """ + errMsg + @"""}", "application/json");
90+
return Json(new
91+
{
92+
result = "fail",
93+
reason = errMsg,
94+
attempt = ++_counter
95+
}, JsonRequestBehavior.AllowGet);
8196
}
8297
}
8398

src/Server/Coderr.Server.Web/Areas/Installation/Views/Setup/ErrorTracking.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<h2>Error tracking</h2>
99
<p>
1010
To correct bugs faster we have activated codeRR in the community server. By completing this
11-
setup, you allow us to collect error information and sent it to our own hosted service.
11+
setup, you allow us to collect error information and send it to our own hosted service.
1212
</p>
1313
<p>
1414
You can optionally enter your email address to get notifications when the errors in your

src/Server/Coderr.Server.Web/Areas/Installation/Views/Shared/_Layout.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>@ViewBag.Title - codeRR</title>
77
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
8-
<link rel="stylesheet" href="/Content/bootstrap.min.css"/>
8+
<link rel="stylesheet" href="@Url.Content("~/Content/bootstrap.min.css")"/>
99
@Styles.Render("~/Content/css")
1010
@Scripts.Render("~/bundles/modernizr")
1111
@RenderSection("Styles", false)
12-
<meta name="description" content="The description of my page"/>
12+
<meta name="description" content="codeRR installation wizard"/>
1313
</head>
1414
<body class="full-width">
1515

Lines changed: 80 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,81 @@
1-
@{
2-
ViewBag.Title = "Installation - Database configuration";
3-
}
4-
<div class="container">
5-
<div class="row">
6-
<div class="col-lg-6">
7-
<h2>Database configuration</h2>
8-
9-
<p>
10-
It's time to to configure the database. To do that you need
11-
to start by specifying which database to use. We expect that you have created
12-
a database and configured an account for it.
13-
</p>
14-
<p>
15-
Modify the connectionString named <code>'Db'</code> in <code>web.config.</code> Click on 'Test Connection' to make sure that it works.
16-
</p>
17-
<form method="post" action="@Url.Action("Connection", "Sql")" style="width: 100%" class="form-inline" id="dbForm">
18-
<div>
19-
<br/><br/>
20-
@Html.Raw(ViewBag.PrevLink)
21-
<button id="saveButton" class="btn">Test Connection</button>
22-
@Html.Raw(ViewBag.NextLink)
23-
</div>
24-
</form>
25-
<br/>
26-
<div class="alert alert-warning" id="error" style="display: none">
27-
</div>
28-
</div>
29-
<div class="col-lg-6">
30-
<h2>Limitation</h2>
31-
<p>
32-
<em>
33-
Currently only Microsoft SQL Server 2012 and above is supported. Need any other DB? Feel free to Contribute
34-
by taking the SqlServer class library and convert it to a library for your favorite DB engine.
35-
</em>
36-
</p>
37-
38-
<h3>Example</h3>
39-
<pre><code>Data Source=(localdb)\ProjectsV12;Initial Catalog=codeRR;Integrated Security=True;Connect Timeout=30;</code></pre>
40-
41-
<h2>Tip!</h2>
42-
<p>
43-
Do you want to give permissions to the IIS app pool? Add <em>"IIS APPPOOL\YourAppPool"</em> as the windows account in SQL Server Management Studio.
44-
</p>
45-
<p>
46-
For instance <code>IIS APPPOOL\DefaultAppPool</code>.
47-
</p>
48-
</div>
49-
</div>
50-
</div>
51-
52-
@section scripts
53-
{
54-
55-
<script type="text/javascript">
56-
$('#saveButton')
57-
.click(function(e) {
58-
e.preventDefault();
59-
var conStr = encodeURIComponent($('[name="connectionString"]').val());
60-
$
61-
.getJSON(
62-
'@Url.RouteUrl(new {Area = "Installation", Controller = "Sql", Action = "Validate"})/?connectionString=' + conStr)
63-
.done(function(data) {
64-
if (data.result == "fail") {
65-
$('#error').text(data.reason).show();
66-
} else {
67-
$('#error').hide();
68-
$("#testConnection").removeClass("btn-primary");
69-
$('#saveButton').removeAttr("disabled").addClass("btn-primary");
70-
humane.log("Connection was successful. Click on the Next button to continue.");
71-
}
72-
});
73-
});
74-
</script>
1+
@{
2+
ViewBag.Title = "Installation - Database configuration";
3+
}
4+
<div class="container">
5+
<div class="row">
6+
<div class="col-lg-6">
7+
<h2>Database configuration</h2>
8+
<p>
9+
It's time to configure the database. To do that you need
10+
to start by specifying which database to use. We expect that you have created
11+
a database and configured an account for it.
12+
</p>
13+
<p>
14+
Modify the connectionString named <code>'Db'</code> in <code>web.config.</code> Click on 'Test Connection' to make sure that it works.
15+
</p>
16+
<form method="post" action="@Url.Action("Connection", "Sql")" style="width: 100%" class="form-inline" id="dbForm">
17+
<div>
18+
<br /><br />
19+
@Html.Raw(ViewBag.PrevLink)
20+
<button id="testConnection" class="btn btn-primary">Test Connection</button>
21+
@Html.Raw(ViewBag.NextLink)
22+
</div>
23+
</form>
24+
<br />
25+
<div class="alert alert-warning" id="error" style="display: none">
26+
</div>
27+
</div>
28+
<div class="col-lg-6">
29+
<h2>Limitation</h2>
30+
<p>
31+
<em>
32+
Currently only Microsoft SQL Server 2012 and above is supported. Need any other DB? Feel free to Contribute
33+
by taking the SqlServer class library and convert it to a library for your favorite DB engine.
34+
</em>
35+
</p>
36+
<h3>Example</h3>
37+
<pre><code>Data Source=(localdb)\ProjectsV12;Initial Catalog=codeRR;Integrated Security=True;Connect Timeout=30;</code></pre>
38+
<h2>Tip!</h2>
39+
<p>
40+
Do you want to give permissions to the IIS app pool? Add <em>"IIS APPPOOL\YourAppPool"</em> as the windows account in SQL Server Management Studio.
41+
</p>
42+
<p>
43+
For instance <code>IIS APPPOOL\DefaultAppPool</code>.
44+
</p>
45+
</div>
46+
</div>
47+
</div>
48+
@section scripts
49+
{
50+
<script type="text/javascript">
51+
$('[data-name="nextLink"]').addClass("disabled");
52+
$('#testConnection')
53+
.click(function(e) {
54+
e.preventDefault();
55+
var conStr = encodeURIComponent($('[name="connectionString"]').val());
56+
var url =
57+
'@Url.RouteUrl(new {Area = "Installation", Controller = "Sql", Action = "Validate"})/?connectionString=' +
58+
conStr;
59+
$.post(url,
60+
function (data) {
61+
if (data.result === "fail") {
62+
var reason = data.reason.replace(/\\n/g, "<br>")
63+
.replace(/\\'/g, "'")
64+
.replace(/\\"/g, '"')
65+
.replace(/\\\\/g, '\\')
66+
.replace(/\\&/g, "&")
67+
.replace(/\\r/g, "r")
68+
.replace(/\\t/g, "\t")
69+
.replace(/\\b/g, "\b")
70+
.replace(/\\f/g, "\f");
71+
$('#error').html(reason).show();
72+
} else {
73+
$('#error').hide();
74+
$("#testConnection").removeClass("btn-primary").addClass('btn-default');
75+
$('[data-name="nextLink"]').removeClass('disabled').addClass('btn-primary');
76+
humane.log("Connection was successful. Click on the Next button to continue.");
77+
}
78+
});
79+
});
80+
</script>
7581
}

src/Server/Coderr.Server.Web/Areas/Installation/Views/Sql/Tables.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
}
44

55
<div class="container">
6-
<div class="col-lg-6">
6+
<div class="col-lg-12">
77
<h2>Tables</h2>
88

99
<p>It's time to install all the tables. Keep your fingers crossed and press "Create Tables"</p>

src/Server/Coderr.Server.Web/Areas/Installation/WizardSteps.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static string GetNextWizardStepLink(this UrlHelper urlHelper)
4040

4141
var step = Steps[index];
4242
return
43-
$@"<a class=""btn btn- btn-default"" href=""{urlHelper.Content(step.VirtualPath)}"">{step.Name} &gt;&gt;</a>";
43+
$@"<a class=""btn btn-outline-primary"" data-name=""nextLink"" href=""{urlHelper.Content(step.VirtualPath)}"">{step.Name} &gt;&gt;</a>";
4444
}
4545

4646
public static string GetPreviousWizardStepLink(this UrlHelper urlHelper)
@@ -53,7 +53,7 @@ public static string GetPreviousWizardStepLink(this UrlHelper urlHelper)
5353

5454
var step = Steps[index];
5555
return
56-
$@"<a class=""btn btn-default"" href=""{urlHelper.Content(step.VirtualPath)}"">&lt;&lt; {step.Name}</a>";
56+
$@"<a class=""btn btn-outline-dark"" href=""{urlHelper.Content(step.VirtualPath)}"">&lt;&lt; {step.Name}</a>";
5757
}
5858

5959
private static int FindCurrentIndex(UrlHelper urlHelper)

src/Server/Coderr.Server.Web/Controllers/PageController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public ActionResult Index(string path)
1313
if (!path.StartsWith("/views", StringComparison.OrdinalIgnoreCase))
1414
return new HttpStatusCodeResult(403);
1515

16-
return PartialView(path);
16+
return PartialView("~" + path);
1717
}
1818
}
1919
}

src/Server/Coderr.Server.Web/Nuget/ReadMe.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)