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

mendersoftware / gui / 944676341

pending completion
944676341

Pull #3875

gitlab-ci

mzedel
chore: aligned snapshots with updated design

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Pull Request #3875: MEN-5414

4469 of 6446 branches covered (69.33%)

230 of 266 new or added lines in 43 files covered. (86.47%)

1712 existing lines in 161 files now uncovered.

8406 of 10170 relevant lines covered (82.65%)

196.7 hits per line

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

87.5
/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 from 'react';
15
import { useDispatch, useSelector } from 'react-redux';
16
import { Link } from 'react-router-dom';
17

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

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

41
const AuthButton = () => (
187✔
42
  <>
1✔
43
    <h3>Authorize devices</h3>
44
    <p>
45
      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
46
      now.
47
    </p>
48
    <p>
49
      See the documentation for more on <DocsLink path="overview/device-authentication" title="Device authentication" />.
50
    </p>
51
  </>
52
);
53

54
const AddGroup = () => (
187✔
55
  <>
1✔
56
    <h3>Device groups</h3>
57
    <p>
58
      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
59
      group only.
60
    </p>
61
    <p>To avoid accidents, Mender only allows a device to be in one group at the time.</p>
62
    <p>
63
      You can find out additional information about device groups in <Link to="/help/devices">the help section</Link>.
64
    </p>
65
  </>
66
);
67

68
const ExpandDevice = () => (
187✔
69
  <>
1✔
70
    <h3>Device inventory</h3>
71
    <p>
72
      Mender automatically collects identity and inventory information from connected devices. You can view this information by clicking on a device to expand
73
      the row.
74
    </p>
75
    <p>
76
      Which information is collected about devices is fully configurable;{' '}
77
      <DocsLink path="client-installation/identity" title="see the documentation for how to configure this" />.
78
    </p>
79
  </>
80
);
81

82
const ExpandArtifact = () => (
187✔
83
  <>
1✔
84
    <h3>Device type compatibility</h3>
85
    <p>
86
      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
87
      information. During a deployment, Mender makes sure that a device will only download and install an Artifact it is compatible with.
88
    </p>
89
    <p>You can click on each Artifact in the Release to expand the row and view more information about it.</p>
90
    <p>
91
      For more information on how to specify the device type compatibility and other artifact metadata,{' '}
92
      <DocsLink path="artifact-creation/create-an-artifact" title="see the documentation" />.
93
    </p>
94
  </>
95
);
96

97
const DeviceSupportTip = () => (
187✔
98
  <p>
1✔
99
    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
100
    (e.g. Raspberry Pi 2/3/4, Beaglebone). Visit <DocsLink path="overview/device-support" title="our documentation" /> for more information about device
101
    support.
102
  </p>
103
);
104

105
const ConfigureTimezoneTip = () => (
187✔
106
  <>
1✔
107
    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
108
    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:
109
    <ul>
110
      <li>Europe/Oslo</li>
111
      <li>America/Los_Angeles</li>
112
      <li>Asia/Tokyo</li>
113
    </ul>
114
    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.
115
  </>
116
);
117

118
const ConfigureRaspberryLedTip = () => {
187✔
119
  const dispatch = useDispatch();
1✔
120
  return (
1✔
121
    <>
122
      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
123
      status LED
124
      <ConfigurationObject
125
        className="margin-top-small margin-bottom-small"
126
        config={{
127
          mmc0: 'The default, which blinks the led on storage activity',
128
          on: 'Turn on the light permanently',
129
          off: 'Turn off the light permanently',
130
          heartbeat: 'Enable heartbeat blinking'
131
        }}
132
        compact
NEW
133
        setSnackbar={(...args) => dispatch(setSnackbar(...args))}
×
134
      />
135
      There are other possible values, but we won&apos;t advertise them here. See
136
      <a href="http://www.d3noob.org/2020/07/controlling-activity-led-on-raspberry-pi.html" target="_blank" rel="noopener noreferrer">
137
        this blog post
138
      </a>{' '}
139
      or{' '}
140
      <a href="https://www.raspberrypi.org/forums/viewtopic.php?t=273194#p1658930" target="_blank" rel="noopener noreferrer">
141
        in the Raspberry Pi forums
142
      </a>{' '}
143
      for more information.
144
    </>
145
  );
146
};
147

148
const ConfigureAddOnTip = () => (
187✔
149
  <p>
1✔
150
    Mender deploys the configuration attributes using the same mechanisms as software updates. The configuration is stored as a JSON file at
151
    <code>/var/lib/mender-configure/device-config.json</code> on the device and then all the scripts in{' '}
152
    <code>/usr/lib/mender-configure/apply-device-config.d/</code> are executed to apply the configuration attributes. To add a new configuration attribute, you
153
    simply need to input it in the UI and add a script to that directory that applies it accordingly.
154
  </p>
155
);
156

157
const NameTagTip = () => (
187✔
158
  <>
1✔
159
    The <i>Name</i> tag will be available as a device indentifier too.
160
  </>
161
);
162

163
const NameFilterTip = () => <>Filtering by name is limited to devices with a previously defined name.</>;
187✔
164

165
const DeviceTypeTip = () => (
187✔
166
  <>
1✔
167
    <p>
168
      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.
169
    </p>
170
    <p>
171
      (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)
172
    </p>
173
  </>
174
);
175

176
const TwoFactorNote = ({ className }) => (
187✔
177
  <div className={className}>
1✔
178
    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
179
    administrator.
180
  </div>
181
);
182

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

185
const DashboardWidget = () => (
187✔
186
  <>Add dashboard widgets to visualize the software distribution or geographical location of all your devices, or a group of your devices.</>
1✔
187
);
188

189
const ScheduleDeployment = () => (
187✔
190
  <>
1✔
191
    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
192
    update at the same time.
193
  </>
194
);
195

196
const GroupDeployment = () => (
187✔
197
  <>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✔
198
);
199

200
const ForceDeployment = () => (
187✔
201
  <>
1✔
202
    <h3>Force update</h3>
203
    <p>This will make the Mender client install the update even if the selected release is already installed.</p>
204
  </>
205
);
206

207
const ArtifactUpload = () => <>Upload an Artifact to an existing or new Release</>;
187✔
208

209
const PhasedPausedDeployments = () => (
187✔
210
  <>
1✔
211
    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
212
    schedule to a <b>single phase</b>.
213
  </>
214
);
215

216
const ResetHistory = () => <>Greyed out items will not be considered during deployment roll out</>;
187✔
217

218
const MenderArtifactUpload = () => (
187✔
219
  <>
1✔
220
    If there is no Release matching this Artifact’s name, a new Release will be created for this Artifact.
221
    <br />
222
    <br />
223
    If there is already a Release matching this Artifact’s name, the Artifact will be grouped in that Release.
224
  </>
225
);
226

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

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

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

233
const TenantToken = () => (
187✔
234
  <>
1✔
235
    <h3>Organization token</h3>
236
    This token is unique for your organization and ensures that only devices that you own are able to connect to your account.
237
  </>
238
);
239

240
const SamlMetadata = () => <>Submit the metadata document from your Identity Provider</>;
187✔
241

242
const ReleaseName = () => (
187✔
243
  <>
1✔
244
    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
245
    compatible with different device types
246
  </>
247
);
248

249
const AttributeLimit = () => {
187✔
250
  const { isHosted } = useSelector(getFeatures);
1✔
251
  return isHosted ? (
1!
252
    <>
253
      Expand to see the list of attributes currently in use. Please{' '}
254
      <a href="mailto:contact@mender.io" target="_blank" rel="noopener noreferrer">
255
        contact our team
256
      </a>{' '}
257
      if your use case requires a different set of attributes.
258
    </>
259
  ) : (
260
    <>Expand to see the list of attributes currently in use.</>
261
  );
262
};
263

264
export const HELPTOOLTIPS = {
187✔
265
  addGroup: { id: 'addGroup', Component: AddGroup },
266
  artifactUpload: { id: 'artifactUpload', Component: ArtifactUpload },
267
  attributeLimit: { id: 'attributeLimit', Component: AttributeLimit },
268
  auditlogExplanation: { id: 'auditlogExplanation', Component: AuditlogExplanation },
269
  authButton: { id: 'authButton', Component: AuthButton },
270
  authExplainButton: { id: 'authExplainButton', Component: AuthExplainButton },
271
  configureAddOnTip: { id: 'configureAddOnTip', Component: ConfigureAddOnTip },
272
  configureRaspberryLedTip: {
273
    id: 'configureRaspberryLedTip',
274
    Component: ConfigureRaspberryLedTip,
275
    isRelevant: ({ device = {} }) => {
×
NEW
276
      const { attributes = {} } = device;
×
NEW
277
      return ['raspberry', 'rpi'].some(type => attributes.device_type?.some(deviceType => deviceType.startsWith(type)));
×
278
    }
279
  },
280
  configureTimezoneTip: {
281
    id: 'configureTimezoneTip',
282
    Component: ConfigureTimezoneTip,
283
    isRelevant: ({ device = {} }) => {
×
NEW
284
      const { attributes = {} } = device;
×
NEW
285
      return ['raspberry', 'rpi', 'qemux86-64'].some(type => attributes.device_type?.some(deviceType => deviceType.startsWith(type)));
×
286
    }
287
  },
288
  dashboardWidget: { id: 'dashboardWidget', Component: DashboardWidget },
289
  deviceSupportTip: { id: 'deviceSupportTip', Component: DeviceSupportTip },
290
  deviceTypeTip: { id: 'deviceTypeTip', Component: DeviceTypeTip },
291
  expandArtifact: { id: 'expandArtifact', Component: ExpandArtifact },
292
  expandDevice: { id: 'expandDevice', Component: ExpandDevice },
293
  forceDeployment: { id: 'forceDeployment', Component: ForceDeployment },
294
  globalSettings: { id: 'globalSettings', Component: GlobalSettings },
295
  groupDeployment: { id: 'groupDeployment', Component: GroupDeployment },
296
  menderArtifactUpload: { id: 'menderArtifactUpload', Component: MenderArtifactUpload },
297
  nameFilterTip: { id: 'nameFilterTip', Component: NameFilterTip },
298
  nameTagTip: { id: 'nameTagTip', Component: NameTagTip },
299
  phasedPausedDeployments: { id: 'phasedPausedDeployments', Component: PhasedPausedDeployments },
300
  releaseName: { id: 'releaseName', Component: ReleaseName },
301
  resetHistory: { id: 'resetHistory', Component: ResetHistory },
302
  samlMetadata: { id: 'samlMetadata', Component: SamlMetadata },
303
  scheduleDeployment: { id: 'scheduleDeployment', Component: ScheduleDeployment },
304
  singleFileUpload: { id: 'singleFileUpload', Component: SingleFileUpload },
305
  tenantToken: { id: 'tenantToken', Component: TenantToken },
306
  twoFactorNote: { id: 'twoFactorNote', SpecialComponent: TwoFactorNote },
307
  webhooks: { id: 'webhooks', Component: Webhooks }
308
};
309

310
export const MenderHelpTooltip = props => {
187✔
311
  const { id, contentProps = {} } = props;
2,341✔
312
  const showHelptips = useSelector(getShowHelptips);
2,341✔
313
  const tooltipsById = useSelector(getTooltipsState);
2,341✔
314
  const dispatch = useDispatch();
2,341✔
315
  const device = useSelector(state => getDeviceById(state, contentProps.deviceId));
4,310✔
316
  const { readState = READ_STATES.unread } = tooltipsById[id] || {};
2,341✔
317
  const { Component, SpecialComponent, isRelevant = yes } = HELPTOOLTIPS[id];
2,341✔
318

319
  const onSetTooltipReadState = state => dispatch(setTooltipReadState(id, state, true));
2,341✔
320
  const onSetAllTooltipsReadState = state => dispatch(setAllTooltipsReadState(state));
2,341✔
321

322
  return (
2,341✔
323
    <HelpTooltip
324
      setAllTooltipsReadState={onSetAllTooltipsReadState}
325
      setTooltipReadState={onSetTooltipReadState}
326
      showHelptips={showHelptips}
327
      device={device}
328
      tooltip={{ Component, SpecialComponent, isRelevant, readState }}
329
      {...props}
330
    />
331
  );
332
};
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