diff --git a/src/@types/parseable/api/about.ts b/src/@types/parseable/api/about.ts index 82f21796..d3766af6 100644 --- a/src/@types/parseable/api/about.ts +++ b/src/@types/parseable/api/about.ts @@ -1,8 +1,12 @@ +export type QueryEngineType = 'Trino' | 'Parseable' | undefined; + +export type LicenseType = 'AGPL-3.0-only' | undefined; + export type AboutData = { commit: string; deploymentId: string; latestVersion: string; - license: string; + license: LicenseType; mode: string; staging: string; store: { type: string; path: string }; diff --git a/src/components/Header/PrimaryHeader.tsx b/src/components/Header/PrimaryHeader.tsx index 35beea62..14eb8168 100644 --- a/src/components/Header/PrimaryHeader.tsx +++ b/src/components/Header/PrimaryHeader.tsx @@ -5,12 +5,15 @@ import { Button, Divider, Image, Stack } from '@mantine/core'; import { FC, useCallback } from 'react'; import styles from './styles/Header.module.css'; import HelpModal from './HelpModal'; +import _ from 'lodash'; import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/AppProvider'; +import { OSS_LICENSE_TYPE } from '@/constants'; const PrimaryHeader: FC = () => { const classes = styles; const { logoContainer, imageSty } = classes; const [maximized, setAppStore] = useAppStore((store) => store.maximized); + const [instanceConfig] = useAppStore((store) => store.instanceConfig); const toggleHelpModal = useCallback(() => setAppStore(appStoreReducers.toggleHelpModal), []); if (maximized) return null; @@ -31,14 +34,16 @@ const PrimaryHeader: FC = () => { className={classes.rightSection} style={{ flexDirection: 'row', height: '100%', justifyContent: 'flex-end' }} gap={8}> - + {instanceConfig?.license && _.isEqual(instanceConfig?.license, OSS_LICENSE_TYPE) && ( + + )} + {_.isEqual(getAboutData?.data.license, OSS_LICENSE_TYPE) && ( + + )} diff --git a/src/constants/index.ts b/src/constants/index.ts new file mode 100644 index 00000000..7afda4aa --- /dev/null +++ b/src/constants/index.ts @@ -0,0 +1,3 @@ +const OSS_LICENSE_TYPE = 'AGPL-3.0-only'; + +export { OSS_LICENSE_TYPE };