FleetbaseFleetbase

ActivityLog

<ActivityLog> renders a compact activity timeline — auto-fetches from the `activity` model, supports date-range filtering, and previews changed attributes.

<ActivityLog>

<ActivityLog> renders a compact timeline of activity records (user and system actions). It auto-fetches activities from the activity Ember Data model, displays relative timestamps, and summarizes creates, deletes, and changed attributes in a sentence-style feed.

When an activity changes more than one attribute, the attribute count opens a hover popover with the changed fields and their previous/new values.

Basic Usage

<ActivityLog @subjectId={{this.order.id}} />

This loads activities where subject_id = order.id and renders them as a compact timeline.

Filtering

<ActivityLog
  @subjectId={{this.order.id}}
  @causerId={{this.user.id}}
/>

Activities are loaded from the API with subject_id and/or causer_id query params plus the date-range filter the user picks.

Dashboard Preview

<ActivityLog
  @subjectId={{this.order.id}}
  @maxVisibleActivities={{3}}
  @showControls={{false}}
>
  <:viewAll>
    <LinkTo @route="orders.order.activity" @model={{this.order}}>
      View all
    </LinkTo>
  </:viewAll>
</ActivityLog>

Use @maxVisibleActivities for small panels or dashboard cards. The :viewAll block renders in the header next to the component controls.

Arguments

Filtering

ArgumentTypeDescription
@subjectIdstringFilter to activities about a specific record
@causerIdstringFilter to activities caused by a specific user

Visual

ArgumentTypeDefaultDescription
@densitystringcompactcompact or cozy
@showAvatarsbooleantrueShow user avatars
@showBadgesbooleanfalseShow activity-type badges
@showHeaderbooleantrueRender the Activity header row
@showControlsbooleantrueRender the date filter and refresh button
@showAttributePreviousValuesbooleantrueInclude previous values in the changed-attributes popover
@maxVisibleActivitiesnumberLimit the number of activities shown
@dateFilterButtonsarrayQuick-pick buttons for the date filter (e.g. "Last 7 days")
@autoClosebooleanClose the date picker after selection
@toggleSelectedbooleanToggle behavior on the date picker

Class Hooks

ArgumentDescription
@headerWrapperClassHeader row
@groupClassTimeline list
@itemClassEach activity item
@itemDetailsClassRow content wrapper
@itemSentenceClassActivity sentence text
@itemRelativeTimestampClassRelative timestamp
@itemBadgeClassActivity badge when @showBadges={{true}}

Callbacks

ArgumentSignatureDescription
@onCauserClick(causer)Called when a user link in an activity is clicked
@onSubjectClick(subject)Called when a subject link is clicked

Yielded Block

BlockPurpose
:filtersRender extra filter controls in the header
:viewAllRender a link or action on the right side of the header
defaultRender additional content after the activity log

Real-World Example

{{!-- Inside an order detail overlay --}}
<ContentPanel @title="Activity Log" @open={{true}}>
  <ActivityLog
    @subjectId={{this.order.id}}
    @density="compact"
    @showAttributePreviousValues={{true}}
    @onCauserClick={{this.openUser}}
  />
</ContentPanel>

Source

FileDescription
addon/components/activity-log.hbsTemplate
addon/components/activity-log.jsClass — queries the activity Ember Data model
ActivityLog | Fleetbase