Skip to content

Commit a66c907

Browse files
Merge branch 'develop' into chore/bump-min-node-version
2 parents af3ee16 + d344661 commit a66c907

File tree

246 files changed

+23347
-22522
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+23347
-22522
lines changed

.distignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
.distignore
33
.editorconfig
44
.eslintignore
5-
.eslintrc.json
5+
.eslintrc.js
66
.gitignore
77
.nvmrc
8+
.phpunit.result.cache
89
composer.lock
910
docker-compose.build.yml
1011
docker-compose.yml
@@ -14,6 +15,7 @@ package-lock.json
1415
phpcs.xml.dist
1516
phpunit.xml
1617
phpunit-multisite.xml
18+
playwright.config.js
1719
renovate.json
1820
.git
1921
.github
@@ -25,3 +27,13 @@ dist
2527
local
2628
node_modules
2729
tests
30+
31+
# Playwright generated files.
32+
/artifacts/
33+
/test-results/
34+
/playwright-report/
35+
/blob-report/
36+
/playwright/.cache/
37+
38+
# JS and SCSS source files.
39+
/src/

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/ui/lib/
2-
**/*.min.js
31
/vendor/
42
/node_modules/
53
/build/

.eslintrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
extends: [
3+
'plugin:@wordpress/eslint-plugin/recommended-with-formatting',
4+
],
5+
env: {
6+
browser: true,
7+
es6: true,
8+
},
9+
rules: {
10+
'@wordpress/no-global-event-listener': 'off',
11+
'jsdoc/check-indentation': 'error',
12+
'@wordpress/dependency-group': 'error',
13+
'import/order': [ 'error', { groups: [ 'builtin', [ 'external', 'unknown' ], 'internal', 'parent', 'sibling', 'index' ] } ],
14+
'jsdoc/require-param': 'off',
15+
'jsdoc/require-param-type': 'off',
16+
'jsdoc/check-param-names': 'off',
17+
},
18+
};

.eslintrc.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/lint-and-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ jobs:
5454
- name: Lint
5555
run: npm run lint
5656

57+
- name: Build
58+
run: npm run build
59+
5760
- name: Pull custom Docker images
5861
run: docker compose pull wordpress
5962

6063
- name: Test
6164
run: npm run test
62-
63-
- name: Build
64-
run: npm run build

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ debug.log
1414
package.lock
1515
.phpunit.result.cache
1616

17-
# Compiled files
18-
ui/js/*.min.js
19-
ui/css/*.min.css
20-
alerts/js/*.min.js
21-
2217
# Generated test data
18+
/artifacts/
2319
tests/data/tmp/*
20+
/test-results/
21+
/playwright-report/
22+
/blob-report/
23+
/playwright/.cache/
24+
/playwright/.auth/

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
22

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"recommendations": [
33
"EditorConfig.EditorConfig",
44
"felixfbecker.php-debug",
5-
"ikappas.phpcs"
5+
"ms-playwright.playwright"
66
]
77
}

Gruntfile.js

Lines changed: 0 additions & 68 deletions
This file was deleted.

alerts/class-alert-type-highlight.php

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Alert_Type_Highlight extends Alert_Type {
1616

1717
/**
1818
* Main JS file script handle.
19+
*
20+
* @deprecated 4.1.0 Constant is not used anymore and will be removed.
1921
*/
2022
const SCRIPT_HANDLE = 'wp-stream-alert-highlight-js';
2123

@@ -307,34 +309,19 @@ public function ajax_remove_highlight() {
307309
* @param string $page WP admin page.
308310
*/
309311
public function enqueue_scripts( $page ) {
310-
if ( 'toplevel_page_wp_stream' === $page ) {
311-
$min = wp_stream_min_suffix();
312-
313-
wp_register_script(
314-
self::SCRIPT_HANDLE,
315-
$this->plugin->locations['url'] . 'alerts/js/alert-type-highlight.' . $min . 'js',
316-
array(
317-
'jquery',
318-
),
319-
$this->plugin->get_version(),
320-
false
321-
);
312+
if ( 'toplevel_page_wp_stream' !== $page ) {
313+
return;
314+
}
322315

323-
$exports = array(
316+
$this->plugin->enqueue_asset(
317+
'alert-type-highlight',
318+
array(),
319+
array(
324320
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
325321
'removeAction' => self::REMOVE_ACTION,
326322
'security' => wp_create_nonce( self::REMOVE_ACTION_NONCE ),
327-
);
328-
329-
wp_scripts()->add_data(
330-
self::SCRIPT_HANDLE,
331-
'data',
332-
sprintf( 'var _streamAlertTypeHighlightExports = %s;', wp_json_encode( $exports ) )
333-
);
334-
335-
wp_add_inline_script( self::SCRIPT_HANDLE, 'streamAlertTypeHighlight.init();', 'after' );
336-
wp_enqueue_script( self::SCRIPT_HANDLE );
337-
}
323+
)
324+
);
338325
}
339326

340327
/**

0 commit comments

Comments
 (0)