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

alkem-io / client-web / #9438

22 Nov 2024 11:19PM UTC coverage: 5.94%. First build
#9438

Pull #7248

travis-ci

Pull Request #7248: Fix build:dev (styled err)

208 of 10567 branches covered (1.97%)

Branch coverage included in aggregate %.

0 of 88 new or added lines in 14 files covered. (0.0%)

1501 of 18203 relevant lines covered (8.25%)

0.19 hits per line

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

0.0
/src/core/lazyLoading/GlobalErrorDialog.tsx
1
import React from 'react';
2
import { Trans, useTranslation } from 'react-i18next';
3
import { Box, Button, Dialog, DialogContent, DialogTitle } from '@mui/material';
4
import { useGlobalError } from './GlobalErrorContext';
5
import { LazyLoadError } from './lazyWithGlobalErrorHandler';
6
import TranslationKey from '@/core/i18n/utils/TranslationKey';
7

NEW
8
const ErrorTranslationMappings = (error: Error): TranslationKey => {
×
NEW
9
  if (error instanceof LazyLoadError) {
×
NEW
10
    return 'pages.error.errors.LazyLoadError';
×
11
  }
NEW
12
  return 'pages.error.errors.unknown';
×
13
};
14

NEW
15
const GlobalErrorDialog: React.FC = () => {
×
NEW
16
  const { t } = useTranslation();
×
NEW
17
  const { error, setError } = useGlobalError();
×
18

NEW
19
  if (!error) return null;
×
20

NEW
21
  return (
×
NEW
22
    <Dialog open={!!error} aria-labelledby="global-error-dialog" onClose={() => setError(null)}>
×
23
      <DialogTitle sx={{ m: 0, p: 2 }} id="customized-dialog-title">
24
        {t('pages.error.title')}
25
      </DialogTitle>
26
      <DialogContent>
27
        <Box>
28
          <Trans
29
            i18nKey="pages.error.line1"
30
            values={{
31
              message: t(ErrorTranslationMappings(error)),
32
            }}
33
            components={{
34
              italic: <i />,
35
            }}
36
          />
37
        </Box>
38
        <Box sx={{ display: 'flex', justifyContent: 'flex-end', marginTop: '20px' }}>
39
          <Button
40
            variant="contained"
41
            onClick={() => {
NEW
42
              setError(null);
×
NEW
43
              window.location.reload();
×
44
            }}
45
          >
46
            {t('pages.error.buttons.reload')}
47
          </Button>
48
        </Box>
49
      </DialogContent>
50
    </Dialog>
51
  );
52
};
53

54
export default GlobalErrorDialog;
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