MM-63447/MM-65101 Remaining changes for deprecated registerPostDropdownMenuComponent API (#33928)

Automatic Merge
This commit is contained in:
Harrison Healey
2025-09-19 08:19:10 +03:00
committed by GitHub
parent 3f5665f324
commit 9500afaf19
2 changed files with 14 additions and 2 deletions
@@ -55,6 +55,7 @@
span.MenuItem__primary-text {
display: inline-flex;
max-width: 100%;
align-items: center;
padding: 5px 0;
line-height: 22px;
white-space: nowrap;
@@ -162,8 +163,6 @@
}
.MenuItem__icon {
position: relative;
top: 4px;
display: inline-flex;
width: 20px;
height: 20px;
+13
View File
@@ -644,9 +644,22 @@ export default class PluginRegistry {
return {id, rootRegisterMenuItem: registerMenuItem(this.id, id, undefined, text, action, filter)};
});
warnedAboutRegisterPostDropdownMenuComponent = false;
// Register a component at the bottom of the post dropdown menu.
// Accepts a React component. Returns a unique identifier.
registerPostDropdownMenuComponent = reArg(['component'], ({component}: DPluginComponentProp) => {
if (!this.warnedAboutRegisterPostDropdownMenuComponent) {
// eslint-disable-next-line no-console
console.warn(
`${this.id}: This plugin is using registerPostDropdownMenuComponent which is deprecated in Mattermost ` +
'v11.0. That API will be removed in a future release, and plugins that use it may not work correctly. ' +
'Please update the plugin to use registerPostDropdownMenuAction instead. See ' +
'https://forum.mattermost.com/t/deprecating-a-post-dropdown-menu-component-plugin-api-v11/25001 for ' +
'more information.',
);
this.warnedAboutRegisterPostDropdownMenuComponent = true;
}
return dispatchPluginComponentAction('PostDropdownMenuItem', this.id, component);
});