Merge branch 'fix/v1.2.3-banner-generic' into 'main'

fix(admin-ui): UpdateBanner generic message

See merge request 2-6/2-6-4/terravault/ordinis!41
This commit is contained in:
Александр Зимин
2026-05-11 10:39:35 +00:00
2 changed files with 9 additions and 7 deletions
@@ -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"
+2
View File
@@ -29,6 +29,7 @@ i18n
'graph.comingSoon.title': 'Скоро',
'graph.comingSoon.description': 'Visualization через d3-force — 40+ справочников с linked edges. В разработке (Stage 3.3 redesign roadmap).',
'updateBanner.message': 'Доступна новая версия НСИ ({{version}}). Обновите страницу, чтобы получить последние исправления.',
'updateBanner.messageGeneric': 'Доступна новая версия НСИ. Обновите страницу, чтобы получить последние исправления.',
'updateBanner.reload': 'Обновить',
'updateBanner.docs': 'Что нового',
'updateBanner.dismiss': 'Закрыть уведомление',
@@ -544,6 +545,7 @@ i18n
'graph.comingSoon.title': 'Coming soon',
'graph.comingSoon.description': 'd3-force visualization of 40+ dictionaries with linked edges. WIP (Stage 3.3 redesign roadmap).',
'updateBanner.message': 'A new NSI version ({{version}}) is available. Reload to get the latest fixes.',
'updateBanner.messageGeneric': 'A new NSI version is available. Reload to get the latest fixes.',
'updateBanner.reload': 'Reload',
'updateBanner.docs': "What's new",
'updateBanner.dismiss': 'Dismiss notification',