Add plugin user settings (#25517)
* Add plugin user settings * Feedback and UI improvements * Extract the plugin configuration instead of just validating it * Fix lint * Fix lint * Divide between settings and sections * i18n-extract * Adjust icon location * Add tests * Improve documentation * Force plugin id * Fix test --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
563f51f3db
Коммит
acd413ef69
@@ -1225,4 +1225,22 @@ export default class PluginRegistry {
|
||||
|
||||
return id;
|
||||
});
|
||||
|
||||
// Register a schema for user settings. This will show in the user settings modals
|
||||
// and all values will be stored in the preferences with cateogry pp_${pluginId} and
|
||||
// the name of the setting.
|
||||
//
|
||||
// The settings definition can be found in /src/types/plugins/user_settings.ts
|
||||
//
|
||||
// Malformed settings will be filtered out.
|
||||
registerUserSettings = reArg(['setting'], ({setting}) => {
|
||||
const data = {
|
||||
pluginId: this.id,
|
||||
setting,
|
||||
};
|
||||
store.dispatch({
|
||||
type: ActionTypes.RECEIVED_PLUGIN_USER_SETTINGS,
|
||||
data,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user