Skip to content

Commit

Permalink
Fixing disapearing connection string on setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Oct 3, 2017
1 parent 67ba2e9 commit 51c62a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ public async Task<string> SetupInternalAsync(SetupContext context)
{
using (var scope = shellContext.EnterServiceScope())
{
var store = scope.ServiceProvider.GetRequiredService<IStore>();
IStore store;

try
{
store = scope.ServiceProvider.GetRequiredService<IStore>();
await store.InitializeAsync();
}
catch(Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@
<fieldset class="row connectionString" asp-validation-class-for="ConnectionString">
<div class="form-group col-md-12">
<label asp-for="ConnectionString">@T["Connection string"]</label>
<input asp-for="ConnectionString" class="form-control" />

<div class="input-group mb-2 mb-sm-0">
<input asp-for="ConnectionString" class="form-control pwd" type="password" />
<div class="input-group-addon reveal" title="@T["Show/hide connection string"]"><i class="fa fa-eye-slash" aria-hidden="true"></i></div>
</div>

<span asp-validation-for="ConnectionString" class="text-danger"></span>
<span class="text-muted form-text small">@T["The connection string to your database instance. e.g., Data Source=<em>localhost</em>;Initial Catalog=<em>Orchard</em>;User Id=<em>userid</em>;Password=<em>password</em>"]</span>
</div>
Expand Down Expand Up @@ -221,6 +226,15 @@
$('#Password').popover({
trigger: 'focus'
})
$(".reveal").on('click',function() {
var $pwd = $(".pwd");
if ($pwd.attr('type') === 'password') {
$pwd.attr('type', 'text');
} else {
$pwd.attr('type', 'password');
}
});
})
//]]>
</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
Expand All @@ -7,6 +7,7 @@

<title>Orchard Setup</title>
<link type="text/css" rel="stylesheet" href="/OrchardCore.Setup/Styles/setup.min.css" />
<link type="text/css" rel="stylesheet" href="/OrchardCore.Resources/Styles/font-awesome.min.css" />
@await RenderSectionAsync("Header", required: false)
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using OrchardCore.Environment.Shell.Models;

Expand All @@ -19,7 +19,7 @@ public class ShellSettings

public ShellSettings(IDictionary<string, string> configuration)
{
_values = configuration;
_values = new Dictionary<string, string>(configuration);

if (!configuration.ContainsKey("State") || !Enum.TryParse(configuration["State"], true, out _tenantState)) {
_tenantState = TenantState.Invalid;
Expand Down

0 comments on commit 51c62a0

Please sign in to comment.