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

mendersoftware / gui / 1057188406

01 Nov 2023 04:24AM UTC coverage: 82.824% (-17.1%) from 99.964%
1057188406

Pull #4134

gitlab-ci

web-flow
chore: Bump uuid from 9.0.0 to 9.0.1

Bumps [uuid](https://github.com/uuidjs/uuid) from 9.0.0 to 9.0.1.
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v9.0.0...v9.0.1)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #4134: chore: Bump uuid from 9.0.0 to 9.0.1

4349 of 6284 branches covered (0.0%)

8313 of 10037 relevant lines covered (82.82%)

200.97 hits per line

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

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

16
import { List, ListItem, ListItemText, Table, TableBody, TableCell, TableHead, TableRow } from '@mui/material';
17
import { makeStyles } from 'tss-react/mui';
18

19
import { FileSize, getFormattedSize } from '../../helpers';
20
import Time from '../common/time';
21

22
const METADATA_SPACING = 2;
8✔
23

24
const useStyles = makeStyles()(theme => ({
8✔
25
  metadataList: {
26
    display: 'flex',
27
    flexDirection: 'row'
28
  },
29
  table: {
30
    background: 'transparent'
31
  },
32
  metadataListItem: {
33
    paddingBottom: 11,
34
    borderBottom: `1px solid ${theme.palette.grey[600]}`,
35
    marginRight: '2vw'
36
  },
37
  payloadHeader: {
38
    background: theme.palette.grey[500],
39
    margin: 0,
40
    padding: 10,
41
    position: 'absolute',
42
    top: -20
43
  }
44
}));
45

46
const attributes = ['Name', 'Checksum', 'Build date', 'Size (uncompressed)'];
8✔
47

48
export const ArtifactPayload = ({ index, payload: { files: payloadFiles, meta_data = {}, type_info } }) => {
8✔
49
  const { classes } = useStyles();
1✔
50
  const files = payloadFiles || [];
1✔
51
  const summedSize = files.reduce((accu, item) => accu + item.size, 0);
1✔
52
  const metaDataObject = meta_data;
1✔
53
  const metaData = [
1✔
54
    { title: 'Type', value: type_info.type },
55
    { title: 'Total Size (uncompressed)', value: getFormattedSize(summedSize) }
56
  ];
57
  return (
1✔
58
    <div className="file-details">
59
      <h4 className={classes.payloadHeader}>Payload {index}</h4>
60
      <List className={classes.metadataList}>
61
        {metaData.map((item, index) => (
62
          <ListItem disabled={true} className={classes.metadataListItem} classes={{ root: 'attributes', disabled: 'opaque' }} key={`metadata-item-${index}`}>
2✔
63
            <ListItemText primary={item.title} secondary={item.value} />
64
          </ListItem>
65
        ))}
66
      </List>
67
      <div className="file-meta">
68
        {Object.keys(metaDataObject).length ? (
1!
69
          <div>
70
            <h4>Update Metadata</h4>
71
            <pre>
72
              <code>{JSON.stringify(metaDataObject, null, METADATA_SPACING)}</code>
73
            </pre>
74
          </div>
75
        ) : null}
76
        <h4>Files</h4>
77
        {files.length ? (
1!
78
          <Table className={classes.table}>
79
            <TableHead>
80
              <TableRow>
81
                {attributes.map((item, index) => (
82
                  <TableCell key={`file-header-${index}`} tooltip={item}>
×
83
                    {item}
84
                  </TableCell>
85
                ))}
86
              </TableRow>
87
            </TableHead>
88
            <TableBody className={classes.table}>
89
              {files.map((file, index) => (
90
                <TableRow key={index}>
×
91
                  <TableCell>{file.name}</TableCell>
92
                  <TableCell style={{ wordBreak: 'break-word' }}>{file.checksum}</TableCell>
93
                  <TableCell>
94
                    <Time value={file.date} />
95
                  </TableCell>
96
                  <TableCell>
97
                    <FileSize fileSize={file.size} />
98
                  </TableCell>
99
                </TableRow>
100
              ))}
101
            </TableBody>
102
          </Table>
103
        ) : (
104
          <p>There are no files in this Artifact</p>
105
        )}
106
      </div>
107
    </div>
108
  );
109
};
110

111
export default ArtifactPayload;
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