@fleetbase/storefront-engine 0.4.2 → 0.4.4
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/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +3 -3
- package/server/src/Http/Controllers/FoodTruckController.php +10 -0
- package/server/src/Http/Filter/FoodTruckFilter.php +11 -0
- package/server/src/Http/Resources/CatalogCategory.php +1 -0
- package/server/src/Notifications/StorefrontOrderAccepted.php +1 -3
package/composer.json
CHANGED
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/storefront-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Headless Commerce & Marketplace Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "storefront",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/core": "^7.23.2",
|
|
47
|
-
"@fleetbase/ember-core": "^0.3.
|
|
48
|
-
"@fleetbase/ember-ui": "^0.3.
|
|
47
|
+
"@fleetbase/ember-core": "^0.3.6",
|
|
48
|
+
"@fleetbase/ember-ui": "^0.3.8",
|
|
49
49
|
"@fleetbase/fleetops-data": "^0.1.20",
|
|
50
50
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|
|
51
51
|
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
namespace Fleetbase\Storefront\Http\Controllers;
|
|
4
4
|
|
|
5
|
+
use Illuminate\Database\Eloquent\Builder;
|
|
6
|
+
|
|
5
7
|
class FoodTruckController extends StorefrontController
|
|
6
8
|
{
|
|
7
9
|
/**
|
|
@@ -10,4 +12,12 @@ class FoodTruckController extends StorefrontController
|
|
|
10
12
|
* @var string
|
|
11
13
|
*/
|
|
12
14
|
public $resource = 'food_truck';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Additional query hook.
|
|
18
|
+
*/
|
|
19
|
+
public function onQueryRecord(Builder $builder)
|
|
20
|
+
{
|
|
21
|
+
$builder->with(['vehicle']);
|
|
22
|
+
}
|
|
13
23
|
}
|
|
@@ -12,6 +12,12 @@ class FoodTruckFilter extends FleetOpsOrderFilter
|
|
|
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
|
+
$this->builder->whereHas('vehicle');
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
public function storefront($storefront)
|
|
16
22
|
{
|
|
17
23
|
$this->builder->whereHas(
|
|
@@ -34,4 +40,9 @@ class FoodTruckFilter extends FleetOpsOrderFilter
|
|
|
34
40
|
|
|
35
41
|
$this->builder->whereIn('service_area_uuid', $matchingServiceAreaIds);
|
|
36
42
|
}
|
|
43
|
+
|
|
44
|
+
public function withDeleted()
|
|
45
|
+
{
|
|
46
|
+
$this->builder->withTrashed();
|
|
47
|
+
}
|
|
37
48
|
}
|
|
@@ -27,6 +27,7 @@ class CatalogCategory extends FleetbaseResource
|
|
|
27
27
|
'owner_uuid' => $this->when(Http::isInternalRequest(), $this->owner_uuid),
|
|
28
28
|
'name' => $this->name,
|
|
29
29
|
'description' => $this->description,
|
|
30
|
+
'icon_url' => $this->icon_url,
|
|
30
31
|
'tags' => data_get($this, 'tags', []),
|
|
31
32
|
'meta' => data_get($this, 'meta', Utils::createObject()),
|
|
32
33
|
'products' => CatalogProduct::collection($this->products ?? []),
|
|
@@ -71,8 +71,6 @@ class StorefrontOrderAccepted extends Notification
|
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Get the notification's delivery channels.
|
|
74
|
-
*
|
|
75
|
-
* @return array
|
|
76
74
|
*/
|
|
77
75
|
public function via($notifiable): array
|
|
78
76
|
{
|
|
@@ -85,7 +83,7 @@ class StorefrontOrderAccepted extends Notification
|
|
|
85
83
|
if (Storefront::hasNotificationChannelConfigured($this->storefront, 'fcm')) {
|
|
86
84
|
$channels[] = FcmChannel::class;
|
|
87
85
|
}
|
|
88
|
-
|
|
86
|
+
|
|
89
87
|
return $channels;
|
|
90
88
|
}
|
|
91
89
|
|