From 5d1fa490455c2b8988770cbe0340ea14064bdec2 Mon Sep 17 00:00:00 2001
From: GogoVega <92022724+GogoVega@users.noreply.github.com>
Date: Mon, 17 Feb 2025 19:46:39 +0100
Subject: [PATCH] Support for disabled categories in sidebar config
---
.../editor-client/src/js/ui/tab-config.js | 3 +++
.../editor-client/src/sass/tab-config.scss | 19 +++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js
index b8e3aa0ba..95f088328 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js
@@ -52,6 +52,7 @@ RED.sidebar.config = (function() {
if (label) {
lockIcon = $('').appendTo(header)
lockIcon.toggle(!!isLocked)
+ $('').appendTo(header)
$('').text(label).appendTo(header);
} else {
$('').appendTo(header);
@@ -251,6 +252,8 @@ RED.sidebar.config = (function() {
if (!validList[id]) {
$(this).remove();
delete categories[id];
+ } else if (RED.nodes.workspace(id)) {
+ $(this).toggleClass("red-ui-sidebar-config-category-disabled", RED.nodes.workspace(id).disabled);
}
})
var globalConfigNodes = [];
diff --git a/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss b/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss
index aed01240a..97e0006bf 100644
--- a/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss
+++ b/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss
@@ -14,6 +14,25 @@
* limitations under the License.
**/
+.red-ui-sidebar-config-category-disabled-icon {
+ display: none;
+}
+
+.red-ui-sidebar-config-category-disabled {
+ .red-ui-sidebar-config-tray-header {
+ font-style: italic;
+ color: var(--red-ui-tab-text-color-disabled-inactive) !important;
+ .red-ui-sidebar-config-category-disabled-icon {
+ display: inline;
+ }
+ }
+ .red-ui-sidebar-node-config-list {
+ .red-ui-palette-node-config {
+ @extend .red-ui-palette-node-config-disabled;
+ }
+ }
+}
+
.red-ui-sidebar-node-config {
position: relative;
background: var(--red-ui-secondary-background);