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

Yoast / wordpress-seo / e022658de49d4f0a857b549b111d8ae1a0466fec

19 Nov 2025 02:39PM UTC coverage: 53.179% (+0.5%) from 52.717%
e022658de49d4f0a857b549b111d8ae1a0466fec

push

github

web-flow
Merge pull request #22726 from Yoast/842-task-list-create-the-redux-slice

842 task list create the redux slice

8640 of 15947 branches covered (54.18%)

Branch coverage included in aggregate %.

7 of 57 new or added lines in 5 files covered. (12.28%)

1 existing line in 1 file now uncovered.

32376 of 61181 relevant lines covered (52.92%)

47129.33 hits per line

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

11.11
/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, useSelect } from "@wordpress/data";
5
import { STORE_NAME } from "../constants";
6
import { ASYNC_ACTION_STATUS } from "../../shared-admin/constants";
7
import { get } from "lodash";
8

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

NEW
29
        const nonce = get( window, "wpseoScriptData.dashboard.nonce", "" );
×
30

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

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