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

mendersoftware / gui / 901187442

pending completion
901187442

Pull #3795

gitlab-ci

mzedel
feat: increased chances of adopting our intended navigation patterns instead of unsupported browser navigation

Ticket: None
Changelog: None
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Pull Request #3795: feat: increased chances of adopting our intended navigation patterns instead of unsupported browser navigation

4389 of 6365 branches covered (68.96%)

5 of 5 new or added lines in 1 file covered. (100.0%)

1729 existing lines in 165 files now uncovered.

8274 of 10019 relevant lines covered (82.58%)

144.86 hits per line

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

72.22
/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

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

29
export const OnboardingCompleteTip = ({ anchor, targetUrl }) => {
190✔
30
  const timer = useRef();
1✔
31
  const dispatch = useDispatch();
1✔
32
  const docsVersion = useSelector(getDocsVersion);
1✔
33
  const url = useSelector(getDemoDeviceAddress) || targetUrl;
1!
34

35
  useEffect(() => {
1✔
36
    dispatch(getDevicesByStatus(DeviceConstants.DEVICE_STATES.accepted))
1✔
37
      .then(tasks => {
UNCOV
38
        return Promise.all(tasks[tasks.length - 1].deviceAccu.ids.map(id => dispatch(getDeviceById(id))));
×
39
      })
40
      .finally(() => {
UNCOV
41
        timer.current = setTimeout(() => dispatch(setOnboardingComplete(true)), 120000);
×
42
      });
43
    return () => {
1✔
44
      dispatch(setOnboardingComplete(true));
1✔
45
      clearTimeout(timer.current);
1✔
46
    };
47
  }, []);
48

49
  return (
1✔
50
    <MenderTooltipClickable
51
      className="tooltip onboard-icon onboard-tip"
52
      id={onboardingSteps.ONBOARDING_FINISHED}
53
      onboarding
54
      startOpen
55
      style={anchor}
56
      PopperProps={{ style: { marginLeft: -30, marginTop: -20 } }}
57
      title={
58
        <div className="content">
59
          <p>Great work! You updated your device with the new Release!</p>
60
          <div className="margin-bottom-small margin-top-small">
61
            Your device is now running the updated version of the software. At
62
            <div className="flexbox centered" style={{ margin: '5px 0' }}>
63
              {!url ? (
1!
64
                <Loader show={true} />
65
              ) : (
66
                <CompletionButton
67
                  className="button"
68
                  variant="text"
69
                  href={`${url}/index.html?source=${encodeURIComponent(window.location)}`}
70
                  target="_blank"
71
                >{`Go to ${url}`}</CompletionButton>
72
              )}
73
            </div>
74
            you should now see &quot;Hello world&quot; in place of the webpage you saw previously. If you continue to see the webpage you saw previously you
75
            might have to refresh the page.
76
          </div>
77
          <p>You&apos;ve now got a good foundation in how to use Mender. Look for more help hints in the UI as you go along.</p>
78
          What next?
79
          <div>
80
            Proceed to one of the following tutorials (listed in recommended order):
81
            <ol>
82
              <li key="deploy-a-system-update">
83
                <a href={`https://docs.mender.io/${docsVersion}get-started/deploy-an-operating-system-update`} target="_blank" rel="noopener noreferrer">
84
                  Deploy an operating system update
85
                </a>
86
              </li>
87
              <li key="deploy-a-container-update">
88
                <a href={`https://docs.mender.io/${docsVersion}get-started/deploy-a-container-update`} target="_blank" rel="noopener noreferrer">
89
                  Deploy a container update
90
                </a>
91
              </li>
92
            </ol>
93
          </div>
94
          <div className="flexbox">
95
            <div style={{ flexGrow: 1 }} />
UNCOV
96
            <Button variant="contained" color="secondary" onClick={() => dispatch(setOnboardingComplete(true))}>
×
97
              Close
98
            </Button>
99
          </div>
100
        </div>
101
      }
102
    >
103
      <CheckCircleIcon />
104
    </MenderTooltipClickable>
105
  );
106
};
107

108
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