-
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
afterFill()
- add loading progress
#5288
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Diff output filesdiff --git a/packages/@uppy/provider-views/lib/Browser.js b/packages/@uppy/provider-views/lib/Browser.js
index 2b692ca..d8a3bfb 100644
--- a/packages/@uppy/provider-views/lib/Browser.js
+++ b/packages/@uppy/provider-views/lib/Browser.js
@@ -33,7 +33,7 @@ function Browser(props) {
if (isLoading) {
return h("div", {
className: "uppy-Provider-loading",
- }, h("span", null, i18n("loading")));
+ }, typeof isLoading === "string" ? isLoading : i18n("loading"));
}
if (displayedPartialTree.length === 0) {
return h("div", {
diff --git a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
index e57827c..cc91b31 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
+++ b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
@@ -258,10 +258,19 @@ export default class ProviderView {
} = this.plugin.getPluginState();
this.setLoading(true);
await _classPrivateFieldLooseBase(this, _withAbort)[_withAbort](async signal => {
- const enrichedTree = await PartialTreeUtils.afterFill(partialTree, path =>
- this.provider.list(path, {
- signal,
- }), this.validateSingleFile);
+ const enrichedTree = await PartialTreeUtils.afterFill(
+ partialTree,
+ path =>
+ this.provider.list(path, {
+ signal,
+ }),
+ this.validateSingleFile,
+ n => {
+ this.setLoading(this.plugin.uppy.i18n("addedNumFiles", {
+ numFiles: n,
+ }));
+ },
+ );
const aggregateRestrictionError = this.validateAggregateRestrictions(enrichedTree);
if (aggregateRestrictionError) {
this.plugin.setPluginState({
diff --git a/packages/@uppy/provider-views/lib/utils/PartialTreeUtils/afterFill.js b/packages/@uppy/provider-views/lib/utils/PartialTreeUtils/afterFill.js
index f6b93a1..59d73ee 100644
--- a/packages/@uppy/provider-views/lib/utils/PartialTreeUtils/afterFill.js
+++ b/packages/@uppy/provider-views/lib/utils/PartialTreeUtils/afterFill.js
@@ -37,7 +37,7 @@ const recursivelyFetch = async (queue, poorTree, poorFolder, apiList, validateSi
queue.add(() => recursivelyFetch(queue, poorTree, folder, apiList, validateSingleFile));
});
};
-const afterFill = async (partialTree, apiList, validateSingleFile) => {
+const afterFill = async (partialTree, apiList, validateSingleFile, reportProgress) => {
const queue = new PQueue({
concurrency: 6,
});
@@ -48,6 +48,10 @@ const afterFill = async (partialTree, apiList, validateSingleFile) => {
poorFolders.forEach(poorFolder => {
queue.add(() => recursivelyFetch(queue, poorTree, poorFolder, apiList, validateSingleFile));
});
+ queue.on("completed", () => {
+ const nOfFilesChecked = poorTree.filter(i => i.type === "file" && i.status === "checked").length;
+ reportProgress(nOfFilesChecked);
+ });
await queue.onIdle();
return poorTree;
}; |
Murderlon
approved these changes
Jul 2, 2024
@Murderlon, how do we treat End-to-end tests / Browser tests (pull_request_target) now, do we consider failing tests that do not relate to our changes flakey tests that can be ignored? This PR had 4 failing tests:
Now I reran it, and it gets 2 failing tests:
|
Ideally the tests aren't flaky and we only merge green CI. We should look into the flakyness. |
github-actions bot
added a commit
that referenced
this pull request
Jul 2, 2024
| Package | Version | Package | Version | | ---------------------- | ------------- | ---------------------- | ------------- | | @uppy/companion | 5.0.0-beta.12 | @uppy/form | 4.0.0-beta.6 | | @uppy/companion-client | 4.0.0-beta.9 | @uppy/provider-views | 4.0.0-beta.11 | | @uppy/core | 4.0.0-beta.12 | uppy | 4.0.0-beta.14 | | @uppy/drag-drop | 4.0.0-beta.5 | | | - @uppy/companion: make `oauthOrigin` option required (Mikael Finstad / #5276) - @uppy/provider-views: `afterFill()` - add loading progress (Evgenia Karunus / #5288)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reintroduces @mifi's loading progress report.
Screen.Recording.2024-06-29.at.14.01.30.mov