Fork Stalwart WebUI v1.0.11 as INBUXA Admin
- One edition: whatever edition the server reports, nothing is hidden or disabled as Enterprise-only (accountStore.setAccountInfo). - INBUXA branding: name, logo (mark plus a text-colored wordmark), favicon, page titles, setup wizard text, and ihasmail's palette in light and dark. - Two-factor setup names INBUXA as the issuer and drops the image parameter that made authenticator apps fetch a logo from a third-party site. - Runs apart from the server: the server address can be set at deploy time with <meta name="api-base-url">, and OAuth endpoints the server returns as relative paths are resolved against the server's address, not the page's. Verified end to end against a separate inbuxa-server. - Upstream's release workflow moved to .github-upstream so it never runs. Upstream's history contains no Enterprise-only code, so this is an ordinary fork. upstream is a fetch-only remote.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -333,7 +333,7 @@ export function BootstrapWizard() {
|
||||
<WizardShell>
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h2 className="text-2xl font-semibold tracking-tight">{t('bootstrap.welcome', 'Welcome to Stalwart')}</h2>
|
||||
<h2 className="text-2xl font-semibold tracking-tight">{t('bootstrap.welcome', 'Welcome to INBUXA')}</h2>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
{t('bootstrap.welcomeSubtitle', "Let's get your server set up.")}
|
||||
</p>
|
||||
@@ -468,7 +468,7 @@ function SuccessScreen({
|
||||
'bootstrap.credentialsCreated',
|
||||
'Your administrator account has been created. Write these down now: the password will not be shown again.',
|
||||
)
|
||||
: t('bootstrap.configuredSuccessfully', 'Stalwart has been configured successfully.')}
|
||||
: t('bootstrap.configuredSuccessfully', 'INBUXA has been configured successfully.')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -500,7 +500,7 @@ function SuccessScreen({
|
||||
<span className="font-medium">{t('bootstrap.nextStepLabel', 'Next step:')}</span>{' '}
|
||||
{t(
|
||||
'bootstrap.nextStepBody',
|
||||
'restart Stalwart for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.',
|
||||
'restart INBUXA for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.',
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -7,24 +7,26 @@
|
||||
import { useEffect, useSyncExternalStore } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getLogoState, loadLogoOnce, subscribeToLogo } from '@/lib/logoCache';
|
||||
import inbuxaMark from '@/assets/inbuxa-mark.png';
|
||||
|
||||
export function DefaultLogo() {
|
||||
const { t } = useTranslation();
|
||||
// The INBUXA compact lockup: the mark as an image, the wordmark as vector
|
||||
// paths in the current text color, so it reads on light and dark themes.
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="95 84 500 90"
|
||||
aria-label={t('logo.stalwartAlt', 'Stalwart Logo')}
|
||||
viewBox="165 35 616 130"
|
||||
aria-label={t('logo.stalwartAlt', 'INBUXA')}
|
||||
className="h-7 w-auto max-w-[320px]"
|
||||
>
|
||||
<path
|
||||
className="fill-current"
|
||||
d="M227.8 143.6c.3 4.2 2.1 7.6 5.1 10.1 3.1 2.5 7.1 3.8 12.1 3.8 4.3 0 7.9-.9 10.5-2.8 2.7-1.9 4-4.5 4-7.8 0-2.4-.7-4.3-2.2-5.7-1.5-1.4-3.4-2.5-6-3.2-2.5-.7-6-1.5-10.6-2.3-4.6-.8-8.6-1.9-11.9-3.2-3.3-1.3-6-3.3-8.1-6.1-2.1-2.7-3.1-6.3-3.1-10.7 0-4.1 1.1-7.7 3.2-10.9s5.1-5.7 9-7.4c3.8-1.8 8.2-2.6 13.2-2.6 5.1 0 9.6 1 13.7 2.9 4 1.9 7.2 4.5 9.5 7.8s3.6 7.1 3.8 11.4h-11.5c-.4-3.7-2-6.6-4.8-8.9-2.8-2.2-6.3-3.4-10.6-3.4-4.1 0-7.5.9-9.9 2.7-2.5 1.8-3.7 4.3-3.7 7.6 0 2.3.7 4.1 2.2 5.5 1.5 1.4 3.4 2.4 5.9 3.1 2.4.7 5.9 1.4 10.5 2.2 4.6.8 8.6 1.9 11.9 3.3 3.3 1.4 6 3.4 8.2 6 2.1 2.6 3.2 6.1 3.2 10.5 0 4.2-1.1 8-3.4 11.3-2.2 3.3-5.4 5.9-9.4 7.8-4 1.9-8.6 2.8-13.7 2.8-5.6 0-10.6-1-14.9-3.1-4.3-2-7.6-4.9-10-8.5-2.4-3.6-3.7-7.8-3.7-12.5l11.5.3zM278.5 102.1l11-2.1v14.6h12.6v9.7h-12.6v27.2c0 2 .4 3.5 1.2 4.3.8.9 2.2 1.3 4.2 1.3h8.4v9.7h-10.6c-5 0-8.6-1.2-10.8-3.5-2.2-2.3-3.4-5.9-3.4-10.7v-50.5zM356.8 114.6v52.2h-9.7l-1.2-7.9c-1.8 2.6-4.2 4.7-7 6.2-2.9 1.6-6.2 2.3-10 2.3-4.8 0-9-1.1-12.7-3.2-3.7-2.1-6.7-5.2-8.8-9.3-2.1-4-3.2-8.8-3.2-14.2 0-5.3 1.1-10 3.2-14s5.1-7.2 8.8-9.4c3.7-2.2 7.9-3.3 12.6-3.3 3.9 0 7.2.7 10.1 2.2 2.9 1.5 5.2 3.5 6.9 6.1l1.3-7.6h9.7zm-15.1 38.7c2.8-3.2 4.2-7.3 4.2-12.4 0-5.2-1.4-9.4-4.2-12.6-2.8-3.3-6.5-4.9-11-4.9-4.6 0-8.2 1.6-11 4.8-2.8 3.2-4.2 7.4-4.2 12.5 0 5.2 1.4 9.4 4.2 12.6 2.8 3.2 6.5 4.8 11 4.8s8.2-1.6 11-4.8zM365.5 97.5l11-2.1v71.3h-11V97.5zM380.3 114.6h11.6l11.9 39.9 11.9-39.9h10.1l11.4 39.9 12.3-39.9h11.2l-17.3 52.2h-11.8l-11-35.5-11.4 35.5-11.9.1-17-52.3zM513.7 114.6v52.2H504l-1.2-7.9c-1.8 2.6-4.2 4.7-7 6.2-2.9 1.6-6.2 2.3-10 2.3-4.8 0-9-1.1-12.7-3.2-3.7-2.1-6.7-5.2-8.8-9.3-2.1-4-3.2-8.8-3.2-14.2 0-5.3 1.1-10 3.2-14s5.1-7.2 8.8-9.4c3.7-2.2 7.9-3.3 12.6-3.3 3.9 0 7.2.7 10.1 2.2 2.9 1.5 5.2 3.5 6.9 6.1l1.3-7.6h9.7zm-15.1 38.7c2.8-3.2 4.2-7.3 4.2-12.4 0-5.2-1.4-9.4-4.2-12.6-2.8-3.3-6.5-4.9-11-4.9-4.6 0-8.2 1.6-11 4.8-2.8 3.2-4.2 7.4-4.2 12.5 0 5.2 1.4 9.4 4.2 12.6 2.8 3.2 6.5 4.8 11 4.8 4.6 0 8.2-1.6 11-4.8zM551.3 114.6v10.3h-4.9c-4.6 0-7.8 1.5-9.9 4.4-2 3-3.1 6.7-3.1 11.3v26.2h-11v-52.2h9.8l1.2 7.8c1.5-2.4 3.4-4.4 5.8-5.8 2.4-1.4 5.6-2.1 9.6-2.1h2.5zM556.3 102.1l11-2.1v14.6h12.6v9.7h-12.6v27.2c0 2 .4 3.5 1.2 4.3.8.9 2.2 1.3 4.2 1.3h8.4v9.7h-10.6c-5 0-8.6-1.2-10.8-3.5s-3.4-5.9-3.4-10.7v-50.5z"
|
||||
/>
|
||||
<path
|
||||
fill="#db2d54"
|
||||
d="M149.1 84.7h-4.8l-44.8 25.9v8.3l44.8 25.9h4.8l44.8-25.9v-8.3l-44.8-25.9zm32.9 30h-35.3V94.4l35.3 20.3zm-35.3 20.4-35.3-20.4 27-15.6v20.2l6.3 3.6h22.9l-20.9 12.2zM99.5 129.9v11l44.8 25.9h4.8l44.8-25.9v-11l-47.2 27.3zM187.3 166.8l6.6-3.8v-11l-25.7 14.8zM99.5 163l6.6 3.8h19.1L99.5 152z"
|
||||
/>
|
||||
<image x="165.85" y="35.00" width="109.39" height="130.00" href={inbuxaMark} />
|
||||
<path className="fill-current" d="M70 0V496H196V0ZM133 554Q99 554 75.5 576.0Q52 598 52 634Q52 670 75.5 692.0Q99 714 133 714Q168 714 191.0 692.0Q214 670 214 634Q214 598 191.0 576.0Q168 554 133 554Z" transform="translate(303.25,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M70 0V496H194V431H212Q224 457 257.0 480.5Q290 504 357 504Q415 504 458.5 477.5Q502 451 526.0 404.5Q550 358 550 296V0H424V286Q424 342 396.5 370.0Q369 398 318 398Q260 398 228.0 359.5Q196 321 196 252V0Z" transform="translate(340.15,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M368 -14Q301 -14 265.0 9.0Q229 32 212 60H194V0H70V700H196V439H214Q225 457 243.5 473.0Q262 489 292.5 499.5Q323 510 368 510Q428 510 479.0 480.5Q530 451 561.0 394.0Q592 337 592 256V240Q592 159 561.0 102.0Q530 45 479.0 15.5Q428 -14 368 -14ZM330 96Q388 96 427.0 133.5Q466 171 466 243V253Q466 325 427.5 362.5Q389 400 330 400Q272 400 233.0 362.5Q194 325 194 253V243Q194 171 233.0 133.5Q272 96 330 96Z" transform="translate(429.55,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M259 -8Q201 -8 157.5 18.5Q114 45 90.0 92.0Q66 139 66 200V496H192V210Q192 154 219.5 126.0Q247 98 298 98Q356 98 388.0 136.5Q420 175 420 244V496H546V0H422V65H404Q392 40 359.0 16.0Q326 -8 259 -8Z" transform="translate(522.25,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M26 0 206 250 28 496H174L287 331H305L418 496H564L386 250L566 0H418L305 167H287L174 0Z" transform="translate(611.65,151.90) scale(0.150000,-0.150000)" />
|
||||
<path className="fill-current" d="M224 -14Q171 -14 129.0 4.5Q87 23 62.5 58.5Q38 94 38 145Q38 196 62.5 230.5Q87 265 130.5 282.5Q174 300 230 300H366V328Q366 363 344.0 385.5Q322 408 274 408Q227 408 204.0 386.5Q181 365 174 331L58 370Q70 408 96.5 439.5Q123 471 167.5 490.5Q212 510 276 510Q374 510 431.0 461.0Q488 412 488 319V134Q488 104 516 104H556V0H472Q435 0 411.0 18.0Q387 36 387 66V67H368Q364 55 350.0 35.5Q336 16 306.0 1.0Q276 -14 224 -14ZM246 88Q299 88 332.5 117.5Q366 147 366 196V206H239Q204 206 184.0 191.0Q164 176 164 149Q164 122 185.0 105.0Q206 88 246 88Z" transform="translate(697.45,151.90) scale(0.150000,-0.150000)" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,17 +27,15 @@ interface OtpAuthFieldProps {
|
||||
readOnly: boolean;
|
||||
}
|
||||
|
||||
const STALWART_IMAGE_URL = 'https://stalw.art/img/favicon-32x32.png';
|
||||
|
||||
function buildOtpAuthUrl(totp: OTPAuth.TOTP): string {
|
||||
const base = totp.toString();
|
||||
const sep = base.includes('?') ? '&' : '?';
|
||||
return `${base}${sep}image=${encodeURIComponent(STALWART_IMAGE_URL)}`;
|
||||
// No `image` parameter: it made authenticator apps fetch a logo from a
|
||||
// third-party site each time someone set up two-factor.
|
||||
return totp.toString();
|
||||
}
|
||||
|
||||
function generateTotp(): { totp: OTPAuth.TOTP; url: string } {
|
||||
const totp = new OTPAuth.TOTP({
|
||||
issuer: 'Stalwart',
|
||||
issuer: 'INBUXA',
|
||||
label: 'account',
|
||||
algorithm: 'SHA1',
|
||||
digits: 6,
|
||||
|
||||
@@ -88,7 +88,7 @@ export function TopBar() {
|
||||
</Link>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
{t('version.label', 'Stalwart WebUI v{{version}}', { version: __APP_VERSION__ })}
|
||||
{t('version.label', 'INBUXA Admin v{{version}}', { version: __APP_VERSION__ })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
const APP_NAME = 'Stalwart WebUI';
|
||||
const APP_NAME = 'INBUXA Admin';
|
||||
|
||||
export function useDocumentTitle(title?: string | null) {
|
||||
useEffect(() => {
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@
|
||||
"bootstrap": {
|
||||
"clipboardBlocked": "Your browser blocked clipboard access.",
|
||||
"complete": "Setup complete",
|
||||
"configuredSuccessfully": "Stalwart has been configured successfully.",
|
||||
"configuredSuccessfully": "INBUXA has been configured successfully.",
|
||||
"copyFailed": "Copy failed",
|
||||
"credentialsCreated": "Your administrator account has been created. Write these down now: the password will not be shown again.",
|
||||
"emptyForm": "Setup form is empty. The server did not return any bootstrap fields.",
|
||||
@@ -23,11 +23,11 @@
|
||||
"failedToLoad": "Failed to load bootstrap state.",
|
||||
"finishSetup": "Finish setup",
|
||||
"loadingSetup": "Loading setup...",
|
||||
"nextStepBody": "restart Stalwart for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.",
|
||||
"nextStepBody": "restart INBUXA for the new configuration to take effect. Once restarted, sign in with the credentials above to continue administering your server.",
|
||||
"nextStepLabel": "Next step:",
|
||||
"noConfirm": "The server did not confirm the update.",
|
||||
"stepOf": "Step {{current}} of {{total}}",
|
||||
"welcome": "Welcome to Stalwart",
|
||||
"welcome": "Welcome to INBUXA",
|
||||
"welcomeSubtitle": "Let's get your server set up."
|
||||
},
|
||||
"common": {
|
||||
@@ -299,11 +299,11 @@
|
||||
},
|
||||
"logo": {
|
||||
"alt": "Logo",
|
||||
"stalwartAlt": "Stalwart Logo"
|
||||
"stalwartAlt": "INBUXA"
|
||||
},
|
||||
"logout": "Logout",
|
||||
"version": {
|
||||
"label": "Stalwart WebUI v{{version}}"
|
||||
"label": "INBUXA Admin v{{version}}"
|
||||
},
|
||||
"oauth": {
|
||||
"backToLogin": "Back to login",
|
||||
|
||||
+50
-50
@@ -7,81 +7,81 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
:root {
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0.017 285.823);
|
||||
--background: #ffffff;
|
||||
--foreground: #111827;
|
||||
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0.017 285.823);
|
||||
--card: #ffffff;
|
||||
--card-foreground: #111827;
|
||||
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0.017 285.823);
|
||||
--popover: #ffffff;
|
||||
--popover-foreground: #111827;
|
||||
|
||||
--content-background: oklch(0.97 0.003 285.823);
|
||||
--content-background: #f6f8fa;
|
||||
|
||||
--primary: oklch(0.205 0.017 285.823);
|
||||
--primary-foreground: oklch(0.985 0.002 285.823);
|
||||
--primary: #0f766e;
|
||||
--primary-foreground: #ffffff;
|
||||
|
||||
--secondary: oklch(0.965 0.005 285.823);
|
||||
--secondary-foreground: oklch(0.205 0.017 285.823);
|
||||
--secondary: #eef1f4;
|
||||
--secondary-foreground: #111827;
|
||||
|
||||
--muted: oklch(0.93 0.005 285.823);
|
||||
--muted-foreground: oklch(0.556 0.015 285.823);
|
||||
--muted: #eef1f4;
|
||||
--muted-foreground: #5b6472;
|
||||
|
||||
--accent: oklch(0.965 0.005 285.823);
|
||||
--accent-foreground: oklch(0.205 0.017 285.823);
|
||||
--accent: #d9f1ee;
|
||||
--accent-foreground: #0b5750;
|
||||
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(0.985 0.002 285.823);
|
||||
--destructive: #dc2626;
|
||||
--destructive-foreground: #ffffff;
|
||||
|
||||
--border: oklch(0.922 0.007 285.823);
|
||||
--input: oklch(0.922 0.007 285.823);
|
||||
--ring: oklch(0.708 0.015 285.823);
|
||||
--border: #e3e7ec;
|
||||
--input: #e3e7ec;
|
||||
--ring: #0f766e;
|
||||
|
||||
--radius: 0.5rem;
|
||||
|
||||
--chart-1: 220 70% 50%;
|
||||
--chart-2: 160 60% 45%;
|
||||
--chart-3: 30 80% 55%;
|
||||
--chart-4: 280 65% 60%;
|
||||
--chart-5: 340 75% 55%;
|
||||
--chart-1: #0f766e;
|
||||
--chart-2: #f9a34c;
|
||||
--chart-3: #1c4053;
|
||||
--chart-4: #0e7490;
|
||||
--chart-5: #b45309;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.141 0.005 285.823);
|
||||
--foreground: oklch(0.985 0.002 285.823);
|
||||
--background: #111a2b;
|
||||
--foreground: #e5e9f0;
|
||||
|
||||
--card: oklch(0.205 0.007 285.823);
|
||||
--card-foreground: oklch(0.985 0.002 285.823);
|
||||
--card: #111a2b;
|
||||
--card-foreground: #e5e9f0;
|
||||
|
||||
--popover: oklch(0.205 0.007 285.823);
|
||||
--popover-foreground: oklch(0.985 0.002 285.823);
|
||||
--popover: #111a2b;
|
||||
--popover-foreground: #e5e9f0;
|
||||
|
||||
--content-background: oklch(0.115 0.005 285.823);
|
||||
--content-background: #0b1220;
|
||||
|
||||
--primary: oklch(0.985 0.002 285.823);
|
||||
--primary-foreground: oklch(0.205 0.017 285.823);
|
||||
--primary: #2dd4bf;
|
||||
--primary-foreground: #052e2b;
|
||||
|
||||
--secondary: oklch(0.274 0.009 285.823);
|
||||
--secondary-foreground: oklch(0.985 0.002 285.823);
|
||||
--secondary: #1f2a3d;
|
||||
--secondary-foreground: #e5e9f0;
|
||||
|
||||
--muted: oklch(0.274 0.009 285.823);
|
||||
--muted-foreground: oklch(0.708 0.015 285.823);
|
||||
--muted: #1f2a3d;
|
||||
--muted-foreground: #9aa5b8;
|
||||
|
||||
--accent: oklch(0.274 0.009 285.823);
|
||||
--accent-foreground: oklch(0.985 0.002 285.823);
|
||||
--accent: #12343a;
|
||||
--accent-foreground: #99f6e4;
|
||||
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(0.985 0.002 285.823);
|
||||
--destructive: #f87171;
|
||||
--destructive-foreground: #0b1220;
|
||||
|
||||
--border: oklch(0.274 0.009 285.823);
|
||||
--input: oklch(0.274 0.009 285.823);
|
||||
--ring: oklch(0.553 0.013 285.823);
|
||||
--border: #1f2a3d;
|
||||
--input: #1f2a3d;
|
||||
--ring: #2dd4bf;
|
||||
|
||||
--chart-1: 220 70% 60%;
|
||||
--chart-2: 160 60% 55%;
|
||||
--chart-3: 30 80% 60%;
|
||||
--chart-4: 280 65% 65%;
|
||||
--chart-5: 340 75% 60%;
|
||||
--chart-1: #2dd4bf;
|
||||
--chart-2: #f9a34c;
|
||||
--chart-3: #9fc2d6;
|
||||
--chart-4: #67e8f9;
|
||||
--chart-5: #fbbf24;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
|
||||
@@ -13,6 +13,12 @@ export function getApiBaseUrl(): string {
|
||||
if (envUrl && envUrl.length > 0) {
|
||||
return envUrl.replace(/\/+$/, '');
|
||||
}
|
||||
// Set at deploy time rather than build time, so one build can point at any
|
||||
// server: <meta name="api-base-url" content="https://mail.example.com">.
|
||||
const injected = document.querySelector('meta[name="api-base-url"]')?.getAttribute('content')?.trim();
|
||||
if (injected) {
|
||||
return injected.replace(/\/+$/, '');
|
||||
}
|
||||
return window.location.origin;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,19 @@ export async function discover(username: string): Promise<DiscoveryResponse> {
|
||||
}),
|
||||
);
|
||||
}
|
||||
return response.json() as Promise<DiscoveryResponse>;
|
||||
const discovered = (await response.json()) as DiscoveryResponse;
|
||||
// A server that doesn't know its public URL yet (bootstrap mode, or no
|
||||
// public URL configured) returns relative endpoints such as "/login". They
|
||||
// belong to the server, so resolve them against the server's address, not
|
||||
// this page's: INBUXA Admin is usually served from somewhere else.
|
||||
const base = `${getApiBaseUrl()}/`;
|
||||
const absolute = (endpoint: string | undefined) => (endpoint ? new URL(endpoint, base).toString() : endpoint);
|
||||
return {
|
||||
...discovered,
|
||||
authorization_endpoint: absolute(discovered.authorization_endpoint) as string,
|
||||
token_endpoint: absolute(discovered.token_endpoint) as string,
|
||||
end_session_endpoint: absolute(discovered.end_session_endpoint),
|
||||
};
|
||||
}
|
||||
|
||||
const UNRESERVED = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';
|
||||
|
||||
@@ -33,7 +33,8 @@ describe('accountStore', () => {
|
||||
|
||||
const state = useAccountStore.getState();
|
||||
expect(state.permissions).toEqual(['b', 'c']);
|
||||
expect(state.edition).toBe('oss');
|
||||
// INBUXA: one edition. A server reporting 'oss' still unlocks everything.
|
||||
expect(state.edition).toBe('enterprise');
|
||||
expect(state.locale).toBe('ja');
|
||||
});
|
||||
|
||||
@@ -101,9 +102,11 @@ describe('accountStore', () => {
|
||||
expect(useAccountStore.getState().edition).toBe('enterprise');
|
||||
});
|
||||
|
||||
it('can be changed to oss', () => {
|
||||
it('is never oss or community, whatever the server reports (INBUXA: one edition)', () => {
|
||||
useAccountStore.getState().setAccountInfo([], 'oss', 'en');
|
||||
expect(useAccountStore.getState().edition).toBe('oss');
|
||||
expect(useAccountStore.getState().edition).toBe('enterprise');
|
||||
useAccountStore.getState().setAccountInfo([], 'community', 'en');
|
||||
expect(useAccountStore.getState().edition).toBe('enterprise');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,8 +23,11 @@ export const useAccountStore = create<AccountState>()((set, get) => ({
|
||||
edition: 'community',
|
||||
locale: 'en',
|
||||
|
||||
setAccountInfo: (permissions, edition, locale) => {
|
||||
set({ permissions, edition, locale });
|
||||
setAccountInfo: (permissions, _edition, locale) => {
|
||||
// INBUXA has one edition, with every feature. Whatever the server reports,
|
||||
// nothing is hidden or disabled as Enterprise-only. Features the server
|
||||
// hasn't rebuilt yet answer that for themselves.
|
||||
set({ permissions, edition: 'enterprise', locale });
|
||||
},
|
||||
|
||||
hasPermission: (perm) => {
|
||||
|
||||
Reference in New Issue
Block a user