Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 126 additions & 126 deletions addon/components/vehicle/form.hbs

Large diffs are not rendered by default.

74 changes: 45 additions & 29 deletions addon/controllers/management/fuel-transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
@service modalsManager;
@service notifications;
@service hostRouter;
@service intl;

@tracked queryParams = ['page', 'limit', 'sort', 'query', 'provider', 'sync_status', 'vehicle', 'connection', 'transaction_at'];
@tracked page = 1;
Expand Down Expand Up @@ -38,26 +39,26 @@ export default class ManagementFuelTransactionsIndexController extends Controlle

get emptyStateTitle() {
if (this.sync_status === 'unmatched') {
return 'No unmatched fuel transactions';
return this.intl.t('management.empty-states.fuel-transactions.no-unmatched-title');
}

if (this.connection) {
return 'No transactions imported for this integration';
return this.intl.t('management.empty-states.fuel-transactions.no-integration-title');
}

return 'No fuel transactions imported yet';
return this.intl.t('management.empty-states.fuel-transactions.no-imported-title');
}

get emptyStateMessage() {
if (this.sync_status === 'unmatched') {
return 'Fleet-Ops did not find imported provider bills that still need vehicle or trip matching.';
return this.intl.t('management.empty-states.fuel-transactions.no-unmatched-description');
}

if (this.connection) {
return 'Run a sync from the fuel integration detail page to import provider bills into this ledger.';
return this.intl.t('management.empty-states.fuel-transactions.no-integration-description');
}

return 'Connect PetroApp or another fuel integration, then run a transaction sync. Imported provider bills appear here before linked Fuel Reports are created.';
return this.intl.t('management.empty-states.fuel-transactions.no-imported-description');
}

get actionButtons() {
Expand All @@ -66,12 +67,12 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
id: 'refresh',
icon: 'refresh',
onClick: this.refresh,
helpText: 'Refresh',
helpText: this.intl.t('management.empty-states.fuel-transactions.refresh'),
},
{
id: 'fuel-integrations',
icon: 'gas-pump',
text: 'Fuel Integrations',
text: this.intl.t('management.empty-states.fuel-transactions.open-integrations'),
onClick: () => this.hostRouter.transitionTo('console.fleet-ops.connectivity.fuel-providers.index'),
permission: 'fleet-ops list fuel-provider-connection',
},
Expand All @@ -88,7 +89,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
return [
{
id: 'bulk-reprocess',
label: `Reprocess ${selected.length} selected`,
label: this.intl.t('management.empty-states.fuel-transactions.reprocess-selected', { count: selected.length }),
fn: () => this.confirmAction('reprocess', selected),
permission: 'fleet-ops update fuel-provider-transaction',
},
Expand All @@ -100,7 +101,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
{
id: 'provider-transaction-id',
sticky: true,
label: 'Transaction',
label: this.intl.t('management.empty-states.fuel-transactions.columns.transaction'),
valuePath: 'provider_transaction_id',
cellComponent: 'cell/fuel-provider-transaction-identity',
action: this.openDetails,
Expand All @@ -112,7 +113,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
},
{
id: 'provider',
label: 'Provider',
label: this.intl.t('management.empty-states.fuel-transactions.columns.provider'),
valuePath: 'provider',
resizable: true,
sortable: true,
Expand All @@ -121,7 +122,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
},
{
id: 'sync-status',
label: 'Status',
label: this.intl.t('management.empty-states.fuel-transactions.columns.status'),
valuePath: 'sync_status',
cellComponent: 'fuel-transaction-status',
resizable: true,
Expand All @@ -132,7 +133,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
},
{
id: 'vehicle-name',
label: 'Vehicle',
label: this.intl.t('management.empty-states.fuel-transactions.columns.vehicle'),
valuePath: 'vehicle_name',
cellComponent: 'cell/vehicle-identity',
permission: 'fleet-ops view vehicle',
Expand All @@ -147,41 +148,41 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
},
{
id: 'vehicle-card-id',
label: 'Card / Internal',
label: this.intl.t('management.empty-states.fuel-transactions.columns.card-internal'),
valuePath: 'vehicle_card_id',
resizable: true,
},
{
id: 'trip-number',
label: 'Trip',
label: this.intl.t('management.empty-states.fuel-transactions.columns.trip'),
valuePath: 'trip_number',
resizable: true,
hidden: true,
},
{
id: 'station-name',
label: 'Station',
label: this.intl.t('management.empty-states.fuel-transactions.columns.station'),
valuePath: 'station_name',
resizable: true,
},
{
id: 'volume',
label: 'Liters',
label: this.intl.t('management.empty-states.fuel-transactions.columns.liters'),
valuePath: 'volume',
resizable: true,
sortable: true,
},
{
id: 'amount',
label: 'Amount',
label: this.intl.t('management.empty-states.fuel-transactions.columns.amount'),
valuePath: 'amount',
cellComponent: 'table/cell/currency',
resizable: true,
sortable: true,
},
{
id: 'fuel-report-id',
label: 'Fuel Report',
label: this.intl.t('management.empty-states.fuel-transactions.columns.fuel-report'),
valuePath: 'fuel_report_id',
cellComponent: 'cell/fuel-report-identity',
resourcePath: (transaction) =>
Expand All @@ -191,7 +192,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
},
{
id: 'transaction-at',
label: 'Date',
label: this.intl.t('management.empty-states.fuel-transactions.columns.date'),
valuePath: 'transactionAt',
sortParam: 'transaction_at',
resizable: true,
Expand All @@ -207,38 +208,53 @@ export default class ManagementFuelTransactionsIndexController extends Controlle
ddButtonText: false,
ddButtonIcon: 'ellipsis-h',
ddButtonIconPrefix: 'fas',
ddMenuLabel: 'Fuel Transaction Actions',
ddMenuLabel: this.intl.t('management.empty-states.fuel-transactions.actions-menu'),
cellClassNames: 'overflow-visible',
wrapperClass: 'flex items-center justify-end mx-2',
sticky: 'right',
width: 60,
actions: [
{ id: 'open-details', label: 'Review Details', fn: this.openDetails, permission: 'fleet-ops view fuel-provider-transaction' },
{
id: 'open-details',
label: this.intl.t('management.empty-states.fuel-transactions.review-details'),
fn: this.openDetails,
permission: 'fleet-ops view fuel-provider-transaction',
},
{
id: 'open-fuel-report',
label: 'Open Fuel Report',
label: this.intl.t('management.empty-states.fuel-transactions.open-fuel-report'),
fn: this.openFuelReport,
isVisible: (transaction) => Boolean(transaction.fuel_report_id),
permission: 'fleet-ops view fuel-report',
},
{ separator: true },
{ id: 'match-vehicle', label: 'Match to Vehicle', fn: this.matchVehicle, permission: 'fleet-ops update fuel-provider-transaction' },
{ id: 'match-order', label: 'Match to Order', fn: this.matchOrder, permission: 'fleet-ops update fuel-provider-transaction' },
{
id: 'match-vehicle',
label: this.intl.t('management.empty-states.fuel-transactions.match-vehicle'),
fn: this.matchVehicle,
permission: 'fleet-ops update fuel-provider-transaction',
},
{
id: 'match-order',
label: this.intl.t('management.empty-states.fuel-transactions.match-order'),
fn: this.matchOrder,
permission: 'fleet-ops update fuel-provider-transaction',
},
{
id: 'reprocess',
label: 'Reprocess / Rematch',
label: this.intl.t('management.empty-states.fuel-transactions.reprocess-rematch'),
fn: (transaction) => this.confirmAction('reprocess', transaction),
permission: 'fleet-ops update fuel-provider-transaction',
},
{
id: 'ignore',
label: 'Ignore Transaction',
label: this.intl.t('management.empty-states.fuel-transactions.ignore-transaction'),
fn: (transaction) => this.confirmAction('ignored', transaction),
permission: 'fleet-ops review fuel-provider-transaction',
},
{
id: 'mark-reviewed',
label: 'Mark Reviewed',
label: this.intl.t('management.empty-states.fuel-transactions.mark-reviewed'),
fn: (transaction) => this.confirmAction('reviewed', transaction),
permission: 'fleet-ops review fuel-provider-transaction',
},
Expand All @@ -257,7 +273,7 @@ export default class ManagementFuelTransactionsIndexController extends Controlle

@action openFuelReport(transaction) {
if (!transaction?.fuel_report_id) {
this.notifications.info('This transaction does not have a linked Fuel Report yet.');
this.notifications.info(this.intl.t('management.empty-states.fuel-transactions.unlinked-info'));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion addon/templates/connectivity/devices/index/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@resource={{this.device}}
@controller={{this}}
@actionButtons={{this.actionButtons}}
@headerTitle="Create a new device"
@headerTitle={{t "common.create-a-new-resource" resource=(lowercase (t "resource.device"))}}
@saveTask={{this.save}}
@onPressCancel={{transition-to "connectivity.devices.index"}}
@onOverlayReady={{fn (mut this.overlay)}}
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/connectivity/sensors/index/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@resource={{this.sensor}}
@controller={{this}}
@actionButtons={{this.actionButtons}}
@headerTitle="Create a new sensor"
@headerTitle={{t "common.create-a-new-resource" resource=(lowercase (t "resource.sensor"))}}
@saveTask={{this.save}}
@onPressCancel={{transition-to "connectivity.sensors.index"}}
@onOverlayReady={{fn (mut this.overlay)}}
Expand Down
12 changes: 6 additions & 6 deletions addon/templates/management/contacts/customers.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
@emptyStateComponent={{component
"table/empty-state"
icon="user-group"
title="Add your first customer"
description="Customers give orders an owner, contact details, and account context for service history."
filteredTitle="No customers match your filters"
filteredDescription="Adjust the search or filters to find another customer."
primaryText="New customer"
title=(t "management.empty-states.customers.title")
description=(t "management.empty-states.customers.description")
filteredTitle=(t "management.empty-states.customers.filtered-title")
filteredDescription=(t "management.empty-states.customers.filtered-description")
primaryText=(t "management.empty-states.customers.primary-text")
primaryIcon="plus"
primaryAction=this.customerActions.transition.create
secondaryText="Import"
secondaryText=(t "common.import")
secondaryIcon="upload"
secondaryAction=this.customerActions.import
}}
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/management/contacts/customers/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@resource={{this.customer}}
@controller={{this}}
@actionButtons={{this.actionButtons}}
@headerTitle="Create a new customer"
@headerTitle={{t "common.create-a-new-resource" resource=(lowercase (t "resource.customer"))}}
@modelName="Customer"
@saveTask={{this.save}}
@onPressCancel={{transition-to "management.contacts.customers"}}
Expand Down
16 changes: 8 additions & 8 deletions addon/templates/management/contacts/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
@emptyStateComponent={{component
"table/empty-state"
icon="address-book"
title="Add your first contact"
description="Contacts keep customer, vendor, and internal stakeholder details ready for orders and communication."
filteredTitle="No contacts match your filters"
filteredDescription="Adjust the search or filters to find another contact."
primaryText="New contact"
title=(t "management.empty-states.contacts.title")
description=(t "management.empty-states.contacts.description")
filteredTitle=(t "management.empty-states.contacts.filtered-title")
filteredDescription=(t "management.empty-states.contacts.filtered-description")
primaryText=(t "management.empty-states.contacts.primary-text")
primaryIcon="plus"
primaryAction=this.contactActions.transition.create
secondaryText="Import"
secondaryText=(t "common.import")
secondaryIcon="upload"
secondaryAction=this.contactActions.import
docsSlug="fleet-ops/resources/contacts/overview"
docsTitle="Contacts guide"
docsText="Contacts guide"
docsTitle=(t "management.empty-states.contacts.docs-title")
docsText=(t "management.empty-states.contacts.docs-text")
docsSource="fleet-ops-empty-contacts"
}}
@withoutHeader={{true}}
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/management/contacts/index/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@resource={{this.contact}}
@controller={{this}}
@actionButtons={{this.actionButtons}}
@headerTitle="Create a new contact"
@headerTitle={{t "common.create-a-new-resource" resource=(lowercase (t "resource.contact"))}}
@saveTask={{this.save}}
@onPressCancel={{transition-to "management.contacts.index"}}
@onOverlayReady={{fn (mut this.overlay)}}
Expand Down
16 changes: 8 additions & 8 deletions addon/templates/management/drivers/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
@emptyStateComponent={{component
"table/empty-state"
icon="id-card"
title="Add your first driver"
description="Drivers power dispatching, live fleet visibility, assignments, and delivery activity."
filteredTitle="No drivers match your search"
filteredDescription="Adjust the search or filters to find another driver."
primaryText="New driver"
title=(t "driver.empty-state.title")
description=(t "driver.empty-state.description")
filteredTitle=(t "driver.empty-state.filtered-title")
filteredDescription=(t "driver.empty-state.filtered-description")
primaryText=(t "driver.empty-state.primary-text")
primaryIcon="plus"
primaryAction=this.driverActions.transition.create
secondaryText="Import"
secondaryText=(t "driver.empty-state.secondary-text")
secondaryIcon="upload"
secondaryAction=this.driverActions.import
docsSlug="fleet-ops/resources/drivers/overview"
docsTitle="Drivers guide"
docsText="Driver guide"
docsTitle=(t "driver.empty-state.docs-title")
docsText=(t "driver.empty-state.docs-text")
docsSource="fleet-ops-empty-drivers"
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/management/drivers/index/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@resource={{this.driver}}
@controller={{this}}
@actionButtons={{this.actionButtons}}
@headerTitle="Create a new driver"
@headerTitle={{t "common.create-a-new-resource" resource=(lowercase (t "resource.driver"))}}
@saveTask={{this.save}}
@onPressCancel={{transition-to "management.drivers.index"}}
@onOverlayReady={{fn (mut this.overlay)}}
Expand Down
16 changes: 8 additions & 8 deletions addon/templates/management/fleets/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
@emptyStateComponent={{component
"table/empty-state"
icon="layer-group"
title="Create your first fleet"
description="Fleets help group vehicles and drivers for dispatching, reporting, and operational coverage."
filteredTitle="No fleets match your filters"
filteredDescription="Adjust the search or filters to find another fleet."
primaryText="New fleet"
title=(t "management.empty-states.fleets.title")
description=(t "management.empty-states.fleets.description")
filteredTitle=(t "management.empty-states.fleets.filtered-title")
filteredDescription=(t "management.empty-states.fleets.filtered-description")
primaryText=(t "management.empty-states.fleets.primary-text")
primaryIcon="plus"
primaryAction=this.fleetActions.transition.create
secondaryText="Import"
secondaryText=(t "common.import")
secondaryIcon="upload"
secondaryAction=this.fleetActions.import
docsSlug="fleet-ops/resources/fleets/overview"
docsTitle="Fleets guide"
docsText="Fleet guide"
docsTitle=(t "management.empty-states.fleets.docs-title")
docsText=(t "management.empty-states.fleets.docs-text")
docsSource="fleet-ops-empty-fleets"
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/management/fleets/index/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@resource={{this.fleet}}
@controller={{this}}
@actionButtons={{this.actionButtons}}
@headerTitle="Create a new fleet"
@headerTitle={{t "common.create-a-new-resource" resource=(lowercase (t "resource.fleet"))}}
@saveTask={{this.save}}
@onPressCancel={{transition-to "management.fleets.index"}}
@onOverlayReady={{fn (mut this.overlay)}}
Expand Down
Loading