Skip to content

feat: add Template and TemplateQuery Ember Data models#511

Merged
roncodes merged 3 commits intodev-v0.7.31from
feature/template-models
Mar 3, 2026
Merged

feat: add Template and TemplateQuery Ember Data models#511
roncodes merged 3 commits intodev-v0.7.31from
feature/template-models

Conversation

@roncodes
Copy link
Member

@roncodes roncodes commented Mar 3, 2026

Adds two Ember Data models to console/app/models/ to support the new template builder system.

Companion PRs: fleetbase/core-api#198 (backend) and fleetbase/ember-ui#121 (component).

template

Full attribute set: uuid, name, description, context_type, paper_size, orientation, width, height, unit, background_color, content (array), is_default, status. Computed: isDraft, isPublished, contextTypeLabel, dimensionLabel. Relationship: hasMany(template-query).

template-query

Full attribute set: uuid, template_uuid, name, label, resource_type, filters (object), sort_by, sort_direction, limit. Computed: variableName, variableToken, resourceTypeLabel. Relationship: belongsTo(template).

Both models follow existing Fleetbase conventions: @ember-data/model decorators, date-fns formatting, standard updatedAgo/createdAt computed properties.

Ronald A Richardson added 3 commits March 3, 2026 06:30
Adds two Ember Data models to the console app to support the new
template builder system introduced in fleetbase/core-api#198 and
fleetbase/ember-ui#121.

## Models

### template
- Full attribute set matching the backend Template model
- Computed: isDraft, isPublished, contextTypeLabel, dimensionLabel
- hasMany: template-query (inverse)
- Supports: name, description, context_type, paper_size, orientation,
  width, height, unit, background_color, content (array), is_default, status

### template-query
- Full attribute set matching the backend TemplateQuery model
- Computed: variableName, variableToken, resourceTypeLabel
- belongsTo: template (inverse)
- Supports: name, label, description, resource_type, filters (object),
  sort_by, sort_direction, limit

Both models follow the existing Fleetbase model conventions:
- @ember-data/model with attr/belongsTo/hasMany decorators
- Standard date computed properties (updatedAgo, updatedAt, createdAt, etc.)
- date-fns for date formatting

Refs: fleetbase/core-api#198, fleetbase/ember-ui#121
@roncodes roncodes changed the base branch from main to dev-v0.7.31 March 3, 2026 13:28
@roncodes roncodes merged commit 8244fdc into dev-v0.7.31 Mar 3, 2026
5 checks passed
@roncodes roncodes deleted the feature/template-models branch March 3, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant