import { Brand, Card, CardBody, CardTitle, DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm, EmptyState, EmptyStateBody, Grid, GridItem, Label, List, ListItem, ListVariant, PageSection, Text, TextContent, Title, } from "@patternfly/react-core"; import React from "react"; import { useTranslation } from "react-i18next"; import _ from "lodash"; import { useRealm } from "../context/realm-context/RealmContext"; import { useServerInfo } from "../context/server-info/ServerInfoProvider"; import "./dashboard.css"; import { toUpperCase } from "../util"; import { HelpItem } from "../components/help-enabler/HelpItem"; import environment from "../environment"; const EmptyDashboard = () => { const { t } = useTranslation("dashboard"); const { realm } = useRealm(); return ( {t("welcome")} {realm} {t("introduction")} ); }; const Dashboard = () => { const { t } = useTranslation("dashboard"); const { realm } = useRealm(); const serverInfo = useServerInfo(); const enabledFeatures = _.xor( serverInfo.profileInfo?.disabledFeatures, serverInfo.profileInfo?.experimentalFeatures, serverInfo.profileInfo?.previewFeatures ); const isExperimentalFeature = (feature: string) => { return serverInfo.profileInfo?.experimentalFeatures?.includes(feature); }; const isPreviewFeature = (feature: string) => { return serverInfo.profileInfo?.previewFeatures?.includes(feature); }; return ( <> {toUpperCase(realm)} realm {t("serverInfo")} {t("version")} {serverInfo.systemInfo?.version} {t("product")} {toUpperCase(serverInfo.profileInfo?.name!)} {t("profile")} {t("enabledFeatures")}{" "} {enabledFeatures.map((feature) => ( {feature}{" "} {isExperimentalFeature(feature) ? ( ) : null} {isPreviewFeature(feature) ? ( ) : null} ))} {t("disabledFeatures")}{" "} {serverInfo.profileInfo?.disabledFeatures?.map( (feature) => ( {feature} ) )} ); }; export const DashboardSection = () => { const { realm } = useRealm(); const isMasterRealm = realm === "master"; return ( <> {!isMasterRealm && } {isMasterRealm && } ); };