visual fixes

This commit is contained in:
Alex Bezdieniezhnykh
2025-05-17 19:34:02 +03:00
parent d02550f5a0
commit dae342b70e
3 changed files with 17 additions and 6 deletions
@@ -7,18 +7,23 @@ using Azaion.Common.DTO;
using Azaion.Common.DTO.Queue;
using Azaion.Common.Events;
using Azaion.Common.Services;
using Azaion.CommonSecurity.DTO;
using Azaion.CommonSecurity.Services;
using MediatR;
namespace Azaion.Dataset;
public class DatasetExplorerEventHandler(
DatasetExplorer datasetExplorer,
IAnnotationService annotationService) :
IAnnotationService annotationService,
IAzaionApi azaionApi) :
INotificationHandler<KeyEvent>,
INotificationHandler<DatasetExplorerControlEvent>,
INotificationHandler<AnnotationCreatedEvent>,
INotificationHandler<AnnotationsDeletedEvent>
{
private readonly IAzaionApi _azaionApi = azaionApi;
private readonly Dictionary<Key, PlaybackControlEnum> _keysControlEnumDict = new()
{
{ Key.Enter, PlaybackControlEnum.SaveAnnotations },
@@ -122,7 +127,7 @@ public class DatasetExplorerEventHandler(
if (annotation.Classes.Contains(selectedClass) || selectedClass == -1)
{
var index = 0;
var annThumb = new AnnotationThumbnail(annotation);
var annThumb = new AnnotationThumbnail(annotation, _azaionApi.CurrentUser.Role.IsValidator());
if (datasetExplorer.SelectedAnnotationDict.ContainsKey(annThumb.Annotation.Name))
{
datasetExplorer.SelectedAnnotationDict.Remove(annThumb.Annotation.Name);