-
Notifications
You must be signed in to change notification settings - Fork 51
Add Publish banner on Overview tab for non-connected sites #2025
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
Open
epeicher
wants to merge
27
commits into
trunk
Choose a base branch
from
stu-911-studio-add-launch-your-site-in-the-main-navigation
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+105
−24
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a1a7570
Implement new site launch and import buttons
epeicher 83e3af9
Fix linting errors
epeicher d747572
Use connect button when there is a site connected
epeicher e9cd44b
Merge branch 'trunk' of github.com:Automattic/studio into update/conn…
epeicher 847efa4
Simplify state, update button text and fix tests
epeicher c643361
Update wording, reuse ConnectButton component
epeicher 59dd4f4
Add a new type and simplify code
epeicher 42d50c4
Fix types
epeicher 2e3fea4
Simplify logic
epeicher 304b9a7
Remove superfluous comment and simplify
epeicher 3ee87ae
Merge branch 'trunk' of github.com:Automattic/studio into update/conn…
epeicher 53b7a23
Use strict equality operator
epeicher e276491
Use local variable to avoid non-null assertion
epeicher 014d956
Merge branch 'trunk' of github.com:Automattic/studio into update/conn…
epeicher bb66758
Simplify logic for selecting sites, fix typo
epeicher 38d8ae4
Move SyncModalMode piece of state to Redux
epeicher c5bca9b
Apply code review suggestion, use Next for Sync dialog button
epeicher 445ab73
Publish on Overview tab for non-connected sites
epeicher 706b4f7
Fix tests
epeicher 5a03ffc
Merge branch 'trunk' of github.com:Automattic/studio into stu-911-stu…
epeicher e2a165a
Updated colors, wording and added interpolate for RTL as per review
epeicher a992626
Move button to header actions
epeicher c800873
Fix issue navigating to the sync tab
epeicher 8c1fe68
Fix issue with refresh not navigating to Sync tab
epeicher e182f7e
Fix issue with merge
epeicher 606a77e
Code review suggestions
epeicher 9386f72
Add cloudUpload icon to Publish site button
epeicher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { globe, cloudUpload } from '@wordpress/icons'; | ||
| import { useI18n } from '@wordpress/react-i18n'; | ||
| import Button from 'src/components/button'; | ||
| import { useSyncSites } from 'src/hooks/sync-sites'; | ||
| import { useContentTabs } from 'src/hooks/use-content-tabs'; | ||
| import { useAppDispatch } from 'src/stores'; | ||
| import { connectedSitesActions, useConnectedSitesData } from 'src/stores/sync'; | ||
| import { Tooltip } from './tooltip'; | ||
|
|
||
| export const PublishSiteButton = () => { | ||
| const { __ } = useI18n(); | ||
| const dispatch = useAppDispatch(); | ||
| const { setSelectedTab } = useContentTabs(); | ||
| const { connectedSites } = useConnectedSitesData(); | ||
| const { isAnySitePulling, isAnySitePushing } = useSyncSites(); | ||
| const isAnySiteSyncing = isAnySitePulling || isAnySitePushing; | ||
| const handlePublishClick = () => { | ||
| setSelectedTab( 'sync' ); | ||
| dispatch( connectedSitesActions.openModal( 'push' ) ); | ||
| }; | ||
|
|
||
| if ( connectedSites.length !== 0 ) return null; | ||
epeicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return ( | ||
| <Tooltip | ||
epeicher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| disabled={ ! isAnySiteSyncing } | ||
| text={ __( | ||
| 'Another site is syncing. Please wait for the sync to finish before you publish your site.' | ||
| ) } | ||
| placement="left" | ||
| > | ||
| <Button | ||
| variant="primary" | ||
| disabled={ isAnySiteSyncing } | ||
| aria-label={ __( 'Publish site' ) } | ||
| onClick={ handlePublishClick } | ||
| icon={ cloudUpload } | ||
| > | ||
| { __( 'Publish site' ) } | ||
| </Button> | ||
| </Tooltip> | ||
| ); | ||
| }; | ||
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.