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
45
imports/ui/components/CookieConsent/CookieConsent.js
Normal file
45
imports/ui/components/CookieConsent/CookieConsent.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import React, { Component } from 'react';
|
||||
import i18n from 'i18next';
|
||||
import './CookieConsent.scss';
|
||||
|
||||
/*
|
||||
* Minimal cookie-consent banner replacing selaias:cookie-consent (Blaze,
|
||||
* dead on Meteor 3: its `Cookies` global is gone and it crashed the whole
|
||||
* client bundle at load). Same behavior: informative banner, dismissed once.
|
||||
*/
|
||||
const STORAGE_KEY = 'tcef-cookie-consent';
|
||||
|
||||
class CookieConsent extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
let accepted = false;
|
||||
try {
|
||||
accepted = window.localStorage.getItem(STORAGE_KEY) === 'yes';
|
||||
} catch (e) { /* storage disabled: show banner every time */ }
|
||||
this.state = { accepted };
|
||||
this.accept = this.accept.bind(this);
|
||||
}
|
||||
|
||||
accept() {
|
||||
try {
|
||||
window.localStorage.setItem(STORAGE_KEY, 'yes');
|
||||
} catch (e) { /* ignore */ }
|
||||
this.setState({ accepted: true });
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.accepted) return null;
|
||||
return (
|
||||
<div className="CookieConsent">
|
||||
<span>
|
||||
{i18n.t('Utilizamos cookies para asegurar un mejor uso de nuestra web. Si continúas navegando, consideramos que aceptas su uso')}
|
||||
</span>
|
||||
<button type="button" className="btn btn-primary btn-sm" onClick={this.accept}>
|
||||
{i18n.t('Aceptar')}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CookieConsent;
|
||||
20
imports/ui/components/CookieConsent/CookieConsent.scss
Normal file
20
imports/ui/components/CookieConsent/CookieConsent.scss
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
.CookieConsent {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 1em;
|
||||
padding: 0.75em 1em;
|
||||
background: rgba(0, 0, 0, 0.85);
|
||||
color: #fff;
|
||||
font-size: 0.9em;
|
||||
|
||||
button {
|
||||
margin-left: 1em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue