From 0f5f4b0590cf0afc1d80c8d72325b9910338ce0b Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Fri, 25 Nov 2022 18:02:02 +0100 Subject: [PATCH] Updates boards registration as product to use name instead of ID (#4247) --- mattermost-plugin/product/api_adapter.go | 6 +++--- mattermost-plugin/webapp/src/index.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mattermost-plugin/product/api_adapter.go b/mattermost-plugin/product/api_adapter.go index 3ed132462..594445e64 100644 --- a/mattermost-plugin/product/api_adapter.go +++ b/mattermost-plugin/product/api_adapter.go @@ -165,11 +165,11 @@ func (a *serviceAPIAdapter) GetFileInfo(fileID string) (*mm_model.FileInfo, erro // func (a *serviceAPIAdapter) PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *mm_model.WebsocketBroadcast) { - a.api.clusterService.PublishWebSocketEvent(boardsProductID, event, payload, broadcast) + a.api.clusterService.PublishWebSocketEvent(boardsProductName, event, payload, broadcast) } func (a *serviceAPIAdapter) PublishPluginClusterEvent(ev mm_model.PluginClusterEvent, opts mm_model.PluginClusterEventSendOptions) error { - return a.api.clusterService.PublishPluginClusterEvent(boardsProductID, ev, opts) + return a.api.clusterService.PublishPluginClusterEvent(boardsProductName, ev, opts) } // @@ -201,7 +201,7 @@ func (a *serviceAPIAdapter) GetLogger() mlog.LoggerIFace { // func (a *serviceAPIAdapter) KVSetWithOptions(key string, value []byte, options mm_model.PluginKVSetOptions) (bool, error) { - b, appErr := a.api.kvStoreService.SetPluginKeyWithOptions(boardsProductID, key, value, options) + b, appErr := a.api.kvStoreService.SetPluginKeyWithOptions(boardsProductName, key, value, options) return b, normalizeAppErr(appErr) } diff --git a/mattermost-plugin/webapp/src/index.tsx b/mattermost-plugin/webapp/src/index.tsx index b883bb056..77eec4588 100644 --- a/mattermost-plugin/webapp/src/index.tsx +++ b/mattermost-plugin/webapp/src/index.tsx @@ -201,7 +201,7 @@ export default class Plugin { let theme = mmStore.getState().entities.preferences.myPreferences.theme setMattermostTheme(theme) - const productID = process.env.TARGET_IS_PRODUCT ? 'com.mattermost.boards' : manifest.id + const productID = process.env.TARGET_IS_PRODUCT ? 'boards' : manifest.id // register websocket handlers this.registry?.registerWebSocketEventHandler(`custom_${productID}_${ACTION_UPDATE_BOARD}`, (e: any) => wsClient.updateHandler(e.data))