Skip to content

Commit fb512c6

Browse files
committed
feat: hide version in case of mismatch
1 parent 2e56ca9 commit fb512c6

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.12.0-pre-2",
3+
"version": "1.12.0-pre-3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/AboutDevtron/AboutDevtronBody.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ import { Button, ButtonComponentType, ButtonStyleType, ButtonVariantType } from
88
import { InstallationType } from '../Header/types'
99
import { Icon } from '../Icon'
1010

11-
const AboutDevtronBody = () => {
11+
const AboutDevtronBody = ({ isFELibAvailable }: { isFELibAvailable: boolean }) => {
1212
const { currentServerInfo } = useMainContext()
1313

1414
const currentVersion = currentServerInfo?.serverInfo?.currentVersion
1515
const isEnterprise = currentServerInfo?.serverInfo?.installationType === InstallationType.ENTERPRISE
1616

17+
const isVersionSame = isFELibAvailable === isEnterprise
18+
1719
const handleEULAClick = () => {
1820
ReactGA.event({
1921
category: 'about-devtron',
@@ -29,7 +31,9 @@ const AboutDevtronBody = () => {
2931
</div>
3032
<div>
3133
<p className="fs-16 cn-9 fw-6 lh-1-5 m-0">Devtron</p>
32-
<p className="fs-13 cn-7 fw-4 lh-20 m-0">{`${isEnterprise ? 'Enterprise' : 'OSS'} Version${currentVersion ? `(${currentVersion})` : ''}`}</p>
34+
{isVersionSame && (
35+
<p className="fs-13 cn-7 fw-4 lh-20 m-0">{`${isEnterprise ? 'Enterprise' : 'OSS'} Version${currentVersion ? `(${currentVersion})` : ''}`}</p>
36+
)}
3337
</div>
3438
<DevtronCopyright />
3539
</div>

src/Shared/Components/AboutDevtron/AboutDevtronDialog.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ import { Backdrop } from '../Backdrop'
44
import { Button } from '../Button'
55
import AboutDevtronBody from './AboutDevtronBody'
66

7-
const AboutDevtronDialog = ({ handleCloseLicenseInfoDialog }: { handleCloseLicenseInfoDialog }) => (
7+
const AboutDevtronDialog = ({
8+
handleCloseLicenseInfoDialog,
9+
isFELibAvailable,
10+
}: {
11+
handleCloseLicenseInfoDialog: () => void
12+
isFELibAvailable: boolean
13+
}) => (
814
<Backdrop onEscape={handleCloseLicenseInfoDialog}>
915
<div className="flexbox-col w-400 br-12 bg__primary border__primary dc__m-auto mt-40">
1016
<div className="p-24">
11-
<AboutDevtronBody />
17+
<AboutDevtronBody isFELibAvailable={isFELibAvailable} />
1218
</div>
1319
<div className="flex px-24 py-20 dc__content-end">
1420
<Button

0 commit comments

Comments
 (0)