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:
@@ -25,16 +25,18 @@ const DOCS_URL = '/docs/' // ordinis-docs deployment, mirrors prod /docs path
|
|||||||
*/
|
*/
|
||||||
export function UpdateBanner() {
|
export function UpdateBanner() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { updateAvailable, serverVersion, serverCommit, serverTag } = useAppVersion()
|
const { updateAvailable, serverTag } = useAppVersion()
|
||||||
const [dismissed, setDismissed] = useState(false)
|
const [dismissed, setDismissed] = useState(false)
|
||||||
|
|
||||||
if (!updateAvailable || dismissed) return null
|
if (!updateAvailable || dismissed) return null
|
||||||
|
|
||||||
// serverTag === 'none' для branch builds (Spring Boot build-info default
|
// serverTag === 'none' для branch builds (Spring Boot build-info default
|
||||||
// sentinel non-null). Не показываем "none" как версию — fallback к
|
// sentinel non-null) — показываем generic message без "(version)" suffix.
|
||||||
// serverVersion (e.g. "0.1.0-SNAPSHOT") и потом к 7-char commit hash.
|
// 0.1.0-SNAPSHOT и raw commit hash для конечного юзера noise.
|
||||||
const tag = serverTag && serverTag !== 'none' ? serverTag : null
|
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 (
|
return (
|
||||||
<div
|
<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">
|
<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 />
|
<ArrowClockwise size={18} weight="bold" className="shrink-0" aria-hidden />
|
||||||
<span className="flex-1 min-w-0">
|
<span className="flex-1 min-w-0">{message}</span>
|
||||||
{t('updateBanner.message', { version: versionLabel })}
|
|
||||||
</span>
|
|
||||||
<div className="flex items-center gap-2 ml-auto">
|
<div className="flex items-center gap-2 ml-auto">
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ i18n
|
|||||||
'graph.comingSoon.title': 'Скоро',
|
'graph.comingSoon.title': 'Скоро',
|
||||||
'graph.comingSoon.description': 'Visualization через d3-force — 40+ справочников с linked edges. В разработке (Stage 3.3 redesign roadmap).',
|
'graph.comingSoon.description': 'Visualization через d3-force — 40+ справочников с linked edges. В разработке (Stage 3.3 redesign roadmap).',
|
||||||
'updateBanner.message': 'Доступна новая версия НСИ ({{version}}). Обновите страницу, чтобы получить последние исправления.',
|
'updateBanner.message': 'Доступна новая версия НСИ ({{version}}). Обновите страницу, чтобы получить последние исправления.',
|
||||||
|
'updateBanner.messageGeneric': 'Доступна новая версия НСИ. Обновите страницу, чтобы получить последние исправления.',
|
||||||
'updateBanner.reload': 'Обновить',
|
'updateBanner.reload': 'Обновить',
|
||||||
'updateBanner.docs': 'Что нового',
|
'updateBanner.docs': 'Что нового',
|
||||||
'updateBanner.dismiss': 'Закрыть уведомление',
|
'updateBanner.dismiss': 'Закрыть уведомление',
|
||||||
@@ -544,6 +545,7 @@ i18n
|
|||||||
'graph.comingSoon.title': 'Coming soon',
|
'graph.comingSoon.title': 'Coming soon',
|
||||||
'graph.comingSoon.description': 'd3-force visualization of 40+ dictionaries with linked edges. WIP (Stage 3.3 redesign roadmap).',
|
'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.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.reload': 'Reload',
|
||||||
'updateBanner.docs': "What's new",
|
'updateBanner.docs': "What's new",
|
||||||
'updateBanner.dismiss': 'Dismiss notification',
|
'updateBanner.dismiss': 'Dismiss notification',
|
||||||
|
|||||||
Reference in New Issue
Block a user