File tree Expand file tree Collapse file tree 3 files changed +30
-10
lines changed Expand file tree Collapse file tree 3 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 33 toSingleLineString ,
44 getFileStream ,
55} from "../../common/utils.mjs" ;
6- import {
7- additionalProps , useFileUrlOrPath ,
8- } from "../../common/filePathOrUrl.mjs" ;
6+ import { additionalProps } from "../../common/filePathOrUrl.mjs" ;
97
108export default {
119 key : "google_drive-update-file" ,
@@ -16,7 +14,26 @@ export default {
1614 additionalProps,
1715 props : {
1816 googleDrive,
19- useFileUrlOrPath,
17+ updateType : {
18+ type : "string" ,
19+ label : "Update Type" ,
20+ description : "Whether to update content or metadata only" ,
21+ options : [
22+ {
23+ label : "Upload content from File URL" ,
24+ value : "File URL" ,
25+ } ,
26+ {
27+ label : "Upload content from File Path" ,
28+ value : "File Path" ,
29+ } ,
30+ {
31+ label : "Update file metadata only" ,
32+ value : "File Metadata" ,
33+ } ,
34+ ] ,
35+ reloadProps : true ,
36+ } ,
2037 drive : {
2138 propDefinition : [
2239 googleDrive ,
Original file line number Diff line number Diff line change 66} from "../../common/utils.mjs" ;
77import { GOOGLE_DRIVE_UPLOAD_TYPE_MULTIPART } from "../../common/constants.mjs" ;
88import {
9- additionalProps , useFileUrlOrPath ,
9+ additionalProps , updateType ,
1010} from "../../common/filePathOrUrl.mjs" ;
1111
1212export default {
@@ -18,7 +18,7 @@ export default {
1818 additionalProps,
1919 props : {
2020 googleDrive,
21- useFileUrlOrPath ,
21+ updateType ,
2222 drive : {
2323 propDefinition : [
2424 googleDrive ,
Original file line number Diff line number Diff line change 1- export const useFileUrlOrPath = {
1+ export const updateType = {
22 type : "string" ,
33 label : "Use File URL or File Path" ,
44 description : "Whether to upload a file from a URL or from the `/tmp` folder" ,
@@ -10,14 +10,17 @@ export const useFileUrlOrPath = {
1010} ;
1111
1212export async function additionalProps ( previousProps ) {
13- const { useFileUrlOrPath } = this ;
13+ const { updateType } = this ;
1414
15- if ( useFileUrlOrPath === "File URL" ) {
15+ if ( updateType === "File URL" ) {
1616 previousProps . fileUrl . hidden = false ;
1717 previousProps . filePath . hidden = true ;
18- } else if ( useFileUrlOrPath === "File Path" ) {
18+ } else if ( updateType === "File Path" ) {
1919 previousProps . fileUrl . hidden = true ;
2020 previousProps . filePath . hidden = false ;
21+ } else {
22+ previousProps . fileUrl . hidden = true ;
23+ previousProps . filePath . hidden = true ;
2124 }
2225
2326 return { } ;
You can’t perform that action at this time.
0 commit comments