ModifiedAt for items, use it by default

This commit is contained in:
2023-08-03 12:00:33 +02:00
parent fe0003e55f
commit 5f1ad922dc
18 changed files with 64 additions and 22 deletions

View File

@@ -4,6 +4,8 @@ public enum ItemOrdering
{
Name,
NameDesc,
CreationDate,
CreationDateDesc,
LastModifyDate,
LastModifyDateDesc,
}

View File

@@ -6,8 +6,10 @@ public sealed class SortItemsCommand : IIdentifiableUserCommand
{
public const string OrderByNameCommandName = "order_by_name";
public const string OrderByNameDescCommandName = "order_by_name_desc";
public const string OrderByDateCommandName = "order_by_date";
public const string OrderByDateDescCommandName = "order_by_date_desc";
public const string OrderByCreatedAtCommandName = "order_by_created_at";
public const string OrderByCreatedAtDescCommandName = "order_by_created_at_desc";
public const string OrderByModifiedAtCommandName = "order_by_modified_at";
public const string OrderByModifiedAtDescCommandName = "order_by_modified_at_desc";
public static readonly SortItemsCommand OrderByNameCommand =
new(OrderByNameCommandName, ItemOrdering.Name, "Order by name");
@@ -15,11 +17,17 @@ public sealed class SortItemsCommand : IIdentifiableUserCommand
public static readonly SortItemsCommand OrderByNameDescCommand =
new(OrderByNameDescCommandName, ItemOrdering.NameDesc, "Order by name (descending)");
public static readonly SortItemsCommand OrderByDateCommand =
new(OrderByDateCommandName, ItemOrdering.LastModifyDate, "Order by date");
public static readonly SortItemsCommand OrderByCreatedAtCommand =
new(OrderByCreatedAtCommandName, ItemOrdering.CreationDate, "Order by created");
public static readonly SortItemsCommand OrderByDateDescCommand =
new(OrderByDateDescCommandName, ItemOrdering.LastModifyDateDesc, "Order by date (descending)");
public static readonly SortItemsCommand OrderByCreatedAtDescCommand =
new(OrderByCreatedAtDescCommandName, ItemOrdering.CreationDateDesc, "Order by created (descending)");
public static readonly SortItemsCommand OrderByLastModifiedCommand =
new(OrderByModifiedAtCommandName, ItemOrdering.LastModifyDate, "Order by last modified");
public static readonly SortItemsCommand OrderByLastModifiedDescCommand =
new(OrderByModifiedAtDescCommandName, ItemOrdering.LastModifyDateDesc, "Order by last modified (descending)");
private SortItemsCommand(string userCommandId, ItemOrdering ordering, string title)
{

View File

@@ -15,6 +15,7 @@ public interface IItemViewModel : IInitable<IItem, ITabViewModel, ItemViewModelT
IDeclarativeProperty<bool> IsAlternative { get; }
IDeclarativeProperty<ItemViewMode> ViewMode { get; set; }
DateTime? CreatedAt { get; set; }
DateTime? ModifiedAt { get; set; }
string? Attributes { get; set; }
bool EqualsTo(IItemViewModel? itemViewModel);
}