Skip to content

Commit

Permalink
First implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed Dec 11, 2024
1 parent a6d5071 commit 174c064
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 16 deletions.
1 change: 1 addition & 0 deletions COMET.Web.Common/COMET.Web.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<PackageReference Include="CDP4ServicesDal-CE" Version="27.4.1" />
<PackageReference Include="CDP4Web-CE" Version="27.4.1" />
<PackageReference Include="DevExpress.Blazor" Version="23.2.9" />
<PackageReference Include="FastMember" Version="1.5.0" />
<PackageReference Include="FluentResults" Version="3.16.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.10" />
Expand Down
49 changes: 49 additions & 0 deletions COMET.Web.Common/Components/CardView.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!------------------------------------------------------------------------------
// Copyright (c) 2023-2024 Starion Group S.A.
//
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, Nabil Abbar
//
// This file is part of CDP4-COMET WEB Community Edition
// The CDP4-COMET WEB Community Edition is the Starion Web Application implementation of ECSS-E-TM-10-25
// Annex A and Annex C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
------------------------------------------------------------------------------->
@namespace COMET.Web.Common.Components
@typeparam T where T : class
@inherits DisposableComponent

<p>
<input type="text" @oninput="this.OnSearchTextChanged" placeholder="Search..." />
</p>
<div class="container" style="height:calc(100% - 30px); overflow:auto;">
<div class="row">
<Virtualize ItemSize="@this.ItemSize" ItemsProvider="this.LoadItems" @ref="this.virtualize">
<ItemContent>
<div class="col" style="height:(@this.ItemSize)px;min-width:(@this.MinWidth)px;">
<div class="card @(this.GetSelectedClass(@context))"
@onclick="@(() => this.selectOption(@context))"
draggable="true"
dropzone="move"
ondragover="event.preventDefault();"
@ondragstart="@(() => this.OnDragNode(@context))"
@ondrop="@(() => this.OnDropNode(@context))">
<div class="card-body" style="overflow-y:hidden;overflow-x:hidden">
@this.ItemTemplate(@context)
</div>
</div>
</div>
</ItemContent>
</Virtualize>
</div>
</div>
191 changes: 191 additions & 0 deletions COMET.Web.Common/Components/CardView.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CardView.razor.cs" company="Starion Group S.A.">
// Copyright (c) 2023-2024 Starion Group S.A.
//
// Authors: Sam Gerené, Alex Vorobiev, Alexander van Delft, Jaime Bernar, Théate Antoine, Nabil Abbar
//
// This file is part of CDP4-COMET WEB Community Edition
// The CDP4-COMET WEB Community Edition is the Starion Web Application implementation of ECSS-E-TM-10-25
// Annex A and Annex C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace COMET.Web.Common.Components
{
using FastMember;

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web.Virtualization;

/// <summary>
/// Component used to show a CardView based on a specific type
/// </summary>
public partial class CardView<T> : DisposableComponent where T : class
{
/// <summary>
/// Gets or sets the item template for the list.
/// </summary>
[Parameter]
public RenderFragment<T>? ItemTemplate { get; set; }

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 42 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

/// <summary>
/// Gets or sets the list of items of type T to use
/// </summary>
[Parameter]
public ICollection<T> Items { get; set; } = new List<T>();

/// <summary>
/// Gets or sets a collection of propertynames of type <see cref="T"/> to perform search on

Check warning on line 51 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 51 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 51 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 51 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 51 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 51 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

XML comment has cref attribute 'T' that refers to a type parameter
/// </summary>
[Parameter]
public string[] SearchFields { get; set; }

/// <summary>
/// Gets or sets the fixed height of a Card, used to calculate the amout of items to load into the DOM in px
/// </summary>
[Parameter]
public float ItemSize { get; set; } = 150;

/// <summary>
/// Gets or sets the minimum width of a Card
/// </summary>
[Parameter]
public float MinWidth { get; set; } = 250;

/// <summary>
/// A reference to the <see cref="Virtualize{T}"/> component for loading items
/// </summary>
private Virtualize<T>? virtualize; // Reference to the Virtualize component

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 71 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

/// <summary>
/// The FastMember <see cref="TypeAccessor"/> to use to perform actions on instances of <see cref="T"/>

Check warning on line 74 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 74 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 74 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 74 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 74 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

XML comment has cref attribute 'T' that refers to a type parameter

Check warning on line 74 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

XML comment has cref attribute 'T' that refers to a type parameter
/// </summary>
private TypeAccessor typeAccessor = TypeAccessor.Create(typeof(T));

/// <summary>
/// The selected Card in the CardView
/// </summary>
private T selected;

/// <summary>
/// Gets the dragged node used in drag and drop interactions
/// </summary>
private T draggedNode { get; set; }

Check warning on line 86 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

Rename property 'draggedNode' to match pascal case naming rules, consider using 'DraggedNode'. (https://rules.sonarsource.com/csharp/RSPEC-100)

/// <summary>
/// Gets or sets the term where to search/filter item of
/// </summary>
private string searchTerm { get; set; } = string.Empty;

Check warning on line 91 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

Rename property 'searchTerm' to match pascal case naming rules, consider using 'SearchTerm'. (https://rules.sonarsource.com/csharp/RSPEC-100)

/// <summary>
/// Gets the class to visually show a Card to be selected or unselected
/// </summary>
/// <param name="vm"></param>
/// <returns></returns>
private string GetSelectedClass(T vm)
{
return vm == this.selected ? "selected" : "";
}

/// <summary>
/// Set the selected item
/// </summary>
/// <param name="item"></param>
private void selectOption(T item)
{
this.selected = item;
}

/// <summary>
/// Method invoked when a node is dragged
/// </summary>
/// <param name="node">The dragged node</param>
private void OnDragNode(T node)
{
this.draggedNode = node;
}

/// <summary>
/// Method invoked when a node is dropped
/// </summary>
/// <param name="targetNode">The target node where the <see cref="draggedNode"/> has been dropped</param>
/// <returns>A <see cref="Task"/></returns>
private async Task OnDropNode(T targetNode)

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 126 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
//TODO: Implement

Check warning on line 128 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)

Check warning on line 128 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
// var targetFolder = (Folder)targetNode.Thing;

Check warning on line 129 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

Remove this commented out code. (https://rules.sonarsource.com/csharp/RSPEC-125)

Check warning on line 129 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

Remove this commented out code. (https://rules.sonarsource.com/csharp/RSPEC-125)

// switch (this.DraggedNode?.Thing)
// {
// case File file:
// await this.ViewModel.FileHandlerViewModel.MoveFile(file, targetFolder);
// break;
// case Folder folder:
// await this.ViewModel.FolderHandlerViewModel.MoveFolder(folder, targetFolder);
// break;
// }
}

/// <summary>
/// Filters the list of items to show in the UI based on the <see cref="searchTerm"/>
/// </summary>
/// <param name="request">The request to perform filtering of the items list</param>
/// <returns>an waitable <see cref="ValueTask"/></returns>
private async ValueTask<ItemsProviderResult<T>> LoadItems(ItemsProviderRequest request)

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 147 in COMET.Web.Common/Components/CardView.razor.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
// Filter items based on the SearchTerm
var filteredItems = string.IsNullOrWhiteSpace(this.searchTerm)
? this.Items
: this.Items.Where(item => this.FilterItem(item, this.searchTerm)).ToList();

// Return paged items for virtualization
var items = filteredItems.Skip(request.StartIndex).Take(request.Count).ToList();
return new ItemsProviderResult<T>(items, filteredItems.Count);
}

/// <summary>
/// Used to filter items based on the <see cref="searchTerm"/>
/// </summary>
/// <param name="item">The item to perform searching on</param>
/// <param name="query">The string to search for</param>
/// <returns>True if the item's selected properties contain the value to search for, otherwise false</returns>
private bool FilterItem(T item, string query)
{
var props = this.typeAccessor.GetMembers();

return props.Where(x => this.SearchFields.Contains(x.Name)).Any(prop =>
{
var value = this.typeAccessor[item, prop.Name].ToString();
return value != null && value.Contains(query, StringComparison.OrdinalIgnoreCase);
});
}

/// <summary>
/// A method that is executed when the user changes the search input element
/// </summary>
/// <param name="e">The <see cref="ChangeEventArgs"/> from the UI element's event</param>
/// <returns></returns>
private async Task OnSearchTextChanged(ChangeEventArgs e)
{
this.searchTerm = e.Value?.ToString() ?? string.Empty;

if (this.virtualize != null)
{
await this.virtualize.RefreshDataAsync(); // Tell Virtualize to refresh data
}
}
}
}
13 changes: 13 additions & 0 deletions COMET.Web.Common/Components/CardView.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.card {
margin-bottom: 10px;
background-color: #f9f9fb;
}

.card:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card.selected {
border: 2px solid var(--bs-primary, var(--primary));
}

55 changes: 43 additions & 12 deletions COMETwebapp/Components/ModelEditor/DetailsPanelEditor.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,46 @@

@if (this.ViewModel.SelectedSystemNode != null)
{
<DxGrid Data="this.ViewModel.Rows" ColumnResizeMode="GridColumnResizeMode.ColumnsContainer" ShowAllRows="true" >
<Columns>
<DxGridDataColumn Caption="Name" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.ParameterTypeName)" />
<DxGridDataColumn Caption="Short Name" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.ShortName)" MinWidth="80" />
<DxGridDataColumn Caption="Actual Value" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.ActualValue)" />
<DxGridDataColumn Caption="Published Value" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.PublishedValue)" />
<DxGridDataColumn Caption="Owner" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.Owner)" MinWidth="50"/>
<DxGridDataColumn Caption="Switch" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.SwitchValue)" MinWidth="60"/>
<DxGridDataColumn Caption="Model Code" FieldName="@nameof(ElementDefinitionDetailsRowViewModel.ModelCode)" MinWidth="100"/>
</Columns>
</DxGrid>
}
<CardView Items="@this.ViewModel.Rows.ToList()" ItemSize="150" MinWidth="180" SearchFields="@this.searchFields">
<ItemTemplate>
<div class="row">
<div class="col-10">
<h6 title="@context.ParameterTypeName" style="overflow:hidden;text-overflow: ellipsis;white-space: nowrap;">@context.ParameterTypeName </h6>
</div>
<div class="col-2" align="right">
<button class="starion-pill" title="Owning Domain Of Expertise: @context.Owner">@context.Owner</button>
</div>
</div>
<div class="row">
<div class="col-12" style="overflow:hidden;text-overflow: ellipsis;white-space: nowrap;" title="@context.ModelCode">
@context.ModelCode
</div>
</div>
<div class="row" style="border-top:1px dotted darkgray;margin-top:8px;padding-top:8px;">
<div class="col-6">
@context.SwitchValue:
</div>
<div class="col-6">
Published:
</div>
</div>
<div class="row">
<div class="col-6" style="overflow:hidden;text-overflow: ellipsis;white-space: nowrap;" title="Actual Value: @context.ActualValue">@context.ActualValue</div>
<div class="col-6" style="overflow:hidden;text-overflow: ellipsis;white-space: nowrap;" title="Published Value: @context.PublishedValue">@context.PublishedValue</div>
</div>
</ItemTemplate>
</CardView>
}

@code
{
private string[] searchFields =
[
nameof(ElementDefinitionDetailsRowViewModel.ParameterTypeName),
nameof(ElementDefinitionDetailsRowViewModel.Owner),
nameof(ElementDefinitionDetailsRowViewModel.ModelCode),
nameof(ElementDefinitionDetailsRowViewModel.ActualValue),
nameof(ElementDefinitionDetailsRowViewModel.PublishedValue),
nameof(ElementDefinitionDetailsRowViewModel.SwitchValue)
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<DxButton Id="addElementDefinition" Text="Add Element Definition" IconCssClass="oi oi-plus" Click="@this.ViewModel.OpenCreateElementDefinitionCreationPopup"/>
</div>
</div>
<div style="height: 73vh!important;" class="sticky-scrollable-column d-flex justify-content-between">
<div style="height: 73vh!important;" class="sticky-scrollable-column justify-content-between">
<DetailsPanelEditor ViewModel="this.ViewModel.ElementDefinitionDetailsViewModel"/>
</div>
</DataItemDetailsComponent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
position: sticky;
top: 0px;
max-height: 80vh;
overflow: auto;
overflow:hidden;
}
11 changes: 11 additions & 0 deletions COMETwebapp/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,14 @@ sub {
.validation-container:not(:has(li)) {
display: none;
}

.starion-pill {
margin: 1px;
height: 19px;
width: auto;
border-radius: 30px;
background-color: white;
border: 1px solid dimgray;
color: dimgray;
padding-top: 0px;
}
4 changes: 2 additions & 2 deletions COMETwebapp/wwwroot/css/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
--spacing-18: 4.5rem;
--spacing-19: 4.75rem;
--spacing-20: 5rem;
--dxbl-listbox-font-size: 0.98rem;
--bs-body-font-size: 0.98rem;
--dxbl-listbox-font-size: 0.88rem;
--bs-body-font-size: 0.88rem;
--font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

0 comments on commit 174c064

Please sign in to comment.