Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inspector dialogues #437

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/inspectors/ctrl/src/AxoInspector.st
Original file line number Diff line number Diff line change
Expand Up @@ -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

/// <summary>
/// Check, if data are overinspected (attempts of inspections is larger than maximum number of allowed retries)
Expand Down Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions src/inspectors/ctrl/src/interfaces/IInspector.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/inspectors/ctrl/src/interfaces/IOnFail.st
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,29 @@
@inherits AxoDialogBaseView<AxoInspectorDialog>
@inject AuthenticationStateProvider _asp


<div class="border border-2 rounded">

<div class="border border-2 rounded p-3">
<h3>Inspection failed, you will need to decide what's next...</h3>
<p>@Component.Symbol</p>

<div class="d-flex justify-content-center ">

<div class="d-flex flex-column align-items-center">
<div>

<h5>@Description</h5>
@if (Inspector != null)
{
<RenderableContentControl Context="Inspector" Presentation="Status" />
}
else
{
<p>Loading inspector... if it's taking long, something is wrong</p>
}

<!-- Renderable content control at the top -->
<RenderableContentControl Context="Component.GetParent()" Presentation="Status"/>
</div>
<div class="d-flex justify-content-center ">
<button type="button" class="btn btn-secondary m-2 w-50" disabled="@RetryDisabled" @onclick="Retry">Retry</button>

<button type="button" class="btn btn-secondary m-2 w-50" @onclick="Terminate">Terminate</button>

<button type="button" class="btn btn-secondary m-2 w-50" @onclick="Override">Override</button>
<div class="mt-3" style="width: 100%;">
<!-- Buttons in a row, centered horizontally -->
<div class="d-flex justify-content-center">
<button type="button" class="btn btn-secondary m-2 w-50" disabled="@RetryDisabled" @onclick="Retry">Retry</button>
<button type="button" class="btn btn-secondary m-2 w-50" @onclick="Terminate">Terminate</button>
<button type="button" class="btn btn-secondary m-2 w-50" @onclick="Override">Override</button>
</div>
</div>

</div>
<div>

<div class="mt-4">
@if (!_asp.GetAuthenticationStateAsync().Result.User.Identity.IsAuthenticated)
{
<p>You are not authorized, please <a href="Identity/Account/Login">Log In</a>.</p>
<p>You are not authorized, please <a href="Identity/Account/Login">Log In</a>.</p>
}

</div>
</div>




Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Loading