•  
     
    story #12189 prevent field modification according to state
Summary
tracker admin
prevent field modification according to state

I can ensure that my artifact is not modified when workflow is used to deal with a normalized process

Overview

The intend of this feature is to progressively settle fields during artifact life in case of usage of worklow to mark maturity stages (like ISO/CMM processes often do). With this in mind, when moving from one stage to another, a bunch of fields that were "under elaboration" became frozen.

It's still possible to un-freeze those fields if the workflow allows some back-tracker (ie. a tracker admin could temporarly allows a transition to make edit possible).

With this feature it would be possible to configure a worklow so an artifact would be entirely "read-only" when "Closed" (except for follow-up comments).

This story depends on story #12187 for new workflow configuration panel.

See live mockup: https://s.codepen.io/enalean/debug/dace752a350bcecdad1003e505bc9992

Functional overview

Tracker administrator point of view, configuration

The configuration of frozen fields is made in workflow transition settings. A new post-action is proposed "Freeze fields" with a multi-select box like in tracker field administration (with fields grouped by containers). All the fields selected won't be modifiable (even by a tracker, project or site administrator).

In order to keep a clear UI and not make it confusing, this post-action can only be added once per state. After adding it once, when you try to add this type of post-action again, then the selectbox for post-action type will show a disabled option.

Edge cases:

  • Field dependencies: if 2 fields have dependencies they must be configured to be either editable or frozen at same time.
  • Triggers: Triggers are defined by tracker admin and can modify a "frozen" field on the behalf of the user.
  • Other post-actions. If the transaction set a value to a field (for instance set "0" as remaining_effort when status is Done) and the field is set to frozen, the post action valuation is done (that is to say: remaining_effort is set to 0 and no longer modifiable).
  • Rules: Rules applies regardless of the frozen field. A tracker admin can make a dead-end transaction by having a global rule that cannot be satisfied due to frozen field.

End user point of view, usage

At a given state, all the frozen fields the user can see are read only (as if they were not updatable as per permissions).

Limitations

There are some limits with the interaction of workflow post action with some Tuleap features:

  • On scrum cardwall. If the workflow defines that at some states either "Remaining effort" or "Assigned to" are no longer modifiable, it will not be taken into account on the cardwall. To say it differently, in this situation, the data won't be updated on the backend (data are safe) but the error will not be shown to the end user. It would require a major rewrite of the current scrum cardwall (out of the scope of this dev) and it's very unlikely that a team would actually set this up.
  • On cardwall renderer of a tracker. If the workflow forbids modification of state at some points of the workflow, the following drag'n drop will be possible but will trigger an error with a opening modal of the artifact to modify the values so the constraints are met.

Technical overview

  • Configuration must be exported/imported with tracker XML format
  • Configuration must be duplicated at tracker / project creation.
  • On the configuration screen fields that are already readonly (burndown, last_update_date, etc) or containers (columns, etc) are not listed to limit the amount of elements to pick-up.

For REST and the angular Artifact modal

The REST routes need to be updated. We initially thought to use the permissions, but those live on the tracker and not on the artifact. The tracker has no knowledge of the particular states of artifacts. We must add the information on the artifact or more precisely, on the artifact's fields.
Here is the proposal:

{
  "field_id": 8506,
  "type": "float",
  "label": "Effort",
  "value": 126
}

Becomes

{
  "field_id": 8506,
  "type": "float",
  "label": "Effort",
  "value": 126,
  "workflow_state": {
    "can_user_update": false
  }
}

The artifact modal will need to be updated to take into account that fields with "can_user_update" === false should not be editable.
"workflow_state" can be reused in story #12188 to also support the "hide" information that will tell the REST consumer that this field is supposed to be hidden.

Empty
external.Kevin.LAVILLE@jtekt.eu, Nouha Terzi (terzino), Denis PILAT (denis_pilat), duffey maxime (duffeym)
Status
Empty
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#12189
Manuel Vacelet (vaceletm)
2022-05-09 16:06
2018-08-27 17:09
4108

References
Referencing story #12189

Git commit

tuleap/tuleap/stable

Add Read only fields transition and disallow field dependencies 67dfb22e5f
Workflow actions must not be processed when workflow is not active 3484ceec99
Workflow is_legacy information is returned by REST route 176e7aa7b6
Workflow is_legacy information is displayed in new UI 980a1ac543
Tracker administrators can disable legacy transition in old UI 09b33d9a0a
Workflow legacy transitions can be deactivated with REST f9c17e209d
We should be able to define workflow transitions matrix from scratch 1b84edc53c
Enhance button label and warning content for legacy workflows 8a48eeaa1c
Deactivate legacy transitions in new UI 87949d5a07
GET read only fields post action dd69c25c49
Convert ArtifactRepresentationBuilder tests to PHPUnit d2288ec5b6
Rename and namespace ArtifactRepresentationBuilder bb6da1e806
Prevent users from submitting read-only fields 750ed2f8d7
Present fields as read-only in web UI afb383884a
Present fields as read-only in Cardwall modal 297681c8d9
Prevent edit in place in Cardwall for read-only fields 571e49daf6
Be able to update artifacts with null changeset values fb1dc7dd95
Check first if field is read-only, then if user can update 05d2613b85
ReadOnlyFieldsDetector does not need to retrieve other post actions a5c98810b8
Artifact link field is not well handled in CSV import a1ce75ca11
Workflow triggers should overrule read-only field post-action a66ce40494
Rename Transition\Update namespace to Workflow\SimpleMode 1871933237
Add a method in DAO to check if tracker uses at least one Frozen Fields post action bc3a4a12b4
PUT create empty FrozenFields post action c7518004f3
Disallow the "Freeze" post action on Test definitions and Test executions trackers e5133e12d4
Setup REST tests for Frozen fields post actions 8581dd45d3
Select frozen fields in PUT REST route c697bc3e5e
Disallow selecting the workflow field as a frozen one 9b24ba5006
Disallow selecting fields with field dependencies for Frozen fields post action a5e844426f
Save Frozen fields actions in database 50b5af5de1
On Switch to advanced Workflow, drop frozen field post actions c7e562bd88
Fix recent issues spotted by vimeo/psalm in the tracker plugin a2b4ad31c5
Inherit frozen fields post action at tracker duplication 721df6b350
Fix type to 'frozen_fields' in GET Transition postactions e4c44390f7
Move navbar title from "Transitions" to "Transitions Rules" in workflow 850263b0b3
Add warning about Frozen Fields post action deletion 7e99e6d46d
GET frozen fields action must return an array of integer 635b23daf2
Rename CIBuild and FrozenFields to FrozenFieldsValue and CIBuildValue a971bb9ee8
Configure frozen fields post-action in web UI 5a271a5038
Drop Frozen Fields feature flag 9d30f70ba9
Drop Frozen Fields feature flag fa9f493a9c
Frozen field warning message must not appear on switch to simple 1f6ea84b39
Introduce the workflow state object 4a449b2f47
Workflow state object is now used in XML import ed13b2828e
Workflow state object is now used in workflow mode switch 07f3ec9084
Use state object in REST POST workflow_transitions/:id 1c7f38253d
Use state object in REST PATCH workflow_transitions/:id 1489290bb8
Use state object in REST PUT workflow_transitions/:id/actions a274d689bc
Cleanup workflow with state object 6fd55ded3d
Disallow the "Freeze" post action on Test definitions and Test executions trackers 24e2b15a29
Disallow choosing a tracker with "Freeze" Post action on any field as Test Definition and Test Execution in TTM Start configuration 9caee2517a
Refactoring: Feedback and redirection must be done by the controller 465df0e915
Disallow choosing a tracker with "Freeze" Post action on any field as Test Definition and Test Execution in TTM XML import 86ca8fc528
Disallow choosing a tracker with "Freeze" Post action on any field as Test Definition and Test Execution in TTM admin form 4284efe8e1
Refactoring: Reduce responsibilities of AdminController class 395c774290
Refactoring: extract check of tracker id in a dedicated object 5535d9bcb3

Follow-ups

User avatar
  • So that
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Status changed from On going to Done
  • Category set to
User avatar
Joris MASSON (jmasson)2019-03-27 16:39
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • CC list Jordan BACHELET (jordan_bachelet_jtekt) removed external.Kevin.LAVILLE@jtekt.eu, Denis PILAT (denis_pilat), Nouha Terzi (terzino) added
User avatar
Joris MASSON (jmasson)2019-03-05 16:40
The new post-action can only be added once

  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2019-03-05 16:05
Add live mockup link

  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar

Update after team review


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • CC list set to Jordan BACHELET (jordan_bachelet_jtekt), duffey maxime (duffeym)
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • So that
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes