@fleetbase/fleetops-engine 0.4.1 → 0.4.2
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/contact-form-panel.js +3 -3
- package/addon/components/driver-form-panel.js +1 -1
- package/addon/components/vehicle-form-panel.js +1 -1
- package/addon/components/vendor-form-panel.js +1 -1
- package/addon/controllers/operations/orders/index/new.js +17 -5
- package/addon/controllers/operations/orders/index/view.js +17 -4
- package/addon/controllers/operations/service-rates/index/edit.js +0 -19
- package/addon/routes/application.js +5 -2
- package/addon/styles/fleetops-engine.css +6 -0
- package/addon/templates/operations/orders/index/new.hbs +1 -1
- package/package.json +2 -2
- package/server/src/Http/Controllers/Api/v1/DriverController.php +4 -1
- package/server/src/Models/Entity.php +1 -1
- package/server/src/Models/Proof.php +1 -1
- package/translations/en-us.yaml +3 -1
|
@@ -137,8 +137,8 @@ export default class ContactFormPanelComponent extends Component {
|
|
|
137
137
|
{
|
|
138
138
|
path: `uploads/${this.currentUser.companyId}/drivers/${this.contact.id}`,
|
|
139
139
|
subject_uuid: this.contact.id,
|
|
140
|
-
subject_type:
|
|
141
|
-
type:
|
|
140
|
+
subject_type: 'fleet-ops:contact',
|
|
141
|
+
type: 'contact_photo',
|
|
142
142
|
},
|
|
143
143
|
(uploadedFile) => {
|
|
144
144
|
this.contact.setProperties({
|
|
@@ -184,7 +184,7 @@ export default class ContactFormPanelComponent extends Component {
|
|
|
184
184
|
{
|
|
185
185
|
path: `uploads/${this.contact.company_uuid}/contacts/${this.contact.slug}`,
|
|
186
186
|
subject_uuid: this.contact.id,
|
|
187
|
-
subject_type: 'contact',
|
|
187
|
+
subject_type: 'fleet-ops:contact',
|
|
188
188
|
type: 'contact_photo',
|
|
189
189
|
},
|
|
190
190
|
(uploadedFile) => {
|
|
@@ -131,7 +131,7 @@ export default class DriverFormPanelComponent extends Component {
|
|
|
131
131
|
{
|
|
132
132
|
path: `uploads/${this.currentUser.companyId}/drivers/${this.driver.id}`,
|
|
133
133
|
subject_uuid: this.driver.id,
|
|
134
|
-
subject_type: 'driver',
|
|
134
|
+
subject_type: 'fleet-ops:driver',
|
|
135
135
|
type: 'driver_photo',
|
|
136
136
|
},
|
|
137
137
|
(uploadedFile) => {
|
|
@@ -131,7 +131,7 @@ export default class VehicleFormPanelComponent extends Component {
|
|
|
131
131
|
{
|
|
132
132
|
path: `uploads/${this.currentUser.companyId}/vehicles/${this.vehicle.id}`,
|
|
133
133
|
subject_uuid: this.vehicle.id,
|
|
134
|
-
subject_type: 'vehicle',
|
|
134
|
+
subject_type: 'fleet-ops:vehicle',
|
|
135
135
|
type: 'vehicle_photo',
|
|
136
136
|
},
|
|
137
137
|
(uploadedFile) => {
|
|
@@ -147,7 +147,7 @@ export default class VendorFormPanelComponent extends Component {
|
|
|
147
147
|
{
|
|
148
148
|
path: `uploads/${this.currentUser.companyId}/vendors/${this.vendor.id}`,
|
|
149
149
|
subject_uuid: this.vendor.id,
|
|
150
|
-
subject_type: 'vendor',
|
|
150
|
+
subject_type: 'fleet-ops:vendor',
|
|
151
151
|
type: 'vendor_logo',
|
|
152
152
|
},
|
|
153
153
|
(uploadedFile) => {
|
|
@@ -1324,24 +1324,30 @@ export default class OperationsOrdersIndexNewController extends BaseController {
|
|
|
1324
1324
|
acceptButtonText: 'Save Changes',
|
|
1325
1325
|
entity,
|
|
1326
1326
|
uploadNewPhoto: (file) => {
|
|
1327
|
+
const fileUrl = URL.createObjectURL(file.file);
|
|
1328
|
+
|
|
1327
1329
|
if (entity.get('isNew')) {
|
|
1328
1330
|
const { queue } = file;
|
|
1329
|
-
const fileUrl = URL.createObjectURL(file.blob);
|
|
1330
1331
|
|
|
1331
1332
|
this.modalsManager.setOption('pendingFileUpload', file);
|
|
1332
1333
|
entity.set('photo_url', fileUrl);
|
|
1333
|
-
// entity.set('photo_upload', fileUrl);
|
|
1334
1334
|
queue.remove(file);
|
|
1335
1335
|
return;
|
|
1336
|
+
} else {
|
|
1337
|
+
entity.set('photo_url', fileUrl);
|
|
1336
1338
|
}
|
|
1337
1339
|
|
|
1340
|
+
// Indicate loading
|
|
1341
|
+
this.modalsManager.startLoading();
|
|
1342
|
+
|
|
1343
|
+
// Perform upload
|
|
1338
1344
|
return this.fetch.uploadFile.perform(
|
|
1339
1345
|
file,
|
|
1340
1346
|
{
|
|
1341
1347
|
path: `uploads/${this.currentUser.companyId}/entities/${entity.id}`,
|
|
1342
1348
|
subject_uuid: entity.id,
|
|
1343
|
-
subject_type:
|
|
1344
|
-
type:
|
|
1349
|
+
subject_type: 'fleet-ops:entity',
|
|
1350
|
+
type: 'entity_photo',
|
|
1345
1351
|
},
|
|
1346
1352
|
(uploadedFile) => {
|
|
1347
1353
|
entity.setProperties({
|
|
@@ -1349,6 +1355,13 @@ export default class OperationsOrdersIndexNewController extends BaseController {
|
|
|
1349
1355
|
photo_url: uploadedFile.url,
|
|
1350
1356
|
photo: uploadedFile,
|
|
1351
1357
|
});
|
|
1358
|
+
|
|
1359
|
+
// Stop loading
|
|
1360
|
+
this.modalsManager.stopLoading();
|
|
1361
|
+
},
|
|
1362
|
+
() => {
|
|
1363
|
+
// Stop loading
|
|
1364
|
+
this.modalsManager.stopLoading();
|
|
1352
1365
|
}
|
|
1353
1366
|
);
|
|
1354
1367
|
},
|
|
@@ -1356,7 +1369,6 @@ export default class OperationsOrdersIndexNewController extends BaseController {
|
|
|
1356
1369
|
modal.startLoading();
|
|
1357
1370
|
|
|
1358
1371
|
const pendingFileUpload = modal.getOption('pendingFileUpload');
|
|
1359
|
-
|
|
1360
1372
|
return entity.save().then(() => {
|
|
1361
1373
|
if (pendingFileUpload) {
|
|
1362
1374
|
return modal.invoke('uploadNewPhoto', pendingFileUpload);
|
|
@@ -858,23 +858,30 @@ export default class OperationsOrdersIndexViewController extends BaseController
|
|
|
858
858
|
acceptButtonText: 'Save Changes',
|
|
859
859
|
entity,
|
|
860
860
|
uploadNewPhoto: (file) => {
|
|
861
|
+
const fileUrl = URL.createObjectURL(file.blob);
|
|
862
|
+
|
|
861
863
|
if (entity.get('isNew')) {
|
|
862
864
|
const { queue } = file;
|
|
863
|
-
const fileUrl = URL.createObjectURL(file.blob);
|
|
864
865
|
|
|
865
866
|
this.modalsManager.setOption('pendingFileUpload', file);
|
|
866
867
|
entity.set('photo_url', fileUrl);
|
|
867
868
|
queue.remove(file);
|
|
868
869
|
return;
|
|
870
|
+
} else {
|
|
871
|
+
entity.set('photo_url', fileUrl);
|
|
869
872
|
}
|
|
870
873
|
|
|
874
|
+
// Indicate loading
|
|
875
|
+
this.modalsManager.startLoading();
|
|
876
|
+
|
|
877
|
+
// Perform upload
|
|
871
878
|
return this.fetch.uploadFile.perform(
|
|
872
879
|
file,
|
|
873
880
|
{
|
|
874
881
|
path: `uploads/${this.currentUser.companyId}/entities/${entity.id}`,
|
|
875
882
|
subject_uuid: entity.id,
|
|
876
|
-
subject_type:
|
|
877
|
-
type:
|
|
883
|
+
subject_type: 'fleet-ops:entity',
|
|
884
|
+
type: 'entity_photo',
|
|
878
885
|
},
|
|
879
886
|
(uploadedFile) => {
|
|
880
887
|
entity.setProperties({
|
|
@@ -882,6 +889,13 @@ export default class OperationsOrdersIndexViewController extends BaseController
|
|
|
882
889
|
photo_url: uploadedFile.url,
|
|
883
890
|
photo: uploadedFile,
|
|
884
891
|
});
|
|
892
|
+
|
|
893
|
+
// Stop loading
|
|
894
|
+
this.modalsManager.stopLoading();
|
|
895
|
+
},
|
|
896
|
+
() => {
|
|
897
|
+
// Stop loading
|
|
898
|
+
this.modalsManager.stopLoading();
|
|
885
899
|
}
|
|
886
900
|
);
|
|
887
901
|
},
|
|
@@ -889,7 +903,6 @@ export default class OperationsOrdersIndexViewController extends BaseController
|
|
|
889
903
|
modal.startLoading();
|
|
890
904
|
|
|
891
905
|
const pendingFileUpload = modal.getOption('pendingFileUpload');
|
|
892
|
-
|
|
893
906
|
return entity.save().then(() => {
|
|
894
907
|
if (pendingFileUpload) {
|
|
895
908
|
return modal.invoke('uploadNewPhoto', pendingFileUpload);
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import OperationsServiceRatesIndexNewController from './new';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
2
|
import { action } from '@ember/object';
|
|
4
|
-
import { inject as service } from '@ember/object';
|
|
5
3
|
|
|
6
4
|
export default class OperationsServiceRatesIndexEditController extends OperationsServiceRatesIndexNewController {
|
|
7
|
-
/**
|
|
8
|
-
* Inject the `intl` service
|
|
9
|
-
*
|
|
10
|
-
* @var {Service}
|
|
11
|
-
*/
|
|
12
|
-
@service intl;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* True if updating service rate.
|
|
16
|
-
*
|
|
17
|
-
* @var {Boolean}
|
|
18
|
-
*/
|
|
19
|
-
@tracked isUpdatingServiceRate = false;
|
|
20
|
-
|
|
21
|
-
// @alias('@model.rate_fees') rateFees;
|
|
22
|
-
// @alias('@model.parcel_fees') parcelFees;
|
|
23
|
-
|
|
24
5
|
/**
|
|
25
6
|
* Updates the service rate to server
|
|
26
7
|
*
|
|
@@ -6,10 +6,13 @@ import getResourceNameFromTransition from '@fleetbase/ember-core/utils/get-resou
|
|
|
6
6
|
export default class ApplicationRoute extends Route {
|
|
7
7
|
@service loader;
|
|
8
8
|
@service fetch;
|
|
9
|
+
@service intl;
|
|
9
10
|
|
|
10
11
|
@action loading(transition) {
|
|
11
|
-
const resourceName = getResourceNameFromTransition(transition);
|
|
12
|
-
this.loader.showOnInitialTransition(transition, 'section.next-view-section', {
|
|
12
|
+
const resourceName = getResourceNameFromTransition(transition, { humanize: true });
|
|
13
|
+
this.loader.showOnInitialTransition(transition, 'section.next-view-section', {
|
|
14
|
+
loadingMessage: resourceName ? this.intl.t('fleet-ops.common.loading-resource', { resourceName }) : this.intl.t('fleet-ops.common.loading'),
|
|
15
|
+
});
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
model() {
|
|
@@ -60,3 +60,9 @@ body[data-theme='dark'] .scheduler-left-sidebar {
|
|
|
60
60
|
.next-sidebar .next-sidebar-panel-container.next-driver-listing > .next-sidebar-panel > .next-content-panel > .next-sidebar-panel-body .next-nav-item.driver-nav-item {
|
|
61
61
|
padding-left: 3.5rem;
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
.multi-drop-select-container .fleetbase-model-select.fleetbase-power-select.ember-model-select > .ember-model-select__loading {
|
|
65
|
+
background: none;
|
|
66
|
+
border: none;
|
|
67
|
+
box-shadow: none;
|
|
68
|
+
}
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
</div>
|
|
214
214
|
|
|
215
215
|
{{#if this.isMultipleDropoffOrder}}
|
|
216
|
-
<DragSortList class="overflow-visible" @items={{this.waypoints}} @dragEndAction={{this.sortWaypoints}} as |waypoint index|>
|
|
216
|
+
<DragSortList class="multi-drop-select-container overflow-visible" @items={{this.waypoints}} @dragEndAction={{this.sortWaypoints}} as |waypoint index|>
|
|
217
217
|
<div id={{concat "waypoint_" (add index 1)}} class="border rounded-md px-3 py-2 shadow-sm border-gray-300 dark:border-gray-900 mb-3">
|
|
218
218
|
<div class="flex items-center justify-between">
|
|
219
219
|
<div class="flex items-center justify-between cursor-move">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/core": "^7.23.2",
|
|
46
|
-
"@fleetbase/ember-core": "^0.2.
|
|
46
|
+
"@fleetbase/ember-core": "^0.2.1",
|
|
47
47
|
"@fleetbase/ember-ui": "^0.2.9",
|
|
48
48
|
"@fleetbase/fleetops-data": "^0.1.7",
|
|
49
49
|
"@fleetbase/leaflet-routing-machine": "^3.2.16",
|
|
@@ -422,7 +422,10 @@ class DriverController extends Controller
|
|
|
422
422
|
return 'Your ' . data_get($company, 'name', config('app.name')) . ' verification code is ' . $verification->code;
|
|
423
423
|
});
|
|
424
424
|
} catch (\Throwable $e) {
|
|
425
|
-
|
|
425
|
+
if (app()->bound('sentry')) {
|
|
426
|
+
app('sentry')->captureException($e);
|
|
427
|
+
}
|
|
428
|
+
return response()->apiError('Unable to send SMS Verification code.');
|
|
426
429
|
}
|
|
427
430
|
|
|
428
431
|
return response()->json(['status' => 'OK']);
|
|
@@ -247,7 +247,7 @@ class Entity extends Model
|
|
|
247
247
|
*/
|
|
248
248
|
public function getPhotoUrlAttribute()
|
|
249
249
|
{
|
|
250
|
-
return data_get($this, 'photo.
|
|
250
|
+
return data_get($this, 'photo.url', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/parcels/medium.png');
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
/**
|
package/translations/en-us.yaml
CHANGED
|
@@ -38,6 +38,7 @@ fleet-ops:
|
|
|
38
38
|
length: Length
|
|
39
39
|
license: License
|
|
40
40
|
loading: Loading...
|
|
41
|
+
loading-resource: Loading {resourceName}...
|
|
41
42
|
make: Make
|
|
42
43
|
manage-message: Manage your vendors
|
|
43
44
|
manpower: Manpower
|
|
@@ -1300,7 +1301,8 @@ fleet-ops:
|
|
|
1300
1301
|
example-second-message: Then the following formula will calculate a service fee of $2.50, which will be added to the base fee.
|
|
1301
1302
|
algorithm-label: Algorithm
|
|
1302
1303
|
algorithm-help-text: Define a formula to be evaluated for this service rate calculation.
|
|
1303
|
-
algorithm-placeholder:
|
|
1304
|
+
algorithm-placeholder: >-
|
|
1305
|
+
(( '{distance}' / 50 ) * .05 ) + (( '{time}' / 60 ) * .01)
|
|
1304
1306
|
percel-fee-title: Parcel Fee's
|
|
1305
1307
|
length-label: Length
|
|
1306
1308
|
length-placeholder: Length in {parcelFeeDimension}
|