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

Yoast / wordpress-seo / bde7e8d6312c5925dd73fb29462bc0e50fd34a72

22 Jan 2025 11:58AM UTC coverage: 42.379%. First build
bde7e8d6312c5925dd73fb29462bc0e50fd34a72

Pull #21946

github

web-flow
Merge f63816306 into e158b7779
Pull Request #21946: 364 add the integration card for google site kit

1818 of 7503 branches covered (24.23%)

Branch coverage included in aggregate %.

50 of 56 new or added lines in 7 files covered. (89.29%)

20674 of 45570 relevant lines covered (45.37%)

4.28 hits per line

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

0.0
/packages/js/src/initializers/settings-store.js
1
import { combineReducers, registerStore } from "@wordpress/data";
2
import { reducers, selectors, actions } from "@yoast/externals/redux";
3
import { get } from "lodash";
4
import * as controls from "../redux/controls/dismissedAlerts";
5

6
const { currentPromotions, dismissedAlerts, isPremium, linkParams  } = reducers;
×
NEW
7
const { isAlertDismissed, getIsPremium, isPromotionActive, selectLinkParams, selectLink } = selectors;
×
8
const { dismissAlert, setCurrentPromotions, setDismissedAlerts, setLinkParams, setIsPremium } = actions;
×
9

10
/**
11
 * Populates the store.
12
 *
13
 * @param {Object} store The store to populate.
14
 *
15
 * @returns {void}
16
 */
17
function populateStore( store ) {
18
        store.dispatch( setDismissedAlerts( get( window, "wpseoScriptData.dismissedAlerts", {} ) ) );
×
19
        store.dispatch( setIsPremium( Boolean( get( window, "wpseoScriptData.isPremium", false ) ) ) );
×
20
        store.dispatch( setCurrentPromotions( get( window, "wpseoScriptData.currentPromotions", {} ) ) );
×
21
        store.dispatch( setLinkParams( get( window, "wpseoScriptData.linkParams", {} ) ) );
×
22
}
23

24
/**
25
 * Initializes the Yoast SEO settings store.
26
 *
27
 * @returns {object} The Yoast SEO settings store.
28
 */
29
export default function initSettingsStore() {
30
        const store = registerStore( "yoast-seo/settings", {
×
31
                reducer: combineReducers( {
32
                        currentPromotions,
33
                        dismissedAlerts,
34
                        isPremium,
35
                        linkParams,
36
                } ),
37
                selectors: {
38
                        isAlertDismissed,
39
                        getIsPremium,
40
                        isPromotionActive,
41
                        selectLinkParams,
42
                        selectLink,
43
                },
44
                actions: {
45
                        dismissAlert,
46
                        setCurrentPromotions,
47
                        setDismissedAlerts,
48
                        setLinkParams,
49
                        setIsPremium,
50
                },
51
                controls,
52
        } );
53

54
        populateStore( store );
×
55

56
        return store;
×
57
}
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