From 1f69b8e5619db65f07e80b930e8f267d1b56f5c8 Mon Sep 17 00:00:00 2001 From: Beate Quednau Date: Fri, 12 Apr 2024 19:44:45 +0200 Subject: [PATCH] Add disabled tabs for new device description --- .../deviceDescriptions/DeviceDescriptionDetails.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/packs/src/apps/mydb/elements/details/deviceDescriptions/DeviceDescriptionDetails.js b/app/packs/src/apps/mydb/elements/details/deviceDescriptions/DeviceDescriptionDetails.js index edb44328f2..1cf822eede 100644 --- a/app/packs/src/apps/mydb/elements/details/deviceDescriptions/DeviceDescriptionDetails.js +++ b/app/packs/src/apps/mydb/elements/details/deviceDescriptions/DeviceDescriptionDetails.js @@ -27,8 +27,6 @@ import LoadingActions from 'src/stores/alt/actions/LoadingActions'; import UIStore from 'src/stores/alt/stores/UIStore'; import UserStore from 'src/stores/alt/stores/UserStore'; import CollectionUtils from 'src/models/collection/CollectionUtils'; -import DeviceDescription from '../../../../../models/DeviceDescription'; -import { DeviceDescriptionsStore } from '../../../../../stores/mobx/DeviceDescriptionsStore'; const DeviceDescriptionDetails = ({ toggleFullScreen }) => { const deviceDescriptionsStore = useContext(StoreContext).deviceDescriptions; @@ -68,10 +66,15 @@ const DeviceDescriptionDetails = ({ toggleFullScreen }) => { ); } - visibleTabs.forEach((key) => { + const disabled = (index) => { + return deviceDescription.id.toString().length < 30 || index === 0 ? false : true; + } + + visibleTabs.forEach((key, i) => { let title = key.charAt(0).toUpperCase() + key.slice(1); + tabContents.push( - + {React.createElement(tabContentComponents[key], { key: `${deviceDescription.id}-${key}`, readonly: isReadOnly()