Skip to content

Commit

Permalink
Update the changes for the Microservices UI Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
atir-naveed-geeksltd committed May 1, 2024
1 parent 75dd186 commit 653b7a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ private string RenderField(PropertyInfo prop, object item)
builder.AppendLine(" <div class=\"form-group row\" style={margin:20px}>");
builder.AppendLine($"<label for='{prop.Name}' class='col-sm-2 col-form-label'>{prop.Name}</label>");
builder.AppendLine("<div class=\"col-sm-10\">");
builder.AppendLine($"<input type='{GetFieldType(prop)}' value='{GetDefaultValue(prop, item)}' name='{prop.Name}' class='{GetFieldClass(prop)}' placeholder='{prop.Name}'>");
var fieldType = GetFieldType(prop);
if (fieldType == "checkbox")
builder.AppendLine($"<input type='{fieldType}' name='{prop.Name}' class='{GetFieldClass(prop)}' placeholder='{prop.Name}'>");
else
builder.AppendLine($"<input type='{fieldType}' value='{GetDefaultValue(prop, item)}' name='{prop.Name}' class='{GetFieldClass(prop)}' placeholder='{prop.Name}'>");
builder.AppendLine("</div>");
builder.AppendLine("</div>");
return builder.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public async Task<string> Render(string nameSpace, string typeName)
if (item == null) item = _type.CreateInstance<IEntity>();
foreach (var column in GetColumns())
{
var val = form.FirstOrDefault(x => x.Key == column.Name).Value.ToString() ?? string.Empty;
column.SetValue(item, ConvertValue(column, val));
var val = form.FirstOrDefault(x => x.Key == column.Name).Value.ToStringOrEmpty() ?? string.Empty;
column.SetValue(item, ConvertValue(column, val == "on" ? "true" : val));
}
try
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.0.0</Version>
<Version>1.0.0.1</Version>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public async Task<string> Run()
content = await new FormModuleGenerator(domainType, _Endpoint).Render(_NameSpace, _TypeName);
else
content = await new ListModuleGenerator(domainType, _Endpoint).Render(_NameSpace, _TypeName);
await Response.WriteAsync(content);

await Task.Delay(1000);
//await Response.WriteAsync(content);

return content;

Expand Down

0 comments on commit 653b7a7

Please sign in to comment.