Skip to content

Commit

Permalink
Merge branch 'trunk' into add/show-sell-with-woo-tour
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran92 authored Mar 21, 2024
2 parents 84713c1 + 35a661e commit 9fead14
Show file tree
Hide file tree
Showing 43 changed files with 1,457 additions and 1,318 deletions.
5 changes: 4 additions & 1 deletion assets/admin/tour/components/sensei-tour-kit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ function SenseiTourKit( {

const config = {
steps,
closeHandler: () => setTourShowStatus( false, true, tourName ),
closeHandler: () => {
removeHighlightClasses();
setTourShowStatus( false, true, tourName );
},
options: {
effects: {
spotlight: null,
Expand Down
7 changes: 7 additions & 0 deletions assets/admin/tour/components/sensei-tour-kit/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import SenseiTourKit from './index';
import getTourSteps from '../../course-tour/steps';
import { removeHighlightClasses } from '../../helper';
/**
* External dependencies
*/
Expand All @@ -26,6 +27,8 @@ jest.mock( '@wordpress/data', () => ( {
useSelect: jest.fn().mockImplementation( () => ( {} ) ),
} ) );

jest.mock( '../../helper' );

const mockFunction = jest.fn();

describe( 'SenseiTourKit', () => {
Expand Down Expand Up @@ -105,6 +108,9 @@ describe( 'SenseiTourKit', () => {

test( 'should close the tour when closeHandler is called', () => {
const setTourShowStatus = jest.fn();
const removeHighlight = jest.fn();

removeHighlightClasses.mockImplementation( removeHighlight );

useDispatch.mockReturnValue( { setTourShowStatus } );

Expand All @@ -119,6 +125,7 @@ describe( 'SenseiTourKit', () => {
true,
'test-tour'
);
expect( removeHighlight ).toHaveBeenCalled();
} );

test( 'should call the event log function when step is viewed', () => {
Expand Down
13 changes: 8 additions & 5 deletions assets/admin/tour/lesson-tour/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,14 @@ export default function getTourSteps() {
// Focus on answer feedback field and highlight answer feedback areas.
{
action: () => {
document
.querySelector(
'.sensei-lms-question__answer-feedback__content .block-editor-rich-text__editable'
)
.focus();
const correctAnswerField = document.querySelector(
'.sensei-lms-question__answer-feedback__content .block-editor-rich-text__editable'
);

correctAnswerField.focus();
correctAnswerField.scrollIntoView( {
block: 'center',
} );

highlightElementsWithBorders( [
'.sensei-lms-question__answer-feedback--correct',
Expand Down
11 changes: 9 additions & 2 deletions assets/admin/tour/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
@import '@automattic/tour-kit/dist/esm/styles.scss';
@import '@automattic/tour-kit/dist/esm/variants/wpcom/styles.scss';

.wpcom-tour-kit .tour-kit-frame__container {
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.25);

&:hover {
z-index: 9999999999;
}
}

.wpcom-tour-kit-step-card {
.wpcom-tour-kit-step-card-overlay-controls {
padding-bottom: 0;
Expand All @@ -19,8 +27,7 @@ $border-color: var(--wp--preset--color--primary, currentcolor);
box-shadow: 0 0 $shadow-width $border-color !important;

&.sensei-tour-highlight--inset {
outline: none !important;
box-shadow: inset 0 0 $shadow-width $border-color !important;;
box-shadow: inset 0 0 $shadow-width $border-color !important;
}
}

Expand Down
25 changes: 25 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
*** Changelog ***

## 4.22.0 - 2024-03-20
### Added
- Added Course onboarding tour [#7535](https://github.com/Automattic/sensei/pull/7535)
- Added Lesson Quiz onboarding tour [#7538](https://github.com/Automattic/sensei/pull/7538)
- Add toggle to pre-publish panel to publish associated lessons when the course is published [#7536](https://github.com/Automattic/sensei/pull/7536)
- Display warning when there are no layouts available. [#7530](https://github.com/Automattic/sensei/pull/7530)

### Changed
- Tweak "Configure learning mode" task description [#7540](https://github.com/Automattic/sensei/pull/7540)
- Updated styles for module title and lesson title in Course Outline block [#7068](https://github.com/Automattic/sensei/pull/7068)

### Removed
- Remove "Customize your lesson template" from task list [#7539](https://github.com/Automattic/sensei/pull/7539)

### Fixed
- Address the issue of patterns flickering in the editor wizard on WPCOM sites [#7511](https://github.com/Automattic/sensei/pull/7511)
- Contact Teacher and Conditional Content block not appearing in Site Editor when Gutenberg is enabled [#7541](https://github.com/Automattic/sensei/pull/7541)
- Email subject with special characters not being displayed correctly [#7546](https://github.com/Automattic/sensei/pull/7546)
- Email Template showing up as default template in editor when GB is installed [#7517](https://github.com/Automattic/sensei/pull/7517)
- Ensure that default passing grade will be "0" for any situation [#7524](https://github.com/Automattic/sensei/pull/7524)
- Fix lesson bulk edit. [#7515](https://github.com/Automattic/sensei/pull/7515)
- Fix Sensei Pro question type not displaying in filter and table on Questions page [#7544](https://github.com/Automattic/sensei/pull/7544)
- Ignore Passing Grade for answer feedback when Pass Required is turned off [#7525](https://github.com/Automattic/sensei/pull/7525)
- WPML: Create quiz and question translations, update relations [#7480](https://github.com/Automattic/sensei/pull/7480)

## 4.21.0 - 2024-02-26
### Added
- Add existing lessons in Course Outline [#7368](https://github.com/Automattic/sensei/pull/7368)
Expand Down
4 changes: 0 additions & 4 deletions changelog/add-ability-to-set-font-size-for-subheader

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-answer-feedback

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-default-quiz-passmark

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-editor-layout-with-divi

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-email-post-type-being-set-for-all-posts

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-encoded-email-subject

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-lesson-bulk-edit

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-ordering-question-type

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-patterns-flicker-on-wpcom

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-wpml-quiz

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/update-learning-mode-task-description

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/update-remove-customize-lesson-template-task

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/update-save-lessons-on-course-save

This file was deleted.

2 changes: 1 addition & 1 deletion includes/admin/class-sensei-course-pre-publish-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Class that handles the pre-publish panel for courses.
*
* @since $$next-version$$
* @since 4.22.0
*/
class Sensei_Course_Pre_Publish_Panel {
/**
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/class-sensei-editor-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public function register_post_metas() {
*
* @access private
*
* @deprecated $$next-version$$ use Sensei_Editor_Wizard::enqueue_editor_wizard_assets instead.
* @deprecated 4.22.0 use Sensei_Editor_Wizard::enqueue_editor_wizard_assets instead.
*/
public function enqueue_admin_scripts( $hook_suffix ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
_deprecated_function( __METHOD__, '$$next-version$$', 'Sensei_Editor_Wizard::enqueue_editor_wizard_assets' );
_deprecated_function( __METHOD__, '4.22.0', 'Sensei_Editor_Wizard::enqueue_editor_wizard_assets' );

$this->enqueue_editor_wizard_assets();
}
Expand Down
16 changes: 8 additions & 8 deletions includes/admin/class-sensei-tour.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Class that handles editor wizards.
*
* @since $$next-version$$
* @since 4.22.0
*/
class Sensei_Tour {

Expand All @@ -34,7 +34,7 @@ private function __construct() {
/**
* Fetches an instance of the class.
*
* @since $$next-version$$
* @since 4.22.0
*
* @return self
*/
Expand All @@ -49,7 +49,7 @@ public static function instance() {
/**
* Initializes the class.
*
* @since $$next-version$$
* @since 4.22.0
*/
public function init() {
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] );
Expand All @@ -72,7 +72,7 @@ public function enqueue_admin_scripts( $hook ) {
) {
$handle = "sensei-$post_type-tour";
$tour_loaders[ $handle ] = [
'minimum_install_version' => '$$next-version$$', // TODO: Add different version for lesson tour later if needed.
'minimum_install_version' => '4.22.0',
'callback' => $this->get_course_lesson_tour_enqueue_callback( $post_type, $handle ),
];
}
Expand All @@ -82,7 +82,7 @@ public function enqueue_admin_scripts( $hook ) {
*
* @hook sensei_tour_loaders Load tours for Sensei.
*
* @since $$next-version$$
* @since 4.22.0
*
* @param {array} $tour_loaders The tour loaders.
*
Expand All @@ -109,7 +109,7 @@ public function enqueue_admin_scripts( $hook ) {
*
* @hook sensei_tour_is_complete Check if a tour is complete.
*
* @since $$next-version$$
* @since 4.22.0
*
* @param {bool} $is_tour_complete The tour completion status.
* @param {string} $tour_id The tour ID.
Expand All @@ -134,7 +134,7 @@ public function enqueue_admin_scripts( $hook ) {
/**
* Set tour status for user.
*
* @since $$next-version$$
* @since 4.22.0
*
* @param string $tour_id The tour ID.
* @param bool $status The tour status.
Expand All @@ -161,7 +161,7 @@ public function set_tour_completion_status( $tour_id, $status, $user_id = 0 ) {
/**
* Get tour status for user.
*
* @since $$next-version$$
* @since 4.22.0
*
* @param string $tour_id The tour ID.
* @param int $user_id The user ID.
Expand Down
6 changes: 3 additions & 3 deletions includes/class-sensei-course-structure.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,19 +593,19 @@ private function create_quiz( int $lesson_id ) {
*
* @since 4.20.1
*
* @deprecated $$next-version$$ Use sensei_quiz_create instead.
* @deprecated 4.22.0 Use sensei_quiz_create instead.
*
* @hook sensei_course_structure_quiz_created
*
* @param {int} $quiz_id Quiz post ID.
* @param {int} $lesson_id Course post ID.
*/
do_action_deprecated( 'sensei_course_structure_quiz_created', array( $quiz_id, $lesson_id ), '$$next-version$$', 'sensei_quiz_create' );
do_action_deprecated( 'sensei_course_structure_quiz_created', array( $quiz_id, $lesson_id ), '4.22.0', 'sensei_quiz_create' );

/**
* Fires after a quiz is created while saving the course structure.
*
* @since $$next-version$$
* @since 4.22.0
*
* @hook sensei_quiz_create
*
Expand Down
2 changes: 1 addition & 1 deletion includes/class-sensei-feature-flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Sensei_Feature_Flags {
'course_outline_ai' => true,
'tutor_ai' => true,
'experimental_features_ui' => true,
'onboarding_tour' => false,
'onboarding_tour' => true,
],
'development' => [
'enrolment_provider_tooltip' => false,
Expand Down
2 changes: 1 addition & 1 deletion includes/class-sensei-lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ public function quiz_update( $post_id ) {
/**
* Fires after a quiz is created while saving a lesson in a non-block editor.
*
* @since $$next-version$$
* @since 4.22.0
*
* @hook sensei_quiz_create
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function save_quiz( WP_REST_Request $request ) {
/**
* Fires after a quiz is created via the REST API.
*
* @since $$next-version$$
* @since 4.22.0
*
* @hook sensei_quiz_create
*
Expand Down
4 changes: 2 additions & 2 deletions includes/rest-api/class-sensei-rest-api-tour-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Sensei Tour API.
*
* @package sensei
* @since $$next-version$$
* @since 4.22.0
*/

namespace Sensei\Admin\Tour;
Expand All @@ -15,7 +15,7 @@
/**
* Sensei Tour REST API endpoints.
*
* @since $$next-version$$
* @since 4.22.0
*/
class Sensei_REST_API_Tour_Controller extends \WP_REST_Controller {

Expand Down
4 changes: 2 additions & 2 deletions includes/wpml/class-course-translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* Compatibility code with WPML.
*
* @since $$next-version$$
* @since 4.22.0
*
* @internal
*/
Expand All @@ -36,7 +36,7 @@ public function init() {
/**
* Save lessons fields on course translation created.
*
* @since $$next-version$$
* @since 4.22.0
*
* @internal
*
Expand Down
Loading

0 comments on commit 9fead14

Please sign in to comment.