From 4dbf8e5cb2f8fb1826c1c99776c415c0a6bdedff Mon Sep 17 00:00:00 2001 From: PTKu <61538034+PTKu@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:30:16 +0200 Subject: [PATCH] Refactors inspector dialog - inspector dialog now displays pertinent dialog - removes dialog injection, each inspector uses dedicated instance --- src/inspectors/ctrl/src/AxoInspector.st | 13 +++--- .../ctrl/src/interfaces/IInspector.st | 6 +-- src/inspectors/ctrl/src/interfaces/IOnFail.st | 6 +-- .../AxoInspectorDialogDialogView.razor | 43 ++++++------------- .../AxoInspectorDialogDialogView.razor.cs | 2 +- 5 files changed, 22 insertions(+), 48 deletions(-) diff --git a/src/inspectors/ctrl/src/AxoInspector.st b/src/inspectors/ctrl/src/AxoInspector.st index d105c51bc..bc2a8ffbd 100644 --- a/src/inspectors/ctrl/src/AxoInspector.st +++ b/src/inspectors/ctrl/src/AxoInspector.st @@ -14,9 +14,12 @@ NAMESPACE AXOpen.Inspectors _isOverInspected: BOOL; _busy : BOOL; _commonData: REF_TO AxoInspectorData; - _originalOverallResult : IAxoComprehensiveResult; + _originalOverallResult : IAxoComprehensiveResult; END_VAR + VAR PUBLIC + _DL : AXOpen.Inspectors.AxoInspectorDialog; + END_VAR /// /// Check, if data are overinspected (attempts of inspections is larger than maximum number of allowed retries) @@ -80,13 +83,9 @@ NAMESPACE AXOpen.Inspectors inRetryStep: IAxoStep; inTerminateStep: IAxoStep; END_VAR - - VAR_IN_OUT - inoDialog : AxoInspectorDialog; - END_VAR - + // here if is coordinator missing, it should provide message to call it with WithCoordinator method - inoDialog.Show(REF(THIS), inRetryStep, inTerminateStep); + _DL.Show(REF(THIS), inRetryStep, inTerminateStep); END_METHOD diff --git a/src/inspectors/ctrl/src/interfaces/IInspector.st b/src/inspectors/ctrl/src/interfaces/IInspector.st index 596f04acb..0f286beb7 100644 --- a/src/inspectors/ctrl/src/interfaces/IInspector.st +++ b/src/inspectors/ctrl/src/interfaces/IInspector.st @@ -26,11 +26,7 @@ NAMESPACE AXOpen.Inspectors inRetryStep: IAxoStep; inTerminateStep: IAxoStep; END_VAR - - VAR_IN_OUT - inoDialog : AxoInspectorDialog; - END_VAR - + END_METHOD METHOD RestoreInspectorTask : BOOL diff --git a/src/inspectors/ctrl/src/interfaces/IOnFail.st b/src/inspectors/ctrl/src/interfaces/IOnFail.st index 38e50d3b9..9e166e571 100644 --- a/src/inspectors/ctrl/src/interfaces/IOnFail.st +++ b/src/inspectors/ctrl/src/interfaces/IOnFail.st @@ -17,11 +17,7 @@ NAMESPACE AXOpen.Inspectors VAR_INPUT inRetryStep: AXOpen.Core.IAxoStep; inTerminateStep: AXOpen.Core.IAxoStep; - END_VAR - - VAR_IN_OUT - inoDialog : AxoInspectorDialog; - END_VAR + END_VAR END_METHOD diff --git a/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor b/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor index bf4628a9d..e1d507b06 100644 --- a/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor +++ b/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor @@ -4,46 +4,29 @@ @inherits AxoDialogBaseView @inject AuthenticationStateProvider _asp - -
- +

Inspection failed, you will need to decide what's next...

-

@Component.Symbol

- -
+
- -
@Description
- @if (Inspector != null) - { - - } - else - { -

Loading inspector... if it's taking long, something is wrong

- } - + +
-
- - - - +
+ +
+ + + +
-
-
+
@if (!_asp.GetAuthenticationStateAsync().Result.User.Identity.IsAuthenticated) { -

You are not authorized, please Log In.

+

You are not authorized, please Log In.

} -
- - - - diff --git a/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor.cs b/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor.cs index 9a6d1a20e..b544a1ab9 100644 --- a/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor.cs +++ b/src/inspectors/src/AxOpen.Inspectors.Blazor/AxoInspectorDialog/AxoInspectorDialogDialogView.razor.cs @@ -23,7 +23,7 @@ protected override void OnAfterRender(bool firstRender) try { // _inspectorIndentity property is subscribed in the method base.AddToPolling() - var parent = Component.GetConnector().IdentityProvider.GetTwinByIdentity(Component._inspectorIndentity.Cyclic); + var parent = Component.GetParent(); if (parent != null) {