@fleetbase/fleetops-engine 0.4.19 → 0.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/components/activity-event-selector.js +1 -1
- package/addon/components/activity-form-panel.js +2 -2
- package/addon/components/activity-logic-builder.js +1 -1
- package/addon/components/admin/navigator-app.hbs +77 -1
- package/addon/components/admin/navigator-app.js +65 -12
- package/addon/components/contact-form-panel.js +2 -2
- package/addon/components/contact-panel.js +2 -2
- package/addon/components/custom-field-form-panel.js +2 -2
- package/addon/components/driver-form-panel.js +2 -2
- package/addon/components/driver-panel.js +2 -2
- package/addon/components/edit-order-route-panel.js +2 -2
- package/addon/components/fleet-form-panel.js +2 -2
- package/addon/components/fleet-panel/driver-listing.js +1 -1
- package/addon/components/fleet-panel/vehicle-listing.js +1 -1
- package/addon/components/fleet-panel.js +2 -2
- package/addon/components/fuel-report-form-panel.js +2 -2
- package/addon/components/fuel-report-panel.js +2 -2
- package/addon/components/issue-form-panel.js +2 -2
- package/addon/components/issue-panel.js +2 -2
- package/addon/components/live-map-drawer.js +2 -2
- package/addon/components/order-config-manager/activity-flow.js +1 -1
- package/addon/components/order-config-manager/custom-fields.js +1 -1
- package/addon/components/order-config-manager/entities.js +1 -1
- package/addon/components/order-config-manager-overlay.js +1 -1
- package/addon/components/order-config-manager.js +2 -2
- package/addon/components/place-form-panel.js +2 -2
- package/addon/components/place-panel.js +2 -2
- package/addon/components/vehicle-form-panel.js +2 -2
- package/addon/components/vehicle-panel.js +2 -2
- package/addon/components/vendor-form-panel/create-form.js +1 -1
- package/addon/components/vendor-form-panel.js +2 -2
- package/addon/components/vendor-panel.js +2 -2
- package/composer.json +2 -2
- package/extension.json +1 -1
- package/package.json +2 -2
- package/server/src/Http/Controllers/Api/v1/DriverController.php +0 -1
- package/server/src/Http/Controllers/Api/v1/OrderController.php +49 -2
- package/server/src/Http/Controllers/Internal/v1/SettingController.php +20 -0
- package/server/src/Http/Filter/ContactFilter.php +5 -0
- package/server/src/Http/Filter/DriverFilter.php +5 -0
- package/server/src/Http/Filter/EntityFilter.php +18 -0
- package/server/src/Http/Filter/FleetFilter.php +5 -0
- package/server/src/Http/Filter/FuelReportFilter.php +5 -0
- package/server/src/Http/Filter/IssueFilter.php +5 -0
- package/server/src/Http/Filter/OrderConfigFilter.php +5 -0
- package/server/src/Http/Filter/OrderFilter.php +5 -0
- package/server/src/Http/Filter/PayloadFilter.php +18 -0
- package/server/src/Http/Filter/PlaceFilter.php +5 -0
- package/server/src/Http/Filter/PurchaseRateFilter.php +18 -0
- package/server/src/Http/Filter/ServiceAreaFilter.php +5 -0
- package/server/src/Http/Filter/ServiceQuoteFilter.php +5 -0
- package/server/src/Http/Filter/ServiceRateFilter.php +5 -0
- package/server/src/Http/Filter/TrackingNumberFilter.php +18 -0
- package/server/src/Http/Filter/TrackingStatusFilter.php +5 -0
- package/server/src/Http/Filter/VehicleFilter.php +5 -0
- package/server/src/Http/Filter/VendorFilter.php +5 -0
- package/server/src/Http/Filter/ZoneFilter.php +5 -0
- package/server/src/Http/Resources/v1/Order.php +1 -0
- package/server/src/Models/Driver.php +1 -1
- package/server/src/Providers/FleetOpsServiceProvider.php +3 -3
- package/server/src/Support/Utils.php +40 -14
- package/server/src/routes.php +3 -0
- package/translations/en-us.yaml +3 -0
- package/addon/utils/apply-context-component-arguments.js +0 -33
- package/addon/utils/context-component-callback.js +0 -16
- package/app/utils/apply-context-component-arguments.js +0 -1
- package/app/utils/context-component-callback.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
-
import contextComponentCallback from '
|
|
4
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
5
5
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -2,8 +2,8 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { underscore, capitalize, w } from '@ember/string';
|
|
5
|
-
import contextComponentCallback from '
|
|
6
|
-
import applyContextComponentArguments from '
|
|
5
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
6
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Component class for managing activity forms.
|
|
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { isArray } from '@ember/array';
|
|
5
5
|
import { isNone } from '@ember/utils';
|
|
6
|
-
import contextComponentCallback from '
|
|
6
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
7
7
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
8
8
|
|
|
9
9
|
export default class ActivityLogicBuilderComponent extends Component {
|
|
@@ -1,8 +1,84 @@
|
|
|
1
|
-
<ContentPanel @title={{t "fleet-ops.component.admin.navigator-app.title"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
|
|
1
|
+
<ContentPanel @title={{t "fleet-ops.component.admin.navigator-app.title"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800 mb-4">
|
|
2
2
|
<InputGroup @name={{t "fleet-ops.component.admin.navigator-app.name"}}>
|
|
3
3
|
<ClickToCopy class="px-4 py-2 border rounded-md bg-gray-100 shadow-sm dark:bg-gray-700 border-gray-200 dark:border-gray-800" @value={{this.url}}>{{this.url}}</ClickToCopy>
|
|
4
4
|
<Attach::Tooltip @class="clean" @animation="scale" @placement="top">
|
|
5
5
|
<InputInfo>{{t "fleet-ops.component.admin.navigator-app.message" htmlSafe=true companyName=@app.name}}</InputInfo>
|
|
6
6
|
</Attach::Tooltip>
|
|
7
7
|
</InputGroup>
|
|
8
|
+
</ContentPanel>
|
|
9
|
+
|
|
10
|
+
<ContentPanel @title={{t "fleet-ops.component.admin.navigator-app.settings"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
|
|
11
|
+
<InputGroup>
|
|
12
|
+
<div class="flex items-center">
|
|
13
|
+
<Toggle @isToggled={{this.isEntityFieldsEditable}} @onToggle={{this.enableEditableEntityFields}} />
|
|
14
|
+
<div class="ml-2">{{t "fleet-ops.component.admin.navigator-app.select-input"}}</div>
|
|
15
|
+
</div>
|
|
16
|
+
</InputGroup>
|
|
17
|
+
{{#if this.isEntityFieldsEditable}}
|
|
18
|
+
<OrderConfigManager @onConfigChanged={{this.onConfigChanged}} as |Action Context|>
|
|
19
|
+
<div class="mt-2">
|
|
20
|
+
<InputGroup @name="Select order config" @helpText="Apply entity editing settings for an order config.">
|
|
21
|
+
<DropdownButton
|
|
22
|
+
class="order-config-select-button mr-2"
|
|
23
|
+
@disabled={{not Context.configs}}
|
|
24
|
+
@text={{if Context.currentConfig.name Context.currentConfig.name (t "fleet-ops.component.order-config-manager.select-order-config")}}
|
|
25
|
+
@textClass="text-sm mr-2"
|
|
26
|
+
@buttonClass="flex-row-reverse w-44 justify-between"
|
|
27
|
+
@icon="caret-down"
|
|
28
|
+
@iconClass="mr-0i"
|
|
29
|
+
@size="sm"
|
|
30
|
+
@iconPrefix="fas"
|
|
31
|
+
@triggerClass="hidden md:flex"
|
|
32
|
+
as |dd|
|
|
33
|
+
>
|
|
34
|
+
<div class="next-dd-menu mt-1 mx-0" aria-labelledby="user-menu">
|
|
35
|
+
<div class="p-1">
|
|
36
|
+
{{#each Context.configs as |orderConfig|}}
|
|
37
|
+
<a href="javascript:;" class="next-dd-item" {{on "click" (dropdown-fn dd Context.selectConfig orderConfig)}}>
|
|
38
|
+
<div class="flex-1 flex flex-row items-center">
|
|
39
|
+
<div class="w-6">
|
|
40
|
+
<FaIcon @icon="cogs" />
|
|
41
|
+
</div>
|
|
42
|
+
<span>{{orderConfig.name}}</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
{{#if (eq Context.currentConfig.id orderConfig.id)}}
|
|
46
|
+
<FaIcon @icon="check" class="text-green-500" />
|
|
47
|
+
{{/if}}
|
|
48
|
+
</div>
|
|
49
|
+
</a>
|
|
50
|
+
{{/each}}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</DropdownButton>
|
|
54
|
+
</InputGroup>
|
|
55
|
+
</div>
|
|
56
|
+
</OrderConfigManager>
|
|
57
|
+
{{#if this.selectedOrderConfig}}
|
|
58
|
+
<div class="bg-gray-400 border-gray-600 rounded-lg px-4 py-2 dark:bg-gray-700 dark:border-gray-800">
|
|
59
|
+
{{#let (get (get this.entityEditingSettings this.selectedOrderConfig.id) "editable_entity_fields") as |editableEntityFields|}}
|
|
60
|
+
{{#each this.entityFields as |entityField|}}
|
|
61
|
+
<div class="mt-1">
|
|
62
|
+
<Checkbox
|
|
63
|
+
@value={{includes entityField editableEntityFields}}
|
|
64
|
+
@label={{smart-humanize entityField}}
|
|
65
|
+
@onToggle={{fn this.toggleFieldEditable entityField}}
|
|
66
|
+
@helpText={{t "fleet-ops.component.admin.visibility-controls.checkbox-text"}}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
{{/each}}
|
|
70
|
+
{{/let}}
|
|
71
|
+
</div>
|
|
72
|
+
<div class="mt-3 flex items-center">
|
|
73
|
+
<Button
|
|
74
|
+
@type="primary"
|
|
75
|
+
@size="lg"
|
|
76
|
+
@icon="save"
|
|
77
|
+
@text={{t "fleet-ops.common.save-changes"}}
|
|
78
|
+
@onClick={{perform this.saveEntityEditingSettings}}
|
|
79
|
+
@isLoading={{not this.saveEntityEditingSettings.isIdle}}
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
{{/if}}
|
|
83
|
+
{{/if}}
|
|
8
84
|
</ContentPanel>
|
|
@@ -1,27 +1,80 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { inject as service } from '@ember/service';
|
|
3
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { isArray } from '@ember/array';
|
|
6
|
+
import { task } from 'ember-concurrency-decorators';
|
|
4
7
|
|
|
5
8
|
export default class NavigatorAppControlsComponent extends Component {
|
|
6
9
|
@service fetch;
|
|
7
10
|
@tracked isLoading = false;
|
|
8
11
|
@tracked url;
|
|
12
|
+
@tracked selectedOrderConfig;
|
|
13
|
+
@tracked entityFields = ['name', 'description', 'sku', 'height', 'width', 'length', 'weight', 'declared_value', 'sale_price'];
|
|
14
|
+
@tracked entityEditingSettings = {};
|
|
15
|
+
@tracked isEntityFieldsEditable = false;
|
|
9
16
|
|
|
10
17
|
constructor() {
|
|
11
18
|
super(...arguments);
|
|
12
|
-
this.getAppLinkUrl();
|
|
19
|
+
this.getAppLinkUrl.perform();
|
|
20
|
+
this.getEntityEditableSettings.perform();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@action enableEditableEntityFields(isEntityFieldsEditable) {
|
|
24
|
+
this.isEntityFieldsEditable = isEntityFieldsEditable;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@action onConfigChanged(orderConfig) {
|
|
28
|
+
this.selectedOrderConfig = orderConfig;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@action toggleFieldEditable(fieldName, isEditable) {
|
|
32
|
+
const editableFields = this.entityEditingSettings[this.selectedOrderConfig.id]?.editable_entity_fields;
|
|
33
|
+
if (isArray(editableFields)) {
|
|
34
|
+
if (isEditable) {
|
|
35
|
+
editableFields.pushObject(fieldName);
|
|
36
|
+
} else {
|
|
37
|
+
editableFields.removeObject(fieldName);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
this.entityEditingSettings = {
|
|
41
|
+
...this.entityEditingSettings,
|
|
42
|
+
[this.selectedOrderConfig.id]: {
|
|
43
|
+
editable_entity_fields: [],
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
return this.toggleFieldEditable(...arguments);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.updateEditableEntityFieldsForOrderConfig(editableFields);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
updateEditableEntityFieldsForOrderConfig(editableFields = [], orderConfig = null) {
|
|
53
|
+
orderConfig = orderConfig === null ? this.selectedOrderConfig : orderConfig;
|
|
54
|
+
this.entityEditingSettings = {
|
|
55
|
+
...this.entityEditingSettings,
|
|
56
|
+
[orderConfig.id]: {
|
|
57
|
+
editable_entity_fields: editableFields,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
13
60
|
}
|
|
14
61
|
|
|
15
|
-
getAppLinkUrl() {
|
|
16
|
-
|
|
62
|
+
@task *getAppLinkUrl() {
|
|
63
|
+
const response = yield this.fetch.get('fleet-ops/navigator/get-link-app');
|
|
64
|
+
const { linkUrl } = response;
|
|
65
|
+
if (linkUrl) {
|
|
66
|
+
this.url = linkUrl;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@task *getEntityEditableSettings() {
|
|
71
|
+
const { entityEditingSettings, isEntityFieldsEditable } = yield this.fetch.get('fleet-ops/settings/entity-editing-settings');
|
|
72
|
+
this.entityEditingSettings = entityEditingSettings;
|
|
73
|
+
this.isEntityFieldsEditable = isEntityFieldsEditable;
|
|
74
|
+
}
|
|
17
75
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.url = linkUrl;
|
|
22
|
-
})
|
|
23
|
-
.finally(() => {
|
|
24
|
-
this.isLoading = false;
|
|
25
|
-
});
|
|
76
|
+
@task *saveEntityEditingSettings() {
|
|
77
|
+
const { entityEditingSettings, isEntityFieldsEditable } = this;
|
|
78
|
+
yield this.fetch.post('fleet-ops/settings/entity-editing-settings', { entityEditingSettings, isEntityFieldsEditable });
|
|
26
79
|
}
|
|
27
80
|
}
|
|
@@ -2,8 +2,8 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
|
-
import contextComponentCallback from '
|
|
6
|
-
import applyContextComponentArguments from '
|
|
5
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
6
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
7
7
|
|
|
8
8
|
export default class ContactFormPanelComponent extends Component {
|
|
9
9
|
/**
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import ContactPanelDetailComponent from './contact-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
export default class ContactPanelComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -5,8 +5,8 @@ import { action } from '@ember/object';
|
|
|
5
5
|
import { dasherize, camelize } from '@ember/string';
|
|
6
6
|
import { task } from 'ember-concurrency-decorators';
|
|
7
7
|
import isObject from '@fleetbase/ember-core/utils/is-object';
|
|
8
|
-
import contextComponentCallback from '
|
|
9
|
-
import applyContextComponentArguments from '
|
|
8
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
10
10
|
import getCustomFieldTypeMap from '../utils/get-custom-field-type-map';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -3,8 +3,8 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import Point from '@fleetbase/fleetops-data/utils/geojson/point';
|
|
6
|
-
import contextComponentCallback from '
|
|
7
|
-
import applyContextComponentArguments from '
|
|
6
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
7
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
8
8
|
|
|
9
9
|
export default class DriverFormPanelComponent extends Component {
|
|
10
10
|
/**
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import DriverPanelDetailComponent from './driver-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
export default class DriverPanelComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import { task } from 'ember-concurrency-decorators';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
10
10
|
import Point from '@fleetbase/fleetops-data/utils/geojson/point';
|
|
11
11
|
import findClosestWaypoint from '@fleetbase/ember-core/utils/find-closest-waypoint';
|
|
@@ -3,8 +3,8 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { underscore } from '@ember/string';
|
|
6
|
-
import contextComponentCallback from '
|
|
7
|
-
import applyContextComponentArguments from '
|
|
6
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
7
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
8
8
|
|
|
9
9
|
export default class FleetFormPanelComponent extends Component {
|
|
10
10
|
/**
|
|
@@ -5,7 +5,7 @@ import { isBlank } from '@ember/utils';
|
|
|
5
5
|
import { action, set } from '@ember/object';
|
|
6
6
|
import { timeout } from 'ember-concurrency';
|
|
7
7
|
import { task } from 'ember-concurrency-decorators';
|
|
8
|
-
import contextComponentCallback from '
|
|
8
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
9
|
|
|
10
10
|
export default class FleetPanelDriverListingComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -5,7 +5,7 @@ import { isBlank } from '@ember/utils';
|
|
|
5
5
|
import { action, set } from '@ember/object';
|
|
6
6
|
import { timeout } from 'ember-concurrency';
|
|
7
7
|
import { task } from 'ember-concurrency-decorators';
|
|
8
|
-
import contextComponentCallback from '
|
|
8
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
9
|
|
|
10
10
|
export default class FleetPanelVehicleListingComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -6,8 +6,8 @@ import { isArray } from '@ember/array';
|
|
|
6
6
|
import FleetPanelDetailComponent from './fleet-panel/details';
|
|
7
7
|
import FleetPanelDriverListingComponent from './fleet-panel/driver-listing';
|
|
8
8
|
import FleetPanelVehicleListingComponent from './fleet-panel/vehicle-listing';
|
|
9
|
-
import contextComponentCallback from '
|
|
10
|
-
import applyContextComponentArguments from '
|
|
9
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
10
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
11
11
|
|
|
12
12
|
export default class FleetPanelComponent extends Component {
|
|
13
13
|
/**
|
|
@@ -2,8 +2,8 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
|
-
import contextComponentCallback from '
|
|
6
|
-
import applyContextComponentArguments from '
|
|
5
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
6
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
7
7
|
|
|
8
8
|
export default class FuelReportFormPanelComponent extends Component {
|
|
9
9
|
/**
|
|
@@ -4,8 +4,8 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import FuelReportPanelDetailsComponent from './fuel-report-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
export default class FuelReportPanelComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -4,8 +4,8 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
import getIssueTypes from '../utils/get-issue-types';
|
|
10
10
|
import getIssueCategories from '../utils/get-issue-categories';
|
|
11
11
|
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import IssuePanelDetailComponent from './issue-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
export default class IssuePanelComponent extends Component {
|
|
10
10
|
/**
|
|
11
11
|
* Service for fetching data.
|
|
@@ -3,8 +3,8 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
|
-
import contextComponentCallback from '
|
|
7
|
-
import applyContextComponentArguments from '
|
|
6
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
7
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
8
8
|
import LiveMapDrawerVehicleListingComponent from './live-map-drawer/vehicle-listing';
|
|
9
9
|
import LiveMapDrawerDriverListingComponent from './live-map-drawer/driver-listing';
|
|
10
10
|
import LiveMapDrawerPlaceListingComponent from './live-map-drawer/place-listing';
|
|
@@ -9,7 +9,7 @@ import { later } from '@ember/runloop';
|
|
|
9
9
|
import { task } from 'ember-concurrency-decorators';
|
|
10
10
|
import generateUUID from '@fleetbase/ember-core/utils/generate-uuid';
|
|
11
11
|
import createFlowActivity from '../../utils/create-flow-activity';
|
|
12
|
-
import contextComponentCallback from '
|
|
12
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Manages the activity flow for order configuration, allowing users to create, edit, and view a sequence of activities.
|
|
@@ -6,7 +6,7 @@ import { isArray } from '@ember/array';
|
|
|
6
6
|
import { later } from '@ember/runloop';
|
|
7
7
|
import { task } from 'ember-concurrency-decorators';
|
|
8
8
|
import isObject from '@fleetbase/ember-core/utils/is-object';
|
|
9
|
-
import contextComponentCallback from '
|
|
9
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Component class for managing custom fields within an order configuration.
|
|
@@ -8,7 +8,7 @@ import { task } from 'ember-concurrency-decorators';
|
|
|
8
8
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
9
9
|
import ObjectProxy from '@ember/object/proxy';
|
|
10
10
|
import createCustomEntity from '../../utils/create-custom-entity';
|
|
11
|
-
import contextComponentCallback from '
|
|
11
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Component class for managing order configuration entities.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
|
-
import contextComponentCallback from '
|
|
3
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
4
4
|
|
|
5
5
|
export default class OrderConfigManagerOverlayComponent extends Component {
|
|
6
6
|
/**
|
|
@@ -9,8 +9,8 @@ import { dasherize } from '@ember/string';
|
|
|
9
9
|
import { task } from 'ember-concurrency-decorators';
|
|
10
10
|
import isModel from '@fleetbase/ember-core/utils/is-model';
|
|
11
11
|
import getModelName from '@fleetbase/ember-core/utils/get-model-name';
|
|
12
|
-
import contextComponentCallback from '
|
|
13
|
-
import applyContextComponentArguments from '
|
|
12
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
13
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
14
14
|
import OrderConfigManagerDetailsComponent from './order-config-manager/details';
|
|
15
15
|
import OrderConfigManagerCustomFieldsComponent from './order-config-manager/custom-fields';
|
|
16
16
|
import OrderConfigManagerActivityFlowComponent from './order-config-manager/activity-flow';
|
|
@@ -4,8 +4,8 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
6
|
import Point from '@fleetbase/fleetops-data/utils/geojson/point';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
export default class PlaceFormPanelComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import PlacePanelDetailComponent from './place-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
export default class PlacePanelComponent extends Component {
|
|
11
11
|
/**
|
|
@@ -2,8 +2,8 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
|
-
import contextComponentCallback from '
|
|
6
|
-
import applyContextComponentArguments from '
|
|
5
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
6
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
7
7
|
import Point from '@fleetbase/fleetops-data/utils/geojson/point';
|
|
8
8
|
|
|
9
9
|
export default class VehicleFormPanelComponent extends Component {
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import VehiclePanelDetailComponent from './vehicle-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents the vehicle panel component, handling vehicle information display and editing.
|
|
@@ -4,7 +4,7 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import apiUrl from '@fleetbase/ember-core/utils/api-url';
|
|
7
|
-
import contextComponentCallback from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
8
|
|
|
9
9
|
export default class VendorFormPanelCreateFormComponent extends Component {
|
|
10
10
|
/**
|
|
@@ -2,8 +2,8 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
|
-
import contextComponentCallback from '
|
|
6
|
-
import applyContextComponentArguments from '
|
|
5
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
6
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
7
7
|
import getVendorTypeOptions from '../utils/get-vendor-type-options';
|
|
8
8
|
import getVendorStatusOptions from '../utils/get-vendor-status-options';
|
|
9
9
|
|
|
@@ -4,8 +4,8 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import VendorPanelDetailComponent from './vendor-panel/details';
|
|
7
|
-
import contextComponentCallback from '
|
|
8
|
-
import applyContextComponentArguments from '
|
|
7
|
+
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
|
+
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
|
|
10
10
|
export default class VendorPanelComponent extends Component {
|
|
11
11
|
/**
|
package/composer.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleetbase/fleetops-api",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.20",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fleetbase-extension",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"require": {
|
|
24
24
|
"php": "^8.0",
|
|
25
|
-
"fleetbase/core-api": "^1.4.
|
|
25
|
+
"fleetbase/core-api": "^1.4.14",
|
|
26
26
|
"barryvdh/laravel-dompdf": "^2.0",
|
|
27
27
|
"brick/geo": "0.7.2",
|
|
28
28
|
"cknow/laravel-money": "^7.1",
|
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.20",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/core": "^7.23.2",
|
|
45
|
-
"@fleetbase/ember-core": "^0.2.
|
|
45
|
+
"@fleetbase/ember-core": "^0.2.8",
|
|
46
46
|
"@fleetbase/ember-ui": "^0.2.11",
|
|
47
47
|
"@fleetbase/fleetops-data": "^0.1.14",
|
|
48
48
|
"@fleetbase/leaflet-routing-machine": "^3.2.16",
|
|
@@ -11,7 +11,6 @@ use Fleetbase\FleetOps\Http\Resources\v1\Driver as DriverResource;
|
|
|
11
11
|
use Fleetbase\FleetOps\Jobs\SimulateDrivingRoute;
|
|
12
12
|
use Fleetbase\FleetOps\Models\Driver;
|
|
13
13
|
use Fleetbase\FleetOps\Models\Order;
|
|
14
|
-
use Fleetbase\FleetOps\Support\Flow;
|
|
15
14
|
use Fleetbase\FleetOps\Support\OSRM;
|
|
16
15
|
use Fleetbase\FleetOps\Support\Utils;
|
|
17
16
|
use Fleetbase\Http\Controllers\Controller;
|
|
@@ -25,6 +25,7 @@ use Fleetbase\FleetOps\Support\Utils;
|
|
|
25
25
|
use Fleetbase\Http\Controllers\Controller;
|
|
26
26
|
use Fleetbase\Models\Company;
|
|
27
27
|
use Fleetbase\Models\File;
|
|
28
|
+
use Fleetbase\Models\Setting;
|
|
28
29
|
use Fleetbase\Support\Auth;
|
|
29
30
|
use Illuminate\Http\Request;
|
|
30
31
|
use Illuminate\Support\Carbon;
|
|
@@ -433,8 +434,6 @@ class OrderController extends Controller
|
|
|
433
434
|
public function query(Request $request)
|
|
434
435
|
{
|
|
435
436
|
$results = Order::queryWithRequest($request, function (&$query, $request) {
|
|
436
|
-
$query->where('company_uuid', session('company'));
|
|
437
|
-
|
|
438
437
|
if ($request->has('payload')) {
|
|
439
438
|
$query->whereHas('payload', function ($q) use ($request) {
|
|
440
439
|
$q->where('public_id', $request->input('payload'));
|
|
@@ -1364,4 +1363,52 @@ class OrderController extends Controller
|
|
|
1364
1363
|
|
|
1365
1364
|
return new ProofResource($proof);
|
|
1366
1365
|
}
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* Retrieves editable fields for a specific order entity based on its configuration.
|
|
1369
|
+
*
|
|
1370
|
+
* This function looks up an order by its ID and retrieves configurable editable fields
|
|
1371
|
+
* associated with it, as defined in the settings. If the order is not found, it returns
|
|
1372
|
+
* a 404 response with an error message. Otherwise, it returns the editable fields for
|
|
1373
|
+
* the order entity.
|
|
1374
|
+
*
|
|
1375
|
+
* @param string $id the unique identifier of the order
|
|
1376
|
+
* @param Request $request the incoming request instance
|
|
1377
|
+
*
|
|
1378
|
+
* @return \Illuminate\Http\JsonResponse returns a JSON response containing either an error message
|
|
1379
|
+
* or the editable fields for the order entity
|
|
1380
|
+
*
|
|
1381
|
+
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException thrown if the order with the given ID cannot be found
|
|
1382
|
+
*/
|
|
1383
|
+
public function getEditableEntityFields(string $id, Request $request)
|
|
1384
|
+
{
|
|
1385
|
+
try {
|
|
1386
|
+
$order = Order::findRecordOrFail($id);
|
|
1387
|
+
} catch (\Illuminate\Database\Eloquent\ModelNotFoundException $exception) {
|
|
1388
|
+
return response()->json(
|
|
1389
|
+
[
|
|
1390
|
+
'error' => 'Order resource not found.',
|
|
1391
|
+
],
|
|
1392
|
+
404
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
// Define settings as array
|
|
1397
|
+
$entityEditingSettings = [];
|
|
1398
|
+
|
|
1399
|
+
// get the order config id
|
|
1400
|
+
$orderConfigId = data_get($order, 'order_config_uuid');
|
|
1401
|
+
|
|
1402
|
+
// Get entity editing settings
|
|
1403
|
+
$savedEntityEditingSettings = Setting::where('key', 'fleet-ops.entity-editing-settings')->value('value');
|
|
1404
|
+
|
|
1405
|
+
if ($orderConfigId && $savedEntityEditingSettings) {
|
|
1406
|
+
$resolvedEntityEditingSettings = data_get($savedEntityEditingSettings, $orderConfigId, []);
|
|
1407
|
+
if ($resolvedEntityEditingSettings) {
|
|
1408
|
+
$entityEditingSettings = data_get($resolvedEntityEditingSettings, 'editable_entity_fields', []);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
return response()->json($entityEditingSettings);
|
|
1413
|
+
}
|
|
1367
1414
|
}
|
|
@@ -47,4 +47,24 @@ class SettingController extends Controller
|
|
|
47
47
|
|
|
48
48
|
return response()->json(['visibilitySettings' => $visibilitySettings]);
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
public function saveEntityEditingSettings(Request $request)
|
|
52
|
+
{
|
|
53
|
+
$entityEditingSettings = $request->input('entityEditingSettings', []);
|
|
54
|
+
$isEntityFieldsEditable = $request->boolean('isEntityFieldsEditable');
|
|
55
|
+
|
|
56
|
+
// Save entity editing settings
|
|
57
|
+
Setting::configure('fleet-ops.entity-editing-settings', $entityEditingSettings);
|
|
58
|
+
Setting::configure('fleet-ops.entity-fields-editable', $isEntityFieldsEditable);
|
|
59
|
+
|
|
60
|
+
return response()->json(['entityEditingSettings' => $entityEditingSettings, 'isEntityFieldsEditable' => $isEntityFieldsEditable]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public function getEntityEditingSettings()
|
|
64
|
+
{
|
|
65
|
+
$entityEditingSettings = Setting::where('key', 'fleet-ops.entity-editing-settings')->value('value');
|
|
66
|
+
$isEntityFieldsEditable = Setting::where('key', 'fleet-ops.entity-fields-editable')->value('value');
|
|
67
|
+
|
|
68
|
+
return response()->json(['entityEditingSettings' => $entityEditingSettings, 'isEntityFieldsEditable' => $isEntityFieldsEditable]);
|
|
69
|
+
}
|
|
50
70
|
}
|
|
@@ -22,6 +22,11 @@ class ContactFilter extends Filter
|
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
public function queryForPublic()
|
|
26
|
+
{
|
|
27
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
public function query(?string $searchQuery)
|
|
26
31
|
{
|
|
27
32
|
$this->builder->search($searchQuery);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\FleetOps\Http\Filter;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\Http\Filter\Filter;
|
|
6
|
+
|
|
7
|
+
class EntityFilter extends Filter
|
|
8
|
+
{
|
|
9
|
+
public function queryForInternal()
|
|
10
|
+
{
|
|
11
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function queryForPublic()
|
|
15
|
+
{
|
|
16
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -12,6 +12,11 @@ class FleetFilter extends Filter
|
|
|
12
12
|
$this->builder->where('company_uuid', $this->session->get('company'))->with(['serviceArea', 'zone']);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
public function queryForPublic()
|
|
16
|
+
{
|
|
17
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
public function query(?string $searchQuery)
|
|
16
21
|
{
|
|
17
22
|
$this->builder->where(function ($query) use ($searchQuery) {
|
|
@@ -13,6 +13,11 @@ class FuelReportFilter extends Filter
|
|
|
13
13
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
public function queryForPublic()
|
|
17
|
+
{
|
|
18
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
public function query(?string $searchQuery)
|
|
17
22
|
{
|
|
18
23
|
$this->builder->search($searchQuery);
|
|
@@ -13,6 +13,11 @@ class IssueFilter extends Filter
|
|
|
13
13
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
public function queryForPublic()
|
|
17
|
+
{
|
|
18
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
public function query(?string $searchQuery)
|
|
17
22
|
{
|
|
18
23
|
$this->builder->search($searchQuery);
|
|
@@ -36,6 +36,11 @@ class OrderFilter extends Filter
|
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
public function queryForPublic()
|
|
40
|
+
{
|
|
41
|
+
$this->builder->where('company_uuid', $this->session->get('company'))->whereHas('trackingNumber')->whereHas('payload');
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
public function unassigned(bool $unassigned)
|
|
40
45
|
{
|
|
41
46
|
if ($unassigned) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\FleetOps\Http\Filter;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\Http\Filter\Filter;
|
|
6
|
+
|
|
7
|
+
class PayloadFilter extends Filter
|
|
8
|
+
{
|
|
9
|
+
public function queryForInternal()
|
|
10
|
+
{
|
|
11
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function queryForPublic()
|
|
15
|
+
{
|
|
16
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -15,6 +15,11 @@ class PlaceFilter extends Filter
|
|
|
15
15
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
public function queryForPublic()
|
|
19
|
+
{
|
|
20
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
public function query(?string $searchQuery)
|
|
19
24
|
{
|
|
20
25
|
$this->builder->search($searchQuery);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\FleetOps\Http\Filter;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\Http\Filter\Filter;
|
|
6
|
+
|
|
7
|
+
class PurchaseRateFilter extends Filter
|
|
8
|
+
{
|
|
9
|
+
public function queryForInternal()
|
|
10
|
+
{
|
|
11
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function queryForPublic()
|
|
15
|
+
{
|
|
16
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -11,6 +11,11 @@ class ServiceRateFilter extends Filter
|
|
|
11
11
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
public function queryForPublic()
|
|
15
|
+
{
|
|
16
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
public function serviceArea(?string $serviceArea)
|
|
15
20
|
{
|
|
16
21
|
$this->builder->whereHas(
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\FleetOps\Http\Filter;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\Http\Filter\Filter;
|
|
6
|
+
|
|
7
|
+
class TrackingNumberFilter extends Filter
|
|
8
|
+
{
|
|
9
|
+
public function queryForInternal()
|
|
10
|
+
{
|
|
11
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public function queryForPublic()
|
|
15
|
+
{
|
|
16
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -11,6 +11,11 @@ class TrackingStatusFilter extends Filter
|
|
|
11
11
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
public function queryForPublic()
|
|
15
|
+
{
|
|
16
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
public function trackingNumber(string $trackingNumber)
|
|
15
20
|
{
|
|
16
21
|
$this->builder->whereHas('trackingNumber', function ($query) use ($trackingNumber) {
|
|
@@ -12,6 +12,11 @@ class VehicleFilter extends Filter
|
|
|
12
12
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
public function queryForPublic()
|
|
16
|
+
{
|
|
17
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
public function query(?string $query)
|
|
16
21
|
{
|
|
17
22
|
$this->builder->search($query);
|
|
@@ -12,6 +12,11 @@ class VendorFilter extends Filter
|
|
|
12
12
|
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
public function queryForPublic()
|
|
16
|
+
{
|
|
17
|
+
$this->builder->where('company_uuid', $this->session->get('company'));
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
public function query(?string $searchQuery)
|
|
16
21
|
{
|
|
17
22
|
$this->builder->search($searchQuery);
|
|
@@ -39,6 +39,7 @@ class Order extends FleetbaseResource
|
|
|
39
39
|
'service_quote_uuid' => $this->when(Http::isInternalRequest(), $this->service_quote_uuid),
|
|
40
40
|
'has_driver_assigned' => $this->when(Http::isInternalRequest(), $this->has_driver_assigned),
|
|
41
41
|
'is_scheduled' => $this->when(Http::isInternalRequest(), $this->is_scheduled),
|
|
42
|
+
'order_config_id' => $this->when(Http::isInternalRequest(), $this->order_config_id),
|
|
42
43
|
'order_config' => $this->when(Http::isInternalRequest(), $this->whenLoaded('orderConfig', $this->orderConfig), data_get($this->orderConfig, 'public_id')),
|
|
43
44
|
'custom_field_values' => $this->when(Http::isInternalRequest(), $this->customFieldValues),
|
|
44
45
|
'customer' => $this->setCustomerType(Resolve::resourceForMorph($this->customer_type, $this->customer_uuid)),
|
|
@@ -157,7 +157,7 @@ class Driver extends Model
|
|
|
157
157
|
*
|
|
158
158
|
* @var array
|
|
159
159
|
*/
|
|
160
|
-
protected $filterParams = ['vendor', 'facilitator', 'customer', 'fleet', 'photo_uuid', 'avatar_uuid'];
|
|
160
|
+
protected $filterParams = ['vendor', 'facilitator', 'customer', 'fleet', 'photo_uuid', 'avatar_uuid', 'avatar_value'];
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* Get the activity log options for the model.
|
|
@@ -80,9 +80,9 @@ class FleetOpsServiceProvider extends CoreServiceProvider
|
|
|
80
80
|
$this->registerObservers();
|
|
81
81
|
$this->registerCommands();
|
|
82
82
|
$this->scheduleCommands(function ($schedule) {
|
|
83
|
-
$schedule->command('fleetops:dispatch-orders')->everyMinute();
|
|
84
|
-
$schedule->command('fleetops:dispatch-adhoc')->everyMinute();
|
|
85
|
-
$schedule->command('fleetops:update-estimations')->
|
|
83
|
+
$schedule->command('fleetops:dispatch-orders')->everyMinute()->withoutOverlapping()->storeOutputInDb();
|
|
84
|
+
$schedule->command('fleetops:dispatch-adhoc')->everyMinute()->withoutOverlapping()->storeOutputInDb();
|
|
85
|
+
$schedule->command('fleetops:update-estimations')->everyFiveMinutes()->withoutOverlapping();
|
|
86
86
|
});
|
|
87
87
|
$this->registerNotifications();
|
|
88
88
|
$this->registerExpansionsFrom(__DIR__ . '/../Expansions');
|
|
@@ -633,13 +633,26 @@ class Utils extends FleetbaseUtils
|
|
|
633
633
|
]
|
|
634
634
|
);
|
|
635
635
|
} else {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
636
|
+
try {
|
|
637
|
+
$point = static::getPointFromMixed($origin);
|
|
638
|
+
$origin = static::createObject(
|
|
639
|
+
[
|
|
640
|
+
'latitude' => $point->getLat(),
|
|
641
|
+
'longitude' => $point->getLng(),
|
|
642
|
+
]
|
|
643
|
+
);
|
|
644
|
+
} catch (\Throwable $e) {
|
|
645
|
+
if (app()->bound('sentry')) {
|
|
646
|
+
app('sentry')->captureException($e);
|
|
647
|
+
}
|
|
648
|
+
// create dummy $origin
|
|
649
|
+
$origin = static::createObject(
|
|
650
|
+
[
|
|
651
|
+
'latitude' => 0,
|
|
652
|
+
'longitude' => 0,
|
|
653
|
+
]
|
|
654
|
+
);
|
|
655
|
+
}
|
|
643
656
|
}
|
|
644
657
|
|
|
645
658
|
if ($destination instanceof \Fleetbase\FleetOps\Models\Place) {
|
|
@@ -650,13 +663,26 @@ class Utils extends FleetbaseUtils
|
|
|
650
663
|
]
|
|
651
664
|
);
|
|
652
665
|
} else {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
666
|
+
try {
|
|
667
|
+
$point = static::getPointFromMixed($destination);
|
|
668
|
+
$destination = static::createObject(
|
|
669
|
+
[
|
|
670
|
+
'latitude' => $point->getLat(),
|
|
671
|
+
'longitude' => $point->getLng(),
|
|
672
|
+
]
|
|
673
|
+
);
|
|
674
|
+
} catch (\Throwable $e) {
|
|
675
|
+
if (app()->bound('sentry')) {
|
|
676
|
+
app('sentry')->captureException($e);
|
|
677
|
+
}
|
|
678
|
+
// create dummy $destination
|
|
679
|
+
$destination = static::createObject(
|
|
680
|
+
[
|
|
681
|
+
'latitude' => 0,
|
|
682
|
+
'longitude' => 0,
|
|
683
|
+
]
|
|
684
|
+
);
|
|
685
|
+
}
|
|
660
686
|
}
|
|
661
687
|
|
|
662
688
|
$cacheKey = $origin->latitude . ':' . $origin->longitude . ':' . $destination->latitude . ':' . $destination->longitude;
|
package/server/src/routes.php
CHANGED
|
@@ -84,6 +84,7 @@ Route::prefix(config('fleetops.api.routing.prefix', null))->namespace('Fleetbase
|
|
|
84
84
|
$router->post('{id}/capture-photo/{subjectId?}', 'OrderController@capturePhoto');
|
|
85
85
|
$router->put('{id}', 'OrderController@update');
|
|
86
86
|
$router->delete('{id}', 'OrderController@delete');
|
|
87
|
+
$router->get('{id}/editable-entity-fields', 'OrderController@getEditableEntityFields');
|
|
87
88
|
});
|
|
88
89
|
// entities routes
|
|
89
90
|
$router->group(['prefix' => 'entities'], function () use ($router) {
|
|
@@ -435,6 +436,8 @@ Route::prefix(config('fleetops.api.routing.prefix', null))->namespace('Fleetbase
|
|
|
435
436
|
function ($router) {
|
|
436
437
|
$router->get('visibility', 'SettingController@getVisibilitySettings');
|
|
437
438
|
$router->post('visibility', 'SettingController@saveVisibilitySettings');
|
|
439
|
+
$router->get('entity-editing-settings', 'SettingController@getEntityEditingSettings');
|
|
440
|
+
$router->post('entity-editing-settings', 'SettingController@saveEntityEditingSettings');
|
|
438
441
|
}
|
|
439
442
|
);
|
|
440
443
|
$router->group(
|
package/translations/en-us.yaml
CHANGED
|
@@ -236,6 +236,9 @@ fleet-ops:
|
|
|
236
236
|
title: Navigator App
|
|
237
237
|
name: Instance Linking URL
|
|
238
238
|
message: Use this URL to link the official Navigator app to this {companyName} instance. Opening this URL on a mobile device will open the Navigator app and update it's configuration and branding.
|
|
239
|
+
settings: Entity Settings
|
|
240
|
+
select-input: Allow driver to update entity details
|
|
241
|
+
|
|
239
242
|
visibility-controls:
|
|
240
243
|
title: Visibility Controls
|
|
241
244
|
message: Visibility controls allow you to disable sections of Fleet-Ops. Toggle the checkbox to enable or disable sections to hide in Fleet-ops.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import getModelName from '@fleetbase/ember-core/utils/get-model-name';
|
|
2
|
-
import isModel from '@fleetbase/ember-core/utils/is-model';
|
|
3
|
-
import { camelize } from '@ember/string';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Applies context and dynamic arguments to a given component.
|
|
7
|
-
*
|
|
8
|
-
* @param {Component} component - The component to which context and arguments will be applied.
|
|
9
|
-
*/
|
|
10
|
-
export default function applyContextComponentArguments(component) {
|
|
11
|
-
const { context, dynamicArgs = {} } = component.args;
|
|
12
|
-
|
|
13
|
-
// Apply context model if available
|
|
14
|
-
if (context && isModel(context)) {
|
|
15
|
-
const contextModelName = camelize(getModelName(context));
|
|
16
|
-
if (contextModelName) {
|
|
17
|
-
component[contextModelName] = context;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Execute any apply callback present in dynamic arguments
|
|
22
|
-
const { applyCallback } = dynamicArgs;
|
|
23
|
-
if (typeof applyCallback === 'function') {
|
|
24
|
-
applyCallback(component);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Apply other dynamic arguments to the component
|
|
28
|
-
for (const [key, value] of Object.entries(dynamicArgs)) {
|
|
29
|
-
if (key !== 'applyCallback') {
|
|
30
|
-
component[key] = value;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default function contextComponentCallback(component, name, ...params) {
|
|
2
|
-
let callbackInvoked = false;
|
|
3
|
-
|
|
4
|
-
if (typeof component.args[name] === 'function') {
|
|
5
|
-
component.args[name](...params);
|
|
6
|
-
callbackInvoked = true;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// now do for context options
|
|
10
|
-
if (typeof component.args.options === 'object' && typeof component.args.options[name] === 'function') {
|
|
11
|
-
component.args.options[name](...params);
|
|
12
|
-
callbackInvoked = true;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return callbackInvoked;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/utils/apply-context-component-arguments';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/utils/context-component-callback';
|