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

mendersoftware / mender-server / 10423

11 Nov 2025 04:53PM UTC coverage: 74.435% (-0.1%) from 74.562%
10423

push

gitlab-ci

web-flow
Merge pull request #1071 from mendersoftware/dependabot/npm_and_yarn/frontend/main/development-dependencies-92732187be

3868 of 5393 branches covered (71.72%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 2 files covered. (100.0%)

176 existing lines in 95 files now uncovered.

64605 of 86597 relevant lines covered (74.6%)

7.74 hits per line

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

98.53
/frontend/src/js/common-ui/dialogs/Log.tsx
1
// Copyright 2020 Northern.tech AS
2✔
2
//
2✔
3
//    Licensed under the Apache License, Version 2.0 (the "License");
2✔
4
//    you may not use this file except in compliance with the License.
2✔
5
//    You may obtain a copy of the License at
2✔
6
//
2✔
7
//        http://www.apache.org/licenses/LICENSE-2.0
2✔
8
//
2✔
9
//    Unless required by applicable law or agreed to in writing, software
2✔
10
//    distributed under the License is distributed on an "AS IS" BASIS,
2✔
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2✔
12
//    See the License for the specific language governing permissions and
2✔
13
//    limitations under the License.
2✔
14
import { useState } from 'react';
2✔
15
import CopyToClipboard from 'react-copy-to-clipboard';
2✔
16

2✔
17
import { Button, DialogActions, DialogContent } from '@mui/material';
2✔
18

2✔
19
import { BaseDialog } from '@northern.tech/common-ui/dialogs/BaseDialog';
2✔
20
import { createFileDownload } from '@northern.tech/utils/helpers';
2✔
21

2✔
22
import { Code } from '../CopyCode';
2✔
23

2✔
24
const wrapperStyle = { marginRight: 10, display: 'inline-block' };
12✔
25

2✔
26
const dialogTypes = {
12✔
27
  'deviceLog': {
2✔
28
    title: 'Deployment log for device',
2✔
UNCOV
29
    filename: ({ device, releaseName, date }) => `deployment-log-${device}-${releaseName}-${date}.log`
2✔
30
  },
2✔
31
  'configUpdateLog': {
2✔
32
    title: 'Config update log for device',
2✔
UNCOV
33
    filename: () => 'configuration-update.log'
2✔
34
  }
2✔
35
};
2✔
36

2✔
37
export const LogDialog = ({ context = {}, logData = '', onClose, type = 'deviceLog' }) => {
12✔
38
  const [copied, setCopied] = useState(false);
3✔
39

2✔
UNCOV
40
  const exportLog = () => createFileDownload(logData, dialogTypes[type].filename(context), '');
2✔
41

2✔
42
  return (
3✔
43
    <BaseDialog open title={dialogTypes[type].title} maxWidth="lg" onClose={onClose}>
2✔
44
      <DialogContent>
2✔
45
        <Code className="log">{logData}</Code>
2✔
46
        <p style={{ marginLeft: 24 }}>{copied && <span className="green fadeIn">Copied to clipboard.</span>}</p>
2!
47
      </DialogContent>
2✔
48
      <DialogActions>
2✔
49
        <div style={wrapperStyle}>
2✔
50
          <Button onClick={onClose}>Cancel</Button>
2✔
51
        </div>
2✔
UNCOV
52
        <CopyToClipboard style={wrapperStyle} text={logData} onCopy={() => setCopied(true)}>
2✔
53
          <Button>Copy to clipboard</Button>
2✔
54
        </CopyToClipboard>
2✔
55
        <Button variant="contained" onClick={exportLog}>
2✔
56
          Export log
2✔
57
        </Button>
2✔
58
      </DialogActions>
2✔
59
    </BaseDialog>
2✔
60
  );
2✔
61
};
2✔
62

2✔
63
export default LogDialog;
2✔
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

© 2025 Coveralls, Inc