v0.12.0 codes for FCM and rebranded jama to RosterChirp

This commit is contained in:
2026-03-22 20:15:57 -04:00
parent 21dc788cd3
commit 819d60d693
40 changed files with 426 additions and 363 deletions

View File

@@ -5,9 +5,9 @@ import { useToast } from '../contexts/ToastContext.jsx';
// ── Helpers ───────────────────────────────────────────────────────────────────
const APP_TYPES = {
'JAMA-Chat': { label: 'JAMA-Chat', desc: 'Chat only. No Branding, Group Manager or Schedule Manager.' },
'JAMA-Brand': { label: 'JAMA-Brand', desc: 'Chat and Branding.' },
'JAMA-Team': { label: 'JAMA-Team', desc: 'Chat, Branding, Group Manager and Schedule Manager.' },
'RosterChirp-Chat': { label: 'RosterChirp-Chat', desc: 'Chat only. No Branding, Group Manager or Schedule Manager.' },
'RosterChirp-Brand': { label: 'RosterChirp-Brand', desc: 'Chat and Branding.' },
'RosterChirp-Team': { label: 'RosterChirp-Team', desc: 'Chat, Branding, Group Manager and Schedule Manager.' },
};
// ── Team Management Tab ───────────────────────────────────────────────────────
@@ -34,7 +34,7 @@ function TeamManagementTab() {
try {
await api.updateTeamSettings({ toolManagers });
toast('Team settings saved', 'success');
window.dispatchEvent(new Event('jama:settings-changed'));
window.dispatchEvent(new Event('rosterchirp:settings-changed'));
} catch (e) { toast(e.message, 'error'); }
finally { setSaving(false); }
};
@@ -82,7 +82,7 @@ function RegistrationTab({ onFeaturesChanged }) {
api.getSettings().then(({ settings }) => setSettings(settings)).catch(() => {});
}, []);
const appType = settings.app_type || 'JAMA-Chat';
const appType = settings.app_type || 'RosterChirp-Chat';
const activeCode = settings.registration_code || '';
const adminEmail = settings.admin_email || '—';
@@ -104,7 +104,7 @@ function RegistrationTab({ onFeaturesChanged }) {
const fresh = await api.getSettings();
setSettings(fresh.settings);
toast('Registration applied successfully.', 'success');
window.dispatchEvent(new Event('jama:settings-changed'));
window.dispatchEvent(new Event('rosterchirp:settings-changed'));
onFeaturesChanged && onFeaturesChanged(f);
} catch (e) { toast(e.message || 'Invalid registration code', 'error'); }
finally { setRegLoading(false); }
@@ -116,12 +116,12 @@ function RegistrationTab({ onFeaturesChanged }) {
const fresh = await api.getSettings();
setSettings(fresh.settings);
toast('Registration cleared.', 'success');
window.dispatchEvent(new Event('jama:settings-changed'));
window.dispatchEvent(new Event('rosterchirp:settings-changed'));
onFeaturesChanged && onFeaturesChanged(f);
} catch (e) { toast(e.message, 'error'); }
};
const typeInfo = APP_TYPES[appType] || APP_TYPES['JAMA-Chat'];
const typeInfo = APP_TYPES[appType] || APP_TYPES['RosterChirp-Chat'];
const siteUrl = window.location.origin;
return (
@@ -132,7 +132,7 @@ function RegistrationTab({ onFeaturesChanged }) {
Registration {activeCode ? 'is' : 'required:'}
</p>
<p style={{ fontSize: 13, color: 'var(--text-secondary)', lineHeight: 1.6 }}>
JAMA {activeCode ? 'is' : 'will be'} registered to:<br />
RosterChirp {activeCode ? 'is' : 'will be'} registered to:<br />
<strong>Type:</strong> {typeInfo.label}<br />
<strong>URL:</strong> {siteUrl}
</p>
@@ -185,9 +185,9 @@ function RegistrationTab({ onFeaturesChanged }) {
)}
<p style={{ fontSize: 12, color: 'var(--text-tertiary)', marginTop: 16, lineHeight: 1.5 }}>
Registration codes unlock application features. Contact your JAMA provider for a code.<br />
<strong>JAMA-Brand</strong> unlocks Branding.&nbsp;
<strong>JAMA-Team</strong> unlocks Branding, Group Manager and Schedule Manager.
Registration codes unlock application features. Contact your RosterChirp provider for a code.<br />
<strong>RosterChirp-Brand</strong> unlocks Branding.&nbsp;
<strong>RosterChirp-Team</strong> unlocks Branding, Group Manager and Schedule Manager.
</p>
</div>
);
@@ -270,18 +270,18 @@ function WebPushTab() {
// ── Main modal ────────────────────────────────────────────────────────────────
export default function SettingsModal({ onClose, onFeaturesChanged }) {
const [tab, setTab] = useState('registration');
const [appType, setAppType] = useState('JAMA-Chat');
const [appType, setAppType] = useState('RosterChirp-Chat');
useEffect(() => {
api.getSettings().then(({ settings }) => {
setAppType(settings.app_type || 'JAMA-Chat');
setAppType(settings.app_type || 'RosterChirp-Chat');
}).catch(() => {});
const handler = () => api.getSettings().then(({ settings }) => setAppType(settings.app_type || 'JAMA-Chat')).catch(() => {});
window.addEventListener('jama:settings-changed', handler);
return () => window.removeEventListener('jama:settings-changed', handler);
const handler = () => api.getSettings().then(({ settings }) => setAppType(settings.app_type || 'RosterChirp-Chat')).catch(() => {});
window.addEventListener('rosterchirp:settings-changed', handler);
return () => window.removeEventListener('rosterchirp:settings-changed', handler);
}, []);
const isTeam = appType === 'JAMA-Team';
const isTeam = appType === 'RosterChirp-Team';
const tabs = [
isTeam && { id: 'team', label: 'Team Management' },