Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move playlist notice and add check for other notices #371

Merged
merged 5 commits into from
Feb 21, 2024
Merged

Conversation

MARQAS
Copy link
Contributor

@MARQAS MARQAS commented Feb 1, 2024

Description of the Change

This PR moves the playlist notice in the admin section outside the controls bar and adds an additional check for notices to show them in respective places

Closes #346

How to test the Change

  • Go to the Brightcove Playlist settings page
  • Observe that the notice is now outside the control bar
  • Add/Edit Post
  • Add Brightcove media.
  • Go to a different section such as Playlist or playlist experience
  • Observe that the notice is being displayed there

Changelog Entry

Fixed - Move playlist notice above controls bar

Credits

Props @MARQAS , @felipeelia

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@@ -21,11 +21,23 @@ public function __construct() {
* Adds all templates for Backbone application
*/
public function add_templates() {
?>
global $pagenow; ?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
global $pagenow; ?>
global $pagenow;
?>

Comment on lines 1312 to 1318
<# if( data.mediaType === 'playlists' || data.mediaType === 'playlistexperience' ) { #>
<div class="notice notice-warning">
<p>
<?php esc_html_e( 'Please note that you can create new playlists only from Brightcove.', 'brightcove' ); ?>
</p>
</div>
<# } #>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this one, @MARQAS. If you are testing for playlistexperience before, do we want to display another very similar message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felipeelia, this was already present, I just moved them. I believe it is there for a reason, There are two different sections, one is to add a Playlist, and the other one is to add a Playlist experience. So it tells the user in the playlist experience section, that you cannot add a new playlist and also you cannot add the new experiences from here as well.
Do you want me to combine them both and say: "Please note that you can create new Playlists or new Experiences only from Brightcove"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Between lines 1292 and 1319 we have 3 ifs, all of them testing data.mediaType. If mediaType is playlistexperience the code will go through 2 ifs (1305 and 1313), and the user will see these two messages at the same time:

Please note that you can create new Experiences only from Brightcove.
Please note that you can create new playlists only from Brightcove.

Do you think that makes sense from the user's perspective? Were you able to reproduce that specific scenario?

@MARQAS MARQAS merged commit 16a58aa into develop Feb 21, 2024
10 of 11 checks passed
@MARQAS MARQAS deleted the fix/346 branch February 21, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move playlists notice outside the controls bar
2 participants