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

Yoast / wordpress-seo / 55dec9a111eaff1b7fe75cefc941ff84009561d0

16 Feb 2026 08:03AM UTC coverage: 53.608% (+0.6%) from 52.986%
55dec9a111eaff1b7fe75cefc941ff84009561d0

Pull #22972

github

leonidasmi
Merge trunk
Pull Request #22972: Add tasks about the SEO and readability of recent posts

8934 of 16506 branches covered (54.13%)

Branch coverage included in aggregate %.

391 of 600 new or added lines in 40 files covered. (65.17%)

1 existing line in 1 file now uncovered.

33402 of 62467 relevant lines covered (53.47%)

47894.4 hits per line

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

6.67
/packages/js/src/general/components/task.js
1
import { TaskRow } from "@yoast/dashboard-frontend";
2
import { useCallback, useMemo } from "@wordpress/element";
3
import { useDispatch, useSelect } from "@wordpress/data";
4
import { STORE_NAME } from "../constants";
5
import { values } from "lodash";
6

7
/**
8
 * The Task component to display a task row and modal.
9
 *
10
 * @param {string} title The title of the task.
11
 * @param {string} id The ID of the task.
12
 * @param {number} duration The duration in minutes.
13
 * @param {string} priority The priority: 'low', 'medium', 'high'.
14
 * @param {boolean} isCompleted Whether the task is completed.
15
 * @param {string} [badge] An optional badge to display next to the task title: `premium`, `woo`, `ai`.
16
 *
17
 * @returns {JSX.Element} The Task component.
18
 */
19
export const Task = ( { title, id, duration, priority, isCompleted, badge } ) => {
2✔
NEW
20
        const { resetTaskError, setCurrentOpenTask } = useDispatch( STORE_NAME );
×
21

NEW
22
        const tasks = useSelect( ( select ) => select( STORE_NAME ).selectTasks(), [] );
×
NEW
23
        const childTasks = values( tasks ).filter( task => id && task.parentTaskId === id );
×
24

NEW
25
        const totalTasks = useMemo( () => {
×
NEW
26
                return childTasks.length;
×
27
        }, [ childTasks ] );
28

NEW
29
        const completedTasks = useMemo( () => {
×
NEW
30
                return childTasks.filter( ( task ) => task.isCompleted ).length;
×
31
        }, [ childTasks ] );
32

33
        const handleOnOpen = useCallback( () => {
×
34
                resetTaskError( id );
×
NEW
35
                setCurrentOpenTask( id );
×
36
        }, [ resetTaskError, setCurrentOpenTask, id ] );
37

38
        return <TaskRow
×
39
                title={ title }
40
                duration={ duration }
41
                priority={ priority }
42
                isCompleted={ isCompleted }
43
                onClick={ handleOnOpen }
44
                completedTasks={ completedTasks }
45
                totalTasks={ totalTasks }
46
                badge={ badge }
47
        />;
48
};
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