Skip to content

Commit 5e7e65b

Browse files
committed
Merge branch 'feat/devtron-license' into feat/devtron-license-helpers
2 parents a050090 + b702ed5 commit 5e7e65b

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { ClipboardButton } from '@Common/index'
2+
3+
import { DOCUMENTATION_HOME_PAGE } from '@Common/Constants'
4+
import { InfoIconTippy } from '..'
5+
import { InstallFingerprintInfoProps } from './types'
6+
7+
const InstallationFingerprintInfo = ({ fingerprint, showHelpTooltip = false }: InstallFingerprintInfoProps) => (
8+
<div className="flexbox-col dc__gap-6">
9+
<div className="flexbox dc__align-items-center dc__gap-4">
10+
<span className="fs-13 lh-20 cn-7 fw-4">Installation Fingerprint</span>
11+
{showHelpTooltip && (
12+
<InfoIconTippy
13+
heading="Installation Fingerprint"
14+
infoText="A unique fingerprint to identify your Devtron Installation. An enterprise license is generated against an installation fingerprint."
15+
documentationLinkText="Documentation"
16+
iconClassName="icon-dim-20 fcn-6"
17+
placement="right"
18+
documentationLink={DOCUMENTATION_HOME_PAGE}
19+
/>
20+
)}
21+
</div>
22+
<div className="flex dc__gap-8">
23+
<span className="cn-9 fs-13 lh-1-5 fw-4 dc__truncate">{fingerprint}</span>
24+
<ClipboardButton content={fingerprint} />
25+
</div>
26+
</div>
27+
)
28+
29+
export default InstallationFingerprintInfo
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { default as DevtronLicenseCard } from './DevtronLicenseCard'
22
export { parseDevtronLicenseDTOIntoLicenseCardData } from './utils'
3+
export { default as InstallationFingerprintInfo } from './InstallationFingerprintInfo'
34
export * from './types'

src/Shared/Components/DevtronLicenseCard/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { DevtronLicenseBaseDTO } from '@Shared/index'
2+
13
export enum LicenseStatus {
24
ACTIVE = 'ACTIVE',
35
EXPIRED = 'EXPIRED',
@@ -20,3 +22,7 @@ export type DevtronLicenseCardProps = {
2022
licenseSuffix: string
2123
}
2224
)
25+
26+
export interface InstallFingerprintInfoProps extends Pick<DevtronLicenseBaseDTO, 'fingerprint'> {
27+
showHelpTooltip?: boolean
28+
}

src/Shared/Components/DevtronLicenseCard/utils.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export const parseDevtronLicenseDTOIntoLicenseCardData = <isCentralDashboard ext
4343
ttl,
4444
licenseStatus: getDevtronLicenseStatus({ ttl, reminderThreshold }),
4545
isTrial,
46-
...(currentUserEmail === claimedByUserDetails?.email ? { licenseKey: license } : { licenseSuffix: license }),
46+
...(currentUserEmail && currentUserEmail === claimedByUserDetails?.email
47+
? { licenseKey: license }
48+
: { licenseSuffix: license }),
4749
}
4850
}

0 commit comments

Comments
 (0)