@fleetbase/storefront-engine 0.2.7 → 0.2.9

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.
Files changed (73) hide show
  1. package/addon/components/file-record.hbs +9 -2
  2. package/addon/components/file-record.js +3 -2
  3. package/addon/components/modals/add-store-hours.hbs +12 -2
  4. package/addon/components/modals/assign-driver.hbs +18 -5
  5. package/addon/components/modals/create-first-store.hbs +18 -6
  6. package/addon/components/modals/create-gateway.hbs +19 -7
  7. package/addon/components/modals/create-network-category.hbs +23 -5
  8. package/addon/components/modals/create-network.hbs +15 -7
  9. package/addon/components/modals/create-new-variant.hbs +20 -4
  10. package/addon/components/modals/create-notification-channel.hbs +22 -17
  11. package/addon/components/modals/create-product-category.hbs +22 -7
  12. package/addon/components/modals/create-store.hbs +11 -3
  13. package/addon/components/modals/import-products.hbs +34 -15
  14. package/addon/components/modals/incoming-order.hbs +29 -19
  15. package/addon/components/modals/manage-addons.hbs +50 -9
  16. package/addon/components/modals/manage-addons.js +3 -2
  17. package/addon/components/modals/order-ready-assign-driver.hbs +24 -13
  18. package/addon/components/modals/select-addon-category.hbs +8 -1
  19. package/addon/components/modals/share-network.hbs +23 -8
  20. package/addon/components/modals/store-details.hbs +4 -4
  21. package/addon/components/modals/store-form.hbs +24 -5
  22. package/addon/components/modals/store-location-form.hbs +26 -16
  23. package/addon/components/network-category-picker.hbs +17 -6
  24. package/addon/components/schedule-manager.hbs +8 -1
  25. package/addon/components/schedule-manager.js +6 -5
  26. package/addon/components/store-selector.hbs +14 -3
  27. package/addon/components/widget/customers.hbs +16 -7
  28. package/addon/components/widget/customers.js +2 -1
  29. package/addon/components/widget/orders.hbs +58 -23
  30. package/addon/components/widget/orders.js +17 -16
  31. package/addon/components/widget/storefront-metrics.hbs +5 -5
  32. package/addon/controllers/customers/index.js +21 -13
  33. package/addon/controllers/networks/index/network/index.js +16 -9
  34. package/addon/controllers/networks/index/network/stores.js +39 -31
  35. package/addon/controllers/networks/index/network.js +3 -2
  36. package/addon/controllers/networks/index.js +10 -3
  37. package/addon/controllers/orders/index.js +30 -23
  38. package/addon/controllers/products/index/category/edit.js +5 -3
  39. package/addon/controllers/products/index/category/new.js +17 -11
  40. package/addon/controllers/products/index/category.js +8 -7
  41. package/addon/controllers/products/index/index.js +9 -2
  42. package/addon/controllers/products/index.js +9 -8
  43. package/addon/controllers/settings/gateways.js +7 -6
  44. package/addon/controllers/settings/index.js +1 -0
  45. package/addon/controllers/settings/locations.js +18 -11
  46. package/addon/controllers/settings/notifications.js +8 -7
  47. package/addon/services/storefront.js +13 -7
  48. package/addon/templates/application.hbs +8 -8
  49. package/addon/templates/customers/index/edit.hbs +0 -1
  50. package/addon/templates/customers/index.hbs +23 -4
  51. package/addon/templates/home.hbs +1 -1
  52. package/addon/templates/networks/index/network/customers.hbs +0 -1
  53. package/addon/templates/networks/index/network/index.hbs +200 -62
  54. package/addon/templates/networks/index/network/orders.hbs +0 -1
  55. package/addon/templates/networks/index/network/stores.hbs +18 -3
  56. package/addon/templates/networks/index/network.hbs +5 -5
  57. package/addon/templates/networks/index.hbs +12 -7
  58. package/addon/templates/orders/index/edit.hbs +0 -1
  59. package/addon/templates/orders/index/new.hbs +0 -1
  60. package/addon/templates/orders/index/view.hbs +0 -1
  61. package/addon/templates/orders/index.hbs +25 -6
  62. package/addon/templates/products/index/category/new.hbs +74 -22
  63. package/addon/templates/products/index.hbs +27 -6
  64. package/addon/templates/settings/api.hbs +3 -3
  65. package/addon/templates/settings/gateways.hbs +10 -10
  66. package/addon/templates/settings/index.hbs +146 -51
  67. package/addon/templates/settings/locations.hbs +13 -6
  68. package/addon/templates/settings/notifications.hbs +5 -7
  69. package/addon/templates/settings.hbs +6 -6
  70. package/composer.json +3 -3
  71. package/extension.json +1 -1
  72. package/package.json +5 -3
  73. package/translations/en-us.yaml +574 -1
@@ -6,6 +6,7 @@ export default class ScheduleManagerComponent extends Component {
6
6
  @service notifications;
7
7
  @service modalsManager;
8
8
  @service store;
9
+ @service intl;
9
10
 
10
11
  @computed('args.subject.hours.@each.id', 'hours.length') get schedule() {
11
12
  const schedule = {};
@@ -43,8 +44,8 @@ export default class ScheduleManagerComponent extends Component {
43
44
  });
44
45
 
45
46
  this.modalsManager.show('modals/add-store-hours', {
46
- title: `Add new hours for ${day}`,
47
- acceptButtonText: 'Add hours',
47
+ title: this.intl.t('storefront.component.schedule-manager.add-new-hours-for-day', { Day: day }),
48
+ acceptButtonText: this.intl.t('storefront.component.schedule-manager-add-hours'),
48
49
  acceptButtonIcon: 'save',
49
50
  hours,
50
51
  confirm: (modal) => {
@@ -52,7 +53,7 @@ export default class ScheduleManagerComponent extends Component {
52
53
 
53
54
  return hours.save().then((hours) => {
54
55
  subject.hours.pushObject(hours);
55
- this.notifications.success(`New hours added for ${day}`);
56
+ this.notifications.success(this.intl.t('storefront.component.schedule-manager.new-hours-added-for-day', { day }));
56
57
  });
57
58
  },
58
59
  });
@@ -60,8 +61,8 @@ export default class ScheduleManagerComponent extends Component {
60
61
 
61
62
  @action removeHours(hours) {
62
63
  this.modalsManager.confirm({
63
- title: 'Are you sure you wish to remove these hours?',
64
- body: 'By removing these operation/availability hours, your store or product may become inactive or unavailable according to the updated schedule...',
64
+ title: this.intl.t('storefront.component.schedule-manager.you-wish-to-remove-these-hour'),
65
+ body: this.intl.t('storefront.component.schedule-manager.by-removing-these-operation'),
65
66
  acceptButtonIcon: 'trash',
66
67
  confirm: (modal) => {
67
68
  modal.startLoading();
@@ -1,5 +1,16 @@
1
1
  {{#if @activeStore}}
2
- <DropdownButton @renderInPlace={{true}} @size="xs" @type="primary" @icon="store" @iconSize="sm" @text={{@activeStore.name}} @buttonClass={{concat "w-full " @buttonClass}} @buttonWrapperClass={{concat "w-full " @buttonWrapperClass}} @wrapperClass={{@wrapperClass}} as |dd|>
2
+ <DropdownButton
3
+ @renderInPlace={{true}}
4
+ @size="xs"
5
+ @type="primary"
6
+ @icon="store"
7
+ @iconSize="sm"
8
+ @text={{@activeStore.name}}
9
+ @buttonClass={{concat "w-full " @buttonClass}}
10
+ @buttonWrapperClass={{concat "w-full " @buttonWrapperClass}}
11
+ @wrapperClass={{@wrapperClass}}
12
+ as |dd|
13
+ >
3
14
  <div role="menu" class="store-selector-dropdown-menu next-dd-menu py-1">
4
15
  <div role="group" class="px-1 overflow-y-scroll max-h-72">
5
16
  {{#each @stores as |store|}}
@@ -7,14 +18,14 @@
7
18
  {{or store.name "-"}}
8
19
  </a>
9
20
  {{else}}
10
- <div class="next-dd-item" role="menuitem">No stores to select</div>
21
+ <div class="next-dd-item" role="menuitem">{{t "storefront.component.store-selector.no-stores"}}</div>
11
22
  {{/each}}
12
23
  </div>
13
24
  <div class="px-1">
14
25
  <div class="next-dd-menu-seperator"></div>
15
26
  <div role="group" class="px-1">
16
27
  <a href="javascript:;" class="next-dd-item" role="menuitem" {{on "click" (dropdown-fn dd this.onCreateStore)}}>
17
- Create a new storefront
28
+ {{t "storefront.component.store-selector.create-storefront"}}
18
29
  </a>
19
30
  </div>
20
31
  </div>
@@ -1,4 +1,13 @@
1
- <ContentPanel @title={{this.title}} @titleStatusRight={{this.customers.length}} @titleStatusRightClass="info-status-badge" @hideStatusDot={{true}} @open={{this.customers.length}} @pad={{false}} @wrapperClass={{@wrapperClass}} @onInsert={{this.getCustomers}}>
1
+ <ContentPanel
2
+ @title={{this.title}}
3
+ @titleStatusRight={{this.customers.length}}
4
+ @titleStatusRightClass="info-status-badge"
5
+ @hideStatusDot={{true}}
6
+ @open={{this.customers.length}}
7
+ @pad={{false}}
8
+ @wrapperClass={{@wrapperClass}}
9
+ @onInsert={{this.getCustomers}}
10
+ >
2
11
  {{#if this.isLoading}}
3
12
  <div class="px-3 py-2">
4
13
  <Spinner class="text-sky-400" />
@@ -8,10 +17,10 @@
8
17
  <table>
9
18
  <thead>
10
19
  <tr class="h-12 text-left py-1">
11
- <th>ID</th>
12
- <th>Phone</th>
13
- <th>Email</th>
14
- <th>Orders</th>
20
+ <th>{{t "storefront.common.id"}}</th>
21
+ <th>{{t "storefront.common.phone"}}</th>
22
+ <th>{{t "storefront.common.email"}}</th>
23
+ <th>{{t "storefront.common.orders"}}</th>
15
24
  <th></th>
16
25
  </tr>
17
26
  </thead>
@@ -35,8 +44,8 @@
35
44
  <div class="flex-1 font-semibold">{{customer.name}}</div>
36
45
  </div>
37
46
  <div class="flex flex-col">
38
- <div class="text-xs">Phone:{{n-a customer.phone}}</div>
39
- <div class="text-xs">Email: {{n-a customer.email}}</div>
47
+ <div class="text-xs">{{t "storefront.component.widget.customers.phone"}}{{n-a customer.phone}}</div>
48
+ <div class="text-xs">{{t "storefront.component.widget.customers.email"}} {{n-a customer.email}}</div>
40
49
  </div>
41
50
  </div>
42
51
  {{/each}}
@@ -7,9 +7,10 @@ import setComponentArg from '@fleetbase/ember-core/utils/set-component-arg';
7
7
  export default class WidgetCustomersComponent extends Component {
8
8
  @service store;
9
9
  @service storefront;
10
+ @service intl;
10
11
  @tracked isLoading = true;
11
12
  @tracked customers = [];
12
- @tracked title = 'Recent Customers';
13
+ @tracked title = this.intl.t('storefront.component.widget.customers.widget-title');
13
14
 
14
15
  constructor(owner, { title }) {
15
16
  super(...arguments);
@@ -1,4 +1,13 @@
1
- <ContentPanel @title={{this.title}} @titleStatusRight={{this.orders.length}} @titleStatuRightClass="info-status-badge" @hideStatusDot={{true}} @open={{this.orders.length}} @pad={{false}} @wrapperClass={{@wrapperClass}} @onInsert={{this.setupWidget}}>
1
+ <ContentPanel
2
+ @title={{this.title}}
3
+ @titleStatusRight={{this.orders.length}}
4
+ @titleStatuRightClass="info-status-badge"
5
+ @hideStatusDot={{true}}
6
+ @open={{this.orders.length}}
7
+ @pad={{false}}
8
+ @wrapperClass={{@wrapperClass}}
9
+ @onInsert={{this.setupWidget}}
10
+ >
2
11
  {{#if this.isLoading}}
3
12
  <div class="px-3 py-2">
4
13
  <Spinner class="text-sky-400" />
@@ -8,12 +17,12 @@
8
17
  <table>
9
18
  <thead>
10
19
  <tr class="h-12 text-left py-1">
11
- <th>ID</th>
12
- <th>Amount</th>
13
- <th>Customer</th>
14
- <th>Driver</th>
15
- <th>Created</th>
16
- <th>Status</th>
20
+ <th>{{t "storefront.component.widget.orders.id-column"}}</th>
21
+ <th>{{t "storefront.common.amount"}}</th>
22
+ <th>{{t "storefront.common.customer"}}</th>
23
+ <th>{{t "storefront.common.driver"}}</th>
24
+ <th>{{t "storefront.common.created"}}</th>
25
+ <th>{{t "storefront.common.status"}}</th>
17
26
  <th></th>
18
27
  </tr>
19
28
  </thead>
@@ -30,13 +39,26 @@
30
39
  </td>
31
40
  <td>
32
41
  {{#if order.isFresh}}
33
- <Button @size="xs" @type="success" @iconPrefix="fas" @icon="check" @text="Accept Order!" @onClick={{fn this.acceptOrder order}} />
42
+ <Button
43
+ @size="xs"
44
+ @type="success"
45
+ @iconPrefix="fas"
46
+ @icon="check"
47
+ @text={{concat (t "storefront.component.widget.orders.accept-order") "!"}}
48
+ @onClick={{fn this.acceptOrder order}}
49
+ />
34
50
  {{/if}}
35
51
  {{#if order.isPreparing}}
36
- <Button @size="xs" @type="success" @icon="bells" @text="Mark as Ready!" @onClick={{fn this.markAsReady order}} />
52
+ <Button @size="xs" @type="success" @icon="bells" @text={{t "storefront.component.widget.orders.mark-as-ready"}} @onClick={{fn this.markAsReady order}} />
37
53
  {{/if}}
38
54
  {{#if order.isPickupReady}}
39
- <Button @size="xs" @type="success" @icon="check" @text="Mark as Completed" @onClick={{fn this.markAsCompleted order}} />
55
+ <Button
56
+ @size="xs"
57
+ @type="success"
58
+ @icon="check"
59
+ @text={{t "storefront.component.widget.orders.mark-as-completed"}}
60
+ @onClick={{fn this.markAsCompleted order}}
61
+ />
40
62
  {{/if}}
41
63
  </td>
42
64
  </tr>
@@ -59,48 +81,61 @@
59
81
  </div>
60
82
  </div>
61
83
  <div class="flex flex-row space-x-2 flex-wrap">
62
- <Button @size="xs" @type="primary" @icon="eye" @text="View" @onClick={{fn this.viewOrder order}} />
63
- <Button @size="xs" @type="default" @icon="steering-wheel" @text={{if order.has_driver_assigned "Change Driver" "Assign Driver"}} @onClick={{fn this.assignDriver order}} />
84
+ <Button @size="xs" @type="primary" @icon="eye" @text={{t "storefront.common.view"}} @onClick={{fn this.viewOrder order}} />
85
+ <Button
86
+ @size="xs"
87
+ @type="default"
88
+ @icon="steering-wheel"
89
+ @text={{if order.has_driver_assigned (t "storefront.component.widget.order.change-driver") (t "storefront.component.widget.order.assign-driver")}}
90
+ @onClick={{fn this.assignDriver order}}
91
+ />
64
92
  {{#if order.isFresh}}
65
- <Button @size="xs" @type="success" @iconPrefix="fas" @icon="check" @text="Accept Order!" @onClick={{fn this.acceptOrder order}} />
93
+ <Button
94
+ @size="xs"
95
+ @type="success"
96
+ @iconPrefix="fas"
97
+ @icon="check"
98
+ @text={{concat (t "storefront.component.widget.orders.accept-order") "!"}}
99
+ @onClick={{fn this.acceptOrder order}}
100
+ />
66
101
  {{/if}}
67
102
  {{#if order.isPreparing}}
68
- <Button @size="xs" @type="success" @icon="bells" @text="Mark as Ready!" @onClick={{fn this.markAsReady order}} />
103
+ <Button @size="xs" @type="success" @icon="bells" @text={{t "storefront.component.widget.orders.mark-as-mark"}} @onClick={{fn this.markAsReady order}} />
69
104
  {{/if}}
70
105
  {{#if order.isPickupReady}}
71
- <Button @size="xs" @type="success" @icon="check" @text="Mark as Completed" @onClick={{fn this.markAsCompleted order}} />
106
+ <Button @size="xs" @type="success" @icon="check" @text={{t "storefront.component.widget.orders.mark-as-completed"}} @onClick={{fn this.markAsCompleted order}} />
72
107
  {{/if}}
73
108
  </div>
74
- <ContentPanel @title="More Details" class="mt-2">
109
+ <ContentPanel @title={{t "storefront.component.widget.orders.title"}} class="mt-2">
75
110
  <div class="flex flex-col py-2 border-t dark:border-gray-800">
76
- <div>Customer: {{n-a order.customer_name}}</div>
77
- <div>Driver: {{n-a order.driver_name}}</div>
111
+ <div>{{t "storefront.component.widget.orders.customer"}}: {{n-a order.customer_name}}</div>
112
+ <div>{{t "storefront.component.widget.orders.driver"}}: {{n-a order.driver_name}}</div>
78
113
  </div>
79
114
  <div class="py-2 space-y-2 border-t dark:border-gray-800">
80
115
  <div class="flex items-center justify-between">
81
- <span class="dark:text-gray-50">Subtotal</span>
116
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.subtotal"}}</span>
82
117
  <span class="dark:text-gray-50">{{format-currency order.meta.subtotal order.meta.currency}}</span>
83
118
  </div>
84
119
  {{#unless order.meta.is_pickup}}
85
120
  <div class="flex items-center justify-between">
86
- <span class="dark:text-gray-50">Delivery fee</span>
121
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-fee"}}</span>
87
122
  <span class="dark:text-gray-50">{{format-currency order.meta.delivery_fee order.meta.currency}}</span>
88
123
  </div>
89
124
  {{/unless}}
90
125
  {{#if order.meta.tip}}
91
126
  <div class="flex items-center justify-between">
92
- <span class="dark:text-gray-50">Tip</span>
127
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.order.tip"}}</span>
93
128
  <span class="dark:text-gray-50">{{get-tip-amount order.meta.tip order.meta.subtotal order.meta.currency}}</span>
94
129
  </div>
95
130
  {{/if}}
96
131
  {{#if order.meta.delivery_tip}}
97
132
  <div class="flex items-center justify-between">
98
- <span class="dark:text-gray-50">Delivery Tip</span>
133
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.order.delivery-tip"}}</span>
99
134
  <span class="dark:text-gray-50">{{get-tip-amount order.meta.delivery_tip order.meta.subtotal order.meta.currency}}</span>
100
135
  </div>
101
136
  {{/if}}
102
137
  <div class="flex items-center justify-between">
103
- <span class="dark:text-gray-50 font-bold">Total</span>
138
+ <span class="dark:text-gray-50 font-bold">{{t "storefront.component.widget.order.tip"}}</span>
104
139
  <span class="dark:text-gray-50 font-bold">{{format-currency order.meta.total order.meta.currency}}</span>
105
140
  </div>
106
141
  </div>
@@ -8,13 +8,14 @@ export default class WidgetOrdersComponent extends Component {
8
8
  @service store;
9
9
  @service storefront;
10
10
  @service fetch;
11
+ @service intl;
11
12
  @service appCache;
12
13
  @service modalsManager;
13
14
  @tracked isLoading = true;
14
15
  @tracked orders = [];
15
16
 
16
17
  @computed('args.title') get title() {
17
- return this.args.title ?? 'Recent Orders';
18
+ return this.args.title ?? this.intl.t('storefront.component.widget.orders.widget-title');
18
19
  }
19
20
 
20
21
  constructor() {
@@ -139,8 +140,8 @@ export default class WidgetOrdersComponent extends Component {
139
140
  await order.loadCustomer();
140
141
 
141
142
  this.modalsManager.show('modals/incoming-order', {
142
- title: 'Accept Order',
143
- acceptButtonText: 'Accept Order',
143
+ title: this.intl.t('storefront.component.widget.orders.accept-order'),
144
+ acceptButtonText: this.intl.t('storefront.component.widget.orders.accept-order'),
144
145
  acceptButtonScheme: 'success',
145
146
  acceptButtonIcon: 'check',
146
147
  order,
@@ -162,9 +163,9 @@ export default class WidgetOrdersComponent extends Component {
162
163
  // for pickup orders
163
164
  if (order.meta?.is_pickup === true) {
164
165
  this.modalsManager.confirm({
165
- title: 'Mark order ready for pickup?',
166
- body: 'Marking the order as ready will notify the customer their order is ready for pickup!',
167
- acceptButtonText: 'Ready for Pickup!',
166
+ title: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-pickup-title'),
167
+ body: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-pickup-body'),
168
+ acceptButtonText: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-pickup-accept-button-text'),
168
169
  acceptButtonIcon: 'check',
169
170
  acceptButtonScheme: 'success',
170
171
  confirm: (modal) => {
@@ -183,8 +184,8 @@ export default class WidgetOrdersComponent extends Component {
183
184
  if (!order.adhoc) {
184
185
  // prompt to assign driver then dispatch
185
186
  return this.modalsManager.show('modals/order-ready-assign-driver', {
186
- title: 'Assign driver and dispatch orders',
187
- acceptButtonText: 'Assign & Dispatch!',
187
+ title: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-not-adhoc-title'),
188
+ acceptButtonText: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-not-adhoc-accept-button-text'),
188
189
  acceptButtonScheme: 'success',
189
190
  acceptButtonIcon: 'check',
190
191
  adhoc: false,
@@ -206,9 +207,9 @@ export default class WidgetOrdersComponent extends Component {
206
207
  }
207
208
 
208
209
  this.modalsManager.confirm({
209
- title: 'Are you want to mark order as ready?',
210
- body: 'Marking the order as ready will dispatch the order to nearby drivers, only mark the order as ready when it can be picked up.',
211
- acceptButtonText: 'Dispatch!',
210
+ title: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-title'),
211
+ body: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-body'),
212
+ acceptButtonText: this.intl.t('storefront.component.widget.orders.mark-as-ready-modal-accept-button-text'),
212
213
  acceptButtonIcon: 'check',
213
214
  acceptButtonScheme: 'success',
214
215
  confirm: (modal) => {
@@ -226,9 +227,9 @@ export default class WidgetOrdersComponent extends Component {
226
227
 
227
228
  @action markAsCompleted(order) {
228
229
  this.modalsManager.confirm({
229
- title: 'Are you sure you want to mark order as completed?',
230
- body: 'Marking the order as completed is a confirmation that the customer has picked up the order and the order is completed.',
231
- acceptButtonText: 'Order Completed!',
230
+ title: this.intl.t('storefront.component.widget.orders.mark-as-completed-modal-title'),
231
+ body: this.intl.t('storefront.component.widget.orders.mark-as-completed-modal-body'),
232
+ acceptButtonText: this.intl.t('storefront.component.widget.orders.mark-as-completed-accept-button-text'),
232
233
  acceptButtonIcon: 'check',
233
234
  acceptButtonScheme: 'success',
234
235
  confirm: (modal) => {
@@ -248,8 +249,8 @@ export default class WidgetOrdersComponent extends Component {
248
249
  await order.loadDriver();
249
250
 
250
251
  this.modalsManager.show('modals/assign-driver', {
251
- title: 'Assign driver',
252
- acceptButtonText: 'Assign Driver',
252
+ title: this.intl.t('storefront.component.widget.orders.assign-driver-modal-title'),
253
+ acceptButtonText: this.intl.t('storefront.component.widget.orders.assign-driver-accept-button-text'),
253
254
  acceptButtonScheme: 'success',
254
255
  acceptButtonIcon: 'check',
255
256
  driver: order.driver_assigned,
@@ -2,7 +2,7 @@
2
2
  <div class="flex items-center justify-between">
3
3
  <div class="flex items-center">
4
4
  <h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-gray-100 mr-2">
5
- Last 30 days
5
+ {{t "storefront.component.widget.storefront-metrics.last-day"}}
6
6
  </h3>
7
7
  {{#if this.isLoading}}
8
8
  <div>
@@ -17,7 +17,7 @@
17
17
  <dl class="mt-4 grid grid-cols-2 gap-5 sm:grid-cols-4">
18
18
  <div class="px-4 py-5 border border-gray-200 dark:border-gray-900 bg-gray-50 dark:bg-gray-700 shadow-sm dark:shadow rounded-lg overflow-hidden sm:p-6">
19
19
  <dt class="text-sm font-medium text-gray-500 dark:text-gray-100 truncate">
20
- Orders
20
+ {{t "storefront.common.orders"}}
21
21
  </dt>
22
22
  <dd class="mt-1 text-3xl font-semibold text-gray-800 dark:text-white">
23
23
  {{this.metrics.orders_count}}
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div class="px-4 py-5 border border-gray-200 dark:border-gray-900 bg-gray-50 dark:bg-gray-700 shadow-sm dark:shadow rounded-lg overflow-hidden sm:p-6">
28
28
  <dt class="text-sm font-medium text-gray-500 dark:text-gray-100 truncate">
29
- Customers
29
+ {{t "storefront.common.customers"}}
30
30
  </dt>
31
31
  <dd class="mt-1 text-3xl font-semibold text-gray-800 dark:text-white">
32
32
  {{this.metrics.customers_count}}
@@ -35,7 +35,7 @@
35
35
 
36
36
  <div class="px-4 py-5 border border-gray-200 dark:border-gray-900 bg-gray-50 dark:bg-gray-700 shadow-sm dark:shadow rounded-lg overflow-hidden sm:p-6">
37
37
  <dt class="text-sm font-medium text-gray-500 dark:text-gray-100 truncate">
38
- Stores
38
+ {{t "storefront.common.orders"}}
39
39
  </dt>
40
40
  <dd class="mt-1 text-3xl font-semibold text-gray-800 dark:text-white">
41
41
  {{this.metrics.stores_count}}
@@ -44,7 +44,7 @@
44
44
 
45
45
  <div class="px-4 py-5 border border-gray-200 dark:border-gray-900 bg-gray-50 dark:bg-gray-700 shadow-sm dark:shadow rounded-lg overflow-hidden sm:p-6">
46
46
  <dt class="text-sm font-medium text-gray-500 dark:text-gray-100 truncate">
47
- Earnings
47
+ {{t "storefront.common.earning"}}
48
48
  </dt>
49
49
  <dd class="mt-1 text-3xl font-semibold text-gray-800 dark:text-white">
50
50
  {{format-currency this.metrics.earnings_sum this.metrics.currency}}
@@ -41,6 +41,13 @@ export default class CustomersIndexController extends Controller {
41
41
  */
42
42
  @service filters;
43
43
 
44
+ /**
45
+ * Inject the `intl` service
46
+ *
47
+ * @var {Service}
48
+ */
49
+ @service intl;
50
+
44
51
  /**
45
52
  * Queryable parameters for this controller's model
46
53
  *
@@ -111,7 +118,7 @@ export default class CustomersIndexController extends Controller {
111
118
  */
112
119
  @tracked columns = [
113
120
  {
114
- label: 'Name',
121
+ label: this.intl.t('storefront.common.name'),
115
122
  valuePath: 'name',
116
123
  width: '15%',
117
124
  cellComponent: 'table/cell/media-name',
@@ -122,7 +129,7 @@ export default class CustomersIndexController extends Controller {
122
129
  filterComponent: 'filter/string',
123
130
  },
124
131
  {
125
- label: 'ID',
132
+ label: this.intl.t('storefront.common.id'),
126
133
  valuePath: 'public_id',
127
134
  cellComponent: 'click-to-copy',
128
135
  width: '15%',
@@ -132,7 +139,7 @@ export default class CustomersIndexController extends Controller {
132
139
  filterComponent: 'filter/string',
133
140
  },
134
141
  {
135
- label: 'Internal ID',
142
+ label: this.intl.t('storefront.customers.index.internal-id'),
136
143
  valuePath: 'internal_id',
137
144
  cellComponent: 'click-to-copy',
138
145
  width: '15%',
@@ -142,7 +149,7 @@ export default class CustomersIndexController extends Controller {
142
149
  filterComponent: 'filter/string',
143
150
  },
144
151
  {
145
- label: 'Email',
152
+ label: this.intl.t('storefront.common.email'),
146
153
  valuePath: 'email',
147
154
  cellComponent: 'table/cell/base',
148
155
  width: '15%',
@@ -152,7 +159,7 @@ export default class CustomersIndexController extends Controller {
152
159
  filterComponent: 'filter/string',
153
160
  },
154
161
  {
155
- label: 'Phone',
162
+ label: this.intl.t('storefront.common.phone'),
156
163
  valuePath: 'phone',
157
164
  cellComponent: 'table/cell/base',
158
165
  width: '15%',
@@ -162,7 +169,7 @@ export default class CustomersIndexController extends Controller {
162
169
  filterComponent: 'filter/string',
163
170
  },
164
171
  {
165
- label: 'Address',
172
+ label: this.intl.t('storefront.common.address'),
166
173
  valuePath: 'address',
167
174
  cellComponent: 'table/cell/anchor',
168
175
  // action: this.viewVendorPlace,
@@ -174,7 +181,7 @@ export default class CustomersIndexController extends Controller {
174
181
  filterComponent: 'filter/string',
175
182
  },
176
183
  {
177
- label: 'Country',
184
+ label: this.intl.t('storefront.common.country'),
178
185
  valuePath: 'country',
179
186
  cellComponent: 'table/cell/base',
180
187
  cellClassNames: 'uppercase',
@@ -186,7 +193,7 @@ export default class CustomersIndexController extends Controller {
186
193
  filterComponent: 'filter/string',
187
194
  },
188
195
  {
189
- label: 'Created At',
196
+ label: this.intl.t('storefront.customers.index.create-at'),
190
197
  valuePath: 'createdAt',
191
198
  sortParam: 'created_at',
192
199
  width: '15%',
@@ -196,7 +203,7 @@ export default class CustomersIndexController extends Controller {
196
203
  filterComponent: 'filter/date',
197
204
  },
198
205
  {
199
- label: 'Updated At',
206
+ label: this.intl.t('storefront.customers.index.update-at'),
200
207
  valuePath: 'updatedAt',
201
208
  sortParam: 'updated_at',
202
209
  width: '15%',
@@ -212,24 +219,25 @@ export default class CustomersIndexController extends Controller {
212
219
  ddButtonText: false,
213
220
  ddButtonIcon: 'ellipsis-h',
214
221
  ddButtonIconPrefix: 'fas',
215
- ddMenuLabel: 'Vendor Actions',
222
+ ddMenuLabel: this.intl.t('storefront.customers.index.vendor-action'),
216
223
  cellClassNames: 'overflow-visible',
217
224
  wrapperClass: 'flex items-center justify-end mx-2',
218
225
  width: '10%',
219
226
  actions: [
220
227
  {
221
- label: 'View Customer Details',
228
+ label: this.intl.t('storefront.customers.index.view-customer-details'),
222
229
  // fn: this.viewVendor,
223
230
  },
224
231
  {
225
- label: 'Edit Customer',
232
+ label: this.intl.t('storefront.customers.index.edit-customer'),
233
+
226
234
  // fn: this.editVendor,
227
235
  },
228
236
  {
229
237
  separator: true,
230
238
  },
231
239
  {
232
- label: 'Delete Customer',
240
+ label: this.intl.t('storefront.customers.index.delete-customer'),
233
241
  // fn: this.deleteVendor,
234
242
  },
235
243
  ],
@@ -42,6 +42,13 @@ export default class NetworksIndexNetworkIndexController extends Controller {
42
42
  */
43
43
  @service fetch;
44
44
 
45
+ /**
46
+ * intl service to handle file uploads and other network requests.
47
+ *
48
+ * @property {Service} intl
49
+ */
50
+ @service intl;
51
+
45
52
  /**
46
53
  * Proof of delivery methods.
47
54
  *
@@ -82,7 +89,7 @@ export default class NetworksIndexNetworkIndexController extends Controller {
82
89
  this.model
83
90
  .save()
84
91
  .then(() => {
85
- this.notifications.success('Changes to network saved.');
92
+ this.notifications.success(this.intl.t('storefront.controllers.networks.index.change-network-saved'));
86
93
  })
87
94
  .catch((error) => {
88
95
  this.notifications.serverError(error);
@@ -134,13 +141,13 @@ export default class NetworksIndexNetworkIndexController extends Controller {
134
141
  });
135
142
 
136
143
  this.editGateway(gateway, {
137
- title: `Create a new payment gateway`,
138
- acceptButtonText: 'Save Gateway',
144
+ title: this.intl.t('storefront.networks.index.network.index.create-new-payment-gateway'),
145
+ acceptButtonText: this.intl.t('storefront.networks.index.network.index.save-gateway'),
139
146
  confirm: (modal) => {
140
147
  modal.startLoading();
141
148
 
142
149
  return gateway.save().then((gateway) => {
143
- this.notifications.success(`New gateway added to network`);
150
+ this.notifications.success(this.intl.t('storefront.networks.index.network.index.new-gateway-add-network'));
144
151
  this.gateways.pushObject(gateway);
145
152
  });
146
153
  },
@@ -169,7 +176,7 @@ export default class NetworksIndexNetworkIndexController extends Controller {
169
176
  modal.startLoading();
170
177
 
171
178
  return gateway.save().then(() => {
172
- this.notifications.success(`Payment gateway changes saved!`);
179
+ this.notifications.success(this.intl.t('storefront.networks.index.network.index.payment-gateway-changes-success'));
173
180
  });
174
181
  };
175
182
  }
@@ -200,13 +207,13 @@ export default class NetworksIndexNetworkIndexController extends Controller {
200
207
  });
201
208
 
202
209
  this.editChannel(channel, {
203
- title: `Create a new notification channel`,
204
- acceptButtonText: 'Create Notification Channel',
210
+ title: this.intl.t('storefront.networks.index.network.index.create-new-notification-channel'),
211
+ acceptButtonText: this.intl.t('storefront.networks.index.network.index.create-notification-channel'),
205
212
  confirm: (modal) => {
206
213
  modal.startLoading();
207
214
 
208
215
  return channel.save().then((channel) => {
209
- this.notifications.success(`New notification channel added to network!`);
216
+ this.notifications.success(this.intl.t('storefront.networks.index.network.index.notification-channel-add-network'));
210
217
  this.channels.pushObject(channel);
211
218
  });
212
219
  },
@@ -235,7 +242,7 @@ export default class NetworksIndexNetworkIndexController extends Controller {
235
242
  modal.startLoading();
236
243
 
237
244
  return channel.save().then(() => {
238
- this.notifications.success(`Notification channel changes saved!`);
245
+ this.notifications.success(this.intl.t('storefront.controllers.networks.index.notification-channel-changes-save'));
239
246
  });
240
247
  };
241
248
  }