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

remove ramda from supporters #982

Open
wants to merge 1 commit into
base: supporter_level_goal
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// License: LGPL-3.0-or-later
const R = require('ramda')
const h = require('snabbdom/h')
const flyd = require('flyd')
const modal = require('ff-core/modal')
Expand All @@ -14,11 +13,11 @@ function init(modalID$) {
const pathPrefix = `/nonprofits/${app.nonprofit_id}`
var state = {
submitForm$: flyd.stream()
, tagMasters$: flyd.map(R.prop('body'), request({method: 'get', path: pathPrefix + '/tag_masters'}).load)
, tagMasters$: flyd.map(r => r.body, request({method: 'get', path: pathPrefix + '/tag_masters'}).load)
}

const emailLists$ = flyd.map(R.prop('body'), request({method: 'get', path: pathPrefix + '/email_lists'}).load)
state.selectedTagMasterIds$ = flyd.map(R.map(ls => ls.tag_master_id), emailLists$)
const emailLists$ = flyd.map(r => r.body, request({method: 'get', path: pathPrefix + '/email_lists'}).load)
state.selectedTagMasterIds$ = flyd.map(emailLists$.map(ls => ls.tag_master_id))

const response$ = flyd_flatMap(
form => request({
Expand Down Expand Up @@ -52,7 +51,7 @@ function view(state) {
h('p', "You're connected on Mailchimp. Choose the tags that you want to keep in sync with your Mailchimp Email Lists.")
, h('hr')
, h('div.fields',
R.map(
(state.tagMasters$() || {data: []}).data.map(
tm => h('fieldset', [
h('input', {
props: {
Expand All @@ -65,7 +64,7 @@ function view(state) {
})
, h('label', {props: {htmlFor: `mailchimpCheckbox--${tm.id}`}}, tm.name)
])
, (state.tagMasters$() || {data: []}).data )
)
)
, h('hr')
, h('div.u-centered', [
Expand Down
Loading