mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
MM-63447/MM-65101 Remaining changes for deprecated registerPostDropdownMenuComponent API (#33928)
Automatic Merge
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user