Major improvements on policy configuration
- Bugfixes on change_policy - Replaced _consent modules with configurable modules
This commit is contained in:
modpol_core
api.lua
interactions
modules
add_child_org.luaadd_child_org_consent.luachange_modules.luachange_policy.luaconsent.luacreate_token.luadefer.luadisplay_policies.luajoin_org.luajoin_org_consent.luaremove_child_org.luaremove_member.luaremove_org.luaremove_org_consent.luarename_org.luasend_token.luatemplate.luatokenomics.lua
orgs
@@ -64,16 +64,24 @@ function change_policy:initiate(result)
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
local readable_value =
|
||||
tostring(modpol.modules[mod_choice][policy_choice])
|
||||
if readable_value == "nil" then
|
||||
readable_value = "none"
|
||||
end
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a policy to change:",
|
||||
policy_list,
|
||||
function(policy_choice)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,
|
||||
"Current " .. policy_choice .. " value: " ..
|
||||
tostring(modpol.modules[mod_choice][policy_choice])
|
||||
.. "\nChange value to (be careful!):",
|
||||
"Current " .. policy_choice .. " value: "
|
||||
.. readable_value
|
||||
.. "\nChange value to (or leave blank):",
|
||||
function(policy_input)
|
||||
if policy_input == "" then
|
||||
policy_input = false
|
||||
end
|
||||
self:approve_change(
|
||||
mod_choice,
|
||||
policy_choice,
|
||||
@@ -94,7 +102,7 @@ end
|
||||
-- @param input (string) input content
|
||||
function change_policy:approve_change(module_slug, policy, input)
|
||||
self.org:call_module(
|
||||
approval_module,
|
||||
self.config.approval_module,
|
||||
self.initiator,
|
||||
{prompt = "Update " .. policy .. " policy on module " ..
|
||||
module_slug .. " with: " .. input .. " ?"},
|
||||
|
Reference in New Issue
Block a user