Contents

Dashboard\Widgets\Dash

Overview

Dash widget for building dashboards

Extends
Implements
  • Larajax\Contracts\ViewComponentInterface

Public Properties

public array $name

name for the dash

public array $code

code as a unique identifier for the dash

public array $reports

reports configuration

public bool $canCreateAndEdit

canCreateAndEdit the dash

public bool $manageUrl

manageUrl for updating the dash

public bool $showInterval

showInterval toggles the interval selector for date ranges

public string $defaultStart

defaultStart specifies default start keyword: today, week, month, quarter, year

public string $defaultEnd

defaultEnd specifies default end keyword: today, week, month, quarter, year

public string $defaultInterval

defaultInterval specifies default grouping interval: day, week, month, quarter, year

public string $defaultCompare

defaultCompare specifies default compare mode: none, prev-period, prev-year

public bool $canMakeDefault

public bool $canResetLayout

public bool $isCustom

isCustom is true when the reports configuration has come from a saved/custom data source.

public bool $isPersonalized

isPersonalized is true when the reports configuration has come from the user preferences instead of the shared dashboard definition.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected $defaultAlias

defaultAlias to identify this widget.

protected boolean $reportsDefined

reportsDefined determines if report definitions have been created.

protected array $allReports

allReports used in this dash.

See Also

protected ?array $allRows

allRows used in this dash.

protected array $reportWidgets

reportWidgets collection of all reports widgets used in this dash.

protected Backend\Classes\DashManager $dashManager

Show inherited protected properties

Inherited Protected Properties


Public Methods

public addReports()

public addReports(array $reports): October\Rain\Element\ElementHolder 

addReports programmatically, used internally and for extensibility

public bindToController()

public bindToController(): void 

bindToController ensure reports are defined and report widgets are registered so they can also be bound to the controller this allows their AJAX features to operate.

public getPropertyOptions()

public getPropertyOptions(string $property): array 

getPropertyOptions returns options for multi-option properties (drop-downs, etc.)

public getReportWidget()

public getReportWidget(string $report): void

getReportWidget returns a specified report widget

public getReportWidgets()

public getReportWidgets(): array 

getReportWidgets for the instance

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public nameToId()

public nameToId($input $input): string 

nameToId is a helper method to convert a report name to a valid ID attribute

public onCommitDashboard()

public onCommitDashboard(): void

onCommitDashboard handler

public onGetWidgetCustomData()

public onGetWidgetCustomData(): void

public onGetWidgetData()

public onGetWidgetData(): void

public onGetWidgetStaticContent()

public onGetWidgetStaticContent(): void

public onInspectableGetOptions()

public onInspectableGetOptions(): void

public onResetDashboard()

public onResetDashboard(): void

onResetDashboard handler

public onRunCustomWidgetHandler()

public onRunCustomWidgetHandler(): void

onRunCustomWidgetHandler handler

public onRunDataSourceHandler()

public onRunDataSourceHandler(): void

onRunDataSourceHandler handler

public onSaveDashboard()

public onSaveDashboard(): void

onSaveDashboard handler

public removeField()

public removeField($name): bool 

removeField programmatically

public removeReport()

public removeReport($name): bool 

removeReport programmatically

public render()

public render(): void

render this widget along with its collection of report widgets.

Show inherited public methods

Inherited Public Methods

Protected Methods

protected addReportsFromCustomDataSource()

protected addReportsFromCustomDataSource($reports): void

addReportsFromCustomDataSource extracts the reports from a custom data source

protected applyIntervalDefaultsFromDatabase()

protected applyIntervalDefaultsFromDatabase($savedDash): void 

applyIntervalDefaultsFromDatabase overrides the widget's interval defaults with values managed by the user via the dashboard form, falling back to the YAML/property defaults when a column is empty.

protected bindPendingReportWidget()

protected bindPendingReportWidget(): void 

bindPendingReportWidget binds a report widget that exists in the browser's unsaved dashboard state but not in the persisted definition, using the widget_config posted via the widget's data-request-data scope. Enables AJAX handlers on legacy report widgets prior to saving the dashboard.

protected cleanDefinitionForSave()

protected cleanDefinitionForSave($definition): void

cleanDefinitionForSave removes meta data from the definition since it is not needed for storage

protected defineDashReports()

protected defineDashReports(): void

defineDashReports creates a flat array of dash reports from the configuration and slots reports in to their respective tabs

protected findDimension()

protected findDimension(
    $dataSource,
    $dimensionCode,
    $strict
): Dashboard\Classes\ReportDimension|null 

protected findMetric()

protected findMetric(
    $dataSource,
    $dimension,
    $metricCode
): Dashboard\Classes\ReportMetric 

protected getConfiguredReportWidget()

protected getConfiguredReportWidget(): void

protected getRequestedDataSource()

protected getRequestedDataSource(
    $widgetConfig
): Dashboard\Classes\ReportDataSourceBase 

protected getWidgetPropertiesForBrowser()

protected getWidgetPropertiesForBrowser($widget): array 

protected initReportWidgetsConcern()

protected initReportWidgetsConcern(): void

protected isReportWidget()

protected isReportWidget($reportType): bool 

isReportWidget checks the input resolves to a class extending ReportWidgetBase or VueReportWidgetBase; runs the base-class check for both aliases and fully-qualified names so posted class names cannot skip verification just by containing a backslash

protected isVueReportWidget()

protected isVueReportWidget($reportType): bool 

isVueReportWidget returns true if the widget is a vue report widget

protected listAllMetrics()

protected listAllMetrics($dataSource, $dimensionCode): array 

protected loadAssets()

protected loadAssets(): void

loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.

protected loadInitialState()

protected loadInitialState(): void

loadInitialState for the dashboards

protected makeDashReport()

protected makeDashReport($name, $config = ]): [Dashboard\Classes\DashReport 

makeDashReport creates a dash report object from name and configuration

protected makeDashReportWidget()

protected makeDashReportWidget($report): void

makeDashReportWidget object from a dash report object

protected makeDataSource()

protected makeDataSource(
    $dataSourceClass
): Dashboard\Classes\ReportDataSourceBase 

protected prepareVars()

protected prepareVars(): void

prepareVars prepares the dash data

protected processDashWidgetReports()

protected processDashWidgetReports($reports): void

processDashWidgetReports processes dash widgets from flexible source (yaml or custom)

protected processDashWidgetReportsFromCustomData()

protected processDashWidgetReportsFromCustomData($reports): void

processDashWidgetReportsFromCustom locates dash widgets from a custom data source

protected processDashWidgetReportsFromYaml()

protected processDashWidgetReportsFromYaml($reports): void

processDashWidgetReports will mutate reports types that are registered as widgets, convert their type to 'widget' and internally allocate the widget object

protected processOverrideFromDatabase()

protected processOverrideFromDatabase(): void

protected processPermissionCheck()

protected processPermissionCheck($reports): void

processPermissionCheck check if user has permissions to show the report and removes it if permission is denied

protected processReportRowWidgetMetrics()

protected processReportRowWidgetMetrics($metrics): void

protected processReportRows()

protected processReportRows($reports): void

protected translateRows()

protected translateRows($rows): array|null 

translateRows resolves localizable strings inside the dashboard rows structure just before it is emitted to the Vue state. This is the edge where YAML/saved config flows into the frontend.

Show inherited protected methods

Inherited Protected Methods