-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@uppy/companion: add parent folder path in onedrive provider #4486
Conversation
Thank you! Note that we have uppy/packages/@uppy/dashboard/src/Dashboard.jsx Lines 386 to 390 in 72f579e
|
That would be fine as well, although the property is a little bit different: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's a 'flat' file? and what does relativePath mean in the context of onedrive? I believe relativePath is only set for local files in Uppy? (not remote/provider files).
Also I'm not sure what's the difference between a file's relativePath and a file's path - what is a path relative to? should it instead be called path?
The way I understand it, parentPath in OneDrive is the whole absolute path to a file excluding the file name, kind of like dirname() in node.js, am i right?
packages/@uppy/companion/src/server/provider/onedrive/adapter.js
Outdated
Show resolved
Hide resolved
By that I meant files that are not located inside another directory but in the root directory.
Yes, that's my understanding as well. Hence I figured
In that specific case there is no difference I believe. |
Ok, I believe relativePath is something completely different than this then (it also includes the file's name), so we shouldn't mix the two together. IMO something like I find the root path |
related? #4423 |
Also related: #4034? |
Also thinking that |
My two cents:
|
Note: we add |
20714d1
to
1c4e35e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the root path should be /
. also there's a bug where it doesn't match from the start of the string
packages/@uppy/companion/src/server/provider/onedrive/adapter.js
Outdated
Show resolved
Hide resolved
Adds the parent folder path to the OneDrive provider. This can be used to determine and distinguish different source locations of files.
1c4e35e
to
7180cb9
Compare
I've been playing around further with this with @JammingBen and we realized that this is not all we need. Basically we want to achieve that recursive cloud uploads work - relative to the selected folder, just like local folders uppy/packages/@uppy/provider-views/src/ProviderView/ProviderView.jsx Lines 277 to 292 in 2b9958c
We might as well just build the full path including the filename in the server and name the property To me that seems a tad more consistent and feels a little less awkward than Also it would make the code a little easier as we don't need to add the if(newFile.absolutePath?.startsWith(file.absolutePath)) {
newFile.relativePath = newFile.absolutePath.slice(file.absolutePath.length - 1)
} This handles the
The Would you like a separate PR for the |
When we agree on something, we should add it to the documentation here: https://github.com/transloadit/uppy.io/blob/4bc81c342bdf48fd9083c6b8975f1f3b078d4580/docs/companion.md?plain=1#L818 |
I've been doing some more thinking around this, and I'm not sure if this is the way to do it, because not all providers support returning the path to Companion in their APIs, so it would't be consistent between providers. We probably want to implement a solution that work across all (most) providers. Will continue the discussion here for now: #4034 (because it is not onedrive specific) |
@JammingBen I guess you can close this one, as a different solution is being worked on and we use the same approach in our fork already |
Superseded by #4537 |
Adds the parent folder path to the OneDrive provider. This can be used to determine and distinguish different source locations of files.
Relates to #4034 (although it doesn't fix it completely because other providers are still missing).