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

Yoast / wordpress-seo / 98930749cbba4cdb77063ec9741855742f55945e

25 Nov 2024 01:32PM CUT coverage: 27.129%. First build
98930749cbba4cdb77063ec9741855742f55945e

Pull #21860

github

web-flow
Merge 51428cf2b into c5f6c46ec
Pull Request #21860: Dashboard: UX feedback

1706 of 7451 branches covered (22.9%)

Branch coverage included in aggregate %.

0 of 14 new or added lines in 3 files covered. (0.0%)

3862 of 13073 relevant lines covered (29.54%)

8.47 hits per line

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

0.0
/packages/js/src/dashboard/scores/components/score-content.js
1
import { SkeletonLoader } from "@yoast/ui-library";
2
import { ContentStatusDescription } from "./content-status-description";
3
import { ScoreChart, ScoreChartSkeletonLoader } from "./score-chart";
4
import { ScoreList, ScoreListSkeletonLoader } from "./score-list";
5

6
/**
7
 * @type {import("../index").Score} Score
8
 * @type {import("../index").ScoreType} ScoreType
9
 */
10

11
/**
12
 * @type {{container: string, list: string, chart: string}}
13
 */
NEW
14
const CLASSNAMES = {
×
15
        container: "yst-flex yst-flex-col @md:yst-flex-row yst-gap-12 yst-mt-6",
16
        list: "yst-grow",
17
        // Calculation: (line-height 1rem + py 0.375rem * 2) * 4 + (spacing 0.75rem * 2 + border 1px ) * 3 = 11.5rem + 3px.
18
        chart: "yst-w-[calc(11.5rem+3px)] yst-aspect-square",
19
};
20

21
/**
22
 * @returns {JSX.Element} The element.
23
 */
24
const ScoreContentSkeletonLoader = () => (
×
25
        <>
×
26
                <SkeletonLoader className="yst-w-full">&nbsp;</SkeletonLoader>
27
                <div className={ CLASSNAMES.container }>
28
                        <ScoreListSkeletonLoader className={ CLASSNAMES.list } />
29
                        <ScoreChartSkeletonLoader className={ CLASSNAMES.chart } />
30
                </div>
31
        </>
32
);
33

34
/**
35
 * @param {Score[]} [scores=[]] The scores.
36
 * @param {boolean} isLoading Whether the scores are still loading.
37
 * @param {Object.<ScoreType,string>} descriptions The descriptions.
38
 * @returns {JSX.Element} The element.
39
 */
40
export const ScoreContent = ( { scores = [], isLoading, descriptions } ) => {
×
41
        if ( isLoading ) {
×
42
                return <ScoreContentSkeletonLoader />;
×
43
        }
44

45
        return (
×
46
                <>
47
                        <ContentStatusDescription scores={ scores } descriptions={ descriptions } />
48
                        <div className={ CLASSNAMES.container }>
49
                                { scores && <ScoreList className={ CLASSNAMES.list } scores={ scores } /> }
×
50
                                { scores && <ScoreChart className={ CLASSNAMES.chart } scores={ scores } /> }
×
51
                        </div>
52
                </>
53
        );
54
};
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