• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 30c6b14cf72bf2df4c2ac8a578b09d5053a0b516

14 Jul 2025 08:34AM UTC coverage: 53.548% (+0.1%) from 53.412%
30c6b14cf72bf2df4c2ac8a578b09d5053a0b516

Pull #22356

github

kyrylo-polozenko-newfold
fix: lint js
Pull Request #22356: Feature/get redirects

8217 of 14316 branches covered (57.4%)

Branch coverage included in aggregate %.

1 of 23 new or added lines in 9 files covered. (4.35%)

105 existing lines in 8 files now uncovered.

30345 of 57698 relevant lines covered (52.59%)

41381.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/js/src/redirects/components/route-layout.js
1
import { __, sprintf } from "@wordpress/i18n";
2
import { Button, Title } from "@yoast/ui-library";
3
import PropTypes from "prop-types";
4
import { LiveAnnouncer, LiveMessage } from "react-aria-live";
5
import { Helmet } from "react-helmet";
6
import { useSelectRedirects } from "../hooks";
7
import { LockClosedIcon } from "@heroicons/react/outline";
8

9
/**
10
 * Route layout wrapper with accessible title and description.
11
 * @param {Object} props The properties.
12
 * @param {JSX.node} children The children.
13
 * @param {string} title The title.
14
 * @param {JSX.node} [description] The description.
15
 * @returns {JSX.Element} The route layout component.
16
 */
17
export const RouteLayout = ( {
×
18
        children,
19
        title,
20
        description,
21
} ) => {
22
        const ariaLiveTitle = sprintf(
×
23
                /* translators: 1: Redirects' section title, 2: Yoast SEO */
24
                __( "%1$s Redirects - %2$s", "wordpress-seo" ),
25
                title,
26
                "Yoast SEO"
27
        );
28

NEW
29
        const upsellLink = useSelectRedirects( "selectLink", [], "https://yoa.st/redirect-manager-upsell" );
×
30

UNCOV
31
        return (
×
32
                <LiveAnnouncer>
33
                        <LiveMessage message={ ariaLiveTitle } aria-live="polite" />
34
                        <Helmet>
35
                                <title>{ ariaLiveTitle }</title>
36
                        </Helmet>
37
                        <header className="yst-p-8 yst-border-b yst-border-slate-200">
38
                                <div className="yst-max-w-screen-sm">
39
                                        <Title>{ title }</Title>
40
                                        { description && <p className="yst-text-tiny yst-mt-3">{ description }</p> }
×
41
                                        <Button
42
                                                as="a"
43
                                                href={ upsellLink }
44
                                                target="_blank"
45
                                                variant="upsell"
46
                                                size="large"
47
                                                className="yst-flex yst-gap-1.5 yst-mt-6 yst-w-fit"
48
                                        >
49
                                                <LockClosedIcon className="yst-w-4 yst-h-4" />
50
                                                <span>{ __( "Unlock with Premium", "wordpress-seo" ) }</span>
51
                                        </Button>
52
                                </div>
53
                        </header>
54
                        { children }
55
                </LiveAnnouncer>
56
        );
57
};
58

59
RouteLayout.propTypes = {
×
60
        children: PropTypes.node.isRequired,
61
        title: PropTypes.string.isRequired,
62
        description: PropTypes.node,
63
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc