= () => {
const { show, secondaryPanelType } = usePanelsState();
const document = useDocumentsState(state => state.documents['asyncapi']?.document) || null;
- const isV3 = document?.version() === '3.0.0';
-
+ const isV3 = document?.version().startsWith('3.');
+
if (show.activityBar === false) {
return null;
}
@@ -68,7 +69,8 @@ export const Sidebar: FunctionComponent
= () => {
onClick: () => updateState('primarySidebar'),
icon: ,
tooltip: 'Navigation',
- enabled: true
+ enabled: true,
+ dataTest: 'button-navigation',
},
// editor
{
@@ -78,27 +80,30 @@ export const Sidebar: FunctionComponent = () => {
onClick: () => updateState('primaryPanel'),
icon: ,
tooltip: 'Editor',
- enabled: true
+ enabled: true,
+ dataTest: 'button-editor',
},
// template
{
name: 'template',
- title: 'Template',
+ title: 'Template preview',
isActive: show.secondaryPanel && secondaryPanelType === 'template',
onClick: () => updateState('secondaryPanel', 'template'),
icon: ,
- tooltip: 'HTML preview',
- enabled: true
+ tooltip: 'Template preview',
+ enabled: true,
+ dataTest: 'button-template-preview',
},
// visuliser
{
name: 'visualiser',
- title: 'Visualiser',
+ title: 'Blocks visualiser',
isActive: show.secondaryPanel && secondaryPanelType === 'visualiser',
onClick: () => updateState('secondaryPanel', 'visualiser'),
icon: ,
tooltip: 'Blocks visualiser',
- enabled: !isV3
+ enabled: !isV3,
+ dataTest: 'button-blocks-visualiser',
},
// newFile
{
@@ -108,7 +113,8 @@ export const Sidebar: FunctionComponent = () => {
onClick: () => showModal(ConfirmNewFileModal),
icon: ,
tooltip: 'New file',
- enabled: true
+ enabled: true,
+ dataTest: 'button-new-file',
},
];
@@ -120,10 +126,10 @@ export const Sidebar: FunctionComponent = () => {
{navigation.map(item => (