mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 11:01:38 -05:00

* [eslint] update eslint rules & add .eslintignore to ignore non-ready nova packages * [clean-up] nova-voting * [clean-up] [bug] nova-users: missing user parameter * [clean-up] nova-users * [clean-up] nova-subscribe * [clean-up] nova-settings * [clean-up] nova-rss * [clean-up] [bug] nova-posts: correct UsersRemoveDeletePosts * [clean-up] nova-posts * [clean-up] nova-notifications * [clean-up] [bug] nova-newsletter: no error.message on throw error * [clean-up] nova-newsletter * [clean-up] nova-lib * [clean-up] nova-kadira * [clean-up] nova-inject-data * [clean-up] nova-getting-started * [clean-up] nova-forms * [clean-up] nova-events * [clean-up] [bug] nova-embedly: no FlowRouter * [clean-up] nova-embedly * [clean-up] nova-email-templates * [clean-up] nova-email * [clean-up] nova-debug * [clean-up] nova-core * [clean-up] [bug] nova-comments: correct UsersRemoveDeleteComments * [clean-up] nova-comments * [clean-up] [bug] nova-cloudinary: use Telescope.settings.collection instand * [clean-up] nova-cloudinary * [clean-up] nova-categories * [clean-up] nova-base-components * [clean-up] nova-api * [eslint] extends react recommended * [clean-up] for jsx files * [eslint] extends meteor recommended * i forgot this one little change
111 lines
3 KiB
JavaScript
111 lines
3 KiB
JavaScript
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
|
|
|
|
/**
|
|
* @summary Kick off the global namespace for Telescope.
|
|
* @namespace Telescope
|
|
*/
|
|
|
|
const Telescope = {};
|
|
|
|
Telescope.VERSION = '0.27.4-nova';
|
|
|
|
// ------------------------------------- Config -------------------------------- //
|
|
|
|
/**
|
|
* @summary Telescope configuration namespace
|
|
* @namespace Telescope.config
|
|
*/
|
|
Telescope.config = {};
|
|
|
|
|
|
// ------------------------------------- Schemas -------------------------------- //
|
|
|
|
SimpleSchema.extendOptions({
|
|
private: Match.Optional(Boolean),
|
|
editable: Match.Optional(Boolean), // editable: true means the field can be edited by the document's owner
|
|
hidden: Match.Optional(Boolean), // hidden: true means the field is never shown in a form no matter what
|
|
required: Match.Optional(Boolean), // required: true means the field is required to have a complete profile
|
|
profile: Match.Optional(Boolean), // profile: true means the field is shown on user profiles
|
|
template: Match.Optional(String), // template used to display the field
|
|
form: Match.Optional(Object), // form placeholder
|
|
autoform: Match.Optional(Object), // legacy form placeholder; backward compatibility
|
|
control: Match.Optional(Match.Any), // NovaForm control (String or React component)
|
|
order: Match.Optional(Number), // position in the form
|
|
group: Match.Optional(Object) // form fieldset group
|
|
});
|
|
|
|
// ------------------------------------- Components -------------------------------- //
|
|
|
|
Telescope.components = {};
|
|
|
|
Telescope.registerComponent = (name, component) => {
|
|
Telescope.components[name] = component;
|
|
};
|
|
|
|
Telescope.getComponent = (name) => {
|
|
return Telescope.components[name];
|
|
};
|
|
|
|
// ------------------------------------- Subscriptions -------------------------------- //
|
|
|
|
/**
|
|
* @summary Subscriptions namespace
|
|
* @namespace Telescope.subscriptions
|
|
*/
|
|
Telescope.subscriptions = [];
|
|
|
|
/**
|
|
* @summary Add a subscription to be preloaded
|
|
* @param {string} subscription - The name of the subscription
|
|
*/
|
|
Telescope.subscriptions.preload = function (subscription, args) {
|
|
Telescope.subscriptions.push({name: subscription, arguments: args});
|
|
};
|
|
|
|
// ------------------------------------- Strings -------------------------------- //
|
|
|
|
Telescope.strings = {};
|
|
|
|
// ------------------------------------- Routes -------------------------------- //
|
|
|
|
Telescope.routes = {
|
|
routes: [],
|
|
add(routeOrRouteArray) {
|
|
const addedRoutes = Array.isArray(routeOrRouteArray) ? routeOrRouteArray : [routeOrRouteArray];
|
|
this.routes = this.routes.concat(addedRoutes);
|
|
}
|
|
}
|
|
|
|
// ------------------------------------- Head Tags -------------------------------- //
|
|
|
|
Telescope.headtags = {
|
|
meta: [],
|
|
link: []
|
|
}
|
|
|
|
// ------------------------------------- Statuses -------------------------------- //
|
|
|
|
Telescope.statuses = [
|
|
{
|
|
value: 1,
|
|
label: 'pending'
|
|
},
|
|
{
|
|
value: 2,
|
|
label: 'approved'
|
|
},
|
|
{
|
|
value: 3,
|
|
label: 'rejected'
|
|
},
|
|
{
|
|
value: 4,
|
|
label: 'spam'
|
|
},
|
|
{
|
|
value: 5,
|
|
label: 'deleted'
|
|
}
|
|
];
|
|
|
|
export default Telescope;
|