fix(Move Binary Data Node): Stringify objects before encoding them in MoveBinaryData (#4882)

* stringify objects before encoding them objects in MoveBinaryData

* add fileSize and fileType on MoveBinaryData converted data

* show `view` option for text files as well

* improve how JSON binary data is shown in the UI
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-12-11 14:10:54 +01:00
committed by GitHub
parent f4481e24e8
commit 3b969d2cd1
10 changed files with 80 additions and 38 deletions

View File

@@ -1060,15 +1060,15 @@ export default mixins(
this.updateNodesExecutionIssues();
},
isViewable (index: number, key: string): boolean {
const { fileType }: IBinaryData = this.binaryData[index][key];
return !!fileType && ['image', 'video'].includes(fileType);
const { fileType } = this.binaryData[index][key];
return !!fileType && ['image', 'video', 'text', 'json'].includes(fileType);
},
isDownloadable (index: number, key: string): boolean {
const { mimeType, fileName }: IBinaryData = this.binaryData[index][key];
const { mimeType, fileName } = this.binaryData[index][key];
return !!(mimeType && fileName);
},
async downloadBinaryData (index: number, key: string) {
const { id, data, fileName, fileExtension, mimeType }: IBinaryData = this.binaryData[index][key];
const { id, data, fileName, fileExtension, mimeType } = this.binaryData[index][key];
if(id) {
const url = this.restApi().getBinaryUrl(id);