Skip to content

Custom view data model #1985

@hahn-kev

Description

@hahn-kev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions