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

Yoast / wordpress-seo / 185dea24014f3cd699a1e8ad1ec1fcf7233b9dc6

18 Nov 2025 03:12PM UTC coverage: 30.979%. First build
185dea24014f3cd699a1e8ad1ec1fcf7233b9dc6

Pull #22726

github

web-flow
Merge 46211d5fb into f28d94ec2
Pull Request #22726: 842 task list create the redux slice

2511 of 9449 branches covered (26.57%)

Branch coverage included in aggregate %.

5 of 51 new or added lines in 4 files covered. (9.8%)

5173 of 15355 relevant lines covered (33.69%)

6.67 hits per line

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

12.5
/packages/js/src/general/components/task.js
1
import { TaskRow, TaskModal } from "@yoast/dashboard-frontend";
2
import { useToggleState } from "@yoast/ui-library";
3
import { useCallback } from "@wordpress/element";
4
import { useDispatch } from "@wordpress/data";
5
import { STORE_NAME } from "../constants";
6
import { get } from "lodash";
7

8
/**
9
 * The Task component to display a task row and modal.
10
 *
11
 * @param {string} title The title of the task.
12
 * @param {string} id The ID of the task.
13
 * @param {string} how The how copy.
14
 * @param {string} why The why copy.
15
 * @param {number} duration The duration in minutes.
16
 * @param {string} priority The priority: 'low', 'medium', 'high'.
17
 * @param {boolean} isCompleted Whether the task is completed.
18
 * @param {Function} onClick Function to call when the row is clicked.
19
 * @param {Object} callToAction The call to action props object.
20
 *
21
 * @returns {JSX.Element} The Task component.
22
 */
23
export const Task = ( { title, id, how, why, duration, priority, isCompleted, callToAction } ) => {
2✔
NEW
24
        const [ isOpen, toggleOpen ] = useToggleState( false );
×
NEW
25
        const { completeTask } = useDispatch( STORE_NAME );
×
26

NEW
27
        const nonce = get( window, "wpseoScriptData.dashboard.nonce", "" );
×
28

NEW
29
        const handleCompleteTask = useCallback( async() => {
×
NEW
30
                completeTask( id, "/wp-json/yoast/v1/complete_task", nonce );
×
31
        }, [ nonce ] );
32

NEW
33
        const callToActionProps = {
×
34
                onClick: handleCompleteTask,
35
                ...callToAction,
36
        };
NEW
37
        return <>
×
38
                <TaskRow
39
                        title={ title }
40
                        duration={ duration }
41
                        priority={ priority }
42
                        isCompleted={ isCompleted }
43
                        onClick={ toggleOpen }
44
                />
45
                <TaskModal
46
                        isOpen={ isOpen }
47
                        onClose={ toggleOpen }
48
                        title={ title }
49
                        duration={ duration }
50
                        priority={ priority }
51
                        why={ why }
52
                        how={ how }
53
                        isCompleted={ isCompleted }
54
                        taskId={ id }
55
                        callToAction={ callToActionProps }
56
                />
57
        </>;
58
};
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

© 2026 Coveralls, Inc