-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
We want custom views to be synced between users, here's the model:
public class CustomView
{
public Guid Id { get; init; }
public required string Name { get; set; }
public DateTimeOffset? DefaultAsOf { get; set; }
public string? DefaultFilter { get; set; }
public required string[] Fields { get; set; }
public required WritingSystemId[] Vernacular { get; set; }
public required WritingSystemId[] Analysis { get; set; }
public ViewBase Base { get; set; }
}
public enum ViewBase
{
FwLite,
FieldWorks,
}
the view base will determine the field labels which are used. The field order is determined by the order they show up in the Fields list, that list can include custom fields by CustomFieldId
(see #1966). Custom views will not support per field writing system visibility, if that is desired then that would fit better with tasks.
The change for this can be fairly simple just using either a json patch change, or a change which is created based on the custom view and just modifies the view in the Apply method, views won't change frequently and so conflicts will be rare.
This model is designed to have a single default Custom View (based on Max(DefaultAsOf)
), we may want to have a default per user role (only manager, editor, observer exist right now), in which case we could have a separate table to track that or just list the roles that this CustomView is default for on a property.