@balena/ui-shared-components 14.1.0-build-secure-boot-backup-669ce6c9a457b9067a2a844d20decdbcd49c2d1d-1 → 14.1.0-build-secure-boot-backup-e7a2ae3ae27da0dd2adfb143b8f73aced69adf58-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -246,15 +246,15 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
246
246
  onChange({ provisioningKeyExpiryDate: event.target.value });
247
247
  }, label: "Provisioning Key expiring on" })] })] })] }), _jsxs(Dialog, { open: showSecureBootConfirmationDialog, onClose: () => {
248
248
  dismissSecureBootWarning(false, dontShowSecureBootWarningAgain);
249
- }, children: [_jsx(DialogTitle, { children: "Enabling Secure Boot and Full Disk Encryption" }), _jsx(DialogContent, { children: _jsxs(Stack, { children: ["Enabling Secure Boot and Full Disk Encryption has important implications:", _jsxs("ul", { children: [_jsxs("li", { children: ["The image you are about to download is", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
250
- source: "Application Add Device Modal Secure Boot Warning signed with balena's main platform key Link",
251
- }, href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/#keys-and-certificates-in-secure-boot", children: "signed with balena's main platform key" })] }), _jsx("li", { children: "Full Disk Encryption (FDE): All data on the disk will be encrypted with a unique key per device, ensuring that data extraction or retrieval from a powered-off device is impossible." }), _jsxs("li", { children: ["Secure Boot: Ensures only OS images signed by balena can unlock the disks and access data stored on the device. Hardened Mode Limitations:", _jsxs("ul", { children: [_jsx("li", { children: "Unsigned kernel modules cannot be loaded." }), _jsx("li", { children: "Boot parameters cannot be modified." }), _jsx("li", { children: "Debugging early boot processes is practically impossible." })] })] })] }), _jsxs(Typography, { children: ["If you need to load out-of-tree kernel drivers or require a unique signing key,", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
252
- source: 'Application Add Device Modal Secure Boot Warning Contact Us Link',
253
- }, href: "mailto:sales@balena.io", target: "_self", children: "contact us" }), ' ', "to discuss your specific requirements."] }), _jsx(MUILinkWithTracking, { eventProperties: {
249
+ }, children: [_jsx(DialogTitle, { children: "Enabling Secure Boot and Full Disk Encryption" }), _jsxs(DialogContent, { children: ["Enabling Secure Boot and Full Disk Encryption has important implications:", _jsxs("ul", { children: [_jsxs("li", { children: ["The image you are about to download is", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
250
+ source: "Application Add Device Modal Secure Boot Warning signed with balena's main platform key Link",
251
+ }, href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/#keys-and-certificates-in-secure-boot", children: "signed with balena's main platform key" })] }), _jsx("li", { children: "Full Disk Encryption (FDE): All data on the disk will be encrypted with a unique key per device, ensuring that data extraction or retrieval from a powered-off device is impossible." }), _jsxs("li", { children: ["Secure Boot: Ensures only OS images signed by balena can unlock the disks and access data stored on the device. Hardened Mode Limitations:", _jsxs("ul", { children: [_jsx("li", { children: "Unsigned kernel modules cannot be loaded." }), _jsx("li", { children: "Boot parameters cannot be modified." }), _jsx("li", { children: "Debugging early boot processes is practically impossible." })] })] })] }), _jsxs(Typography, { children: ["If you need to load out-of-tree kernel drivers or require a unique signing key,", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
252
+ source: 'Application Add Device Modal Secure Boot Warning Contact Us Link',
253
+ }, href: "mailto:sales@balena.io", target: "_self", children: "contact us" }), ' ', "to discuss your specific requirements."] }), _jsx(Typography, { component: "p", children: _jsx(MUILinkWithTracking, { eventProperties: {
254
254
  source: 'Application Add Device Modal Secure Boot Warning Learn More Link',
255
- }, href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/", children: "Learn more about Secure Boot and Full Disk Encryption." }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { onChange: (event) => {
256
- setDontShowSecureBootWarningAgain(event.target.checked);
257
- } }), label: "Don't show me this warning again for this device type", sx: { mt: 2 } })] }) }), _jsxs(DialogActions, { children: [_jsx(Button, { "aria-label": "Go back and do not acknowledge Secure Boot and Full Disk Encryption warning", onClick: () => {
255
+ }, href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/", children: "Learn more about Secure Boot and Full Disk Encryption." }) }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { onChange: (event) => {
256
+ setDontShowSecureBootWarningAgain(event.target.checked);
257
+ } }), label: "Don't show me this warning again for this device type", sx: { mt: 2 } })] }), _jsxs(DialogActions, { children: [_jsx(Button, { "aria-label": "Go back and do not acknowledge Secure Boot and Full Disk Encryption warning", onClick: () => {
258
258
  dismissSecureBootWarning(false, dontShowSecureBootWarningAgain);
259
259
  }, variant: "outlined", color: "secondary", children: "Cancel" }), _jsx(Button, { "aria-label": "Acknowledge Secure Boot and Full Disk Encryption warning", onClick: () => {
260
260
  onChange({ secureboot: true });
@@ -2,7 +2,7 @@ import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useDropzone } from 'react-dropzone';
4
4
  import { Typography, InputLabel, Stack, Link, LinearProgress, Box, useMediaQuery, useTheme, } from '@mui/material';
5
- import { useCallback, useMemo, useState } from 'react';
5
+ import { useCallback, useEffect, useMemo, useState } from 'react';
6
6
  import { IconButtonWithTracking, Tooltip } from '../../..';
7
7
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
8
8
  import { faCircleExclamation, faFile, faFileImage, faTrash, faUpload, } from '@fortawesome/free-solid-svg-icons';
@@ -64,6 +64,7 @@ const getErrorMessage = (code, message, maxSize) => {
64
64
  };
65
65
  export const FileWidget = ({ onChange, multiple, schema, uiSchema, }) => {
66
66
  const [files, setFiles] = useState([]);
67
+ const [filesWithDataUrl, setFilesWithDataUrl] = useState([]);
67
68
  const [errorFiles, setErrorFiles] = useState([]);
68
69
  const theme = useTheme();
69
70
  const mobile = useMediaQuery(theme.breakpoints.down('md'));
@@ -102,16 +103,13 @@ export const FileWidget = ({ onChange, multiple, schema, uiSchema, }) => {
102
103
  const base64Data = reader.result.split(',')[1];
103
104
  file.base64Data = base64Data;
104
105
  const dataUrl = `data:${file.type};name=${file.name};base64,${base64Data}`;
105
- if (multiple) {
106
- // NOTE: JSONSchema array data-url does not expect objects but only strings[]
107
- // see: https://github.com/rjsf-team/react-jsonschema-form/blob/297dac059fdf64fd1453bebb8366f0602c722f90/packages/utils/src/schema/isFilesArray.ts#L24
108
- onChange([...files, ...acceptedFiles].map((f) => `data:${f.type};name=${f.name};base64,${base64Data}`));
109
- return;
110
- }
111
- onChange({
112
- dataUrl,
113
- uploadedFile: file,
114
- });
106
+ setFilesWithDataUrl((prev) => [
107
+ ...prev,
108
+ {
109
+ dataUrl,
110
+ uploadedFile: file,
111
+ },
112
+ ]);
115
113
  };
116
114
  reader.readAsDataURL(file);
117
115
  });
@@ -122,7 +120,21 @@ export const FileWidget = ({ onChange, multiple, schema, uiSchema, }) => {
122
120
  setFiles(acceptedFiles.length ? [acceptedFiles[0]] : []);
123
121
  }
124
122
  setErrorFiles(rejectedFiles);
125
- }, [onChange, setFiles, files, multiple]);
123
+ }, [setFiles, files, multiple]);
124
+ useEffect(() => {
125
+ if (filesWithDataUrl.length && filesWithDataUrl.length === files.length) {
126
+ // NOTE: JSONSchema array data-url does not expect objects but only strings[]
127
+ // see: https://github.com/rjsf-team/react-jsonschema-form/blob/297dac059fdf64fd1453bebb8366f0602c722f90/packages/utils/src/schema/isFilesArray.ts#L24
128
+ // Check if possibile to always pass only strings (dataUrls) and not objects when not multiple.
129
+ if (multiple) {
130
+ onChange(filesWithDataUrl.map((fileWithDataUrl) => fileWithDataUrl.dataUrl));
131
+ return;
132
+ }
133
+ // If not multiple, the schema accept an object and we can pass it directly
134
+ // if not necessary, in a major release we can change it to pass only the dataUrl string and unify the behaviour
135
+ onChange(filesWithDataUrl[0]);
136
+ }
137
+ }, [files, filesWithDataUrl, multiple, onChange]);
126
138
  const removeFile = useCallback((index) => {
127
139
  const newFiles = [...files];
128
140
  newFiles.splice(index, 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/ui-shared-components",
3
- "version": "14.1.0-build-secure-boot-backup-669ce6c9a457b9067a2a844d20decdbcd49c2d1d-1",
3
+ "version": "14.1.0-build-secure-boot-backup-e7a2ae3ae27da0dd2adfb143b8f73aced69adf58-1",
4
4
  "main": "./dist/index.js",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -133,7 +133,7 @@
133
133
  },
134
134
  "homepage": "https://github.com/balena-io/ui-shared-components#readme",
135
135
  "versionist": {
136
- "publishedAt": "2025-09-30T13:32:15.991Z"
136
+ "publishedAt": "2025-10-06T15:03:01.816Z"
137
137
  },
138
138
  "overrides": {
139
139
  "storybook": "$storybook"