* fix open jamtrack dialog for people with less than 10 jamtracks
This commit is contained in:
parent
d045c94f54
commit
3fa58715fc
|
|
@ -4,7 +4,6 @@ describe JamTrackHfaRequest do
|
|||
include CarrierWave::Test::Matchers
|
||||
include UsesTempFiles
|
||||
|
||||
#let(:jamtrack1) {FactoryGirl.create(:jam_track, hfa_license_status: false, hfa_license_desired: true, alternative_license_status: false)
|
||||
let(:jamtrack1) {FactoryGirl.create(:jam_track, duration: 90, server_fixation_date: Time.now.to_date ) }
|
||||
|
||||
it "creates request" do
|
||||
|
|
@ -18,7 +17,7 @@ describe JamTrackHfaRequest do
|
|||
request.request_csv_filename.should_not be_nil
|
||||
request.approved_at.should be_nil
|
||||
request.received_at.should be_nil
|
||||
|
||||
|
||||
request_id = JamTrackHfaRequestId.first
|
||||
request_id.request_id.should_not be_nil
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,12 @@
|
|||
|
||||
app.user().done(function(user) {
|
||||
|
||||
if (user.purchased_jamtracks_count > perPage) {
|
||||
var showSearch = (user.purchased_jamtracks_count > perPage)
|
||||
|
||||
var $autocomplete = $dialog.find('[data-react-class="JamTrackAutoComplete"]')
|
||||
if (showSearch) {
|
||||
$autocomplete.show()
|
||||
$searchBtn.show()
|
||||
|
||||
searchQuery = $.cookie(cookieName)
|
||||
if (!searchQuery) {
|
||||
|
|
@ -54,15 +59,19 @@
|
|||
logger.error("unable to parse search query: " + e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getPurchasedJamTracks(0)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
// initialize pagination
|
||||
var $paginator = context.JK.Paginator.create(parseInt(jqXHR.getResponseHeader('total-entries')), perPage, 0, onPageSelected, 20)
|
||||
$paginatorHolder.append($paginator);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$autocomplete.hide()
|
||||
$searchBtn.hide()
|
||||
}
|
||||
|
||||
getPurchasedJamTracks(0)
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
// initialize pagination
|
||||
var $paginator = context.JK.Paginator.create(parseInt(jqXHR.getResponseHeader('total-entries')), perPage, 0, onPageSelected, 20)
|
||||
$paginatorHolder.append($paginator);
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
.dialog-inner
|
||||
|
||||
= react_component 'JamTrackAutoComplete', {:onSearch => 'window.JK.OpenJamTrackDialogInstance.search'}
|
||||
|
||||
button.search-btn.button-orange SEARCH
|
||||
.recording-wrapper
|
||||
table.open-jam-tracks cellspacing="0" cellpadding="0" border="0"
|
||||
|
|
|
|||
Loading…
Reference in New Issue