Skip to content

Feat/update layout redirects #22319

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
wants to merge 6 commits into
base: feature/redirection20
Choose a base branch
from

Conversation

kyrylo-polozenko-newfold
Copy link

@kyrylo-polozenko-newfold kyrylo-polozenko-newfold commented May 28, 2025

Context

This PR introduces the initial structure for the Redirections feature in the application. The goal is to establish a foundation for managing and displaying redirections within the admin interface.

Summary

This PR can be summarized in the following changelog entry:

Adds the basic structure and UI for the Redirections page in the WordPress SEO plugin.
Some components were also moved to the shared layer and reused on the settings and redirects pages

UI changes

This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

React frontend structure

@kyrylo-polozenko-newfold kyrylo-polozenko-newfold added UI change PRs that result in a change in the UI changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog labels May 28, 2025
@enricobattocchi enricobattocchi added this to the feature/redirection20 milestone May 29, 2025
@@ -245,9 +245,6 @@ Content.propTypes = {
articleTypeOptions: schemaTypeOptionsPropType.isRequired,
showArticleTypeInput: PropTypes.bool.isRequired,
additionalHelpTextLink: PropTypes.string.isRequired,
helpTextLink: PropTypes.string.isRequired,
helpTextTitle: PropTypes.string.isRequired,
helpTextDescription: PropTypes.string.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope

@@ -227,7 +227,7 @@ WincherUpgradeCalloutDescription.propTypes = {
*
* @returns {wp.Element | null} The Wincher upgrade callout.
*/
const WincherUpgradeCallout = ( { onClose, isTitleShortened, trackingInfo } ) => {
const WincherUpgradeCallout = ( { onClose = () => {}, isTitleShortened = false, trackingInfo = {} } ) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope

@@ -15,7 +15,7 @@ import TextInput from "../../base/text-input";
*
* @returns {WPElement} A wrapped TextInput for the social inputs.
*/
export default function SocialInput( { id, onChange, socialMedium, isDisabled, ...restProps } ) {
export default function SocialInput( { id = "", onChange = () => {}, socialMedium = "", isDisabled = false, ...restProps } ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope, should be in a separate PR.

@@ -17,7 +17,7 @@ import { STORE_NAME } from "../constants";
*
* @returns {JSX.Element} The alert item component.
*/
const AlertItem = ( { id, nonce, dismissed, message } ) => {
const AlertItem = ( { id = "", nonce = "", dismissed = false, message = "" } ) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope, should be in a separate PR.

@@ -10,7 +10,7 @@ import { useSelectGeneralPage } from "../hooks";
* @param {JSX.node} children The children.
* @returns {JSX.Element} The element.
*/
export const SidebarLayout = ( { contentClassName, children } ) => {
export const SidebarLayout = ( { contentClassName = "", children = null } ) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope, should be in a separate PR.

className="yst-button yst-button--secondary yst-min-h-[40px]"
>
{ __( "Apply", "wordpress-seo" ) }
</button>
Copy link
Contributor

@vraja-pro vraja-pro May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Button from UI-Library? If it's necessary, please mention in the PR technical choices.

className="yst-button yst-button--secondary yst-min-h-[40px]"
>
{ __( "Filter", "wordpress-seo" ) }
</button>
Copy link
Contributor

@vraja-pro vraja-pro May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, we can use Button from ui library with variant = seconday.

<div className="yst-paper yst-grow yst-max-w-page">
<div className="yst-space-y-6 yst-mb-8 xl:yst-mb-0">
<main>
<AppRoutes pathname={ pathname } />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we don't need to pass pathname as a prop if we can get it from useLocation?

className="yst-pointer-events-none yst-absolute yst-top-3.5 yst-start-4 yst-h-5 yst-w-5 yst-text-slate-400"
{ ...ariaSvgProps }
/>
<Combobox.Input
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's an autocomplete, you can use the component from ui-library.

</>;
};

Search.propTypes = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

propTypes is no longer required, we are moving away from propTypes.

), [] );

return <>
<button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Ui-library button

* @param {string} [props.buttonId] - The ID attribute for the search button.
* @param {string} [props.modalId] - The ID attribute for the modal dialog.
* @param {string} [props.userLocale] - The user's locale, used for locale-sensitive operations.
* @param {Array<Object>} props.queryableSearchIndex - The searchable index data to query against.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify the object property with JS docs: typedef

@enricobattocchi
Copy link
Member

Hey @kyrylo-polozenko-newfold, my teammate @vraja-pro left a first round of comments above
One thing that's not clear to us is that in some files you have added the default values for params for unrelated components, I suppose it was because eslint was complaining? If so, you should probably try to fix any error/warning in the components you are introducing to avoid conflicts - we are in the process to fix the other warnings so there could be some overlap...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog UI change PRs that result in a change in the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants