Merge pull request #2114 from mattermost/app-bar-icon
[MM-40214] Implement App Bar component
This commit is contained in:
commit
c8dea5b691
4 changed files with 11 additions and 1 deletions
|
@ -131,7 +131,7 @@ ifneq ($(wildcard $(ASSETS_DIR)/.),)
|
|||
cp -r $(ASSETS_DIR) dist/$(PLUGIN_ID)/
|
||||
endif
|
||||
ifneq ($(HAS_PUBLIC),)
|
||||
cp -r public dist/$(PLUGIN_ID)/
|
||||
cp -r public dist/$(PLUGIN_ID)/public/
|
||||
endif
|
||||
ifneq ($(HAS_SERVER),)
|
||||
mkdir -p dist/$(PLUGIN_ID)/server
|
||||
|
|
BIN
mattermost-plugin/public/app-bar-icon.png
Normal file
BIN
mattermost-plugin/public/app-bar-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -195,6 +195,12 @@ export default class Plugin {
|
|||
}
|
||||
|
||||
this.registry.registerProduct('/boards', 'product-boards', 'Boards', '/boards/welcome', MainApp, HeaderComponent)
|
||||
|
||||
if (this.registry.registerAppBarComponent) {
|
||||
const appBarIconURL = windowAny.baseURL + '/public/app-bar-icon.png'
|
||||
this.registry.registerAppBarComponent(appBarIconURL, goToFocalboardWorkspace, 'Open Boards Workspace')
|
||||
}
|
||||
|
||||
this.registry.registerPostWillRenderEmbedComponent((embed) => embed.type === 'boards', BoardsUnfurl, false)
|
||||
} else {
|
||||
windowAny.frontendBaseURL = subpath + '/plug/focalboard'
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Channel, ChannelMembership} from 'mattermost-redux/types/channels';
|
||||
|
||||
export interface PluginRegistry {
|
||||
registerPostTypeComponent(typeName: string, component: React.ElementType)
|
||||
registerChannelHeaderButtonAction(icon: React.Element, action: () => void, dropdownText: string, tooltipText: string)
|
||||
|
@ -11,6 +14,7 @@ export interface PluginRegistry {
|
|||
registerPostWillRenderEmbedComponent(match: (embed: {type: string, data: any}) => void, component: any, toggleable: boolean)
|
||||
registerWebSocketEventHandler(event: string, handler: (e: any) => void)
|
||||
unregisterWebSocketEventHandler(event: string)
|
||||
registerAppBarComponent(iconURL: string, action: (channel: Channel, member: ChannelMembership) => void, tooltipText: React.ReactNode)
|
||||
|
||||
// Add more if needed from https://developers.mattermost.com/extend/plugins/webapp/reference
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue