From fff3b18f60392e8b62c2b696361ddf9b42471878 Mon Sep 17 00:00:00 2001 From: Julian Rubisch Date: Tue, 25 Jan 2022 08:57:02 +0100 Subject: [PATCH 1/2] Rename serviceName to directUploadToken in AS' DirectUpload --- activestorage/app/javascript/activestorage/direct_upload.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/activestorage/app/javascript/activestorage/direct_upload.js b/activestorage/app/javascript/activestorage/direct_upload.js index e5c279d173d60..0112d7b0ba498 100644 --- a/activestorage/app/javascript/activestorage/direct_upload.js +++ b/activestorage/app/javascript/activestorage/direct_upload.js @@ -5,11 +5,11 @@ import { BlobUpload } from "./blob_upload" let id = 0 export class DirectUpload { - constructor(file, url, serviceName, attachmentName, delegate) { + constructor(file, url, directUploadToken, attachmentName, delegate) { this.id = ++id this.file = file this.url = url - this.serviceName = serviceName + this.directUploadToken = directUploadToken this.attachmentName = attachmentName this.delegate = delegate } @@ -21,7 +21,7 @@ export class DirectUpload { return } - const blob = new BlobRecord(this.file, checksum, this.url, this.serviceName, this.attachmentName) + const blob = new BlobRecord(this.file, checksum, this.url, this.directUploadToken, this.attachmentName) notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr) blob.create(error => { From 8f9d8c2f75e5428faa3c506448b6df7372eb8ff6 Mon Sep 17 00:00:00 2001 From: Julian Rubisch Date: Tue, 25 Jan 2022 10:40:03 +0100 Subject: [PATCH 2/2] Update packages --- activestorage/app/assets/javascripts/activestorage.esm.js | 6 +++--- activestorage/app/assets/javascripts/activestorage.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activestorage/app/assets/javascripts/activestorage.esm.js b/activestorage/app/assets/javascripts/activestorage.esm.js index dad68d5373441..941ef597dda7f 100644 --- a/activestorage/app/assets/javascripts/activestorage.esm.js +++ b/activestorage/app/assets/javascripts/activestorage.esm.js @@ -608,11 +608,11 @@ class BlobUpload { let id = 0; class DirectUpload { - constructor(file, url, serviceName, attachmentName, delegate) { + constructor(file, url, directUploadToken, attachmentName, delegate) { this.id = ++id; this.file = file; this.url = url; - this.serviceName = serviceName; + this.directUploadToken = directUploadToken; this.attachmentName = attachmentName; this.delegate = delegate; } @@ -622,7 +622,7 @@ class DirectUpload { callback(error); return; } - const blob = new BlobRecord(this.file, checksum, this.url, this.serviceName, this.attachmentName); + const blob = new BlobRecord(this.file, checksum, this.url, this.directUploadToken, this.attachmentName); notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr); blob.create((error => { if (error) { diff --git a/activestorage/app/assets/javascripts/activestorage.js b/activestorage/app/assets/javascripts/activestorage.js index 8291629fad15d..cfb696872d058 100644 --- a/activestorage/app/assets/javascripts/activestorage.js +++ b/activestorage/app/assets/javascripts/activestorage.js @@ -600,11 +600,11 @@ } let id = 0; class DirectUpload { - constructor(file, url, serviceName, attachmentName, delegate) { + constructor(file, url, directUploadToken, attachmentName, delegate) { this.id = ++id; this.file = file; this.url = url; - this.serviceName = serviceName; + this.directUploadToken = directUploadToken; this.attachmentName = attachmentName; this.delegate = delegate; } @@ -614,7 +614,7 @@ callback(error); return; } - const blob = new BlobRecord(this.file, checksum, this.url, this.serviceName, this.attachmentName); + const blob = new BlobRecord(this.file, checksum, this.url, this.directUploadToken, this.attachmentName); notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr); blob.create((error => { if (error) {