Studio: Allow to start the import when there is already a process in progress from onClick - #775
Merged
katinthehatsite merged 1 commit intoJan 9, 2025
Conversation
fredrikekelund
left a comment
Contributor
There was a problem hiding this comment.
Nice catch, and this change works as expected 👍
However, I think it'd make sense to solve this at a more foundational level. The entire "main view" component tree should re-render when we switch sites, IMO. If it did, it would also resolve this problem, since React would instantiate a new <input>.
Changing the key prop passed to TabPanel accomplishes that:
diff --git a/src/components/site-content-tabs.tsx b/src/components/site-content-tabs.tsx
index c95f8b6..56cebb2 100644
--- a/src/components/site-content-tabs.tsx
+++ b/src/components/site-content-tabs.tsx
@@ -41,7 +41,7 @@ export function SiteContentTabs() {
orientation="horizontal"
onSelect={ ( tabName ) => setSelectedTab( tabName as TabName ) }
initialTabName={ selectedTab }
- key={ selectedTab }
+ key={ selectedSite.id + selectedTab }
>
{ ( { name } ) => (
<div className="h-full">
fredrikekelund
approved these changes
Jan 9, 2025
fredrikekelund
left a comment
Contributor
There was a problem hiding this comment.
Approving this PR to unblock us 👍 I created https://github.com/Automattic/dotcom-forge/issues/10219 as a follow-up
Contributor
Author
|
Sounds good, thanks for the review @fredrikekelund - I will merge this for now 👍 |
katinthehatsite
deleted the
fix/import-can-not-be-started-on-multiple-sites
branch
January 9, 2025 13:10
1 task
This file contains hidden or 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
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.
Related issues
Closes https://github.com/Automattic/dotcom-forge/issues/9759
Proposed Changes
This PR ensures that multiple import processes can be started at the same time from the
Import / Exporttab for different sites. It is currently possible with the drag and drop functionality but not with file selector.Testing Instructions
npm startImport/Exporttab on Studio site AImport/Exporttab on Studio site BPre-merge Checklist