Skip to content

Commit 22b5278

Browse files
committed
feat: bug fixes and general improvements
1 parent b9b3cf5 commit 22b5278

12 files changed

Lines changed: 65 additions & 627 deletions

File tree

src/WebExpress.WebApp.Test/WebExpress.WebApp.Test.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1818
<PackageReference Include="WebExpress.WebIndex" Version="0.0.8-alpha" />
1919
<PackageReference Include="WebExpress.WebUI" Version="0.0.8-alpha" />
20-
<PackageReference Include="xunit" Version="2.9.2" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
20+
<PackageReference Include="xunit" Version="2.9.3" />
21+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>
2424
</PackageReference>

src/WebExpress.WebApp/Assets/js/webexpress.webapp.table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ webexpress.webapp.tableCtrl = class extends webexpress.webui.tableCtrl {
3838
receiveData() {
3939
if (this._filter === undefined || this._filter == null) { this._filter = ""; }
4040
if (this._page === undefined || this._page == null) { this._page = 0; }
41-
$.ajax({ type: "GET", url: this._restUri + "?wql=" + this._filter + "&page=" + this._page, dataType: 'json', }).then(function (response) {
41+
$.ajax({ type: "GET", url: this._restUri + "?search=" + this._filter + "&page=" + this._page, dataType: 'json', }).then(function (response) {
4242
var data = response.data;
4343
this.clear();
4444
this.addRange(data);

src/WebExpress.WebApp/WWW/Api/1/RestUserManagement.cs

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

src/WebExpress.WebApp/WebApi/RestApiCrud.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public virtual object GetData(Request request)
5959

6060
lock (Guard)
6161
{
62-
var wqlStatement = WebEx.ComponentHub.GetComponentManager<WebIndex.IndexManager>()?.Retrieve<T>(wql ?? $"{GetDefaultSearchAttribute()}='{search}'");
62+
var wqlStatement = !string.IsNullOrWhiteSpace(search) || !string.IsNullOrWhiteSpace(wql)
63+
? WebEx.ComponentHub.GetComponentManager<WebIndex.IndexManager>()?.Retrieve<T>(wql ?? $"{GetDefaultSearchAttribute()}='{search}*'")
64+
: WebEx.ComponentHub.GetComponentManager<WebIndex.IndexManager>()?.Retrieve<T>("");
6365
var data = GetData(wqlStatement, request);
6466

6567
var count = data.Count();
@@ -107,7 +109,7 @@ public void DeleteData(Request request)
107109
protected virtual string GetDefaultSearchAttribute()
108110
{
109111
return typeof(T).GetProperties()
110-
//.Where(x => x.GetCustomAttribute<IndexDefaultSearchAttribute>() != null)
112+
.Where(x => x.GetCustomAttribute<IndexDefaultSearchAttribute>() != null)
111113
.Where(x => x.GetCustomAttribute<IndexIgnoreAttribute>() == null)
112114
.Select(x => x.Name)
113115
.FirstOrDefault();

src/WebExpress.WebApp/WebControl/ControlModalFormConfirm.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ControlModalFormConfirm : ControlModalForm
4141
/// <summary>
4242
/// Returns or sets the submit button.
4343
/// </summary>
44-
private ControlFormItemButtonSubmit SubmitButton { get; set; }
44+
private ControlFormItemButtonSubmit SubmitButton { get; } = new ControlFormItemButtonSubmit("submit");
4545

4646
/// <summary>
4747
/// Returns or sets the redirect uri.
@@ -55,8 +55,6 @@ public class ControlModalFormConfirm : ControlModalForm
5555
public ControlModalFormConfirm(string id = null, params ControlFormItem[] content)
5656
: base(id, content)
5757
{
58-
SubmitButton = new ControlFormItemButtonSubmit("submit");
59-
6058
Form.ProcessForm += (s, e) =>
6159
{
6260
OnConfirm(e.Context);
@@ -110,6 +108,7 @@ public override IHtmlNode Render(IRenderControlContext renderContext, IVisualTre
110108
}
111109

112110
Form.RedirectUri = RedirectUri ?? renderContext.Request.Uri;
111+
SubmitButton.Text = SubmitButtonLabel;
113112

114113
return base.Render(renderContext, visualTree, items);
115114
}
Lines changed: 55 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,55 @@
1-
//using WebExpress.WebCore.Internationalization;
2-
//using WebExpress.WebCore.WebHtml;
3-
//using WebExpress.WebCore.WebPage;
4-
//using WebExpress.WebUI.WebControl;
5-
6-
//namespace WebExpress.WebApp.WebControl
7-
//{
8-
// public class ControlModalFormConfirmDelete : ControlModalFormConfirm
9-
// {
10-
// /// <summary>
11-
// /// Initializes a new instance of the class.
12-
// /// </summary>
13-
// /// <param name="id">The control id.</param>
14-
// public ControlModalFormConfirmDelete(string id = null)
15-
// : this(id, null)
16-
// {
17-
18-
// }
19-
20-
// /// <summary>
21-
// /// Initializes a new instance of the class.
22-
// /// </summary>
23-
// /// <param name="id">The control id.</param>
24-
// /// <param name="content">The form controls.</param>
25-
// public ControlModalFormConfirmDelete(string id, params ControlFormItem[] content)
26-
// : base(id, content)
27-
// {
28-
// }
29-
30-
// /// <summary>
31-
// /// Convert to html.
32-
// /// </summary>
33-
// /// <param name="context">The context in which the control is rendered.</param>
34-
// /// <returns>The control as html.</returns>
35-
// public override IHtmlNode Render(RenderContext context)
36-
// {
37-
// if (string.IsNullOrWhiteSpace(Header))
38-
// {
39-
// Header = context.Page.I18N("webexpress.webapp", "delete.header");
40-
// }
41-
42-
// if (string.IsNullOrWhiteSpace(SubmitButtonLabel))
43-
// {
44-
// SubmitButtonLabel = context.Page.I18N("webexpress.webapp", "delete.label");
45-
// }
46-
47-
// if (Content == null)
48-
// {
49-
// Content = new ControlFormItemStaticText() { Text = context.Page.I18N("webexpress.webapp", "delete.description") };
50-
// }
51-
52-
// if (SubmitButtonIcon == null)
53-
// {
54-
// SubmitButtonIcon = new PropertyIcon(TypeIcon.TrashAlt);
55-
// }
56-
57-
// if (SubmitButtonColor == null)
58-
// {
59-
// SubmitButtonColor = new PropertyColorButton(TypeColorButton.Danger);
60-
// }
61-
62-
// return base.Render(context);
63-
// }
64-
// }
65-
//}
1+
using WebExpress.WebCore.Internationalization;
2+
using WebExpress.WebCore.WebHtml;
3+
using WebExpress.WebUI.WebControl;
4+
using WebExpress.WebUI.WebIcon;
5+
using WebExpress.WebUI.WebPage;
6+
7+
namespace WebExpress.WebApp.WebControl
8+
{
9+
/// <summary>
10+
/// Represents a modal confirmation form specifically for delete actions.
11+
/// </summary>
12+
public class ControlModalFormConfirmDelete : ControlModalFormConfirm
13+
{
14+
/// <summary>
15+
/// Initializes a new instance of the class.
16+
/// </summary>
17+
/// <param name="id">The control id.</param>
18+
public ControlModalFormConfirmDelete(string id = null)
19+
: this(id, null)
20+
{
21+
22+
}
23+
24+
/// <summary>
25+
/// Initializes a new instance of the class.
26+
/// </summary>
27+
/// <param name="id">The control id.</param>
28+
/// <param name="content">The form controls.</param>
29+
public ControlModalFormConfirmDelete(string id, params ControlFormItem[] content)
30+
: base(id, content)
31+
{
32+
SubmitButtonIcon = new IconTrash();
33+
SubmitButtonColor = new PropertyColorButton(TypeColorButton.Danger);
34+
}
35+
36+
/// <summary>
37+
/// Converts the control to an HTML representation.
38+
/// </summary>
39+
/// <param name="renderContext">The context in which the control is rendered.</param>
40+
/// <param name="visualTree">The visual tree representing the control's structure.</param>
41+
/// <returns>An HTML node representing the rendered control.</returns>
42+
public override IHtmlNode Render(IRenderControlContext renderContext, IVisualTreeControl visualTree)
43+
{
44+
if (string.IsNullOrWhiteSpace(Header))
45+
{
46+
Header = I18N.Translate(renderContext, "webexpress.webapp:delete.header");
47+
}
48+
49+
SubmitButtonLabel ??= I18N.Translate(renderContext, "webexpress.webapp:delete.label");
50+
Content ??= new ControlFormItemStaticText() { Text = I18N.Translate(renderContext, "webexpress.webapp:delete.description") };
51+
52+
return base.Render(renderContext, visualTree);
53+
}
54+
}
55+
}

src/WebExpress.WebApp/WebUser/Group.cs

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

src/WebExpress.WebApp/WebUser/Model/WebItem.cs

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

src/WebExpress.WebApp/WebUser/Model/WebItemGroup.cs

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

0 commit comments

Comments
 (0)