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

mendersoftware / gui / 1091795320

01 Dec 2023 04:32AM UTC coverage: 82.784% (-17.2%) from 99.964%
1091795320

Pull #4229

gitlab-ci

web-flow
chore: Bump node from 21.1.0-alpine to 21.2.0-alpine

Bumps node from 21.1.0-alpine to 21.2.0-alpine.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #4229: chore: Bump node from 21.1.0-alpine to 21.2.0-alpine

4316 of 6292 branches covered (0.0%)

8333 of 10066 relevant lines covered (82.78%)

188.98 hits per line

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

92.42
/src/js/components/helptips/helptooltips.js
1
// Copyright 2017 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, { useCallback } from 'react';
15
import { useDispatch, useSelector } from 'react-redux';
16

17
import { setSnackbar } from '../../actions/appActions';
18
import { setAllTooltipsReadState, setTooltipReadState } from '../../actions/userActions';
19
import { yes } from '../../constants/appConstants';
20
import { READ_STATES } from '../../constants/userConstants';
21
import { getDeviceById, getFeatures, getTooltipsState } from '../../selectors';
22
import ConfigurationObject from '../common/configurationobject';
23
import DocsLink from '../common/docslink';
24
import { HelpTooltip } from '../common/mendertooltip';
25

26
const AuthExplainButton = () => (
183✔
27
  <>
1✔
28
    <h3>Device authorization status</h3>
29
    <p>
30
      Each device sends an authentication request containing its identity attributes and its current public key. You can accept, reject or dismiss these
31
      requests to determine the authorization status of the device.
32
    </p>
33
    <p>
34
      In cases such as key rotation, each device may have more than one identity/key combination listed. See the documentation for more on{' '}
35
      <DocsLink path="overview/device-authentication" title="Device authentication" />.
36
    </p>
37
  </>
38
);
39

40
const AuthButton = () => (
183✔
41
  <>
1✔
42
    <h3>Authorize devices</h3>
43
    <p>
44
      Expand this section to view the authentication options for this device. You can decide whether to accept it, reject it, or just dismiss this device for
45
      now.
46
    </p>
47
    <p>
48
      See the documentation for more on <DocsLink path="overview/device-authentication" title="Device authentication" />.
49
    </p>
50
  </>
51
);
52

53
const AddGroup = () => (
183✔
54
  <>
1✔
55
    <h3>Device groups</h3>
56
    <p>
57
      It is possible to create groups of devices. Once you have created a group and added one or more devices to it, you can deploy an update to that specific
58
      group only.
59
    </p>
60
  </>
61
);
62

63
const ExpandArtifact = () => (
183✔
64
  <>
1✔
65
    <h3>Device type compatibility</h3>
66
    <p>
67
      Mender Artifacts have <b>Device types compatible</b> as part of their metadata. All devices report which device type they are, as part of their inventory
68
      information. During a deployment, Mender makes sure that a device will only download and install an Artifact it is compatible with.
69
    </p>
70
    <p>You can click on each Artifact in the Release to expand the row and view more information about it.</p>
71
    <p>
72
      For more information on how to specify the device type compatibility and other artifact metadata,{' '}
73
      <DocsLink path="artifact-creation/create-an-artifact" title="see the documentation" />.
74
    </p>
75
  </>
76
);
77

78
const DeviceSupportTip = () => (
183✔
79
  <p>
1✔
80
    The steps in the guide should work on most operating systems in the Debian family (e.g. Debian, Ubuntu, Raspberry Pi OS) and devices based on ARMv6 or newer
81
    (e.g. Raspberry Pi 2/3/4, Beaglebone). Visit <DocsLink path="overview/device-support" title="our documentation" /> for more information about device
82
    support.
83
  </p>
84
);
85

86
const ConfigureTimezoneTip = () => (
183✔
87
  <>
1✔
88
    To see the effects of applying a configuration to your device you can set one of the below values to modify the timezone of your device. While all values
89
    from <i>timedatectl list-timezones</i> will work, to easily see the impact of the changed value you can use one of the following values:
90
    <ul>
91
      <li>Europe/Oslo</li>
92
      <li>America/Los_Angeles</li>
93
      <li>Asia/Tokyo</li>
94
    </ul>
95
    Once the configuration has been applied you can see the effect by opening the Remote Terminal to the device and executing the <i>date</i> command.
96
  </>
97
);
98

99
const ConfigureRaspberryLedTip = () => {
183✔
100
  const dispatch = useDispatch();
1✔
101
  return (
1✔
102
    <>
103
      To see the effects of applying a configuration to your device you can set one of the below values to modify the behaviour of your Raspberry Pi green
104
      status LED
105
      <ConfigurationObject
106
        className="margin-top-small margin-bottom-small"
107
        config={{
108
          mmc0: 'The default, which blinks the led on storage activity',
109
          on: 'Turn on the light permanently',
110
          off: 'Turn off the light permanently',
111
          heartbeat: 'Enable heartbeat blinking'
112
        }}
113
        compact
114
        setSnackbar={(...args) => dispatch(setSnackbar(...args))}
×
115
      />
116
      There are other possible values, but we won&apos;t advertise them here. See
117
      <a href="http://www.d3noob.org/2020/07/controlling-activity-led-on-raspberry-pi.html" target="_blank" rel="noopener noreferrer">
118
        this blog post
119
      </a>{' '}
120
      or{' '}
121
      <a href="https://www.raspberrypi.org/forums/viewtopic.php?t=273194#p1658930" target="_blank" rel="noopener noreferrer">
122
        in the Raspberry Pi forums
123
      </a>{' '}
124
      for more information.
125
    </>
126
  );
127
};
128

129
const ConfigureAddOnTip = () => (
183✔
130
  <p>
1✔
131
    Mender deploys the configuration attributes using the same mechanisms as software updates. The configuration is stored as a JSON file at
132
    <code>/var/lib/mender-configure/device-config.json</code> on the device and then all the scripts in{' '}
133
    <code>/usr/lib/mender-configure/apply-device-config.d/</code> are executed to apply the configuration attributes. To add a new configuration attribute, you
134
    simply need to input it in the UI and add a script to that directory that applies it accordingly.
135
  </p>
136
);
137

138
const NameTagTip = () => (
183✔
139
  <>
1✔
140
    The <i>Name</i> tag will be available as a device indentifier too.
141
  </>
142
);
143

144
const NameFilterTip = () => <>Filtering by name is limited to devices with a previously defined name.</>;
183✔
145

146
const DeviceTypeTip = () => (
183✔
147
  <>
1✔
148
    <p>
149
      If you don&apos;t see your exact device on the list, choose <i>Generic ARMv6 or newer</i> to continue the tutorial for now.
150
    </p>
151
    <p>
152
      (Note: if your device is <i>not</i> based on ARMv6 or newer, the tutorial won&apos;t work - instead, go back and use the virtual device)
153
    </p>
154
  </>
155
);
156

157
const TwoFactorNote = ({ className }) => (
183✔
158
  <div className={className}>
1✔
159
    Two Factor Authentication is enabled for your account. If you haven&apos;t set up a 3rd party authentication app with a verification code, please contact an
160
    administrator.
161
  </div>
162
);
163

164
const AuditlogExplanation = () => <>The audit log shows the history of changes made to your Devices, Artifacts, Deployments, and user management.</>;
183✔
165

166
const DashboardWidget = () => (
183✔
167
  <>Add dashboard widgets to visualize the software distribution or geographical location of all your devices, or a group of your devices.</>
1✔
168
);
169

170
const ScheduleDeployment = () => (
183✔
171
  <>
1✔
172
    This time is relative to the server only – each device&apos;s time zone will not be taken into account. Devices across different time zones will receive the
173
    update at the same time.
174
  </>
175
);
176

177
const GroupDeployment = () => (
183✔
178
  <>The deployment will skip any devices in the group that are already on the target Release version, or that have an incompatible device type.</>
1✔
179
);
180

181
const ForceDeployment = () => (
183✔
182
  <>
1✔
183
    <h3>Force update</h3>
184
    <p>This will make the Mender client install the update even if the selected release is already installed.</p>
185
  </>
186
);
187

188
const ArtifactUpload = () => <>Upload an Artifact to an existing or new Release</>;
183✔
189

190
const PhasedPausedDeployments = () => (
183✔
191
  <>
1✔
192
    This feature is not available on <b>phased deployments</b>. If you&apos;d like to set pause states between update steps, go back and adjust the rollout
193
    schedule to a <b>single phase</b>.
194
  </>
195
);
196

197
const ResetHistory = () => <>Greyed out items will not be considered during deployment roll out</>;
183✔
198

199
const MenderArtifactUpload = () => (
183✔
200
  <>
1✔
201
    If there is no Release matching this Artifact’s name, a new Release will be created for this Artifact.
202
    <br />
203
    <br />
204
    If there is already a Release matching this Artifact’s name, the Artifact will be grouped in that Release.
205
  </>
206
);
207

208
const SingleFileUpload = () => <>This will generate a single file application update Artifact, which requires some additional metadata to be entered.</>;
183✔
209

210
const GlobalSettings = () => <>These settings apply to all users, so changes made here may affect other users&apos; experience.</>;
183✔
211

212
const Webhooks = () => <>Webhooks are triggered when a device&apos;s status is updated, or a device is decommissioned or provisioned.</>;
183✔
213

214
const TenantToken = () => (
183✔
215
  <>
1✔
216
    <h3>Organization token</h3>
217
    This token is unique for your organization and ensures that only devices that you own are able to connect to your account.
218
  </>
219
);
220

221
const SamlMetadata = () => <>Submit the metadata document from your Identity Provider</>;
183✔
222

223
const ReleaseName = () => (
183✔
224
  <>
1✔
225
    If a Release with this name already exists, this new Artifact may be grouped into a Release with other Artifacts of the same name - so long as they are
226
    compatible with different device types
227
  </>
228
);
229

230
const AttributeLimit = () => {
183✔
231
  const { isHosted } = useSelector(getFeatures);
1✔
232
  return isHosted ? (
1!
233
    <>
234
      Expand to see the list of attributes currently in use. Please{' '}
235
      <a href="mailto:support@mender.io" target="_blank" rel="noopener noreferrer">
236
        contact our team
237
      </a>{' '}
238
      if your use case requires a different set of attributes.
239
    </>
240
  ) : (
241
    <>Expand to see the list of attributes currently in use.</>
242
  );
243
};
244

245
export const HELPTOOLTIPS = {
183✔
246
  addGroup: { id: 'addGroup', Component: AddGroup },
247
  artifactUpload: { id: 'artifactUpload', Component: ArtifactUpload },
248
  attributeLimit: { id: 'attributeLimit', Component: AttributeLimit },
249
  auditlogExplanation: { id: 'auditlogExplanation', Component: AuditlogExplanation },
250
  authButton: { id: 'authButton', Component: AuthButton },
251
  authExplainButton: { id: 'authExplainButton', Component: AuthExplainButton },
252
  configureAddOnTip: { id: 'configureAddOnTip', Component: ConfigureAddOnTip },
253
  configureRaspberryLedTip: {
254
    id: 'configureRaspberryLedTip',
255
    Component: ConfigureRaspberryLedTip,
256
    isRelevant: ({ device = {} }) => {
×
257
      const { attributes = {} } = device;
×
258
      return ['raspberry', 'rpi'].some(type => attributes.device_type?.some(deviceType => deviceType.startsWith(type)));
×
259
    }
260
  },
261
  configureTimezoneTip: {
262
    id: 'configureTimezoneTip',
263
    Component: ConfigureTimezoneTip,
264
    isRelevant: ({ device = {} }) => {
×
265
      const { attributes = {} } = device;
×
266
      return ['raspberry', 'rpi', 'qemux86-64'].some(type => attributes.device_type?.some(deviceType => deviceType.startsWith(type)));
×
267
    }
268
  },
269
  dashboardWidget: { id: 'dashboardWidget', Component: DashboardWidget },
270
  deviceSupportTip: { id: 'deviceSupportTip', Component: DeviceSupportTip },
271
  deviceTypeTip: { id: 'deviceTypeTip', Component: DeviceTypeTip },
272
  expandArtifact: { id: 'expandArtifact', Component: ExpandArtifact },
273
  forceDeployment: { id: 'forceDeployment', Component: ForceDeployment },
274
  globalSettings: { id: 'globalSettings', Component: GlobalSettings },
275
  groupDeployment: { id: 'groupDeployment', Component: GroupDeployment },
276
  menderArtifactUpload: { id: 'menderArtifactUpload', Component: MenderArtifactUpload },
277
  nameFilterTip: { id: 'nameFilterTip', Component: NameFilterTip },
278
  nameTagTip: { id: 'nameTagTip', Component: NameTagTip },
279
  phasedPausedDeployments: { id: 'phasedPausedDeployments', Component: PhasedPausedDeployments },
280
  releaseName: { id: 'releaseName', Component: ReleaseName },
281
  resetHistory: { id: 'resetHistory', Component: ResetHistory },
282
  samlMetadata: { id: 'samlMetadata', Component: SamlMetadata },
283
  scheduleDeployment: { id: 'scheduleDeployment', Component: ScheduleDeployment },
284
  singleFileUpload: { id: 'singleFileUpload', Component: SingleFileUpload },
285
  tenantToken: { id: 'tenantToken', Component: TenantToken },
286
  twoFactorNote: { id: 'twoFactorNote', SpecialComponent: TwoFactorNote },
287
  webhooks: { id: 'webhooks', Component: Webhooks }
288
};
289

290
export const MenderHelpTooltip = props => {
183✔
291
  const { id, contentProps = {} } = props;
2,173✔
292
  const tooltipsById = useSelector(getTooltipsState);
2,173✔
293
  const dispatch = useDispatch();
2,173✔
294
  const device = useSelector(state => getDeviceById(state, contentProps.deviceId));
4,022✔
295
  const { readState = READ_STATES.unread } = tooltipsById[id] || {};
2,173✔
296
  const { Component, SpecialComponent, isRelevant = yes } = HELPTOOLTIPS[id];
2,173✔
297

298
  const onSetTooltipReadState = useCallback((...args) => dispatch(setTooltipReadState(...args)), [dispatch]);
2,173✔
299
  const onSetAllTooltipsReadState = state => dispatch(setAllTooltipsReadState(state));
2,173✔
300

301
  return (
2,173✔
302
    <HelpTooltip
303
      setAllTooltipsReadState={onSetAllTooltipsReadState}
304
      setTooltipReadState={onSetTooltipReadState}
305
      device={device}
306
      tooltip={{ Component, SpecialComponent, isRelevant, readState }}
307
      {...props}
308
    />
309
  );
310
};
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