Skip to content

Commit

Permalink
Merge pull request #298 from 10up/develop
Browse files Browse the repository at this point in the history
Release 2.8.0
  • Loading branch information
oscarssanchez authored Oct 18, 2022
2 parents a7cfdad + 0ba1cfd commit 3ae0620
Show file tree
Hide file tree
Showing 64 changed files with 2,085 additions and 15,500 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: E2E test

env:
NODE_VERSION: "12"

on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
jobs:
cypress:
name: ${{ matrix.core.name }}
runs-on: ubuntu-latest
strategy:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Composer (optional)
run: composer install
continue-on-error: true
- name: Build (optional)
run: npm run build
continue-on-error: true
- name: Set the core version
run: ./tests/bin/set-core-version.js ${{ matrix.core.version }}
- name: Set up WP environment
run: npm run env:start
- name: Test
run: npm run cypress:run
22 changes: 21 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,24 @@ jobs:
- name: npm install
run: npm install
- name: eslint
run: npm run lint-js
run: npm run lint-js

phpcs:
name: PHP Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: composer install
run: composer install

- name: PHPCS check
run: composer run lint
10 changes: 10 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": ["."],
"env": {
"tests": {
"mappings": {
"wp-cli.yml": "./tests/bin/wp-cli.yml"
}
}
}
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [2.8.0] - 2022-10-17

### Deprecated
- BC_Oauth_API::Method _request_access_token() in favor of BC_Oauth_API::request_access_token()
- Action brightcove/admin/settings_page in favor of brightcove_admin_settings_page
- Action brightcove/admin/videos_page in favor of brightcove_admin_videos_page
- Action brightcove/admin/playlists_page in favor of brightcove_admin_playlists_page
- Action brightcove/admin/edit_source_page in favor of brightcove_admin_edit_source_page
- Action brightcove/admin/labels_page in favor of brightcove_admin_labels_page
- Action brightcove/admin/edit_label_page in favor of brightcove_admin_edit_label_page

### Added
- Ability to add Application ID parameter to video player. Props [@oscarssanchez](https://github.com/oscarssanchez), and [@felipeelia](https://github.com/felipeelia), via [#295](https://github.com/10up/brightcove-video-connect/pull/295).
- Initial E2E tests. Props [@oscarssanchez](https://github.com/oscarssanchez), and [@felipeelia](https://github.com/felipeelia), via [#288](https://github.com/10up/brightcove-video-connect/pull/288).

### Fixed
- PHPCS Fixes. Props [@oscarssanchez](https://github.com/oscarssanchez), and [@felipeelia](https://github.com/felipeelia), via [#286](https://github.com/10up/brightcove-video-connect/pull/286).

## [2.7.0] - 2022-06-29

### Fixed
Expand Down Expand Up @@ -381,6 +399,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- First release

[Unreleased]: https://github.com/10up/brightcove-video-connect/compare/master...develop
[2.8.0]: https://github.com/10up/brightcove-video-connect/compare/2.7.0...2.8.0
[2.7.0]: https://github.com/10up/brightcove-video-connect/compare/2.6.1...2.7.0
[2.6.1]: https://github.com/10up/brightcove-video-connect/compare/2.6.0...2.6.1
[2.6.0]: https://github.com/10up/brightcove-video-connect/compare/2.5.2...2.6.0
Expand Down
4 changes: 4 additions & 0 deletions assets/css/jquery-ui-datepicker.min.css

Large diffs are not rendered by default.

43 changes: 23 additions & 20 deletions assets/js/brightcove-admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/brightcove-admin.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/brightcove-admin.min.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions assets/js/src/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
var playsinline = props.attributes.playsinline || '';
var pictureinpicture = props.attributes.picture_in_picture || '';
var languageDetection = props.attributes.language_detection || '';
var applicationId = props.attributes.application_id || '';
var embed = props.attributes.embed || '';
var mute = props.attributes.mute || '';
var sizing = props.attributes.sizing || 'responsive';
Expand Down Expand Up @@ -215,6 +216,7 @@
setAttrs.mute = attrs.named.mute;
setAttrs.playsinline = attrs.named.playsinline;
setAttrs.picture_in_picture = attrs.named.picture_in_picture;
setAttrs.application_id = attrs.named.application_id;
setAttrs.language_detection = attrs.named.language_detection;
setAttrs.padding_top = attrs.named.padding_top;
} else if (attrs.numeric[0] === '[bc_playlist') {
Expand Down Expand Up @@ -440,6 +442,18 @@
});
},
}),
!isExperience &&
el(components.TextControl, {
label: __('Application Id:', 'brightcove'),
type: 'string',
value: applicationId,
onChange: function (value) {
props.setAttributes({
...props.attributes,
application_id: value,
});
},
}),
!isExperience &&
el(components.CheckboxControl, {
label: __('Autoplay', 'brightcove'),
Expand Down
20 changes: 10 additions & 10 deletions assets/js/src/models/media-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ var MediaCollection = Backbone.Collection.extend({
this.searchTerm = options.searchTerm || '';
this.dates = options.dates || 'all';
this.tag = options.tag || '';
this.folderId = options.folderId || '';
this.oldFolderId = options.oldFolderId || '';
this.folder_id = options.folder_id || '';
this.old_folder_id = options.old_folder_id || '';
this.labelPath = options.labelPath || '';
this.oldLabelPath = options.oldLabelPath || '';

Expand Down Expand Up @@ -85,14 +85,14 @@ var MediaCollection = Backbone.Collection.extend({
this.fetch();
});

this.listenTo(wpbc.broadcast, 'change:folder', function (folderId) {
this.oldFolderId = this.folderId;
this.listenTo(wpbc.broadcast, 'change:folder', function (folder_id) {
this.old_folder_id = this.folder_id;

if (folderId === 'all') {
folderId = '';
if (folder_id === 'all') {
folder_id = '';
}

this.folderId = folderId;
this.folder_id = folder_id;
this.fetch();
});

Expand Down Expand Up @@ -189,8 +189,8 @@ var MediaCollection = Backbone.Collection.extend({
labels: this.labels,
labelPath: this.labelPath,
oldLabelPath: this.oldLabelPath,
oldFolderId: this.oldFolderId,
folderId: this.folderId,
old_folder_id: this.old_folder_id,
folder_id: this.folder_id,
state: this.state,
oldState: this.oldState,
tagName: wpbc.preload.tags[this.tag],
Expand All @@ -205,7 +205,7 @@ var MediaCollection = Backbone.Collection.extend({
'search',
'tags',
'type',
'folderId',
'folder_id',
'tagName',
'state',
);
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/models/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ var MediaModel = Backbone.Model.extend({
name: this.get('name'),
nonce: wpbc.preload.nonce,
tags: this.get('tags'),
oldFolderId: this.get('oldFolderId'),
folderId: this.get('folderId'),
old_folder_id: this.get('old_folder_id'),
folder_id: this.get('folder_id'),
type: this.get('mediaType'),
custom_fields: this.get('custom_fields'),
history: this.get('_change_history'),
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/views/brightcove-media-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ var BrightcoveMediaManagerView = BrightcoveView.extend({

this.listenTo(wpbc.broadcast, 'change:folder', function (folder) {
this.clearPreview();
this.model.set('oldFolderId', this.model.get('folderId'));
this.model.set('folderId', folder);
this.model.set('old_folder_id', this.model.get('folder_id'));
this.model.set('folder_id', folder);
});

this.listenTo(wpbc.broadcast, 'change:label', function (labelPath) {
Expand Down
5 changes: 4 additions & 1 deletion assets/js/src/views/media-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var MediaDetailsView = BrightcoveView.extend({
'change #languagedetection': 'toggleIframe',
'change .experience-details input[name="sizing"],.experience-details input[name="embed-style"]':
'toggleExperienceUnits',
'change #video-player, #autoplay, #pictureinpicture, #languagedetection, #playsinline, #mute, input[name="embed-style"], input[name="sizing"], #aspect-ratio, #width, #height':
'change #video-player, #applicationid, #autoplay, #pictureinpicture, #languagedetection, #playsinline, #mute, input[name="embed-style"], input[name="sizing"], #aspect-ratio, #width, #height':
'generateShortcode',
'change #generate-shortcode': 'toggleShortcodeGeneration',
},
Expand Down Expand Up @@ -142,6 +142,7 @@ var MediaDetailsView = BrightcoveView.extend({
playsinline = $('#playsinline').is(':checked') ? 'playsinline' : '',
pictureinpicture = $('#pictureinpicture').is(':checked') ? 'pictureinpicture' : '',
languagedetection = $('#languagedetection').is(':checked') ? 'languagedetection' : '',
applicationId = $('#applicationid').val(),
mute = $('#mute').is(':checked') ? 'muted' : '',
embedStyle = $('input[name="embed-style"]:checked').val(),
sizing = $('input[name="sizing"]:checked').val(),
Expand Down Expand Up @@ -197,6 +198,8 @@ var MediaDetailsView = BrightcoveView.extend({
pictureinpicture +
'" language_detection="' +
languagedetection +
'" application_id="' +
applicationId +
'" max_width="' +
maxWidth +
'" ' +
Expand Down
Loading

0 comments on commit 3ae0620

Please sign in to comment.