• 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

78.57
/src/js/components/helptips/onboardingcompletetip.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, { useEffect, useRef } from 'react';
15
import { useDispatch, useSelector } from 'react-redux';
16

17
import { CheckCircle as CheckCircleIcon } from '@mui/icons-material';
18
import { Button } from '@mui/material';
19
import { withStyles } from 'tss-react/mui';
20

21
import { getDeviceById, getDevicesByStatus } from '../../actions/deviceActions';
22
import { setOnboardingComplete } from '../../actions/onboardingActions';
23
import * as DeviceConstants from '../../constants/deviceConstants';
24
import { onboardingSteps } from '../../constants/onboardingConstants';
25
import { getDemoDeviceAddress } from '../../selectors';
26
import Loader from '../common/loader';
27
import { MenderTooltipClickable } from '../common/mendertooltip';
28

29
export const CompletionButton = withStyles(Button, ({ palette }) => ({
184✔
30
  root: {
31
    backgroundColor: palette.background.default,
32
    '&:hover': {
33
      backgroundColor: palette.background.default
34
    }
35
  }
36
}));
37

38
export const OnboardingCompleteTip = ({ anchor, targetUrl }) => {
184✔
39
  const timer = useRef();
1✔
40
  const dispatch = useDispatch();
1✔
41
  const url = useSelector(getDemoDeviceAddress) || targetUrl;
1!
42

43
  useEffect(() => {
1✔
44
    dispatch(getDevicesByStatus(DeviceConstants.DEVICE_STATES.accepted))
1✔
45
      .then(tasks => {
46
        return Promise.all(tasks[tasks.length - 1].deviceAccu.ids.map(id => dispatch(getDeviceById(id))));
×
47
      })
48
      .finally(() => {
49
        timer.current = setTimeout(() => dispatch(setOnboardingComplete(true)), 120000);
×
50
      });
51
    return () => {
1✔
52
      dispatch(setOnboardingComplete(true));
1✔
53
      clearTimeout(timer.current);
1✔
54
    };
55
  }, [dispatch]);
56

57
  return (
1✔
58
    <MenderTooltipClickable
59
      className="tooltip onboard-icon onboard-tip"
60
      id={onboardingSteps.DEPLOYMENTS_PAST_COMPLETED}
61
      onboarding
62
      startOpen
63
      style={anchor}
64
      PopperProps={{ style: { marginLeft: -30, marginTop: -20 } }}
65
      title={
66
        <div className="content">
67
          <b>
68
            <p>Fantastic! You completed your first deployment!</p>
69
            <p>Your deployment is finished and your device is now running the updated software.</p>
70
          </b>
71
          <div className="margin-bottom-small margin-top-small">
72
            {!url ? (
1!
73
              <Loader show={true} />
74
            ) : (
75
              <CompletionButton className="button" variant="text" href={`${url}/index.html?source=${encodeURIComponent(window.location)}`} target="_blank">
76
                {`Go to ${url}`}
77
              </CompletionButton>
78
            )}
79
            <br />
80
            and you should see the demo web application actually being run on the device.
81
          </div>
82
          <p>NOTE: if you have local network restrictions, you may need to check them if you have difficulty loading the page.</p>
83
          <div className="flexbox">
84
            <div style={{ flexGrow: 1 }} />
85
            <Button variant="contained" color="secondary" onClick={() => dispatch(setOnboardingComplete(true))}>
×
86
              Close
87
            </Button>
88
          </div>
89
        </div>
90
      }
91
    >
92
      <CheckCircleIcon />
93
    </MenderTooltipClickable>
94
  );
95
};
96

97
export default OnboardingCompleteTip;
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