Skip to content

Commit

Permalink
Merge pull request #348 from ix-ax/Add-dialogs-to-template
Browse files Browse the repository at this point in the history
Add dialogs to template
  • Loading branch information
PTKu authored Feb 20, 2024
2 parents fff8a9b + 0bbd9a1 commit abd13a2
Show file tree
Hide file tree
Showing 126 changed files with 3,518 additions and 1,341 deletions.
8 changes: 8 additions & 0 deletions src/base/src/AXOpen.Base.Abstractions/Dialogs/IAlert.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


namespace AXOpen.Base.Dialogs
{
public interface IAlert: IDialog
{
}
}

This file was deleted.

16 changes: 16 additions & 0 deletions src/base/src/AXOpen.Base.Abstractions/Dialogs/IAlertService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;


namespace AXOpen.Base.Dialogs
{
public interface IAlertService
{
public event EventHandler? AlertDialogChanged;
public void AddAlertDialog(eAlertType type, string title, string message, int time);
public void AddAlertDialog(IAlertToast toast);
public List<IAlertToast> GetAlertDialogs();
public void RemoveAlertDialog(IAlertToast toast);
public void RemoveAllAlertDialogs();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace AXOpen.Base.Dialogs
{
public interface IAlertDialog
public interface IAlertToast
{
public Guid Id { get; set; }
public eAlertDialogType Type { get; set; }
public eAlertType Type { get; set; }
public string Title { get; set; }
public string Message { get; set; }
public DateTimeOffset TimeToBurn { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
namespace AXOpen.Base.Dialogs
{

public interface IsDialogType : ITwinObject
public interface IDialog : ITwinObject
{
/// <summary>
/// Gets or sets dialog locator id.
/// </summary>
string DialogId { get; set; }
string DialogLocatorId { get; set; }

/// <summary>
/// Initialized remote task for this dialog, with polling instead of cyclic subscription.
Expand Down
7 changes: 7 additions & 0 deletions src/base/src/AXOpen.Base.Abstractions/Dialogs/IModalDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace AXOpen.Base.Dialogs
{
public interface IModalDialog : IDialog
{
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

namespace AXOpen.Base.Dialogs
{
public enum eAlertDialogType
public enum eAlertType
{
Undefined = 0,
Info = 10,
Expand Down
15 changes: 15 additions & 0 deletions src/core/app/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug live on PLC",
"type": "plc-debug",
"request": "launch",
"program": "${workspaceFolder}",
"ip": "10.10.10.115"
}
]
}
8 changes: 8 additions & 0 deletions src/core/app/apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,13 @@ scripts:
r:
- apax plc-mode set stop -t $AXTARGET -y
- apax plc-mode set run -t $AXTARGET -y

delta:
- START=$(date +%s)
- apax build --ignore-scripts
- apax sld load --accept-security-disclaimer -t $AXTARGET -i
$AXTARGETPLATFORMINPUT --mode delta
- echo "Downloaded in :" $(expr $(date +%s) - $START) "s"

installStrategy: strict
apaxVersion: 3.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@namespace axopencore
@using AXOpen.Core;
@using AXSharp.Connector;
@using Microsoft.AspNetCore.Components.Authorization
@inherits RenderableComplexComponentBase<AxoDialogExamples.AxoDialogTest>
@implements IDisposable;

<div class="border border-2 m-1 rounded">
<h5>@Component.Symbol</h5>

<div style="display: flex; justify-content: space-between;">
<div style="flex: 1;">
<RenderableContentControl Context="@Component._restoreDialog" Presentation="Control" />
</div>

<div style="flex: 1;">
<RenderableContentControl Context="@Component._callDialog" Presentation="Control" />
</div>

<div style="flex: 1;">
<RenderableContentControl Context="@Component._callDialogInSequnce" Presentation="Control" />
<RenderableContentControl Context="@Component._iterationStep" Presentation="Control" />
</div>

<div style="flex: 1;">
<RenderableContentControl Context="@Component._alertInSequnce" Presentation="Control" />
<RenderableContentControl Context="@Component._alertIterationStep" Presentation="Control" />
</div>
</div>
</div>

<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h3 class="accordion-header" id="headingOne">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Dialog Section
</button>
</h3>
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div class="accordion-body">
<div class="border border-2 m-1 rounded">
<RenderableContentControl Context="@Component._dialog" Presentation="Control" />
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h3 class="accordion-header" id="headingTwo">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Alert Dialog Section
</button>
</h3>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
<div class="accordion-body">
<div class="border border-2 m-1 rounded">
<RenderableContentControl Context="@Component._alertDialog" Presentation="Control" />
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@namespace axopencore
@using AXOpen.Core;
@using AXSharp.Connector;
@using Microsoft.AspNetCore.Components.Authorization
@inherits RenderableComplexComponentBase<AxoDialogExamples.Dialogs>
@implements IDisposable;

<div class="border border-1 rounded m-0">
<h4>@Component.Symbol</h4>

<div class="border border-2 m-1 rounded">
<div style="display: flex; justify-content: space-between;">
<div style="flex: 1;">
<RenderableContentControl Context="@Component._invokeRestoreAll" Presentation="Control" />
</div>

<div style="flex: 1;">
<RenderableContentControl Context="@Component._invokeCallAll" Presentation="Control" />
</div>

<div style="flex: 1;">
<RenderableContentControl Context="@Component._invokeSequnceAll" Presentation="Control" />
</div>
</div>
</div>

<div class="border border-2 m-1 rounded border-warning">
<div style="display: flex; justify-content: space-between;">
<div style="flex: 1;">
<axopencore.AxoDialogTestView Component="@Component.AA" />
</div>

<div style="flex: 1;">
<axopencore.AxoDialogTestView Component="@Component.BB" />
</div>
</div>
</div>

</div>


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@page "/DialogExamplesControl"
@using axopencore
@using AXOpen.Core
@using AXOpen.Core.Blazor.AxoDialogs

<axopencore.AxoDialogsView Component="@Entry.Plc.D_111" />

<axopencore.AxoDialogsView Component="@Entry.Plc.D_222" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@page "/DialogExamplesHandling_1"
@using axopencore
@using AXOpen.Core
@using AXOpen.Core.Blazor.AxoDialogs

<h3>Dialog Examples Handling</h3>

<AxoDialogLocator LocatorPath="dialog1" ObservedObjects="new[] {Entry.Plc.D_111}"></AxoDialogLocator>

<AXOpen.Core.Blazor.Dialogs.AxoAlertLocator ObservedObjects="new [] {Entry.Plc.D_111}"></AXOpen.Core.Blazor.Dialogs.AxoAlertLocator>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@page "/DialogExamplesHandling_2"
@using axopencore
@using AXOpen.Core
@using AXOpen.Core.Blazor.AxoDialogs

<h3>Dialog Examples Handling 1 and 2</h3>

<AxoDialogLocator LocatorPath="dialog2" DisplayInModalWindow="false" ObservedObjects="new [] { Entry.Plc.D_222, Entry.Plc.D_111}"></AxoDialogLocator>

<AXOpen.Core.Blazor.Dialogs.AxoAlertLocator ObservedObjects="new [] { Entry.Plc.D_222}"></AXOpen.Core.Blazor.Dialogs.AxoAlertLocator>
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,10 @@
<span class="oi oi-plus" aria-hidden="true"></span> AxoMomentaryTaskDocu
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="DocuExamples/AxoDataDocuExamples">
<span class="oi oi-plus" aria-hidden="true"></span> AxoDataExamplesDocu
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="AxoMessagingStaticDocu">
<span class="oi oi-plus" aria-hidden="true"></span> AxoMessagingStaticDocu
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="DocuExamples/AxoDataFragmetsDocuExamples">
<span class="oi oi-plus" aria-hidden="true"></span> AxoDataFragmetsDocuExamples
</NavLink>
</div>
</nav>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@*@using AXSharp.Presentation.Blazor.Controls.Dialogs.AlertDialog;*@
@using axopen_integrations_blazor.Data
@using AXOpen.Base.Dialogs
@inject IAlertDialogService DialogService
@inject IAlertService DialogService
@inject WeatherForecastService ForecastService

<PageTitle>Weather forecast</PageTitle>
Expand Down Expand Up @@ -53,6 +53,6 @@ else

public void CreateToast()
{
DialogService.AddAlertDialog(eAlertDialogType.Success, "Test", "test", 30);
DialogService.AddAlertDialog(eAlertType.Success, "Test", "test", 30);
}
}
2 changes: 1 addition & 1 deletion src/core/app/ix-blazor/axopencore.blazor/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/"
@*@using AXSharp.Presentation.Blazor.Controls.Dialogs.AlertDialog;*@
@*@inject IAlertDialogService DialogService*@
@*@inject IAlertService DialogService*@

<PageTitle>Index</PageTitle>

Expand Down
5 changes: 5 additions & 0 deletions src/core/app/ix-blazor/axopencore.blazor/Pages/Security.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/Security"

<h3>Security</h3>

<AxOpen.Security.Views.SecurityManagementView />
Loading

0 comments on commit abd13a2

Please sign in to comment.