Skip to content

Commit

Permalink
Merge pull request #103 from fleetbase/dev-v0.4.25
Browse files Browse the repository at this point in the history
v0.4.25
  • Loading branch information
roncodes authored Apr 9, 2024
2 parents ece7edf + 1f1baf1 commit 8e1ad62
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 20 deletions.
3 changes: 1 addition & 2 deletions addon/components/layout/fleet-ops-sidebar/driver-listing.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ export default class LayoutFleetOpsSidebarDriverListingComponent extends Compone
}

displayPanelDropdown = true;

panelDropdownButtonActions = [
{
label: 'Create new driver...',
onClick: () => {
const driver = this.store.createRecord('driver');
this.contextPanel.focus(driver);
this.contextPanel.focus(driver, 'editing');
},
},
];
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/fleetops-api",
"version": "0.4.24",
"version": "0.4.25",
"description": "Fleet & Transport Management Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Fleet-Ops",
"version": "0.4.24",
"version": "0.4.25",
"description": "Fleet & Transport Management Extension for Fleetbase",
"repository": "https://github.com/fleetbase/fleetops",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/fleetops-engine",
"version": "0.4.24",
"version": "0.4.25",
"description": "Fleet & Transport Management Extension for Fleetbase",
"fleetbase": {
"route": "fleet-ops"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle()
['model' => \Fleetbase\FleetOps\Models\Order::class, 'columns' => ['customer_type', 'facilitator_type']],
['model' => \Fleetbase\FleetOps\Models\Place::class, 'columns' => ['owner_type']],
['model' => \Fleetbase\FleetOps\Models\Entity::class, 'columns' => ['customer_type']],
['model' => \Fleetbase\FleetOps\Models\PurchaseRate::class, 'columns' => ['customer_type']]
['model' => \Fleetbase\FleetOps\Models\PurchaseRate::class, 'columns' => ['customer_type']],
];

foreach ($models as $modelConfig) {
Expand Down
7 changes: 5 additions & 2 deletions server/src/Http/Controllers/Api/v1/DriverController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ public function update($id, UpdateDriverRequest $request)
$userDetails = $request->only(['name', 'password', 'email', 'phone']);

// update driver user details
$driver->user->update($userDetails);
$driverUser = $driver->getUser();
if ($driverUser) {
$driverUser->update($userDetails);
}

// vehicle assignment public_id -> uuid
if ($request->has('vehicle')) {
Expand Down Expand Up @@ -776,4 +779,4 @@ private static function phone(?string $phone = null): string

return $phone;
}
}
}
4 changes: 2 additions & 2 deletions server/src/Http/Controllers/Api/v1/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public function query(Request $request)

if ($request->filled('on')) {
$on = Carbon::parse($request->input('on'));

$query->where(function ($q) use ($on) {
$q->whereDate('created_at', $on);
$q->orWhereDate('scheduled_at', $on);
Expand Down Expand Up @@ -1408,4 +1408,4 @@ public function getEditableEntityFields(string $id, Request $request)

return response()->json($entityEditingSettings);
}
}
}
1 change: 0 additions & 1 deletion server/src/Http/Controllers/FleetOpsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Fleetbase\FleetOps\Http\Controllers;

use Fleetbase\FleetOps\Models\Order;
use Fleetbase\Http\Controllers\FleetbaseController;

class FleetOpsController extends FleetbaseController
Expand Down
12 changes: 8 additions & 4 deletions server/src/Http/Controllers/Internal/v1/DriverController.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,18 @@ function (&$request, &$driver, &$input) {
}
$input = $input->except(['name', 'password', 'email', 'phone', 'meta', 'avatar_uuid', 'photo_uuid'])->toArray();

$driver->user->update($userInput);
$driver->flushAttributesCache();
// Update driver user details
$driverUser = $driver->getUser();
if ($driverUser) {
$driverUser->update($userInput);
$input['slug'] = $driverUser->slug;
}

$input['slug'] = $driver->user->slug;
// Flush cache
$driver->flushAttributesCache();
},
function ($request, &$driver) {
$driver->load(['user']);

if ($driver->user) {
$driver->user->setHidden(['driver']);
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/Http/Requests/CreateContactRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CreateContactRequest extends FleetbaseRequest
*/
public function authorize()
{
return request()->session()->has('storefront_key') || request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');;
return request()->session()->has('storefront_key') || request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion server/src/Http/Requests/CreateEntityRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CreateEntityRequest extends FleetbaseRequest
*/
public function authorize()
{
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');;
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion server/src/Http/Requests/CreateIssueRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CreateIssueRequest extends FleetbaseRequest
*/
public function authorize()
{
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');;
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion server/src/Http/Requests/CreatePlaceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CreatePlaceRequest extends FleetbaseRequest
*/
public function authorize()
{
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');;
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion server/src/Http/Requests/CreateVehicleRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CreateVehicleRequest extends FleetbaseRequest
*/
public function authorize()
{
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');;
return request()->session()->has('api_credential') || request()->session()->has('is_sanctum_token');
}

/**
Expand Down

0 comments on commit 8e1ad62

Please sign in to comment.