mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-04 12:40:57 +00:00
Implement new approach for plugin settings
- URL specifies plugin slug and setting key
This commit is contained in:
@ -32,7 +32,7 @@ const plugins_enabled = false;
|
||||
* Interactively edit a setting value.
|
||||
* Launches a modal dialog form to adjut the value of the setting.
|
||||
*/
|
||||
function editSetting(pk, options={}) {
|
||||
function editSetting(key, options={}) {
|
||||
|
||||
// Is this a global setting or a user setting?
|
||||
var global = options.global || false;
|
||||
@ -44,13 +44,13 @@ function editSetting(pk, options={}) {
|
||||
var url = '';
|
||||
|
||||
if (plugin) {
|
||||
url = `/api/plugin/settings/${pk}/`;
|
||||
url = `/api/plugin/settings/${plugin}/${key}/`;
|
||||
} else if (notification) {
|
||||
url = `/api/settings/notification/${pk}/`;
|
||||
} else if (global) {
|
||||
url = `/api/settings/global/${pk}/`;
|
||||
url = `/api/settings/global/${key}/`;
|
||||
} else {
|
||||
url = `/api/settings/user/${pk}/`;
|
||||
url = `/api/settings/user/${key}/`;
|
||||
}
|
||||
|
||||
var reload_required = false;
|
||||
|
Reference in New Issue
Block a user