|
|
@@ -8,6 +8,7 @@ using InABox.Avalonia.Components;
|
|
|
using InABox.Avalonia.Dialogs;
|
|
|
using InABox.Core;
|
|
|
using PRS.Avalonia.Components;
|
|
|
+using PRS.Avalonia.DigitalForms;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
@@ -35,6 +36,9 @@ internal partial class TaskEditViewModel : ModuleViewModel
|
|
|
[ObservableProperty]
|
|
|
private KanbanDocumentModel _documents;
|
|
|
|
|
|
+ [ObservableProperty]
|
|
|
+ private KanbanFormModel _forms;
|
|
|
+
|
|
|
[ObservableProperty]
|
|
|
private Func<Task>? _takePhotoAction;
|
|
|
|
|
|
@@ -81,6 +85,18 @@ internal partial class TaskEditViewModel : ModuleViewModel
|
|
|
Documents = new KanbanDocumentModel(DataAccess,
|
|
|
() => new Filter<KanbanDocument>(x => x.EntityLink.ID).IsEqualTo(Shell?.ID ?? CoreUtils.FullGuid),
|
|
|
() => DefaultCacheFileName<KanbanDocumentShell>(Shell?.ID));
|
|
|
+ Forms = new KanbanFormModel(DataAccess,
|
|
|
+ () => new Filter<KanbanForm>(x => x.Parent.ID).IsEqualTo(Shell?.ID ?? CoreUtils.FullGuid),
|
|
|
+ () => DefaultCacheFileName<KanbanFormShell>(Shell?.ID));
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override async Task<TimeSpan> OnRefresh()
|
|
|
+ {
|
|
|
+ CanEditDescription = Shell.ManagerID == Repositories.Me.ID;
|
|
|
+ await Task.WhenAll(
|
|
|
+ Documents.RefreshAsync(true),
|
|
|
+ Forms.RefreshAsync(true));
|
|
|
+ return TimeSpan.Zero;
|
|
|
}
|
|
|
|
|
|
public override bool OnBackButtonPressed()
|
|
|
@@ -143,13 +159,6 @@ internal partial class TaskEditViewModel : ModuleViewModel
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- protected override async Task<TimeSpan> OnRefresh()
|
|
|
- {
|
|
|
- CanEditDescription = Shell.ManagerID == Repositories.Me.ID;
|
|
|
- await Documents.RefreshAsync(true);
|
|
|
- return TimeSpan.Zero;
|
|
|
- }
|
|
|
-
|
|
|
public void Changed()
|
|
|
{
|
|
|
var changed = Shell.IsChanged();
|
|
|
@@ -267,4 +276,10 @@ internal partial class TaskEditViewModel : ModuleViewModel
|
|
|
Changed();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ [RelayCommand]
|
|
|
+ private void FormClicked(KanbanFormShell shell)
|
|
|
+ {
|
|
|
+ DigitalFormsHostViewModel<KanbanFormModel, KanbanFormShell, Kanban, KanbanLink, KanbanForm>.EditForm(Forms, shell, Shell.Entity);
|
|
|
+ }
|
|
|
}
|