Skip to content

Commit

Permalink
Merge branch 'trunk' into add/php-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
m1r0 authored Aug 11, 2023
2 parents 3325bc8 + ecf3cfc commit bc7ec84
Show file tree
Hide file tree
Showing 142 changed files with 11,199 additions and 502 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ jobs:
path: playwright-report/
retention-days: 30
if-no-files-found: ignore
- name: Slack Notification on Failure
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && github.event_name == 'push' }}
env:
SLACK_CHANNEL: ${{ secrets.SLACK_JANITORIAL_CHANNEL }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'E2E Testing'
SLACK_COLOR: 'error'
SLACK_FOOTER: ''
12 changes: 10 additions & 2 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: npm ci
- name: Lint JS
run: npm run lint-types

test:
name: JS Testing
runs-on: ubuntu-latest
Expand All @@ -61,4 +61,12 @@ jobs:
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run test-js

- name: Slack Notification on Failure
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && github.event_name == 'push' }}
env:
SLACK_CHANNEL: ${{ secrets.SLACK_JANITORIAL_CHANNEL }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'JS Testing'
SLACK_COLOR: 'error'
SLACK_FOOTER: ''
16 changes: 13 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy:
fail-fast: false
fail-fast: true
max-parallel: 10
matrix:
wp: ['latest']
wpmu: [0]
php: ['7.3', '7.4', '8.0']
include:
- php: 7.3
wp: '6.0'
- php: 7.3
wp: '6.1'
- php: 7.3
wp: '6.2'
- php: 7.3
wp: latest
wpmu: 1
Expand Down Expand Up @@ -154,3 +154,13 @@ jobs:

- name: Run tests
run: ./vendor/bin/phpunit

- name: Slack Notification on Failure
uses: rtCamp/action-slack-notify@v2
if: ${{ failure() && github.event_name == 'push' }}
env:
SLACK_CHANNEL: ${{ secrets.SLACK_JANITORIAL_CHANNEL }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: 'PHP Testing'
SLACK_COLOR: 'error'
SLACK_FOOTER: ''
33 changes: 18 additions & 15 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: Trunk Workflow
on:
push:
branches:
- trunk
push:
branches:
- trunk
jobs:
unit-js:
uses: ./.github/workflows/js.yml
unit-php:
uses: ./.github/workflows/php.yml
e2e:
uses: ./.github/workflows/e2e.yml
docs:
needs: [ unit-js, unit-php, e2e ]
uses: ./.github/workflows/build-docs.yml
build:
needs: [ unit-js, unit-php, e2e ]
uses: ./.github/workflows/build.yml
unit-js:
uses: ./.github/workflows/js.yml
secrets: inherit
unit-php:
uses: ./.github/workflows/php.yml
secrets: inherit
e2e:
uses: ./.github/workflows/e2e.yml
secrets: inherit
docs:
needs: [ unit-js, unit-php, e2e ]
uses: ./.github/workflows/build-docs.yml
build:
needs: [ unit-js, unit-php, e2e ]
uses: ./.github/workflows/build.yml
3 changes: 3 additions & 0 deletions assets/css/3rd-party/themes/astra/learning-mode.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
div.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
color: inherit;
}
4 changes: 2 additions & 2 deletions assets/css/learning-mode-compat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ $breakpoint: 782px;
font-family: inherit;
font-weight: inherit;
font-size: inherit;
background-color: inherit !important;
color: inherit !important;
background-color: inherit;
color: inherit;
text-transform: unset;

&:hover {
Expand Down
7 changes: 2 additions & 5 deletions assets/css/sensei-course-theme/buttons.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

$breakpoint: 782px;

.sensei-course-theme .wp-block-buttons {
Expand All @@ -8,19 +7,17 @@ $breakpoint: 782px;
}

.sensei-course-theme__button,
.wp-block-button.is-style-outline > .wp-block-button__link,
.sensei-course-theme__link {
align-items: center;
white-space: nowrap;
width: 100%;
height: 100%;
justify-content: center;
white-space: nowrap;
width: 100%;

@media screen and (max-width: $breakpoint) {
padding: .625rem;
}


&.has-icon {
display: flex;
gap: 8px;
Expand Down
13 changes: 7 additions & 6 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
## 4.16.0 - 2023-07-13

### Added
- Enable to select how to generate lessons when a course is created [#6999]
- Enable to select how to generate lessons when a course is created [#6999](https://github.com/Automattic/sensei/pull/6999)

### Changed
- Bump minimum required PHP version to 7.3 [#7005]
- Bump minimum required PHP version to 7.3 [#7005](https://github.com/Automattic/sensei/pull/7005)

### Fixed
- Fix Continue Course block not redirecting to first lesson in some cases [#6997]
- Fix emails not using the From Name/Email settings [#6968]
- Fix PHP 8.1 autovivification of falsy value deprecation message [#7015]
- Removed Beta label from Editor Menu [#6989]
- Fix Continue Course block not redirecting to first lesson in some cases [#6997](https://github.com/Automattic/sensei/pull/6997)
- Fix emails not using the From Name/Email settings [#6968](https://github.com/Automattic/sensei/pull/6968)
- Fix PHP 8.1 autovivification of falsy value deprecation message [#7015](https://github.com/Automattic/sensei/pull/7015)
- Removed Beta label from Editor Menu [#6989](https://github.com/Automattic/sensei/pull/6989)


## 4.15.1 - 2023-06-22
### Added
Expand Down
4 changes: 4 additions & 0 deletions changelog/add-data-migrator
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Add student progress migration
4 changes: 4 additions & 0 deletions changelog/add-email-cc-bcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Add CC/BCC fields for Sensei emails.
4 changes: 4 additions & 0 deletions changelog/add-profile-links-filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Updates the `sensei_results_links` filter to include the learner's user ID when displaying public profiles and to display results links publicly.
4 changes: 4 additions & 0 deletions changelog/fix-duplicate-comment-section-in-fse-themes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix duplicate comment sections under lesson in FSE themes
5 changes: 5 additions & 0 deletions changelog/fix-grades-duplicates
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Part of progress storage feature which is not publicly released.


4 changes: 4 additions & 0 deletions changelog/fix-learning-mode-template-on-wpcom
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix lesson styling in editor on WordPress 6.3 or when Gutenberg enabled
4 changes: 4 additions & 0 deletions changelog/fix-lesson-button-colors
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix custom button colors not being applied in Learning Mode
4 changes: 4 additions & 0 deletions changelog/fix-lesson-not-using-set-template-in-fse-themes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed issue of lessons not using the selected template in FSE themes
4 changes: 4 additions & 0 deletions changelog/fix-php81-deprecation-notice
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix PHP 8.1 deprecation notice on Students page
4 changes: 4 additions & 0 deletions changelog/fix-view-results-button-not-working
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix "view results" button not working
4 changes: 4 additions & 0 deletions changelog/fix-wp-core-deprecation-messages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix `strpos`and `str_replace` deprecation messages in PHP 8.1 and 8.2
1 change: 1 addition & 0 deletions includes/3rd-party/3rd-party.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
require_once __DIR__ . '/jetpack.php';
require_once __DIR__ . '/woocommerce.php';
require_once __DIR__ . '/yoast.php';
require_once __DIR__ . '/themes/astra.php';
require_once __DIR__ . '/themes/divi.php';
require_once __DIR__ . '/themes/course.php';
24 changes: 24 additions & 0 deletions includes/3rd-party/themes/astra.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Adds additional compatibility with the Astra theme.
*
* @package 3rd-Party
*/

/**
* Enqueue Astra theme-specific Learning Mode styles.
*/
function sensei_load_learning_mode_styles_for_astra_theme() {
$course_id = Sensei_Utils::get_current_course();
$is_target_theme = 'astra' === strtolower( wp_get_theme()->get_template() );

if ( empty( $course_id ) || ! $is_target_theme ) {
return false;
}

if ( Sensei_Course_Theme_Option::has_learning_mode_enabled( $course_id ) ) {
Sensei()->assets->enqueue( 'astra-learning-mode', 'css/3rd-party/themes/astra/learning-mode.css' );
}
}

add_action( 'wp_enqueue_scripts', 'sensei_load_learning_mode_styles_for_astra_theme' );
37 changes: 22 additions & 15 deletions includes/admin/class-sensei-learners-admin-bulk-actions-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,25 @@ private function courses_select( $courses, $selected_course, $select_id = 'cours
}

/**
* Helper method to display the bulk action selector.
* Gets the HTML for the bulk action dropdown.
*
* @return string HTML for the bulk action dropdown.
*/
private function render_bulk_action_select_box() {
?>
<select id="bulk-action-selector-top" name="sensei_bulk_action_select" class="sensei-student-bulk-actions__placeholder-dropdown sensei-bulk-action-select">
<option value="0"><?php echo esc_html( __( 'Select Bulk Actions', 'sensei-lms' ) ); ?></option>
<?php
foreach ( $this->controller->get_known_bulk_actions() as $value => $translation ) {
echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $translation ) . '</option>';
}
?>
</select>
<?php
private function get_bulk_action_dropdown_html() {
$html = '';

$html .= '<select id="bulk-action-selector-top" name="sensei_bulk_action_select" class="sensei-student-bulk-actions__placeholder-dropdown sensei-bulk-action-select">';
$html .= '<option value="0">';
$html .= esc_html( __( 'Select Bulk Actions', 'sensei-lms' ) );
$html .= '</option>';

foreach ( $this->controller->get_known_bulk_actions() as $value => $translation ) {
$html .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $translation ) . '</option>';
}

$html .= '</select>';

return $html;
}

/**
Expand All @@ -388,14 +394,15 @@ public function data_table_header() {
<div class="sensei-student-bulk-actions__bulk_actions_container">
<?php
echo wp_kses(
$this->render_bulk_action_select_box(),
$this->get_bulk_action_dropdown_html(),
array(
'option' => array(
'value' => array(),
),
'select' => array(
'id' => array(),
'name' => array(),
'id' => array(),
'class' => array(),
'name' => array(),
),
)
);
Expand Down
11 changes: 10 additions & 1 deletion includes/blocks/class-sensei-block-view-results.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ public function render( $attributes, $content ): string {
return '';
}

return '<form method="get" action="' . esc_url( Sensei_Course::get_view_results_link( $course_id ) ) . '" class="sensei-block-wrapper sensei-cta">' .
$results_link = Sensei_Course::get_view_results_link( $course_id );
parse_str( wp_parse_url( $results_link, PHP_URL_QUERY ), $results_link_query_params );

$form_inputs = '';
foreach ( $results_link_query_params as $name => $value ) {
$form_inputs .= '<input type="hidden" name="' . esc_attr( $name ) . '" value="' . esc_attr( $value ) . '">';
}

return '<form method="get" action="' . esc_url( $results_link ) . '" class="sensei-block-wrapper sensei-cta">' .
$form_inputs .
preg_replace(
'/<a(.*)>/',
'<button type="submit" $1>',
Expand Down
4 changes: 2 additions & 2 deletions includes/class-sensei-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static function get_top_menu_capability() {
*/
public function add_course_order() {
add_submenu_page(
null, // Hide in menu.
'', // Hide in menu.
__( 'Order Courses', 'sensei-lms' ),
__( 'Order Courses', 'sensei-lms' ),
'manage_sensei',
Expand All @@ -147,7 +147,7 @@ public function add_course_order() {
*/
public function add_lesson_order() {
add_submenu_page(
null,
'',
__( 'Order Lessons', 'sensei-lms' ),
__( 'Order Lessons', 'sensei-lms' ),
'edit_published_lessons',
Expand Down
Loading

0 comments on commit bc7ec84

Please sign in to comment.