-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into add/ability-to-set-font-size-for-subheader
- Loading branch information
Showing
134 changed files
with
12,352 additions
and
4,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
assets/admin/course-pre-publish-panel/course-pre-publish-panel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { useEntityProp } from '@wordpress/core-data'; | ||
import { PluginPrePublishPanel } from '@wordpress/edit-post'; | ||
import { ToggleControl } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import SenseiIcon from '../../icons/logo-tree.svg'; | ||
|
||
/** | ||
* Course pre-publish panel. | ||
*/ | ||
export const CoursePrePublishPanel = () => { | ||
const [ meta, setMeta ] = useEntityProp( 'postType', 'course', 'meta' ); | ||
const { sensei_course_publish_lessons: publishLessons } = meta; | ||
|
||
return ( | ||
<PluginPrePublishPanel | ||
title={ __( 'Sensei LMS', 'sensei-lms' ) } | ||
icon={ <SenseiIcon height="20" width="20" /> } | ||
initialOpen={ true } | ||
> | ||
<ToggleControl | ||
label={ __( 'Publish lessons', 'sensei-lms' ) } | ||
help={ __( | ||
'Publish lessons when the course is published.', | ||
'sensei-lms' | ||
) } | ||
checked={ publishLessons } | ||
onChange={ ( value ) => | ||
setMeta( { ...meta, sensei_course_publish_lessons: value } ) | ||
} | ||
/> | ||
</PluginPrePublishPanel> | ||
); | ||
}; | ||
|
||
export default CoursePrePublishPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { registerPlugin } from '@wordpress/plugins'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import CoursePrePublishPanel from './course-pre-publish-panel'; | ||
|
||
registerPlugin( 'sensei-course-pre-publish-panel-plugin', { | ||
render: CoursePrePublishPanel, | ||
icon: null, | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import '@testing-library/jest-dom'; | ||
import { render } from '@testing-library/react'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useSelect } from '@wordpress/data'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import PatternsList from './patterns-list'; | ||
|
||
jest.mock( '@wordpress/data' ); | ||
|
||
describe( '<PatternsList />', () => { | ||
it( 'Should show warning when no layouts available.', () => { | ||
useSelect.mockReturnValue( { | ||
patterns: [], | ||
} ); | ||
|
||
const { queryByText } = render( | ||
<PatternsList onChoose={ () => {} } /> | ||
); | ||
|
||
expect( | ||
queryByText( 'No layouts available for this theme.' ) | ||
).toBeVisible(); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.