@fleetbase/storefront-engine 0.2.8 → 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.
|
@@ -95,14 +95,15 @@ export default class ProductsIndexCategoryNewController extends BaseController {
|
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
// Queue and upload immediatley
|
|
98
99
|
this.uploadQueue.pushObject(file);
|
|
99
100
|
this.fetch.uploadFile.perform(
|
|
100
101
|
file,
|
|
101
102
|
{
|
|
102
103
|
path: `uploads/storefront/${this.activeStore.id}/products`,
|
|
103
104
|
subject_uuid: this.product.id,
|
|
104
|
-
subject_type:
|
|
105
|
-
type:
|
|
105
|
+
subject_type: 'storefront:product',
|
|
106
|
+
type: 'storefront_product',
|
|
106
107
|
},
|
|
107
108
|
(uploadedFile) => {
|
|
108
109
|
this.product.files.pushObject(uploadedFile);
|
|
@@ -116,6 +117,10 @@ export default class ProductsIndexCategoryNewController extends BaseController {
|
|
|
116
117
|
},
|
|
117
118
|
() => {
|
|
118
119
|
this.uploadQueue.removeObject(file);
|
|
120
|
+
// remove file from queue
|
|
121
|
+
if (file.queue && typeof file.queue.remove === 'function') {
|
|
122
|
+
file.queue.remove(file);
|
|
123
|
+
}
|
|
119
124
|
}
|
|
120
125
|
);
|
|
121
126
|
}
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
class="min-h-56 dropzone w-full rounded-lg px-4 py-8 min-h bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500"
|
|
215
215
|
>
|
|
216
216
|
<div class="flex items-center justify-center py-5">
|
|
217
|
-
<Spinner class="text-sm dar:text-gray-100" @loadingMessage="
|
|
217
|
+
<Spinner class="text-sm dar:text-gray-100" @loadingMessage={{t "component.dropzone.uploading"}} />
|
|
218
218
|
</div>
|
|
219
219
|
</div>
|
|
220
220
|
{{else}}
|
|
@@ -222,28 +222,27 @@
|
|
|
222
222
|
<FileDropzone @queue={{queue}} class="dropzone file-dropzone" as |dropzone|>
|
|
223
223
|
{{#if dropzone.active}}
|
|
224
224
|
{{#if dropzone.valid}}
|
|
225
|
-
|
|
225
|
+
{{t "component.dropzone.drop-to-upload"}}
|
|
226
226
|
{{else}}
|
|
227
|
-
|
|
227
|
+
{{t "component.dropzone.invalid"}}
|
|
228
228
|
{{/if}}
|
|
229
229
|
{{else if queue.files.length}}
|
|
230
230
|
<div class="my-2">
|
|
231
231
|
<FaIcon @icon="photo-video" class="text-indigo-500 mr-2" />
|
|
232
|
-
{{pluralize queue.files.length "file"}}
|
|
233
|
-
ready for upload.
|
|
232
|
+
{{t "component.dropzone.files-ready-for-upload" numOfFiles=(pluralize queue.files.length (t "component.dropzone.file"))}}
|
|
234
233
|
</div>
|
|
235
234
|
<div class="my-2">({{queue.progress}}%)</div>
|
|
236
235
|
{{else}}
|
|
237
236
|
<h4 class="font-semibold mb-8">
|
|
238
237
|
<FaIcon @icon="photo-video" @size="2x" class="text-indigo-500 mr-2" />
|
|
239
|
-
|
|
238
|
+
{{t "component.dropzone.upload-images-videos"}}
|
|
240
239
|
</h4>
|
|
241
240
|
<div>
|
|
242
241
|
{{#if dropzone.supported}}
|
|
243
|
-
<p class="text-base font-semibold my-5">
|
|
242
|
+
<p class="text-base font-semibold my-5">{{t "component.dropzone.dropzone-supported-images-videos"}}</p>
|
|
244
243
|
{{/if}}
|
|
245
244
|
<FileUpload @name="files" @for="files" @accept={{join "," this.acceptedFileTypes}} @multiple={{true}} @onFileAdded={{this.queueFile}}>
|
|
246
|
-
<a tabindex={{0}} class="btn btn-magic cursor-pointer ml-1">or
|
|
245
|
+
<a tabindex={{0}} class="btn btn-magic cursor-pointer ml-1">{{t "component.dropzone.or-select-button-text"}}</a>
|
|
247
246
|
</FileUpload>
|
|
248
247
|
</div>
|
|
249
248
|
{{/if}}
|
|
@@ -252,15 +251,15 @@
|
|
|
252
251
|
{{#if this.uploadQueue}}
|
|
253
252
|
<div class="mx-4">
|
|
254
253
|
<div class="flex items-center justify-between mb-4">
|
|
255
|
-
<span class="leading-6 dark:text-gray-100">
|
|
254
|
+
<span class="leading-6 dark:text-gray-100">{{t "component.dropzone.upload-queue"}}</span>
|
|
256
255
|
</div>
|
|
257
256
|
<div class="space-y-2 mb-4">
|
|
258
257
|
{{#each this.uploadQueue as |file|}}
|
|
259
|
-
<div class="flex items-center justify-between bg-
|
|
260
|
-
<div class="text-
|
|
258
|
+
<div class="flex items-center justify-between bg-blue-100 border border-blue-800 dark:border-blue-800 py-1.5 shadow-sm rounded-lg px-4">
|
|
259
|
+
<div class="text-xs text-blue-900 truncate">{{truncate-filename file.name 50}}</div>
|
|
261
260
|
<div class="flex items-center text-sm">
|
|
262
|
-
<Spinner class="text-
|
|
263
|
-
<span class="font-bold text-
|
|
261
|
+
<Spinner class="text-blue-900 mr-2" />
|
|
262
|
+
<span class="font-bold text-blue-900">{{round file.progress}}%</span>
|
|
264
263
|
</div>
|
|
265
264
|
</div>
|
|
266
265
|
{{/each}}
|
package/composer.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleetbase/storefront-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "Headless Commerce & Marketplace Extension for Fleetbase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fleetbase-extension",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
],
|
|
23
23
|
"require": {
|
|
24
24
|
"php": "^7.4|^8.0",
|
|
25
|
-
"fleetbase/core-api": "^1.3.
|
|
26
|
-
"fleetbase/fleetops-api": "^0.4.
|
|
25
|
+
"fleetbase/core-api": "^1.3.13",
|
|
26
|
+
"fleetbase/fleetops-api": "^0.4.4",
|
|
27
27
|
"geocoder-php/google-maps-places-provider": "^1.4",
|
|
28
28
|
"laravel-notification-channels/apn": "^3.8",
|
|
29
29
|
"laravel-notification-channels/fcm": "^2.7",
|
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/storefront-engine",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
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
|
"@fleetbase/ember-core": "^0.2.0",
|
|
47
|
-
"@fleetbase/ember-ui": "^0.2.
|
|
48
|
-
"@fleetbase/fleetops-data": "^0.1.
|
|
47
|
+
"@fleetbase/ember-ui": "^0.2.10",
|
|
48
|
+
"@fleetbase/fleetops-data": "^0.1.8",
|
|
49
49
|
"@babel/core": "^7.23.2",
|
|
50
50
|
"@fortawesome/ember-fontawesome": "^0.4.1",
|
|
51
51
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|