@fleetbase/storefront-engine 0.4.4 → 0.4.6
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/modals/create-gateway.hbs +13 -27
- package/addon/components/schedule-manager.hbs +24 -20
- package/addon/components/settings-container.hbs +3 -2
- package/addon/components/widget/customers.hbs +56 -78
- package/addon/components/widget/orders.hbs +281 -303
- package/addon/components/widget/storefront-key-metrics.hbs +1 -1
- package/addon/components/widget/storefront-metrics.hbs +2 -2
- package/addon/controllers/settings.js +36 -0
- package/addon/services/storefront.js +6 -1
- package/addon/templates/settings/gateways.hbs +3 -3
- package/addon/templates/settings/index.hbs +322 -321
- package/addon/templates/settings/locations.hbs +2 -2
- package/addon/templates/settings.hbs +8 -30
- package/addon/utils/get-gateway-schemas.js +2 -0
- package/app/controllers/settings.js +1 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +2 -2
- package/server/config/storefront.php +11 -1
- package/server/src/Http/Controllers/v1/CheckoutController.php +42 -11
- package/server/src/Http/Controllers/v1/CustomerController.php +1 -1
- package/server/src/Http/Controllers/v1/OrderController.php +206 -1
- package/server/src/Http/Filter/OrderFilter.php +35 -29
- package/server/src/Http/Middleware/ThrottleRequests.php +16 -0
- package/server/src/Models/Cart.php +1 -1
- package/server/src/Models/FoodTruck.php +1 -1
- package/server/src/Providers/StorefrontServiceProvider.php +1 -1
- package/server/src/Support/QPay.php +78 -0
- package/server/src/routes.php +1 -0
|
@@ -35,33 +35,19 @@
|
|
|
35
35
|
<div class="input-group">
|
|
36
36
|
<Checkbox @value={{@options.gateway.sandbox}} @label={{t "storefront.component.modals.create-getaway.sandbox-getaway"}} @onToggle={{fn (mut @options.gateway.sandbox)}} />
|
|
37
37
|
</div>
|
|
38
|
-
<div class="p-2 rounded-md
|
|
39
|
-
<h4 class="mb-2 font-semibold text-
|
|
40
|
-
{{#
|
|
41
|
-
{{#
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{{
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{{/each-in}}
|
|
52
|
-
{{else}}
|
|
53
|
-
{{#each-in @options.gateway.config as |key value|}}
|
|
54
|
-
{{#if (is-bool-value value)}}
|
|
55
|
-
<div class="input-group">
|
|
56
|
-
<Checkbox @value={{value}} @label={{humanize key}} @onToggle={{fn @options.setConfigKey key}} />
|
|
57
|
-
</div>
|
|
58
|
-
{{else}}
|
|
59
|
-
<InputGroup @name={{humanize key}}>
|
|
60
|
-
<Input class="form-input w-full" placeholder={{humanize key}} @value={{value}} {{on "blur" (fn @options.setConfigKey key)}} />
|
|
61
|
-
</InputGroup>
|
|
62
|
-
{{/if}}
|
|
63
|
-
{{/each-in}}
|
|
64
|
-
{{/if}}
|
|
38
|
+
<div class="p-2 rounded-md mb-2 mt-4 border border-gray-200 dark:border-gray-800">
|
|
39
|
+
<h4 class="mb-2 font-semibold text-xs tracking-wide uppercase text-gray-700 dark:text-gray-400">Config</h4>
|
|
40
|
+
{{#each-in @options.schema as |key value|}}
|
|
41
|
+
{{#if (is-bool-value value)}}
|
|
42
|
+
<div class="input-group">
|
|
43
|
+
<Checkbox @value={{get @options.gateway.config key}} @label={{smart-humanize key}} @onToggle={{fn @options.setConfigKey key}} />
|
|
44
|
+
</div>
|
|
45
|
+
{{else}}
|
|
46
|
+
<InputGroup @name={{humanize key}}>
|
|
47
|
+
<Input class="form-input w-full" placeholder={{smart-humanize key}} @value={{get @options.gateway.config key}} {{on "blur" (fn @options.setConfigKey key)}} />
|
|
48
|
+
</InputGroup>
|
|
49
|
+
{{/if}}
|
|
50
|
+
{{/each-in}}
|
|
65
51
|
</div>
|
|
66
52
|
{{/if}}
|
|
67
53
|
</div>
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
<div class="schedule-manager-wrapper" ...attributes>
|
|
2
2
|
{{#each-in this.schedule as |day hours|}}
|
|
3
|
-
<div class="content-panel
|
|
4
|
-
<div class="content-panel-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@icon="calendar-week"
|
|
9
|
-
@text={{t "storefront.component.schedule-manager.add-hours"}}
|
|
10
|
-
@textClass="truncate text-xs"
|
|
11
|
-
@size="sm"
|
|
12
|
-
@onClick={{fn this.addHours @subject day}}
|
|
13
|
-
class="{{@addHoursButtonClass}}"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="content-panel-body {{@contentPanelBodyClass}}">
|
|
18
|
-
{{#each hours as |hour|}}
|
|
19
|
-
<div class="flex items-center justify-between mb-2">
|
|
20
|
-
<div class="dark:text-gray-100">{{hour.humanReadableHours}}</div>
|
|
3
|
+
<div class="next-content-panel-wrapper bordered-classic is-open">
|
|
4
|
+
<div class="next-content-panel-container is-open">
|
|
5
|
+
<div class="next-content-panel {{@contentPanelClass}} shadow-sm">
|
|
6
|
+
<div class="next-content-panel-header items-center {{@contentPanelHeaderClass}}">
|
|
7
|
+
<h4 class="font-semibold text-sm dark:text-gray-100">{{day}}</h4>
|
|
21
8
|
<div>
|
|
22
|
-
<Button
|
|
9
|
+
<Button
|
|
10
|
+
@icon="calendar-week"
|
|
11
|
+
@text={{t "storefront.component.schedule-manager.add-hours"}}
|
|
12
|
+
@textClass="truncate text-xs"
|
|
13
|
+
@size="xs"
|
|
14
|
+
@onClick={{fn this.addHours @subject day}}
|
|
15
|
+
class="{{@addHoursButtonClass}}"
|
|
16
|
+
/>
|
|
23
17
|
</div>
|
|
24
18
|
</div>
|
|
25
|
-
|
|
19
|
+
<div class="next-content-panel-body {{@contentPanelBodyClass}}">
|
|
20
|
+
{{#each hours as |hour|}}
|
|
21
|
+
<div class="flex items-center justify-between mb-2">
|
|
22
|
+
<div class="dark:text-gray-100">{{hour.humanReadableHours}}</div>
|
|
23
|
+
<div>
|
|
24
|
+
<Button @iconPrefix="fas" @type="danger" @size="xs" @icon="times" @onClick={{fn this.removeHours hour}} class="{{@removeHoursButtonClass}}" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
{{/each}}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
26
30
|
</div>
|
|
27
31
|
</div>
|
|
28
32
|
{{/each-in}}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<div class="overflow-y-scroll h-screen">
|
|
2
|
-
<div class="h-screen"
|
|
3
|
-
<main class="h-screen max-w-xl mx-auto pt-
|
|
2
|
+
<div class="h-screen">
|
|
3
|
+
<main class="h-screen max-w-xl mx-auto pt-4" ...attributes>
|
|
4
4
|
{{yield}}
|
|
5
|
+
<Spacer @height="400px" />
|
|
5
6
|
</main>
|
|
6
7
|
</div>
|
|
7
8
|
</div>
|
|
@@ -1,82 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</a>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
1
|
+
<ContentPanel
|
|
2
|
+
@title={{this.title}}
|
|
3
|
+
@titleStatusRight={{this.customers.length}}
|
|
4
|
+
@titleStatusRightClass="info-status-badge"
|
|
5
|
+
@hideStatusDot={{true}}
|
|
6
|
+
@open={{this.loaded}}
|
|
7
|
+
@isLoading={{this.loadCustomers.isRunning}}
|
|
8
|
+
@pad={{false}}
|
|
9
|
+
@wrapperClass={{@wrapperClass}}
|
|
10
|
+
@panelBodyClass="p-0i"
|
|
11
|
+
>
|
|
12
|
+
<div class="flex justify-end px-4 pt-2 space-x-2">
|
|
13
|
+
<Button @icon="refresh" @size="xs" @onClick={{perform this.loadCustomers}} />
|
|
21
14
|
</div>
|
|
22
|
-
{{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<Button @icon="refresh" @size="xs" @onClick={{perform this.loadCustomers}} />
|
|
35
|
-
</div>
|
|
36
|
-
{{#if (media "isMobile")}}
|
|
37
|
-
<div class="flex flex-col p-3 space-y-3">
|
|
38
|
-
{{#each this.customers as |customer|}}
|
|
39
|
-
<div class="py-2 px-3 rounded-md border border-gray-400 dark:border-gray-700">
|
|
40
|
-
<div class="flex flex-row">
|
|
41
|
-
<div>
|
|
42
|
-
<Image src={{avatar-url customer.photo_url}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{customer.name}} />
|
|
43
|
-
</div>
|
|
44
|
-
<div>
|
|
45
|
-
<div class="text-xs font-bold dark:text-gray-100">{{customer.name}}</div>
|
|
46
|
-
<div class="text-xs dark:text-gray-100">{{customer.email}}</div>
|
|
47
|
-
<div class="text-xs dark:text-gray-100">{{customer.phone}}</div>
|
|
48
|
-
</div>
|
|
15
|
+
{{#if (media "isMobile")}}
|
|
16
|
+
<div class="flex flex-col p-3 space-y-3">
|
|
17
|
+
{{#each this.customers as |customer|}}
|
|
18
|
+
<div class="py-2 px-3 rounded-md border border-gray-400 dark:border-gray-700">
|
|
19
|
+
<div class="flex flex-row">
|
|
20
|
+
<div>
|
|
21
|
+
<Image src={{avatar-url customer.photo_url}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{customer.name}} />
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<div class="text-xs font-bold dark:text-gray-100">{{customer.name}}</div>
|
|
25
|
+
<div class="text-xs dark:text-gray-100">{{customer.email}}</div>
|
|
26
|
+
<div class="text-xs dark:text-gray-100">{{customer.phone}}</div>
|
|
49
27
|
</div>
|
|
50
28
|
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
29
|
+
</div>
|
|
30
|
+
{{/each}}
|
|
31
|
+
</div>
|
|
32
|
+
{{else}}
|
|
33
|
+
<div class="table-wrapper table-fluid">
|
|
34
|
+
<table class="storefront-widget-table">
|
|
35
|
+
<thead>
|
|
36
|
+
<tr class="h-12 text-left py-1">
|
|
37
|
+
<th style={{"width: 20%"}}>{{t "storefront.common.id"}}</th>
|
|
38
|
+
<th style={{"width: 15%"}}>{{t "storefront.common.name"}}</th>
|
|
39
|
+
<th style={{"width: 20%"}}>{{t "storefront.common.phone"}}</th>
|
|
40
|
+
<th style={{"width: 35%"}}>{{t "storefront.common.email"}}</th>
|
|
41
|
+
<th style={{"width: 10%"}}>{{t "storefront.common.orders"}}</th>
|
|
42
|
+
<th></th>
|
|
43
|
+
</tr>
|
|
44
|
+
</thead>
|
|
45
|
+
<tbody>
|
|
46
|
+
{{#each this.customers as |customer|}}
|
|
47
|
+
<tr class="h-12">
|
|
48
|
+
<td><a href="javascript:;" {{on "click" (fn this.viewCustomer customer)}}>{{customer.public_id}}</a></td>
|
|
49
|
+
<td>{{n-a customer.name}}</td>
|
|
50
|
+
<td>{{n-a customer.phone}}</td>
|
|
51
|
+
<td>{{n-a customer.email}}</td>
|
|
52
|
+
<td>{{n-a customer.orders 0}}</td>
|
|
53
|
+
<td></td>
|
|
64
54
|
</tr>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<td>{{n-a customer.phone}}</td>
|
|
72
|
-
<td>{{n-a customer.email}}</td>
|
|
73
|
-
<td>{{n-a customer.orders 0}}</td>
|
|
74
|
-
<td></td>
|
|
75
|
-
</tr>
|
|
76
|
-
{{/each}}
|
|
77
|
-
</tbody>
|
|
78
|
-
</table>
|
|
79
|
-
</div>
|
|
80
|
-
{{/if}}
|
|
81
|
-
</ContentPanel>
|
|
82
|
-
{{/if}}
|
|
55
|
+
{{/each}}
|
|
56
|
+
</tbody>
|
|
57
|
+
</table>
|
|
58
|
+
</div>
|
|
59
|
+
{{/if}}
|
|
60
|
+
</ContentPanel>
|