* 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>
Этот коммит содержится в:
Daniel Espino García
2023-12-14 11:30:31 +01:00
коммит произвёл GitHub
родитель 563f51f3db
Коммит acd413ef69
36 изменённых файлов: 2163 добавлений и 56 удалений

Просмотреть файл

@@ -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,
});
});
}