Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
const fields = {
completeName: m.prop(''),
anonymous: h.toggleProp(false, true),
address: m.prop({ country_id: defaultCountryID }),
ownerDocument: m.prop(''),
errors: m.prop([])
};
const creditCardFields = {
name: m.prop(''),
number: m.prop(''),
expMonth: m.prop(''),
expYear: m.prop(''),
save: m.prop(false),
cvv: m.prop(''),
errors: m.prop([]),
cardOwnerDocument: m.prop('')
};
const populateForm = (fetchedData) => {
const data = _.first(fetchedData) || { address: {} };
if (!_.isEmpty(data.address)) {
fields.address(_.omit(data.address, 'id'));
}
fields.completeName(data.name);
fields.ownerDocument(data.owner_document);
creditCardFields.cardOwnerDocument(data.owner_document);
controller: () => {
return {
ripple: m.prop(),
waves: m.prop(),
delegate: m.prop()
};
},
view: (ctrl, opts = {}) => {
var Todo = function(data) {
this.description = m.prop(data.description);
this.done = m.prop(false);
};
controller: function(args) {
const filtersVM = args.filtersVM,
displayModal = h.toggleProp(false, true),
contributionsPerDay = m.prop([]),
visitorsTotal = m.prop(0),
visitorsPerDay = m.prop([]),
loader = catarse.loaderWithToken;
if (h.paramByName('online_success') === 'true') {
displayModal.toggle();
}
const processVisitors = (data) => {
if (!_.isEmpty(data)) {
visitorsPerDay(data);
visitorsTotal(_.first(data).total);
}
};
const lVisitorsPerDay = catarseMoments.loaderWithToken(models.projectVisitorsPerDay.getRowOptions(filtersVM.parameters()));
lVisitorsPerDay.load().then(processVisitors);
controller: function(args) {
const contributedProjects = m.prop(),
projectReminders = m.prop(),
mailMarketingLists = m.prop(),
user_id = args.userId,
showNotifications = h.toggleProp(false, true),
error = m.prop(false);
userVM.getUserProjectReminders(user_id).then(
projectReminders
).catch((err) => {
error(true);
m.redraw();
});
userVM.getMailMarketingLists().then((data) => {
mailMarketingLists(generateListHandler(data));
}
).catch((err) => {
error(true);
return _.map(list, (item, i) => {
const user_signed = !_.isEmpty(user_lists) && !_.isUndefined(_.find(user_lists, userList => userList.marketing_list ? userList.marketing_list.list_id === item.list_id : false));
const handler = {
item,
in_list: user_signed,
should_insert: m.prop(false),
should_destroy: m.prop(false),
isInsertInListState: h.toggleProp(false, true),
hovering: m.prop(false)
};
handler.isInsertInListState(!handler.in_list);
return handler;
});
};
controller: function(args) {
const user_id = args.userId,
userCommonId = args.user && args.user.common_id,
subscriptions = commonPayment.paginationVM(models.userSubscription),
onlinePages = catarse.paginationVM(models.userContribution),
successfulPages = catarse.paginationVM(models.userContribution),
failedPages = catarse.paginationVM(models.userContribution),
error = m.prop(false),
loader = m.prop(true),
handleError = () => {
error(true);
loader(false);
m.redraw();
},
contextVM = catarse.filtersVM({
user_id: 'eq',
state: 'in',
project_state: 'in'
}),
contextSubVM = catarse.filtersVM({
user_id: 'eq',
status: 'in'
});
models.userSubscription.pageSize(9);
controller: function(args) {
const project = m.prop({});
projectVM.fetchProject(args.item.project_external_id, false).then((data) => {
project(_.first(data));
});
return {
project
};
},
controller: function(args) {
const isSlip = m.prop(false),
scope = () => args.vm.isInternational()
? I18nIntScope()
: I18nScope();
return {
isSlip,
scope,
vm: args.vm
};
},
view: function(ctrl, args) {
id: 'eq'
}),
filterVM = catarse.filtersVM({
project_id: 'eq'
}),
{
project_id,
reward_id
} = args;
rewardFilterVM.id(reward_id);
filterVM.project_id(project_id);
const rewardVM = catarse.loaderWithToken(models.rewardDetail.getPageOptions(rewardFilterVM.parameters())),
l = loader(models.projectDetail.getRowOptions(filterVM.parameters()));
const reward = m.prop([]);
l.load().then(projectDetails);
rewardVM.load().then(reward);
const choice = {
multiple: [
m('span.fa.fa-dot-circle-o'),
' MĂșltipla escolha'
],
open: [
m('span.fa.fa-align-left'),
' Resposta aberta'
]
};
const setQuestionType = (question, type) => () => {
question.type = type;