Vulcan/packages/nova-notifications/lib/custom_fields.js

70 lines
1.5 KiB
JavaScript
Raw Normal View History

2016-06-23 15:00:58 +09:00
import Users from 'meteor/nova:users';
const notificationsGroup = {
name: "notifications",
order: 2
};
// Add notifications options to user profile settings
Users.addField([
{
fieldName: '__notifications_users',
fieldSchema: {
label: 'New users',
type: Boolean,
optional: true,
defaultValue: false,
control: "checkbox",
2016-12-01 16:09:54 +09:00
viewableIf: ['anonymous'],
insertableIf: ['admins'],
editableIf: ['admins'],
group: notificationsGroup
}
},
{
fieldName: '__notifications_posts',
fieldSchema: {
label: 'New posts',
type: Boolean,
optional: true,
defaultValue: false,
control: "checkbox",
2016-12-01 16:09:54 +09:00
viewableIf: ['anonymous'],
insertableIf: ['default'],
editableIf: ['default'],
group: notificationsGroup
}
}
]);
2016-05-09 13:32:34 +09:00
if (typeof Comments !== "undefined") {
Users.addField([
{
fieldName: '__notifications_comments',
fieldSchema: {
label: 'Comments on my posts',
type: Boolean,
optional: true,
defaultValue: true,
control: "checkbox",
2016-12-01 16:09:54 +09:00
viewableIf: ['anonymous'],
insertableIf: ['default'],
editableIf: ['default']
}
},
{
fieldName: '__notifications_replies',
fieldSchema: {
label: 'Replies to my comments',
type: Boolean,
optional: true,
defaultValue: true,
control: "checkbox",
2016-12-01 16:09:54 +09:00
viewableIf: ['anonymous'],
insertableIf: ['default'],
editableIf: ['default']
}
}
]);
}