• 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

97.94
/frontend/src/js/components/helptips/OnboardingCompleteTip.tsx
1
// Copyright 2019 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 { useEffect, useRef } from 'react';
2✔
15
import { useDispatch, useSelector } from 'react-redux';
2✔
16

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

2✔
21
import Loader from '@northern.tech/common-ui/Loader';
2✔
22
import { MenderTooltipClickable } from '@northern.tech/common-ui/helptips/MenderTooltip';
2✔
23
import { DEVICE_STATES, onboardingSteps } from '@northern.tech/store/constants';
2✔
24
import { getDemoDeviceAddress } from '@northern.tech/store/selectors';
2✔
25
import { getDeviceById, getDevicesByStatus, setOnboardingComplete } from '@northern.tech/store/thunks';
2✔
26

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

2✔
36
export const OnboardingCompleteTip = ({ anchor, targetUrl }) => {
23✔
37
  const timer = useRef();
3✔
38
  const dispatch = useDispatch();
3✔
39
  const url = useSelector(getDemoDeviceAddress) || targetUrl;
3!
40

2✔
41
  useEffect(() => {
3✔
42
    dispatch(getDevicesByStatus({ status: DEVICE_STATES.accepted }))
3✔
43
      .unwrap()
2✔
44
      .then(tasks => Promise.all(tasks[tasks.length - 1].deviceAccu.ids.map(id => dispatch(getDeviceById(id)))))
4✔
45
      .finally(() => {
2✔
46
        timer.current = setTimeout(() => dispatch(setOnboardingComplete(true)), 120000);
3✔
47
      });
2✔
48
    return () => {
3✔
49
      clearTimeout(timer.current);
3✔
50
    };
2✔
51
  }, [dispatch]);
2✔
52

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

2✔
93
export default OnboardingCompleteTip;
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