Cardbox.View (Cardbox v0.1.0)

Copy Markdown View Source

A saved view of a collection: how it shows (type), which records, in which order (query, Cardbox.Query's wire format), and the options of its type.

TypeShown withOptions
tableMasucolumns (field keys, in order), hidden, widths (%{key => px})
boardNarabegroup_by (a select, status, person or checkbox field), hidden_groups, card_fields
listNarabefields
calendarKoyomidate_field (a date field)
chartFudekind, x (and its unit), y, color, title (see Cardbox.Fude)
canvasHakushilayout (%{record_id => %{"x" => x, "y" => y}}), edges (a relation field)

A view with no owner is shared with everyone who has the collection; a view with an owner (a person's id) is theirs.

An app adds types of its own (use Cardbox, views: ["timeline"]), whose options its Cardbox.check_view/3 checks, and draws them itself: a view of any type has its query, and list/3 of it gives its records.

Summary

Functions

Cardbox's types of views.

Types

t()

@type t() :: %Cardbox.View{
  __meta__: term(),
  collection: term(),
  collection_id: integer() | nil,
  id: integer() | nil,
  inserted_at: term(),
  name: String.t(),
  options: map(),
  owner: String.t() | nil,
  position: String.t() | nil,
  query: map(),
  type: String.t(),
  updated_at: term()
}

Functions

types()

@spec types() :: [String.t()]

Cardbox's types of views.