diff --git a/client/js/events/discounts/index.js b/client/js/events/discounts/index.js index 5166fe0dc..941565627 100644 --- a/client/js/events/discounts/index.js +++ b/client/js/events/discounts/index.js @@ -1,6 +1,5 @@ // License: LGPL-3.0-or-later var request = require('../../common/client') -var R = require('ramda') appl.def('discounts.url', '/nonprofits/' + app.nonprofit_id + '/events/' + appl.event_id + '/event_discounts') diff --git a/client/js/events/discounts/manage.js b/client/js/events/discounts/manage.js index 96ab988dd..a606bc57d 100644 --- a/client/js/events/discounts/manage.js +++ b/client/js/events/discounts/manage.js @@ -1,5 +1,4 @@ // License: LGPL-3.0-or-later -var R = require('ramda') var request = require('../../common/client') var format = require('../../common/format') @@ -81,8 +80,8 @@ function validate(form_obj){ appl.notify("Percentage can't be more than 100") return false } - var codes = R.pluck('code', R.reject(function(x){ return x['id'] === Number(form_obj.id)}, appl.discounts.data)) - var hasDupeCodes = R.contains(form_obj.code, codes) + var codes = appl.discounts.data.filter(x => x['id'] !== Number(form_obj.id)).map(i => i.code) + var hasDupeCodes = codes.includes(form_obj.code) if (hasDupeCodes){ appl.notify("That code is already being used for this event. Please type another code.") diff --git a/client/js/events/listings/index.js b/client/js/events/listings/index.js index eb942a36a..4a31e1326 100644 --- a/client/js/events/listings/index.js +++ b/client/js/events/listings/index.js @@ -1,5 +1,4 @@ // License: LGPL-3.0-or-later -const R = require('ramda') const h = require('snabbdom/h') const flyd = require('flyd') const render = require('ff-core/render') @@ -34,7 +33,7 @@ module.exports = pathPrefix => { return mixin([h('p.u-padding--15', 'Loading...')]) if(!resp$().body.length) return mixin([h('p.u-padding--15', `No ${key} events`)]) - return mixin(R.map(listing, resp$().body)) + return mixin(resp$().body.map(listing)); } const view = state => diff --git a/client/js/events/show/page.js b/client/js/events/show/page.js index 0a4e8aeec..6357eea12 100644 --- a/client/js/events/show/page.js +++ b/client/js/events/show/page.js @@ -10,7 +10,6 @@ const donateWiz = require('../../nonprofits/donate/wizard') const snabbdom = require('snabbdom') const h = require('snabbdom/h') const flyd = require('flyd') -const R = require('ramda') const render = require('ff-core/render') const modal = require('ff-core/modal') @@ -27,8 +26,8 @@ function init() { var state = { } const startWiz$ = flyd.stream() const donateButtons = document.querySelectorAll('.js-openDonationModal') - R.map(x => x.addEventListener('click', createClickListener(startWiz$)), donateButtons) - state.modalID$ = flyd.map(R.always('donationModal'), startWiz$) + donateButtons.map((x) => x.addEventListener('click', createClickListener(startWiz$))); + state.modalID$ = flyd.map(() => 'donationModal', startWiz$) state.donateWiz = donateWiz.init(flyd.stream({event_id: app.event_id, hide_cover_fees_option: app.hide_cover_fees_option})) return state }