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

mendersoftware / gui / 897326496

pending completion
897326496

Pull #3752

gitlab-ci

mzedel
chore(e2e): made use of shared timeout & login checking values to remove code duplication

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Pull Request #3752: chore(e2e-tests): slightly simplified log in test + separated log out test

4395 of 6392 branches covered (68.76%)

8060 of 9780 relevant lines covered (82.41%)

126.17 hits per line

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

75.86
/src/js/components/auditlogs/eventdetails/filetransfer.js
1
// Copyright 2021 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, { useEffect } from 'react';
15
import { connect } from 'react-redux';
16

17
import { useTheme } from '@mui/material/styles';
18

19
import { getDeviceById } from '../../../actions/deviceActions';
20
import { getIdAttribute, getUserCapabilities } from '../../../selectors';
21
import Loader from '../../common/loader';
22
import DeviceDetails, { DetailInformation } from './devicedetails';
23

24
export const FileTransfer = ({ canReadDevices, device, idAttribute, item, getDeviceById, onClose }) => {
7✔
25
  const theme = useTheme();
1✔
26

27
  useEffect(() => {
1✔
28
    const { object } = item;
1✔
29
    if (!device && canReadDevices) {
1!
30
      getDeviceById(object.id);
×
31
    }
32
  }, []);
33

34
  if (canReadDevices && !device) {
1!
35
    return <Loader show={true} />;
×
36
  }
37

38
  const {
39
    actor,
40
    meta: { path = [] }
×
41
  } = item;
1✔
42
  const sessionMeta = {
1✔
43
    Path: path.join(','),
44
    User: actor.email
45
  };
46

47
  return (
1✔
48
    <div className="flexbox column" style={{ margin: theme.spacing(3), minWidth: 'min-content' }}>
49
      {canReadDevices && <DeviceDetails device={device} idAttribute={idAttribute} onClose={onClose} />}
2✔
50
      <DetailInformation title="file transfer" details={sessionMeta} />
51
    </div>
52
  );
53
};
54

55
const actionCreators = { getDeviceById };
7✔
56

57
const mapStateToProps = (state, ownProps) => {
7✔
58
  const { item = {} } = ownProps;
1!
59
  const deviceId = item.object.id;
1✔
60
  const { canReadDevices } = getUserCapabilities(state);
1✔
61
  return {
1✔
62
    canReadDevices,
63
    device: state.devices.byId[deviceId],
64
    idAttribute: getIdAttribute(state).attribute
65
  };
66
};
67

68
export default connect(mapStateToProps, actionCreators)(FileTransfer);
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