-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override renderring attribute (#316)
* just build * BaseAttribute in progress * Added test for presentationBase atribute * Rename PresentationBaseAttribute to RenderTemplateOverrideAttribute --------- Co-authored-by: blazej.kuhajda <blazej.kuhajda@mts.sk>
- Loading branch information
Showing
27 changed files
with
304 additions
and
18 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...tions/src/AXSharp.Abstractions/Presentation/Attributes/RenderTemplateOverrideAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// AXSharp.Abstractions | ||
// Copyright (c) 2023 Peter Kurhajec (PTKu), MTS, and Contributors. All Rights Reserved. | ||
// Contributors: https://github.com/ix-ax/axsharp/graphs/contributors | ||
// See the LICENSE file in the repository root for more information. | ||
// https://github.com/ix-ax/axsharp/blob/dev/LICENSE | ||
// Third party licenses: https://github.com/ix-ax/axsharp/blob/master/notices.md | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
public class RenderTemplateOverrideAttribute : Attribute | ||
{ | ||
|
||
public RenderTemplateOverrideAttribute(string templateOverrideName) | ||
{ | ||
this.TemplateOverrideName = templateOverrideName; | ||
} | ||
|
||
public string TemplateOverrideName { get; protected set; } | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...sandbox/AXSharp.RenderableContent.Tests/HtmlFiles/stTestRenderTemplateOverrideStruct.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div name="testingProgram-testRenderTemplateOverrideStruct" b-gswuladdww> | ||
<div name="testingProgram-testRenderTemplateOverrideStruct-testInteger" class="w-100 form-group mb-2"> | ||
<label for:ignore="testingProgram.testRenderTemplateOverrideStruct.testInteger_bb8cdc40-b3a2-4f63-a246-c626fdf69f49">Test Integer</label> | ||
<input id:ignore="testingProgram.testRenderTemplateOverrideStruct.testInteger_bb8cdc40-b3a2-4f63-a246-c626fdf69f49" readonly="readonly" class="w-100 form-control " style="background-color:transparent" type="text" step="any" value="0" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-custom-class="custom-tooltip" data-bs-title="testingProgram.testRenderTemplateOverrideStruct.Test Integer" /> | ||
|
||
<div class="invalid-feedback"></div> | ||
</div><div name="testingProgram-testRenderTemplateOverrideStruct-testString" class="w-100 form-group mb-2"> | ||
<label for:ignore="testingProgram.testRenderTemplateOverrideStruct.testString_ad32b01b-b9da-4234-86f0-14cbee7ec07b">Test String</label> | ||
<input id:ignore="testingProgram.testRenderTemplateOverrideStruct.testString_ad32b01b-b9da-4234-86f0-14cbee7ec07b" readonly="readonly" class="w-100 form-control " style="background-color:transparent" type="text" step="any" value="" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-custom-class="custom-tooltip" data-bs-title="testingProgram.testRenderTemplateOverrideStruct.Test String" /> | ||
|
||
<div class="invalid-feedback"></div> | ||
</div> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
...ts/sandbox/AXSharp.RenderableContent.Tests/HtmlFiles/stTestRenderTemplateOverrideTag.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div name="testingProgram-testRenderTemplateOverrideTag" b-gswuladdww> | ||
<div name="testingProgram-testRenderTemplateOverrideTag" class="w-100 form-group mb-2"> | ||
<label for:ignore="testingProgram.testRenderTemplateOverrideTag_9a154b6a-7421-4b58-b3ca-0120db12dc53">testRenderTemplateOverrideTag</label> | ||
<input id:ignore="testingProgram.testRenderTemplateOverrideTag_9a154b6a-7421-4b58-b3ca-0120db12dc53" readonly="readonly" class="w-100 form-control " style="background-color:transparent" type="text" step="any" value="0" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-custom-class="custom-tooltip" data-bs-title="testingProgram.testRenderTemplateOverrideTag" /> | ||
|
||
<div class="invalid-feedback"></div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...AXSharp.blazor/tests/sandbox/IxBlazor.App/Custom/MySimplePrimitiveStructDisplayView.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@namespace ixBlazor.App.Custom | ||
@inherits RenderableComplexComponentBase<ITwinObject> | ||
@using AXSharp.Connector.ValueTypes; | ||
|
||
<div class="w-100 form-group"> | ||
<div> | ||
<h1>My Simpl ePrimitive Struct Display View</h1> | ||
</div> | ||
</div> | ||
|
22 changes: 22 additions & 0 deletions
22
src/AXSharp.blazor/tests/sandbox/IxBlazor.App/Custom/MySimplePrimitiveTagDisplayView.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@namespace ixBlazor.App.Custom | ||
@inherits RenderableComponentBase | ||
@using AXSharp.Connector.ValueTypes; | ||
|
||
<div class="w-100 form-group"> | ||
<div> | ||
<h1>tested primitive tag</h1> | ||
</div> | ||
</div> | ||
|
||
@code{ | ||
|
||
[Parameter] | ||
public ITwinPrimitive Onliner { get; set; } | ||
[Parameter] | ||
public bool IsReadOnly { get; set; } | ||
|
||
protected override void OnInitialized() | ||
{ | ||
UpdateValuesOnChange(Onliner); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/AXSharp.blazor/tests/sandbox/IxBlazor.App/Pages/AttributeTests.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@page "/attributeTests" | ||
<h3>WrapLayout</h3> | ||
|
||
|
||
<div> | ||
<p>------- "TAG Display"--------------</p> | ||
</div> | ||
<RenderableContentControl Presentation="Display" Context="@Entry.Plc.MAINC.OverridedSimpleTag"> | ||
</RenderableContentControl> | ||
|
||
<div> | ||
<p>------- "TAG Control"--------------</p> | ||
</div> | ||
<RenderableContentControl Presentation="Control" Context="@Entry.Plc.MAINC.OverridedSimpleTag"> | ||
</RenderableContentControl> | ||
|
||
<div> | ||
<p>------- "STRUCT Display"--------------</p> | ||
</div> | ||
<RenderableContentControl Presentation="Display" Context="@Entry.Plc.MAINC.OverridedSimpleStruct"> | ||
</RenderableContentControl> | ||
|
||
<div> | ||
<p>------- "STRUCT Control"--------------</p> | ||
</div> | ||
<RenderableContentControl Presentation="Control" Context="@Entry.Plc.MAINC.OverridedSimpleStruct"> | ||
</RenderableContentControl> |
10 changes: 9 additions & 1 deletion
10
src/AXSharp.blazor/tests/sandbox/IxBlazor.App/Shared/NavMenu.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.