Skip to content

Commit

Permalink
Editor Toolbar: New Playlist not working with no results
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao committed Apr 22, 2024
1 parent 21baf71 commit 3a81d54
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
15 changes: 11 additions & 4 deletions ui/src/editor-core/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,8 @@ Toolbar.prototype.mediaContentPopulate = function(menu) {

if (
(!res.data || res.data.length == 0) &&
$mediaContent.find('.toolbar-card').length == 0
$mediaContent.find('.toolbar-card:not(.toolbar-card-special)')
.length == 0
) {
// Handle card behaviour
self.handleCardsBehaviour();
Expand Down Expand Up @@ -2443,7 +2444,9 @@ Toolbar.prototype.layoutTemplatesContentPopulate = function(menu) {
} else if (response.login) {
window.location.href = window.location.href;
location.reload();
} else if ($content.find('.toolbar-card').length === 0) {
} else if (
$content.find('.toolbar-card:not(.toolbar-card-special)').length === 0
) {
$searchForm.append(
'<div class="no-results-message">' +
toolbarTrans.noMediaToShow +
Expand Down Expand Up @@ -2648,10 +2651,14 @@ Toolbar.prototype.playlistsContentPopulate = function(menu) {
} else if (response.login) {
window.location.href = window.location.href;
location.reload();
} else if ($content.find('.toolbar-card').length === 0) {
} else if (
$content.find('.toolbar-card:not(.toolbar-card-special)').length === 0
) {
self.handleCardsBehaviour();

$searchForm.append(
'<div class="no-results-message">' +
toolbarTrans.noMediaToShow +
toolbarTrans.noPlaylistsToShow +
'</div>');
}

Expand Down
2 changes: 1 addition & 1 deletion ui/src/templates/toolbar-card-media-upload.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="toolbar-card upload-card"
<div class="toolbar-card upload-card toolbar-card-special"
data-toggle="tooltip"
data-type="widget"
data-sub-type="{{type}}"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/templates/toolbar-card-playlist-new-template.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="toolbar-card new-playlist-card"
<div class="toolbar-card new-playlist-card toolbar-card-special"
data-toggle="tooltip"
data-type="widgets"
data-sub-type="{{#if editingPlaylist}}subplaylist{{else}}playlist{{/if}}"
Expand Down
1 change: 1 addition & 0 deletions views/common.twig
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@
noActionsToShow: "{{ "No actions to display" |trans }}",
noTemplatesToShow: "{{ "No templates to display"|trans }}",
noMediaToShow: "{{ "No media to display!" |trans }}",
noPlaylistsToShow: "{{ "No playlists to display!" |trans }}",
showMore: "{{ "Show more" |trans }}",
noShowMore: "{{ "No more results for this filter!" |trans }}",
mediaPreview: {
Expand Down

0 comments on commit 3a81d54

Please sign in to comment.