fix(admin-ui): UpdateBanner generic message
This commit is contained in:
@@ -25,16 +25,18 @@ const DOCS_URL = '/docs/' // ordinis-docs deployment, mirrors prod /docs path
|
||||
*/
|
||||
export function UpdateBanner() {
|
||||
const { t } = useTranslation()
|
||||
const { updateAvailable, serverVersion, serverCommit, serverTag } = useAppVersion()
|
||||
const { updateAvailable, serverTag } = useAppVersion()
|
||||
const [dismissed, setDismissed] = useState(false)
|
||||
|
||||
if (!updateAvailable || dismissed) return null
|
||||
|
||||
// serverTag === 'none' для branch builds (Spring Boot build-info default
|
||||
// sentinel non-null). Не показываем "none" как версию — fallback к
|
||||
// serverVersion (e.g. "0.1.0-SNAPSHOT") и потом к 7-char commit hash.
|
||||
// sentinel non-null) — показываем generic message без "(version)" suffix.
|
||||
// 0.1.0-SNAPSHOT и raw commit hash для конечного юзера noise.
|
||||
const tag = serverTag && serverTag !== 'none' ? serverTag : null
|
||||
const versionLabel = tag || serverVersion || serverCommit?.substring(0, 7) || ''
|
||||
const message = tag
|
||||
? t('updateBanner.message', { version: tag })
|
||||
: t('updateBanner.messageGeneric')
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -44,9 +46,7 @@ export function UpdateBanner() {
|
||||
>
|
||||
<div className="max-w-6xl mx-auto px-4 sm:px-6 py-2 flex items-center gap-3 flex-wrap text-sm">
|
||||
<ArrowClockwise size={18} weight="bold" className="shrink-0" aria-hidden />
|
||||
<span className="flex-1 min-w-0">
|
||||
{t('updateBanner.message', { version: versionLabel })}
|
||||
</span>
|
||||
<span className="flex-1 min-w-0">{message}</span>
|
||||
<div className="flex items-center gap-2 ml-auto">
|
||||
<Button
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user