name: dashboard
label: Dashboard
icon: dashboard_ea
hidden: true
version: 2
fields:
  name:
    label: Name
    type: text
    searchable: true
    index: true
    required: true
  apps:
    label: Apps
    type: lookup
    multiple: true
    reference_to: apps
    filterable: true
  widgets:
    label: Widgets
    type: grid
    is_wide: true
  widgets.$.label:
    label: label
    type: text
  widgets.$.type:
    label: type
    type: lookup
    required: true
    optionsFunction: !<tag:yaml.org,2002:js/function> |-
      function (values) {
        return [{
            label: t("webapp_dashboard_widgets_type_instances_pendings"),
            value: "instances_pendings",
            icon: "all"
          },
          {
            label: t("webapp_dashboard_widgets_type_apps"),
            value: "apps",
            icon: "all"
          },
          {
            label: t("webapp_dashboard_widgets_type_announcements_week"),
            value: "announcements_week",
            icon: "all"
          },
          {
            label: t("webapp_dashboard_widgets_type_tasks_today"),
            value: "tasks_today",
            icon: "all"
          },
          {
            label: t("webapp_dashboard_widgets_type_events_today"),
            value: "events_today",
            icon: "all"
          },
          {
            label: t("webapp_dashboard_widgets_type_html"),
            value: "html",
            icon: "all"
        }];
      }
  widgets.$.position:
    label: position
    type: lookup
    required: true
    optionsFunction: !<tag:yaml.org,2002:js/function> |-
      function (values) {
        return [{
            label: t("webapp_dashboard_widgets_position_center_top"),
            value: "CENTER_TOP",
            icon: "topic2"
          },
          {
            label: t("webapp_dashboard_widgets_position_center_bottom_left"),
            value: "CENTER_BOTTOM_LEFT",
            icon: "topic2"
          },
          {
            label: t("webapp_dashboard_widgets_position_center_bottom_right"),
            value: "CENTER_BOTTOM_RIGHT",
            icon: "topic2"
          },
          {
            label: t("webapp_dashboard_widgets_position_center_right"),
            value: "RIGHT",
            icon: "topic2"
          }];
      }
  widgets.$.html:
    label: HTML
    type: textarea
    required: false
  description:
    label: Description
    type: textarea
    is_wide: true
list_views:
  all:
    columns:
      - name
      - apps
      - modified
    label: All Dashboard
    filter_scope: space
permission_set:
  user:
    allowCreate: false
    allowDelete: false
    allowEdit: false
    allowRead: false
    modifyAllRecords: false
    viewAllRecords: false
  admin:
    allowCreate: true
    allowDelete: true
    allowEdit: true
    allowRead: true
    modifyAllRecords: true
    viewAllRecords: true
