@ducna01120/fleetops-engine
Version:
Fleet & Transport Management Extension for Fleetbase
56 lines (50 loc) • 1.47 kB
JavaScript
import BaseController from '@ducna01120/fleetops-engine/controllers/base-controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ManagementPlacesIndexDetailsController extends BaseController {
/**
* The currently active view tab ('details' by default).
*
* @type {String}
* @tracked
*/
view = 'details';
/**
* An array of query parameters to be serialized in the URL.
*
* @type {String[]}
* @tracked
*/
queryParams = ['view'];
/**
* Transitions back to the "management.places.index" route.
*
* @method
* @action
* @returns {Transition} The transition object representing the route change.
*/
transitionBack() {
return this.transitionToRoute('management.places.index');
}
/**
* Transitions to the edit view for a specific vehicle.
*
* @method
* @param {placeModel} place - The vehicle to be edited.
* @action
* @returns {Transition} The transition object representing the route change.
*/
onEdit(place) {
return this.transitionToRoute('management.places.index.edit', place);
}
/**
* Updates the active view tab.
*
* @method
* @param {String} tab - The name of the tab to activate.
* @action
*/
onTabChanged(tab) {
this.view = tab;
}
}