-
Notifications
You must be signed in to change notification settings - Fork 49
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
Feat / IA for Newsletters #3490
Conversation
@miguelpeixe - I assigned you in Asana. I'll reach out in slack. |
Addressing the remaining work:
I've settled on using Gutenberg's envelope with proper styles to match different states:
The menu order handling has been refactored in #3501 and merged to this PR.
This seems like a very edge case, which I didn't tackle here. If this becomes a problem, we can setup redirects later on.
This wizard should reflect the react version, under Engagement, not the one coming from the Newsletters plugin. The Newsletters version should remain unchanged and available in case the main plugin is not installed. I've refactored this PR to move the wizard from the Engagement tab to the root level under the Newsletters menu. This also means moving the methods from To match the proposed tabs with "Tracking", a new wizard was created for those settings:
We were also missing the wizard header when creating and editing local subscription lists: Testing
|
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.
@miguelpeixe this is great!
We were also missing the wizard header when creating and editing local subscription lists:
Nice catch - thanks for adding this.
Testing
- Checkout this branch and, without the Newsletters plugin active, confirm the menu is not available
- Activate Newsletters and confirm the menu is now available
- Visit all links on the Newsletters menu and confirm the expected pages render
- Click “Newsletters -> Settings”, configure and ESP and hit Save
- Refresh the page and confirm the changes persist
- Toggle Subscription Lists and Save
- Refresh the page and confirm the changes persist
- Click “Add New” on Subscription Lists
- Confirm the editor renders with the correct wizard header
- Save the list and click “<< Back to Subscription Lists management”
- Confirm you’re back to the Settings wizard
- Navigate to the “Tracking” tab
- Toggle both options, refresh the page and confirm they persist
All tests work as described. Some feedback:
- Submenu highlighting:
- Not highlighting /wp-admin/post-new.php?post_type=newspack_nl_cpt (template select and edit screen). Should highlight "All Newsletters"?
- Not highlighting /wp-admin/post-new.php?post_type=newspack_nl_ads_cpt. Should highlight "Advertising"?
- "All Newsletters" highlighted when on Add New Lists (/wp-admin/post-new.php?post_type=newspack_nl_list) - is this intentional?
- Is Newsletters > Tracking new (not in Figma)?
- Not highlighting /wp-admin/post-new.php?post_type=newspack_nl_cpt (template select and edit screen). Should highlight "All Newsletters"?
- Newsletters > Settings
- Settings tabs missing headers. Have added suggestions below.
const [ { newslettersConfig }, updateConfiguration ] = hooks.useObjectState( {} ); | ||
const [ initialProvider, setInitialProvider ] = useState( '' ); | ||
const [ lockedLists, setLockedLists ] = useState( false ); | ||
const [ authUrl, setAuthUrl ] = useState( false ); | ||
|
||
return ( | ||
<> | ||
<NewspackNewsletters | ||
<Settings |
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.
<Settings | |
<h1>{ __( 'Newsletter Settings', 'newspack-plugin' ) }</h1> | |
<Settings |
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.
It feels like we're saying the same thing 3 times:
It's how it's proposed in the design, but since the design screen doesn't have the wizard header, maybe it slipped by. @thomasguillot could you confirm that this is the intended result?
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.
I think it's ok if we repeat things and it's to have some sort of consistency with the other wizards. We could probably the heading to simply "Settings"
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.
Which one?
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.
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.
Added in ac26dbc
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.
Like this?
Yes
|
||
return ( | ||
<> | ||
<ActionCard |
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.
<ActionCard | |
<h1>{ __( 'Newsletter Tracking', 'newspack-plugin' ) }</h1> | |
<ActionCard |
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.
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.
Same here, I'd say "Tracking" is sufficient
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.
Added in ac26dbc
Thansk for the review, @jaredrethman!
Nice catch! After some investigation I finally understood how Unfortunately, as stated in the code, I was unable to make the Settings submenu get highlighted when editing a Subscription List. The
Yes. We missed it, but it's required.
👍
Whoops! I missed it. Added in bb131a9 |
@miguelpeixe thank you for your changes/fixes.
If highlighting "Settings" when adding/editing a Subscription List is what we want it would require updating: newspack-plugin/includes/wizards/class-newsletters-wizard.php Lines 507 to 513 in bb131a9
to: if ( ! empty( $submenu_file ) && strpos( $submenu_file, 'newspack_nl_list' ) !== false ) {
return $this->slug;
} |
🤯 thank you!! Updated in f9442fb |
@jaredrethman I've also just pushed b6a9f7e to address 1205919985867982-as-1208668902916641/f There's no need to have the ESP settings ActionCard inside a div. There's no instance in which |
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.
@miguelpeixe nice work here - appreciate the revisions! Approved!
All Submissions:
Changes proposed in this Pull Request:
Once the "TODOs" below are done, this PR will complete the Information Architecture Wizard for the Newsletters Plugin. This code will update the existing Newsletters Plugin header and menu.
See screenshot:
Additionally the new Dashboards page is updated so that if the Newsletters plugin is not installed, then the dashboard will not show Newsletters items.
See screenshot:
TODOs:
We may need to change the menu icon. Export the SVG from Figma or talk to Thomas/designer. See code comment:
// @TODO get SVG from Figma? This one is "envelope" from: https://wordpress.github.io/gutenberg/?path=/story/icons-icon--library
I was having a hard time setting the Newsletters CPT parent menu item to a decimal value. It seems that CPTs only support an integer value for
menu_positon
. So I created a function that will loop throughglobal $menu
and then move the CPT to position 3.3 or "3.33" if something is already at 3.3. See the current code in functionmove_cpt_menu()
. You may want to look at functionregistered_post_type_newsletters( $post_type )
to see how I'm changing themenu_icon
but when I try to change themenu_position
to 3.3 in that function it doesn't work.I didn't have chance to fully test what happens if someone goes to a "bookmarked" category or tag page that was removed by this Wizard. I recommended we remove categories and tags from the Newsletters menu in this PR ( Feat: Information Architecture for Newsletters newspack-newsletters#1678 ) but still, even with the links removed, someone could have bookmarked any of the following links, so we may want to view them in the browser and see what the user would see. We'll probably want to remove the "blue" Newsletters header and apply the new Admin Header like this code does for the other screens.
There is an existing Newsletters admin screen in the current (trunk) Newspack Plugin. It can be seen in wp-admin
Newspack > Engagement > Newsletters
oradmin.php?page=newspack-engagement-wizard#/newsletters
. It looks to be a React version of the existing Newsletters Settings screen. Typically I'm not a fan of having different screens that do the same thing, so ... maybe we can just remove the React version when IA goes live since Newsletters already has a Settings screen? But I'm not in charge 😉 If it is kept, I'm not sure how to "plug it in" so that admin users that have the Newspack Plugin with IA active get "redirected/shown" the React version of the screen vs admin users that just use Newsletters stand-alone without the Newspack Plugin who will just see the normal settings page.Finally, I'm not sure why
ci/cirlceci:test-php
is failing in github below. Maybe it was an error that got merged into this branch viatrunk
orepic/ia
?How to test the changes in this Pull Request:
npm run build
get_settings_url()
in the related PR ( Feat: Information Architecture for Newsletters newspack-newsletters#1678 )Other information: