Skip to content
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

Add @uppy/webdav #5551

Merged
merged 14 commits into from
Dec 17, 2024
Merged

Add @uppy/webdav #5551

merged 14 commits into from
Dec 17, 2024

Conversation

Murderlon
Copy link
Member

Superseding #5528 as I can't edit the PR

@Murderlon Murderlon requested a review from mifi December 16, 2024 12:28
@Murderlon Murderlon self-assigned this Dec 16, 2024
Copy link
Contributor

github-actions bot commented Dec 16, 2024

Diff output files
diff --git a/packages/@uppy/companion/lib/server/controllers/get.js b/packages/@uppy/companion/lib/server/controllers/get.js
index 44c2d07..f69f049 100644
--- a/packages/@uppy/companion/lib/server/controllers/get.js
+++ b/packages/@uppy/companion/lib/server/controllers/get.js
@@ -8,7 +8,7 @@ async function get(req, res) {
   const { accessToken } = providerUserSession;
   const { provider } = req.companion;
   async function getSize() {
-    return provider.size({ id, token: accessToken, query: req.query });
+    return provider.size({ id, token: accessToken, providerUserSession, query: req.query });
   }
   const download = () => provider.download({ id, token: accessToken, providerUserSession, query: req.query });
   try {
diff --git a/packages/@uppy/companion/lib/server/provider/index.js b/packages/@uppy/companion/lib/server/provider/index.js
index 12e8acb..af96424 100644
--- a/packages/@uppy/companion/lib/server/provider/index.js
+++ b/packages/@uppy/companion/lib/server/provider/index.js
@@ -11,6 +11,7 @@ const instagram = require("./instagram/graph");
 const facebook = require("./facebook");
 const onedrive = require("./onedrive");
 const unsplash = require("./unsplash");
+const webdav = require("./webdav");
 const zoom = require("./zoom");
 const { getURLBuilder } = require("../helpers/utils");
 const logger = require("../logger");
@@ -65,7 +66,7 @@ module.exports.getProviderMiddleware = (providers, grantConfig) => {
  * @returns {Record<string, typeof Provider>}
  */
 module.exports.getDefaultProviders = () => {
-  const providers = { dropbox, box, drive: Drive, googlephotos, facebook, onedrive, zoom, instagram, unsplash };
+  const providers = { dropbox, box, drive: Drive, googlephotos, facebook, onedrive, zoom, instagram, unsplash, webdav };
   return providers;
 };
 /**
diff --git a/packages/@uppy/locales/lib/en_US.js b/packages/@uppy/locales/lib/en_US.js
index 73ee7bc..e35a04f 100644
--- a/packages/@uppy/locales/lib/en_US.js
+++ b/packages/@uppy/locales/lib/en_US.js
@@ -28,6 +28,7 @@ en_US.strings = {
   aspectRatioPortrait: "Crop portrait (9:16)",
   aspectRatioSquare: "Crop square",
   authAborted: "Authentication aborted",
+  authenticate: "Connect",
   authenticateWith: "Connect to %{pluginName}",
   authenticateWithTitle: "Please authenticate with %{pluginName} to select files",
   back: "Back",
@@ -133,7 +134,9 @@ en_US.strings = {
   pluginNameScreenCapture: "Screencast",
   pluginNameUnsplash: "Unsplash",
   pluginNameUrl: "Link",
+  pluginNameWebdav: "WebDAV",
   pluginNameZoom: "Zoom",
+  pluginWebdavInputLabel: "WebDAV URL for a file (e.g. from ownCloud or Nextcloud)",
   poweredBy: "Powered by %{uppy}",
   processingXFiles: {
     "0": "Processing %{smart_count} file",
diff --git a/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js b/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
index 2348479..acaee1e 100644
--- a/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
+++ b/packages/@uppy/provider-views/lib/GooglePicker/GooglePickerView.js
@@ -148,7 +148,7 @@ export default function GooglePickerView(_ref) {
       pluginName: pickerType === "drive" ? uppy.i18n("pluginNameGoogleDrive") : uppy.i18n("pluginNameGooglePhotos"),
       pluginIcon: pickerType === "drive" ? GoogleDriveIcon : GooglePhotosIcon,
       handleAuth: showPicker,
-      i18n: uppy.i18nArray,
+      i18n: uppy.i18n,
       loading: loading,
     });
   }
diff --git a/packages/@uppy/provider-views/lib/ProviderView/AuthView.js b/packages/@uppy/provider-views/lib/ProviderView/AuthView.js
index 8e23845..264d238 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/AuthView.js
+++ b/packages/@uppy/provider-views/lib/ProviderView/AuthView.js
@@ -125,17 +125,11 @@ export default function AuthView(_ref3) {
         pluginName,
       }),
     ),
-    h(
-      "div",
-      {
-        className: "uppy-Provider-authForm",
-      },
-      renderForm({
-        pluginName,
-        i18n,
-        loading,
-        onAuth: handleAuth,
-      }),
-    ),
+    renderForm({
+      pluginName,
+      i18n,
+      loading,
+      onAuth: handleAuth,
+    }),
   );
 }
diff --git a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
index 2e08398..4213b00 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
+++ b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
@@ -331,7 +331,7 @@ export default class ProviderView {
         pluginName: this.plugin.title,
         pluginIcon: pluginIcon,
         handleAuth: this.handleAuth,
-        i18n: this.plugin.uppy.i18nArray,
+        i18n: this.plugin.uppy.i18n,
         renderForm: opts.renderAuthForm,
         loading: loading,
       });
diff --git a/packages/@uppy/provider-views/lib/index.js b/packages/@uppy/provider-views/lib/index.js
index 9d7cc3d..052661e 100644
--- a/packages/@uppy/provider-views/lib/index.js
+++ b/packages/@uppy/provider-views/lib/index.js
@@ -1,3 +1,4 @@
 export { default as GooglePickerView } from "./GooglePicker/GooglePickerView.js";
 export { default as ProviderViews, defaultPickerIcon } from "./ProviderView/index.js";
+export { default as SearchInput } from "./SearchInput.js";
 export { default as SearchProviderViews } from "./SearchProviderView/index.js";

@dschmidt
Copy link
Contributor

Oh, thanks for picking it up! <3

@dschmidt
Copy link
Contributor

feel free to squash everything as you like

@Murderlon
Copy link
Member Author

Still need to fix the styling of the plugin and the icon before merging.

@mifi
Copy link
Contributor

mifi commented Dec 16, 2024

You mean styling the form?

@Murderlon
Copy link
Member Author

  • Added tsconfigs (and added a reference to the new plugin so it's actually type checked)
  • Convert plugin to TS (it was just plain JS in TS file)
  • Improved the UI, reusing existing components
  • Fixed locale strings

@dschmidt can you double check locally if things are still working as expected?

@dschmidt
Copy link
Contributor

Works like a charm for me!

@Murderlon Murderlon merged commit 9164ad5 into main Dec 17, 2024
20 checks passed
@Murderlon Murderlon deleted the webdav-plugin branch December 17, 2024 08:27
github-actions bot added a commit that referenced this pull request Dec 17, 2024
| Package                    | Version | Package                    | Version |
| -------------------------- | ------- | -------------------------- | ------- |
| @uppy/companion            |   5.3.0 | @uppy/progress-bar         |   4.1.0 |
| @uppy/companion-client     |   4.3.0 | @uppy/provider-views       |   4.2.0 |
| @uppy/core                 |   4.3.1 | @uppy/status-bar           |   4.0.6 |
| @uppy/google-drive-picker  |   0.2.1 | @uppy/utils                |   6.0.6 |
| @uppy/google-photos-picker |   0.2.1 | @uppy/webdav               |   0.1.0 |
| @uppy/locales              |   4.4.0 | uppy                       |   4.9.0 |

- @uppy/webdav: Add @uppy/webdav (Merlijn Vos / #5551)
- @uppy/google-drive-picker,@uppy/google-photos-picker,@uppy/locales: Add missing Google Picker locale entries (Merlijn Vos / #5552)
- @uppy/core: bring back validateRestrictions (Merlijn Vos / #5538)
- @uppy/google-drive-picker,@uppy/google-photos-picker: Fix TS generics on new Google Picker plugins (Merlijn Vos / #5550)
- @uppy/locales: Add missing French locale entries (Steven SAN / #5549)
- e2e,@uppy/status-bar,@uppy/utils: Companion stream upload unknown size files (Mikael Finstad / #5489)
@dschmidt
Copy link
Contributor

oh wow, thank you so much for getting this over the finish line!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants