@balena/ui-shared-components 15.2.10 → 15.2.11-build-add-experimental-secure-boot-flag-e7fd4aa4ad3fc121ec9337ba1d2269cd8c769fb6-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.
@@ -41,7 +41,7 @@ export const GENERIC_X86_SLUG = 'generic-amd64';
41
41
  export const GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION = '6.6.10';
42
42
  export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVersions, isInitialDefault, osType, osTypes, hasEsrVersions, model, formElement, downloadUrl, applicationId, authToken, onSelectedOsTypeChange, onChange, }) {
43
43
  var _a, _b;
44
- const { state } = useAnalyticsContext();
44
+ const { state: analyticsState } = useAnalyticsContext();
45
45
  const [showAdvancedSettings, setShowAdvancedSettings] = useState(false);
46
46
  const [showSecureBootConfirmationDialog, setShowSecureBootConfirmationDialog,] = useState(false);
47
47
  const [dontShowSecureBootWarningAgain, setDontShowSecureBootWarningAgain] = useState(false);
@@ -53,16 +53,18 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
53
53
  const versionSelectionOpts = useMemo(() => (showAllVersions ? selectionOpts : preferredSelectionOpts), [preferredSelectionOpts, selectionOpts, showAllVersions]);
54
54
  const showAllVersionsToggle = useMemo(() => preferredSelectionOpts.length < selectionOpts.length, [preferredSelectionOpts.length, selectionOpts.length]);
55
55
  const supportsSecureBoot = useMemo(() => {
56
- return (model.deviceType.slug === GENERIC_X86_SLUG &&
56
+ var _a, _b;
57
+ return (((_b = (_a = analyticsState.featureFlags) === null || _a === void 0 ? void 0 : _a['toggle-secure-boot']) === null || _b === void 0 ? void 0 : _b.value) === 'on' &&
58
+ model.deviceType.slug === GENERIC_X86_SLUG &&
57
59
  semver.gte(model.version, GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION));
58
- }, [model.deviceType.slug, model.version]);
60
+ }, [analyticsState.featureFlags, model.deviceType.slug, model.version]);
59
61
  const secureBootDontShowAgainKey = `${model.deviceType.slug}_secureboot_warning_do_not_show_again`;
60
62
  const dismissSecureBootWarning = useCallback((accepted, dontShowAgain) => {
61
63
  var _a;
62
64
  setShowSecureBootConfirmationDialog(false);
63
- (_a = state.webTracker) === null || _a === void 0 ? void 0 : _a.track('Application Add Device Modal Hide Secure Boot Warning', { accepted, dontShowAgain });
65
+ (_a = analyticsState.webTracker) === null || _a === void 0 ? void 0 : _a.track('Application Add Device Modal Hide Secure Boot Warning', { accepted, dontShowAgain });
64
66
  setDontShowSecureBootWarningAgain(false);
65
- }, [state.webTracker]);
67
+ }, [analyticsState.webTracker]);
66
68
  const handleVariantChange = useCallback((newVariant) => {
67
69
  setVariant(newVariant);
68
70
  const newState = {
@@ -195,8 +197,8 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
195
197
  !getFromLocalStorage(secureBootDontShowAgainKey)) {
196
198
  event.preventDefault();
197
199
  setShowSecureBootConfirmationDialog(true);
198
- if (state.webTracker) {
199
- state.webTracker.track('Application Add Device Modal Show Secure Boot Warning');
200
+ if (analyticsState.webTracker) {
201
+ analyticsState.webTracker.track('Application Add Device Modal Show Secure Boot Warning');
200
202
  }
201
203
  }
202
204
  }, onChange: (event) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/ui-shared-components",
3
- "version": "15.2.10",
3
+ "version": "15.2.11-build-add-experimental-secure-boot-flag-e7fd4aa4ad3fc121ec9337ba1d2269cd8c769fb6-1",
4
4
  "main": "./dist/index.js",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -135,7 +135,7 @@
135
135
  },
136
136
  "homepage": "https://github.com/balena-io/ui-shared-components#readme",
137
137
  "versionist": {
138
- "publishedAt": "2025-12-02T16:41:44.214Z"
138
+ "publishedAt": "2025-12-04T18:39:50.032Z"
139
139
  },
140
140
  "overrides": {
141
141
  "storybook": "$storybook",