feat: RHS panel + channel header button + public icon
- Switched from registerAppBarComponent (not in MM 11.4 build) to registerChannelHeaderButtonAction + registerRightHandSidebarComponent - Added public/icon.svg for channel header button - Fixed store dispatch for RHS toggle action - Plugin deployment permissions fix (uid 2000)
This commit is contained in:
3
plugin/server/public/icon.svg
Normal file
3
plugin/server/public/icon.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#166de0">
|
||||||
|
<path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-1 14H5V6h14v12zM7 9h2v2H7zm0 4h2v2H7zm4-4h6v2h-6zm0 4h6v2h-6z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 237 B |
2
plugin/webapp/dist/main.js
vendored
2
plugin/webapp/dist/main.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,3 +1,4 @@
|
|||||||
|
import React from 'react';
|
||||||
import { PluginRegistry, WebSocketPayload, LiveStatusData } from './types';
|
import { PluginRegistry, WebSocketPayload, LiveStatusData } from './types';
|
||||||
import LiveStatusPost from './components/live_status_post';
|
import LiveStatusPost from './components/live_status_post';
|
||||||
import RHSPanel from './components/rhs_panel';
|
import RHSPanel from './components/rhs_panel';
|
||||||
@@ -16,13 +17,24 @@ class LiveStatusPlugin {
|
|||||||
LiveStatusPost,
|
LiveStatusPost,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Register RHS panel with AppBar icon
|
// Register RHS sidebar component
|
||||||
// This creates both the sidebar component and the toolbar button to toggle it
|
const rhsResult = registry.registerRightHandSidebarComponent({
|
||||||
registry.registerAppBarComponent({
|
component: RHSPanel,
|
||||||
iconUrl: '', // Empty = use default plugin icon from assets/icon.svg
|
title: 'Agent Status',
|
||||||
tooltipText: 'Agent Status',
|
});
|
||||||
rhsComponent: RHSPanel,
|
|
||||||
rhsTitle: 'Agent Status',
|
// Add channel header button to toggle the RHS panel
|
||||||
|
const toggleAction = rhsResult.toggleRHSPlugin;
|
||||||
|
registry.registerChannelHeaderButtonAction({
|
||||||
|
icon: React.createElement('i', {
|
||||||
|
className: 'icon icon-cog-outline',
|
||||||
|
style: { fontSize: '18px' },
|
||||||
|
}),
|
||||||
|
action: () => {
|
||||||
|
store.dispatch(toggleAction);
|
||||||
|
},
|
||||||
|
dropdownText: 'Agent Status',
|
||||||
|
tooltipText: 'Toggle Agent Status panel',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register WebSocket event handler
|
// Register WebSocket event handler
|
||||||
|
|||||||
Reference in New Issue
Block a user