* VRFS-3528 - make sure open jamtrack dialog passes 'show_purchased_only'
This commit is contained in:
parent
6d010a561b
commit
386ed8144c
|
|
@ -230,6 +230,8 @@ module JamRuby
|
||||||
return {artists: [], songs: []}
|
return {artists: [], songs: []}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
options[:show_purchased_only] = options[:show_purchased_only]
|
||||||
|
|
||||||
options[:limit] = options[:limit] || 5
|
options[:limit] = options[:limit] || 5
|
||||||
|
|
||||||
options[:artist_search] = options[:match]
|
options[:artist_search] = options[:match]
|
||||||
|
|
@ -387,6 +389,11 @@ module JamRuby
|
||||||
|
|
||||||
query = query.where("jam_tracks.status = ?", 'Production') unless user.admin
|
query = query.where("jam_tracks.status = ?", 'Production') unless user.admin
|
||||||
|
|
||||||
|
if options[:show_purchased_only]
|
||||||
|
query = query.joins(:jam_track_rights)
|
||||||
|
query = query.where("jam_track_rights.user_id = ?", user.id)
|
||||||
|
end
|
||||||
|
|
||||||
if options[:artist_search]
|
if options[:artist_search]
|
||||||
tsquery = Search.create_tsquery(options[:artist_search])
|
tsquery = Search.create_tsquery(options[:artist_search])
|
||||||
if tsquery
|
if tsquery
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ MIX_MODES = context.JK.MIX_MODES
|
||||||
#@search()
|
#@search()
|
||||||
|
|
||||||
|
|
||||||
getOptions: (input, callback) =>
|
getOptions: (input, callback) ->
|
||||||
|
|
||||||
#@logger.debug("getOptions input #{input}", this)
|
#@logger.debug("getOptions input #{input}", this)
|
||||||
|
|
||||||
|
|
@ -88,7 +88,12 @@ MIX_MODES = context.JK.MIX_MODES
|
||||||
callback(null, {options: [], complete: false})
|
callback(null, {options: [], complete: false})
|
||||||
return
|
return
|
||||||
|
|
||||||
@rest.autocompleteJamTracks({match:input, limit:5})
|
query = {match:input, limit:5}
|
||||||
|
|
||||||
|
if @props.show_purchased_only
|
||||||
|
query.show_purchased_only = true
|
||||||
|
|
||||||
|
@rest.autocompleteJamTracks(query)
|
||||||
.done((autocomplete) =>
|
.done((autocomplete) =>
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
.dialog-inner
|
.dialog-inner
|
||||||
|
|
||||||
= react_component 'JamTrackAutoComplete', {:onSearch => 'window.JK.OpenJamTrackDialogInstance.search'}
|
= react_component 'JamTrackAutoComplete', {:onSearch => 'window.JK.OpenJamTrackDialogInstance.search', show_purchased_only:true}
|
||||||
|
|
||||||
button.search-btn.button-orange SEARCH
|
button.search-btn.button-orange SEARCH
|
||||||
.recording-wrapper
|
.recording-wrapper
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue