• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alkem-io / client-web / #6263

16 Nov 2023 11:59AM UTC coverage: 5.91%. First build
#6263

Pull #5203

travis-ci

Pull Request #5203: IconButton Labels

184 of 8743 branches covered (0.0%)

Branch coverage included in aggregate %.

1 of 43 new or added lines in 37 files covered. (2.33%)

1281 of 16046 relevant lines covered (7.98%)

0.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/ui/helpButton/PlatformHelpButton.tsx
1
import { useState, Suspense } from 'react';
2
import HelpIcon from '@mui/icons-material/Help';
3
import HelpDialog from '@/core/help/dialog/HelpDialog';
4
import { IconButton } from '@mui/material';
5
import { useConfig } from '@/domain/platform/config/useConfig';
6
import { useCurrentUserContext } from '@/domain/community/userCurrent/useCurrentUserContext';
7
import { AuthorizationPrivilege, PlatformFeatureFlagName } from '@/core/apollo/generated/graphql-schema';
8
import { useFullscreen } from '@/core/ui/fullscreen/useFullscreen';
9
import { useTranslation } from 'react-i18next';
10
import { lazyWithGlobalErrorHandler } from '@/core/lazyLoading/lazyWithGlobalErrorHandler';
11

12
const ChatWidget = lazyWithGlobalErrorHandler(() => import('@/main/guidance/chatWidget/ChatWidget'));
×
NEW
13

×
14
const PlatformHelpButton = () => {
×
15
  const { t } = useTranslation();
×
16
  const [dialogOpen, setDialogOpen] = useState(false);
×
17
  const openHelpDialog = () => {
18
    setDialogOpen(true);
19
  };
×
20

×
21
  const { fullscreen } = useFullscreen();
×
22
  const { isFeatureEnabled } = useConfig();
×
23
  const isGuidanceEnabled = isFeatureEnabled(PlatformFeatureFlagName.GuidenceEngine);
24
  const { platformPrivilegeWrapper: userWrapper } = useCurrentUserContext();
×
25
  const shouldDisplayChatWidget =
26
    !fullscreen && // Never show the widget when there's something in fullscreen
27
    userWrapper?.hasPlatformPrivilege(AuthorizationPrivilege.AccessInteractiveGuidance) &&
28
    isGuidanceEnabled;
×
29

30
  return (
×
31
    <>
32
      {shouldDisplayChatWidget ? (
33
        <Suspense fallback={null}>
34
          <ChatWidget />
35
        </Suspense>
36
      ) : (
37
        <IconButton onClick={openHelpDialog} aria-label={t('common.help')}>
×
38
          <HelpIcon color="primary" fontSize="large" sx={{ filter: 'drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));' }} />
39
        </IconButton>
40
      )}
41
      <HelpDialog open={dialogOpen} onClose={() => setDialogOpen(false)} />
42
    </>
43
  );
44
};
45

46
export default PlatformHelpButton;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc