meteor3: purge dead client packages — web UI renders on 3.1
alanning:roles removed (client crashed the whole bundle; plain user.roles checks instead), selaias:cookie-consent replaced by in-repo React banner, publish-performant-counts vendored with countAsync, Meteor.autorun dropped (App)/Tracker.autorun (FiresMap), and the map publications not covered by the REST smoke (activefiresmyloc, activefiresunionmyloc, fireAlerts, oauth.verifyConfiguration) converted to async APIs. Verified in browser: / and /fires render with map + cookie banner, zero uncaught exceptions. REST smoke byte-identical (12/12).
This commit is contained in:
parent
0ff9848cd4
commit
eb3aec82ae
16 changed files with 194 additions and 50 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* global CookieConsent Intl */
|
||||
/* global Intl */
|
||||
import i18n from 'i18next';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
|
|
@ -89,23 +89,9 @@ i18n.use(backend)
|
|||
|
||||
i18nReady.set(true);
|
||||
|
||||
// cookies eu consent
|
||||
const cookiesOpt = {
|
||||
cookieTitle: t('Uso de Cookies'),
|
||||
cookieMessage: t('Utilizamos cookies para asegurar un mejor uso de nuestra web. Si continúas navegando, consideramos que aceptas su uso'),
|
||||
/* cookieMessage: t('Uso de Cookies'),
|
||||
cookieMessageImply: t('Utilizamos cookies para asegurar un mejor uso de nuestra web. Si continúas navegando, consideramos que aceptas su uso'), */
|
||||
showLink: false,
|
||||
position: 'bottom',
|
||||
linkText: 'Lee más',
|
||||
linkRouteName: '/privacy',
|
||||
acceptButtonText: t('Aceptar'),
|
||||
html: false,
|
||||
expirationInDays: 70,
|
||||
forceShow: false
|
||||
};
|
||||
|
||||
CookieConsent.init(cookiesOpt);
|
||||
// Cookie consent banner: selaias:cookie-consent (Blaze, dead on Meteor 3)
|
||||
// replaced by the React component imports/ui/components/CookieConsent,
|
||||
// which reuses the same i18n keys.
|
||||
});
|
||||
|
||||
Meteor.subscribe('userData'); // lang is there
|
||||
|
|
|
|||
|
|
@ -1,5 +1,18 @@
|
|||
/* global Facts */
|
||||
import { Roles } from 'meteor/alanning:roles';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Facts } from 'meteor/facts-base';
|
||||
|
||||
Facts.setUserIdFilter(userId => Roles.userIsInRole(userId, ['admin']));
|
||||
/*
|
||||
* alanning:roles removed (1.x is dead on Meteor 3 — crashes the whole client
|
||||
* bundle at load — and 4.x needs a data migration we don't want). Admin check
|
||||
* against the plain `user.roles` field, cached at startup: facts are
|
||||
* dev/admin instrumentation and the admin set essentially never changes.
|
||||
*/
|
||||
const adminIds = new Set();
|
||||
|
||||
Meteor.startup(async () => {
|
||||
await Meteor.users
|
||||
.find({ roles: 'admin' }, { fields: { _id: 1 } })
|
||||
.forEachAsync(u => adminIds.add(u._id));
|
||||
});
|
||||
|
||||
Facts.setUserIdFilter(userId => adminIds.has(userId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue