Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/lm-button-padding-and-gap-style
Browse files Browse the repository at this point in the history
  • Loading branch information
donnapep authored Aug 18, 2023
2 parents 2e967cc + 85297b6 commit 5ff86ad
Show file tree
Hide file tree
Showing 89 changed files with 12,938 additions and 388 deletions.
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ trim_trailing_whitespace = true
[*.{md,txt,json,yml}]
trim_trailing_whitespace = false

[*.{json}]
[*.json]
indent_size = 2
tab_width = 2

[*.{json,yml}]
insert_final_newline = false
indent_style = space

[composer.json]
indent_size = 4
tab_width = 4
indent_style = tab
insert_final_newline = true
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ jobs:
name: sensei-lms-${{ github.event.pull_request.head.sha }}
path: ${{ github.workspace }}/sensei-lms/
retention-days: 7

syntax-check:
name: PHP Syntax Check
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.3, 8.1]
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: sensei-lms-${{ github.event.pull_request.head.sha }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phplint
coverage: none

- name: Check Syntax
run: phplint ./sensei-lms
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ jobs:
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
47 changes: 47 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Psalm Test

on:
pull_request:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Psalm
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 10
matrix:
php: ['7.3', '8.2']
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get cached composer directories
uses: actions/cache@v3
with:
path: ~/.cache/composer/
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
- uses: actions/cache@v3
with:
path: vendor/
key: ${{ runner.os }}-vendor-${{ hashFiles('composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: none

- name: Install
run: composer install --no-ansi --no-interaction --prefer-dist --no-progress

- name: Run Psalm
run: ./vendor/bin/psalm
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ Before submitting a pull request, make sure that your changes follow the followi
Test your code on the minimum supported PHP and WordPress versions.
- Please ensure that any dependencies are properly handled and documented.

## Composer

- Because of possible conflicts, all required composer packages should be `scoped`. Scoping is done by copying the package to the `third-party` folder and changing its namespace to `Sensei\ThirdParty\...`. To do so, first, add the package as a dev dependency - `composer require --dev vendor/package`. Then, edit `config/scoper.inc.php` to include the new package. Keep in mind that some packages may have their dependencies, so add those as well. Finally, run `composer dump-autoload` which will initialize the scoping process.

## JavaScript and CSS

- JavaScript, JSX, and SCSS files (using [SASS](https://sass-lang.com/documentation/file.SASS_REFERENCE.html)) need to be compiled before using the plugin.
Expand Down
4 changes: 2 additions & 2 deletions assets/admin/editor-wizard/steps/lesson-patterns-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const LessonPatternsStep = ( { wizardData, ...props } ) => {
return (
<Fragment>
<PatternsStep
title={ __( 'Lesson Type', 'sensei-lms' ) }
title={ __( 'Lesson Layout', 'sensei-lms' ) }
replaces={ replaces }
{ ...props }
/>
Expand All @@ -48,7 +48,7 @@ const UpsellBlock = () => (
<LogoTreeIcon className="sensei-editor-wizard-patterns-upsell__logo" />
<div className="sensei-editor-wizard-patterns-upsell__text">
<b className="sensei-editor-wizard-patterns-upsell__title">
{ __( 'Want More Lesson Types?', 'sensei-lms' ) }
{ __( 'Want More Lesson Layouts?', 'sensei-lms' ) }
</b>
<br />
{ __(
Expand Down
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,21 +7,19 @@ $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: 20px;
line-height: 100%;
letter-spacing: -0.14px;
}


&.has-icon {
display: flex;
gap: 8px;
Expand Down
2 changes: 0 additions & 2 deletions assets/css/sensei-course-theme/quiz.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ $tablet-breakpoint: 768px;
}

&__header {
position: sticky;
top: var(--top-offset);
background-color: var(--sensei-background-color);
z-index: 100;

Expand Down
11 changes: 7 additions & 4 deletions assets/css/sensei-course-theme/sidebar-mobile-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

$breakpoint: 783px;

.sensei-course-theme__sidebar-toggle {
.single-quiz .sensei-course-theme__sidebar-toggle {
display: none;
}

.single-lesson .sensei-course-theme__sidebar-toggle {
display: block;
width: 24px;
height: 24px;
Expand All @@ -31,17 +35,17 @@ $breakpoint: 783px;
background: none;
}
}

// Desktop
@media screen and (min-width: ($breakpoint)) {
.sensei-course-theme__sidebar-toggle {
.single-lesson .sensei-course-theme__sidebar-toggle {
display: none;
}
}

// Mobile
@media screen and (max-width: ($breakpoint - 1)) {
.sensei-course-theme {

&--sidebar-open {
overflow: hidden;

Expand Down Expand Up @@ -84,6 +88,5 @@ $breakpoint: 783px;
&:not(&--sidebar-open) &__sidebar {
opacity: 0;
}

}
}
14 changes: 7 additions & 7 deletions assets/shared/structure/structure-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,27 +245,27 @@ export function registerStructureStore( {
return;
}

const isSavingPost =
editor.isSavingPost() && ! editor.isAutosavingPost();
const isSavingStructure = select(
storeName
).getIsSavingStructure();

const isSavingPost =
editor.isSavingPost() && ! editor.isAutosavingPost();
if ( isSavingPost ) {
editorStartedSaving = true;
metaSavingStarted = false;
}

if ( editorStartedSaving && ! metaSavingStarted ) {
metaSavingStarted = editPostSelector.isSavingMetaBoxes();
const isSavingMetaBoxes = editPostSelector.isSavingMetaBoxes();
if ( isSavingMetaBoxes ) {
metaSavingStarted = true;
}

if (
! structureStartedSaving &&
! isSavingPost &&
! isSavingMetaBoxes &&
editorStartedSaving &&
metaSavingStarted &&
! editPostSelector.isSavingMetaBoxes()
metaSavingStarted
) {
// Start saving structure when post has finished saving.
structureStartedSaving = true;
Expand Down
20 changes: 18 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
*** Changelog ***

## 4.16.0 - 2023-07-13
## 4.16.1 - 2023-08-15
### Added
- Add CC/BCC fields for Sensei emails [#7014](https://github.com/Automattic/sensei/pull/7014)

### Changed
- Update the `sensei_results_links` filter to include the learner's user ID when displaying public profiles and to display results links publicly [#7048](https://github.com/Automattic/sensei/pull/7048)

### Fixed
- Fix "View Results" button not working [#7058](https://github.com/Automattic/sensei/pull/7058)
- Fix custom button colors not being applied in Learning Mode [#7080](https://github.com/Automattic/sensei/pull/7080)
- Fix duplicate comment sections under lesson in FSE themes [#7044](https://github.com/Automattic/sensei/pull/7044)
- Fix lessons not using the selected template in FSE themes [#7045](https://github.com/Automattic/sensei/pull/7045)
- Fix error when the module author user is deleted [#7082](https://github.com/Automattic/sensei/pull/7082)
- Fix lessons not being saved when creating a course on the latest Gutenberg version [#7091](https://github.com/Automattic/sensei/pull/7091)
- Fix lesson styling in editor on WordPress 6.3 or when Gutenberg enabled [#7054](https://github.com/Automattic/sensei/pull/7054)
- Fix PHP 8.1 deprecation notice on Students page [#7038](https://github.com/Automattic/sensei/pull/7038)
- Fix `strpos`and `str_replace` deprecation messages in PHP 8.1 and 8.2 [#7028](https://github.com/Automattic/sensei/pull/7028)

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

Expand All @@ -14,7 +31,6 @@
- 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
- Add Enrolled and Completion columns on the reports course page. [#6966](https://github.com/Automattic/sensei/pull/6966)
Expand Down
4 changes: 4 additions & 0 deletions changelog/add-header-on-lm-quiz-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added header on the learning mode template of quizzes
4 changes: 0 additions & 4 deletions changelog/add-profile-links-filter

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-duplicate-comment-section-in-fse-themes

This file was deleted.

4 changes: 4 additions & 0 deletions changelog/fix-extra-heading-fix-course-and-lesson
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed extra header element in lesson content
5 changes: 0 additions & 5 deletions changelog/fix-grades-duplicates

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-php81-deprecation-notice

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/fix-wp-core-deprecation-messages

This file was deleted.

4 changes: 4 additions & 0 deletions changelog/update-lesson-types-naming
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Change "Lesson Type" to "Lesson Layout" in wizard
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"dms/phpunit-arraysubset-asserts": "0.5.0",
"humbug/php-scoper": "0.15.0",
"pelago/emogrifier": "7.0.0",
"php-stubs/wordpress-stubs": "^6.3",
"phpcompatibility/phpcompatibility-wp": "2.1.4",
"sirbrillig/phpcs-no-get-current-user": "1.1.0",
"sirbrillig/phpcs-variable-analysis": "2.11.16",
"squizlabs/php_codesniffer": "3.7.2",
"symfony/polyfill-php80": "1.16.0",
"vimeo/psalm": "4.22.0",
"wp-coding-standards/wpcs": "2.3.0",
"yoast/phpunit-polyfills": "2.0.0"
},
Expand Down Expand Up @@ -99,7 +101,16 @@
},
"extra": {
"changelogger": {
"changelog": "changelog.txt"
"changelog": "changelog.txt",
"types": {
"security": "Vulnerability fix (e.g. Fix XSS vulnerability)",
"added": "New feature (e.g. Add quiz generation using AI)",
"changed": "Changes to existing functionality (e.g. Redirect to next lesson without showing a message, Bump minimum required PHP version to 7.3)",
"deprecated": "Soon-to-be removed feature (e.g. Deprecate the legacy email system in favor of the new one)",
"removed": "Removed feature (e.g. Remove the legacy email system)",
"fixed": "Bug fix (e.g. Fix admin notice styles)",
"dev": "Changes that third-party devs should be aware of (e.g. Deprecate the `Sensei_Emails` class, Remove wrapper elements from templates, Introduce new hook: `sensei_email_send`)"
}
}
}
}
Loading

0 comments on commit 5ff86ad

Please sign in to comment.