wiki:KeepInterfaceSimplePlugin

Version 2 (modified by figaro, 8 years ago) (diff)

Cosmetic changes

Dynamically show and hide fields and options, and enforce user-defined rules on commits.

Description

This plugin supports complex workflows that contain lots of fields or have lots of rules about what is and isn't permitted. It can dynamically control what fields appear in the user interface depending on complex conditions that are nonetheless easy to define and configure. It can also block commits if necessary, such as when certain information hasn't been provided.

There are two main components, named 'assistant' and 'warden'.

The Assistant uses expressions to define what fields are presented to the user in different circumstances. For example, take the rules:

[kis_assistant]
approval.visible = !status in 'new', 'closed'
approval.options.basic_set = Not assessed, Denied
approval.available.basic_set = true
approval.options.full_set = Approved
approval.available.full_set = authname has_role 'approver' || _approval == 'Approved'

This requires that a custom field named 'approval' is defined (either a Select or a Radio field) with options 'Not assessed', 'Denied' and 'Approved'. The first rule states that the field only appears when the ticket status is other than 'new' or 'closed'. The basic set of options 'Not assessed' or 'Denied' are always available, but the full set of options including 'Approved' is only available if the user is a member of the 'approver' group or if the field already had the value 'Approved' when the page was loaded.

The Warden prevents commits from being made if certain conditions aren't met. For example, take the rules:

[kis_warden]
approval required to close = status == 'closed' && approval != 'Approved'
only designated approver can approve = !authname has_role 'approver' && approval != _approval && approval == 'Approved'

The first rule means that the ticket cannot be closed if the 'approval' field has not been set to the value 'Approved'. The second rule means that only a user who is a member of the group 'approver' can change the 'approval' field to that value.

Bugs/Feature Requests

Existing bugs and feature requests for KeepInterfaceSimplePlugin are here.

If you have any issues, create a new ticket.

defect

10 / 10

enhancement

1 / 4

task

2 / 2

Download

Download the zipped source from here.

Source

You can check out KeepInterfaceSimplePlugin from here using Subversion, or browse the source with Trac.

Installation

General instructions on installing Trac plugins can be found on the TracPlugins page.

Recent Changes

17316 by ash on 2018-12-10 22:23:18
Version 2.5
17315 by ash on 2018-12-10 09:06:07
Correctly retrieve "previous" value of a field for a new ticket (i.e. blank)
17314 by ash on 2018-12-10 08:47:29
Fix problem in how Warden rules look up the current value of a field when it _isn't_ changing. Related to the changes made for #13494 and found in testing.
re #13494
(more)

Author/Contributors

Author: ash
Maintainer: Jon Ashley
Contributors: