-
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
feat(webdav): initial implementation for a WebDAV simple auth provider #5528
base: main
Are you sure you want to change the base?
Conversation
Seen the type errors ... will fix tomorrow |
52e2882
to
ef88405
Compare
@Murderlon fixed the type issues, but I'm clueless about the compare_diff test... it looks like new dependencies should be installed by uppy/.github/workflows/e2e.yml Lines 110 to 114 in 44a378a
but it doesn't seem to work? |
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.
Looks good overall! Thanks a lot for picking this up 👌
Perhaps reverting your changes for the action and resolving #5528 (comment) will help |
0eea4ee
to
1bbe4f8
Compare
I'm afraid I can't easily change that (as commented above) - do you have any other ideas? Apart from that everything seems to work and I've addressed all your comments (I think), thanks for the feedback! |
I can take a look later |
I can't make changes because you don't allow edits from contributors. Try to add this to run: |
git checkout FETCH_HEAD -- packages
+ - run: corepack yarn install
- run: corepack yarn build:js:typeless |
Maybe that's because I've sent the PR from the owncloud organization... mh :-\
Still failing :-\ |
Let's undo f657f79 and I'll merge it. I'm pretty sure it's just problematic for PRs introducing a new dependency, which I can sort out in |
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.
Nice stuff!
- Should we have an e2e test for this or would that be very hard to implement? maybe there's a simple mock webdav server implemented in node.js or we can apt install a webdav server and start it up in cypress?
- should we have docs at https://github.com/transloadit/uppy.io ?
- ui not pretty but I guess we can merge it as-is for now. at least it works
requestPath, // TODO FIXME | ||
modifiedDate: item.lastmod, // TODO FIXME: convert 'Tue, 04 Jul 2023 13:09:47 GMT' to ISO 8601 |
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.
these should be fixed (or removed if not in use)
requestPath, // TODO FIXME | |
modifiedDate: item.lastmod, // TODO FIXME: convert 'Tue, 04 Jul 2023 13:09:47 GMT' to ISO 8601 |
throw new Error('call to thumbnail is not implemented') | ||
} | ||
|
||
// todo fixme implement |
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.
// todo fixme implement |
const HttpAgentClass = getProtectedHttpAgent({ protocol, allowLocalIPs: !allowLocalUrls }) | ||
|
||
// dynamic import because Comanion currently uses CommonJS and webdav is shipped as ESM | ||
// can be implemented as regular require as soon as Node 20.17 or 22 is required |
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.
// can be implemented as regular require as soon as Node 20.17 or 22 is required | |
// todo implement as regular require as soon as Node 20.17 or 22 is required |
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.
not to myself: oops, there's also a typo "Comanion"
const onSubmit = (event) => { | ||
event.preventDefault() | ||
onAuth({ webdavUrl: webdavUrl.trim() }) | ||
} |
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.
usecallback to prevent unnecessary re-renders?
const onSubmit = (event) => { | |
event.preventDefault() | |
onAuth({ webdavUrl: webdavUrl.trim() }) | |
} | |
const onSubmit = useCallback((e) => { | |
e.preventDefault() | |
onAuth({ webdavUrl: webdavUrl.trim() }) | |
}, [onAuth, webdavUrl]) |
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.
haha, @Murderlon told me to remove the useCallback we had in place before...
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.
useCallback
/useMemo
are overused and should only be leveraged if you know something is slow, not just for the sake of it.
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.
when coding it's not always obvious that something is going to become slow once it's in production with real world data. IMO it's safer to just add a useCallback than to find out by surprise later that your app is re-rendering the whole React tree on every key stroke in an <input>
for example.
Co-authored-by: Mikael Finstad <[email protected]>
I will address @mifi 's comments asap, not sure what to do with the useCallback ... and I still need help with the translations, any hints? |
I'm traveling and away from my laptop till 16 December. @mifi would be great if you can help get this over the finish line. |
I don't think you need to translate anything. You've added them English keys, and AFAIK it will fallback to those. |
But it doesnt work! The keys are not picked up is what I'm saying |
As #4621 got stale and @Murderlon suggested to implement only the SimpleAuth part of it... here we go.
I intentionally left out any visual configuration for now, I would like to get the actual functionality merged asap and deal with everything else in a followup.
I couldn't make the translations work (at least not the ones in the AuthForm) in the dev server, any hints for that?
Otherwise it works for me (tm)