-
Notifications
You must be signed in to change notification settings - Fork 798
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
Remove duplicate views: Show notices #40609
Open
mmtr
wants to merge
1
commit into
trunk
Choose a base branch
from
update/remove-duplicate-views-notices
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.
+186
−0
Open
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions
4
projects/packages/jetpack-mu-wpcom/changelog/update-remove-duplicate-views-notices
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Remove duplicate views: Show notices |
36 changes: 36 additions & 0 deletions
36
...es/jetpack-mu-wpcom/src/features/wpcom-admin-interface/removed-calypso-screen-notice.scss
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.components-modal__frame.removed-calypso-screen-notice { | ||
width: 512px; | ||
|
||
.removed-calypso-screen-notice__image { | ||
background-color: #7b90ff; | ||
padding-top: 60px; | ||
padding-left: 32px; | ||
padding-right: 32px; | ||
|
||
img { | ||
border-top-left-radius: 4px; | ||
border-top-right-radius: 4px; | ||
width: 100%; | ||
display: block; | ||
} | ||
} | ||
|
||
h1 { | ||
font-weight: 500; | ||
font-size: 20px; | ||
line-height: 24px; | ||
margin: 16px 0; | ||
padding: 8px 32px 0; | ||
color: #1e1e1e; | ||
} | ||
|
||
p { | ||
line-height: 20px; | ||
margin: 0 0 16px; | ||
padding: 0 32px; | ||
color: #1e1e1e; | ||
} | ||
} | ||
|
||
|
||
|
70 changes: 70 additions & 0 deletions
70
...ges/jetpack-mu-wpcom/src/features/wpcom-admin-interface/removed-calypso-screen-notice.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* global removedCalypsoScreenNoticeConfig */ | ||
|
||
import { Guide } from '@wordpress/components'; | ||
import { createRoot, useState } from '@wordpress/element'; | ||
import { __, sprintf } from '@wordpress/i18n'; | ||
import { addQueryArgs } from '@wordpress/url'; | ||
import './removed-calypso-screen-notice.scss'; | ||
|
||
const Notice = () => { | ||
const [ isOpen, setIsOpen ] = useState( true ); | ||
|
||
if ( ! isOpen ) { | ||
return null; | ||
} | ||
|
||
const dismiss = () => { | ||
setIsOpen( false ); | ||
fetch( | ||
addQueryArgs( removedCalypsoScreenNoticeConfig.ajaxUrl, { | ||
action: 'wpcom_dismiss_removed_calypso_screen_notice', | ||
_ajax_nonce: removedCalypsoScreenNoticeConfig.dismissNonce, | ||
screen: removedCalypsoScreenNoticeConfig.screen, | ||
} ) | ||
); | ||
}; | ||
|
||
const title = sprintf( | ||
// translators: %s: page name | ||
__( 'A better %s view for everyone', 'jetpack-mu-wpcom' ), | ||
removedCalypsoScreenNoticeConfig.title | ||
); | ||
|
||
return ( | ||
<Guide | ||
className="removed-calypso-screen-notice" | ||
contentLabel={ title } | ||
finishButtonText={ __( 'Got it', 'jetpack-mu-wpcom' ) } | ||
onFinish={ dismiss } | ||
pages={ [ | ||
{ | ||
image: ( | ||
<div className="removed-calypso-screen-notice__image"> | ||
<img alt="" src={ removedCalypsoScreenNoticeConfig.imageUrl } /> | ||
</div> | ||
), | ||
content: ( | ||
<> | ||
<h1>{ title }</h1> | ||
<p> | ||
{ sprintf( | ||
// translators: %s: page name | ||
__( | ||
"We've switched to the standard WordPress %s view to bring you improvements that also benefit the entire WordPress community.", | ||
'jetpack-mu-wpcom' | ||
), | ||
removedCalypsoScreenNoticeConfig.title | ||
) } | ||
</p> | ||
</> | ||
), | ||
}, | ||
] } | ||
/> | ||
); | ||
}; | ||
|
||
const container = document.createElement( 'div' ); | ||
document.body.appendChild( container ); | ||
const root = createRoot( container ); | ||
root.render( <Notice /> ); |
Binary file added
BIN
+59.8 KB
projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-interface/screens/edit-php.webp
Binary file not shown.
Binary file added
BIN
+28.6 KB
...-wpcom/src/features/wpcom-admin-interface/screens/edit-phppost_typejetpack-portfolio.webp
Binary file not shown.
Binary file added
BIN
+24.7 KB
...pcom/src/features/wpcom-admin-interface/screens/edit-phppost_typejetpack-testimonial.webp
Binary file not shown.
Binary file added
BIN
+56.3 KB
...ck-mu-wpcom/src/features/wpcom-admin-interface/screens/edit-tags-phptaxonomycategory.webp
Binary file not shown.
Binary file added
BIN
+136 KB
...ck-mu-wpcom/src/features/wpcom-admin-interface/screens/edit-tags-phptaxonomypost_tag.webp
Binary file not shown.
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
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
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.
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.
Just out of curiosity, what happens if we don't remove the filers before getting the options?
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.
The notices would be displayed to users currently using the classic view (i.e. tangled wp-admin) or the classic admin interface (i.e. untangled wp-admin).