• 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

94.24
/frontend/src/js/components/auditlogs/AuditLogsList.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 { Sort as SortIcon } from '@mui/icons-material';
2✔
15
import { makeStyles } from 'tss-react/mui';
2✔
16

2✔
17
import DetailsIndicator from '@northern.tech/common-ui/DetailsIndicator';
2✔
18
import Loader from '@northern.tech/common-ui/Loader';
2✔
19
import Pagination from '@northern.tech/common-ui/Pagination';
2✔
20
import { SORTING_OPTIONS } from '@northern.tech/store/constants';
2✔
21

2✔
22
export const defaultRowsPerPage = 20;
7✔
23

2✔
24
const useStyles = makeStyles()(theme => ({
7✔
25
  auditlogsList: {
2✔
26
    '& .auditlogs-list-item': {
2✔
27
      display: 'grid',
2✔
28
      gridTemplateColumns: '2fr 1fr 1fr 2fr 2fr 1.75fr 120px',
2✔
29
      gridColumnGap: theme.spacing(4),
2✔
30
      padding: `5px ${theme.spacing(2)}`,
2✔
31
      borderBottom: `1px solid ${theme.palette.border?.main ?? theme.palette.divider}`,
2!
32
      height: theme.spacing(6),
2✔
33
      minHeight: theme.spacing(6),
2✔
34
      maxHeight: theme.spacing(6),
2✔
35
      alignItems: 'center',
2✔
36
      '&:last-of-type': {
2✔
37
        borderBottom: 'transparent'
2✔
38
      },
2✔
39
      '& > *': {
2✔
40
        display: 'flex',
2✔
41
        alignItems: 'center',
2✔
42
        maxHeight: theme.spacing(6),
2✔
43
        overflow: 'hidden'
2✔
44
      },
2✔
45
      '> .text-overflow': {
2✔
46
        display: 'block'
2✔
47
      },
2✔
48
      '&.auditlogs-list-item-header': {
2✔
49
        borderBottom: 'transparent',
2✔
50
        cursor: 'initial',
2✔
51
        padding: `10px ${theme.spacing(2)}`,
2✔
52
        position: 'relative'
2✔
53
      }
2✔
54
    }
2✔
55
  }
2✔
56
}));
2✔
57

2✔
58
export const AuditLogsList = ({
7✔
59
  items,
2✔
60
  onChangePage,
2✔
61
  onChangeRowsPerPage,
2✔
62
  onChangeSorting,
2✔
63
  selectionState,
2✔
64
  onIssueSelection,
2✔
65
  userCapabilities,
2✔
66
  auditLogColumns
2✔
67
}) => {
2✔
68
  const { page, perPage, sort = {}, total: count, isLoading } = selectionState;
20✔
69
  const { classes } = useStyles();
20✔
70

2✔
71
  return (
20✔
72
    !!items.length && (
2✔
73
      <div className={`fadeIn deploy-table-contain auditlogs-list ${classes.auditlogsList}`}>
2✔
74
        <div className="auditlogs-list-item auditlogs-list-item-header muted">
2✔
75
          {auditLogColumns.map((column, index) => (
2✔
76
            <div
110✔
77
              className="columnHeader"
2✔
78
              key={`columnHeader-${index}`}
2✔
UNCOV
79
              onClick={() => (column.sortable ? onChangeSorting() : null)}
2!
80
              style={column.sortable ? {} : { cursor: 'initial' }}
2✔
81
            >
2✔
82
              {column.title}
2✔
83
              {column.sortable ? <SortIcon className={`sortIcon selected ${(sort.direction === SORTING_OPTIONS.desc).toString()}`} /> : null}
2✔
84
            </div>
2✔
85
          ))}
2✔
86
          <div />
2✔
87
        </div>
2✔
88
        <div className="auditlogs-list">
2✔
89
          {items.map(item => {
2✔
90
            const allowsExpansion = !!item.change || item.action.includes('terminal') || item.action.includes('portforward');
56!
91
            return (
56✔
92
              <div
2✔
93
                className={`auditlogs-list-item ${allowsExpansion ? 'clickable' : ''}`}
2!
94
                key={`event-${item.time}`}
2✔
95
                onClick={() => onIssueSelection(allowsExpansion ? item : undefined)}
3!
96
              >
2✔
97
                {auditLogColumns.map((column, index) => column.render(item, index, userCapabilities))}
326✔
98
                {allowsExpansion ? <DetailsIndicator /> : <div />}
2!
99
              </div>
2✔
100
            );
2✔
101
          })}
2✔
102
        </div>
2✔
103
        <div className="flexbox margin-top">
2✔
104
          <Pagination
2✔
105
            className="margin-top-none"
2✔
106
            count={count}
2✔
107
            rowsPerPage={perPage}
2✔
108
            onChangeRowsPerPage={onChangeRowsPerPage}
2✔
109
            page={page}
2✔
110
            onChangePage={onChangePage}
2✔
111
          />
2✔
112
          <Loader show={isLoading} small />
2✔
113
        </div>
2✔
114
      </div>
2✔
115
    )
2✔
116
  );
2✔
117
};
2✔
118

2✔
119
export default AuditLogsList;
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