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

Yoast / wordpress-seo / 70b9888401bd509d869041fb39a61814fc34b626

21 Nov 2024 01:32PM CUT coverage: 19.826% (-34.9%) from 54.688%
70b9888401bd509d869041fb39a61814fc34b626

Pull #21833

github

web-flow
Merge 4758aaca0 into 6774f0888
Pull Request #21833: Fix admin notices in alert center

0 of 25 new or added lines in 4 files covered. (0.0%)

23 existing lines in 5 files now uncovered.

432 of 2179 relevant lines covered (19.83%)

1053269.79 hits per line

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

0.0
/packages/js/src/general/store/admin-notices.js
1
import { createSlice } from "@reduxjs/toolkit";
2
import { get } from "lodash";
3
import { getMigratingNoticeInfo } from "../../helpers/migrateNotices";
4

NEW
5
export const ADMIN_NOTICES_NAME = "adminNotices";
×
6

NEW
7
const slice = createSlice( {
×
8
        name: ADMIN_NOTICES_NAME,
9
        initialState: { notices: getMigratingNoticeInfo() },
10
        reducers: {
11
                /**
12
                 * @param {Object} state The state of the slice.
13
                 * @param {string} noticeID The ID of the notice to resolve.
14
                 * @returns {void}
15
                 */
16
                dismissNotice( state, { payload: noticeID } ) {
NEW
17
                        state.notices.map( ( notice ) => {
×
NEW
18
                                if ( notice.id === noticeID ) {
×
NEW
19
                                        notice.isDismissed = true;
×
20
                                }
21
                        } );
22
                },
23
                /**
24
                 * @param {Object} state The state of the slice.
25
                 * @param {string} noticeID The ID of the notice to unresolve.
26
                 * @returns {void}
27
                 */
28
                restoreNotice( state, { payload: noticeID } ) {
NEW
29
                        state.notices.map( ( notice ) => {
×
NEW
30
                                if ( notice.id === noticeID ) {
×
NEW
31
                                        notice.isDismissed = false;
×
32
                                }
33
                        } );
34
                },
35
        },
36
} );
37

38
/**
39
 * @returns {Object} The initial state.
40
 */
NEW
41
export const getInitialAdminNoticesState = slice.getInitialState;
×
42

NEW
43
export const adminNoticesSelectors = {
×
NEW
44
        selectNotices: state => get( state, `${ ADMIN_NOTICES_NAME }.notices`, [] ),
×
45
};
46

NEW
47
export const adminNoticesActions = slice.actions;
×
48

NEW
49
export const adminNoticesReducer = slice.reducer;
×
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