Skip to content

Commit 19b19ba

Browse files
authored
Merge pull request #1001 from NeurodataWithoutBorders/add_pl2_interface
2 parents 04c4288 + 3bf2708 commit 19b19ba

4 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/electron/frontend/core/components/Search.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ export class Search extends LitElement {
397397
this.#onSelect(option);
398398
});
399399

400-
if (disabled) listItemElement.setAttribute("disabled", "");
400+
if (disabled) {
401+
listItemElement.setAttribute("disabled", "");
402+
if (option.disabledReason)
403+
listItemElement.style.setProperty("--disabled-label", `"${option.disabledReason}"`);
404+
}
401405

402406
const container = document.createElement("div");
403407

src/electron/frontend/core/components/pages/guided-mode/data/GuidedStructure.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Page } from "../../Page.js";
33

44
// For Multi-Select Form
55
import { Button } from "../../../Button.js";
6-
import { supportedInterfaces } from "../../../../globals";
6+
import { supportedInterfaces, windowsOnlyInterfaces } from "../../../../globals";
77
import { Search } from "../../../Search.js";
88
import { Modal } from "../../../Modal";
99
import { List } from "../../../List";
@@ -129,13 +129,18 @@ export class GuidedStructurePage extends Page {
129129
suffixes: value.suffixes ?? [],
130130
};
131131

132+
const isSupported = supportedInterfaces.includes(interfaceName);
133+
const disabledReason =
134+
!isSupported && windowsOnlyInterfaces.includes(interfaceName) ? "Windows only" : undefined;
135+
132136
return {
133137
...value, // Contains label and name already (extra metadata)
134138
key: displayName,
135139
value: interfaceName,
136140
structuredKeywords,
137141
category,
138-
disabled: !supportedInterfaces.includes(interfaceName),
142+
disabled: !isSupported,
143+
disabledReason,
139144
};
140145
});
141146

src/electron/frontend/core/globals.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import { os, path, crypto, isElectron, isTestEnvironment } from "../utils/electr
22

33
import paths from "../../../paths.config.json" assert { type: "json" };
44

5-
import supportedInterfaces from "../../../supported_interfaces.json" assert { type: "json" };
5+
import allSupportedInterfaces from "../../../supported_interfaces.json" assert { type: "json" };
6+
7+
// Interfaces that are only supported on specific platforms
8+
const windowsOnlyInterfaces = ["Plexon2RecordingInterface"];
9+
const isWindows = os && os.platform() === "win32";
10+
const supportedInterfaces = allSupportedInterfaces.filter((name) => !windowsOnlyInterfaces.includes(name) || isWindows);
611

712
export { isTestEnvironment };
813

@@ -44,4 +49,4 @@ export const ENCRYPTION_IV = isElectron ? crypto.randomBytes(IV_LENGTH) : "";
4449
// Storybook
4550
export const isStorybook = window.location.href.includes("iframe.html");
4651

47-
export { supportedInterfaces };
52+
export { supportedInterfaces, windowsOnlyInterfaces };

src/supported_interfaces.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@
4343
"BrukerTiffSinglePlaneConverter",
4444
"BrukerTiffMultiPlaneConverter",
4545
"MiniscopeConverter",
46-
"CellExplorerRecordingInterface"
46+
"CellExplorerRecordingInterface",
47+
"Plexon2RecordingInterface"
4748
]

0 commit comments

Comments
 (0)