Skip to content

Commit

Permalink
Engineering models also have the comet image on the side panel
Browse files Browse the repository at this point in the history
  • Loading branch information
joao4all committed Apr 18, 2024
1 parent 93b2332 commit f1d100b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ public async Task VerifyAddEngineeringModel()
[Test]
public async Task VerifyRowClick()
{
Assert.That(this.renderer.Instance.IsModelSelected, Is.EqualTo(false));
Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(false));

var firstRow = this.viewModel.Object.Rows.Items.First();
var grid = this.renderer.FindComponent<DxGrid>();
await this.renderer.InvokeAsync(async () => await grid.Instance.SelectedDataItemChanged.InvokeAsync(firstRow));

Assert.That(this.renderer.Instance.IsModelSelected, Is.EqualTo(true));
Assert.That(this.renderer.Instance.IsOnEditMode, Is.EqualTo(true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Copyright (c) 2023-2024 RHEA System S.A.
CustomizeEditModel="this.CustomizeEditThing"
EditMode="GridEditMode.PopupEditForm"
EditModelSaving="@(() => this.OnEditThingSaving())"
EditFormButtonsVisible="false"
PageSize="20"
PagerNavigationMode="PagerNavigationMode.Auto"
PageSizeSelectorVisible="true"
Expand All @@ -51,8 +52,6 @@ Copyright (c) 2023-2024 RHEA System S.A.
@{
var row = (DomainOfExpertiseRowViewModel)context.DataItem;

<DxButton Id="editDomainOfExpertiseButton" Text="Edit" Click="@(() => this.Grid.StartEditRowAsync(context.VisibleIndex))" Enabled="@(row.IsAllowedToWrite)"/>

<DxButton Id="@(row.IsDeprecated ? "undeprecateButton" : "deprecateButton")"
Text="@(row.IsDeprecated ? "Un-deprecate" : "Deprecate")"
Click="() => this.ViewModel.OnDeprecateUnDeprecateButtonClick(row)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Copyright (c) 2023-2024 RHEA System S.A.
PageSizeSelectorVisible="true"
PageSizeSelectorItems="@(new[] { 20, 35, 50 })"
PageSizeSelectorAllRowsItemVisible="true"
CssClass="d-inline">
CssClass="d-inline height-fit-content">
<Columns>
<DxGridDataColumn FieldName="@nameof(EngineeringModelRowViewModel.Name)" MinWidth="150"/>
<DxGridDataColumn FieldName="@nameof(EngineeringModelRowViewModel.ShortName)" MinWidth="80"/>
Expand Down Expand Up @@ -159,29 +159,25 @@ Copyright (c) 2023-2024 RHEA System S.A.

</DxGrid>

@if (this.IsModelSelected)
{
<div style="width: 70%;">
<DxToolbar ItemClick="@this.OnDetailsItemClick">
<Items>
@foreach (var mappedValue in this.mapOfComponentsAndNames)
{
<DxToolbarItem @key="@(mappedValue.Value)"
Name="@(mappedValue.Value)"
Text="@(mappedValue.Value)"
Tooltip="@(mappedValue.Value)"
RenderStyle="@(mappedValue.Key == this.SelectedComponent ? ButtonRenderStyle.Primary : ButtonRenderStyle.Secondary)" />
}
</Items>
</DxToolbar>

@if (this.SelectedComponent != null)
{
<DynamicComponent Type="@this.SelectedComponent" Parameters="this.parameters"/>
}
<DataItemDetailsComponent IsSelected="@this.IsOnEditMode">
<DxToolbar ItemClick="@this.OnDetailsItemClick">
<Items>
@foreach (var mappedValue in this.mapOfComponentsAndNames)
{
<DxToolbarItem @key="@(mappedValue.Value)"
Name="@(mappedValue.Value)"
Text="@(mappedValue.Value)"
Tooltip="@(mappedValue.Value)"
RenderStyle="@(mappedValue.Key == this.SelectedComponent ? ButtonRenderStyle.Primary : ButtonRenderStyle.Secondary)" />
}
</Items>
</DxToolbar>

</div>
}
@if (this.SelectedComponent != null)
{
<DynamicComponent Type="@this.SelectedComponent" Parameters="this.parameters"/>
}
</DataItemDetailsComponent>
</div>
<div class="pb-3"></div>
</LoadingComponent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ public partial class EngineeringModelsTable : SelectedDataItemBase<EngineeringMo
[Inject]
public IEngineeringModelsTableViewModel ViewModel { get; set; }

/// <summary>
/// Gets or sets the value to check if a model has been selected
/// </summary>
public bool IsModelSelected { get; private set; }

/// <summary>
/// Gets the condition to check if the source model was selected in creation form
/// </summary>
Expand Down Expand Up @@ -116,7 +111,7 @@ protected override void CustomizeEditThing(GridCustomizeEditModelEventArgs e)
private void OnSelectedDataItemChanged(EngineeringModelRowViewModel row)
{
this.ViewModel.Thing = row.Thing;
this.IsModelSelected = true;
this.IsOnEditMode = true;
this.parameters[nameof(EngineeringModelSetup)] = row.Thing;
}

Expand Down

0 comments on commit f1d100b

Please sign in to comment.