stable

Clone or download

Read-only

fix: artifact view field deps selects the first target value

How to test: - Setup a tracker with field dependencies between two selectbox or multi-selectbox fields. Make sure at least one dependency leads to only one target value. - Submit or edit an artifact from this tracker, in the artifact view - When you choose a source value, and the target value is the only one possible, it should be selected automatically. - When there is more than one target value, the first target value is selected automatically. - It keeps previously selected target value. For example, when you change from a source value that as two targets to a source value that has three targets, then if you selected the second target value, it stays selected (and does not switch to the first value). Notes: When its list of options changed, list-picker used to re-select the last selected value according to its internal state. This behaviour causes problems for us because now, the field dependencies code will select an option when refreshing the target options. List-picker now ignores its internal state and re-reads the selected options, and shows them as selected (_without_ dispatching another "change" event, this would cause an infinite loop). part of request #22648 Convert AngularJS directives and controllers to hybrids web components part of request #30389 Target field dependency is no longer auto-selected Change-Id: Ie8fac82fb057e9473122c2074be3225f8ae97f6f

Modified Files

Name
M lib/frontend/list-picker/src/events/ListOptionsChangesObserver.test.ts +6 −6 Go to diff View file
M lib/frontend/list-picker/src/events/ListOptionsChangesObserver.ts +1 −1 Go to diff View file
M lib/frontend/list-picker/src/list-picker.ts +2 −2 Go to diff View file
M lib/frontend/list-picker/src/selection/MultipleSelectionManager.test.ts +116 −37 Go to diff View file
M lib/frontend/list-picker/src/selection/MultipleSelectionManager.ts +16 −14 Go to diff View file
M lib/frontend/list-picker/src/selection/SingleSelectionManager.test.ts +91 −71 Go to diff View file
M lib/frontend/list-picker/src/selection/SingleSelectionManager.ts +17 −29 Go to diff View file
M lib/frontend/list-picker/src/type.ts +1 −1 Go to diff View file
M plugins/tracker/scripts/legacy/src/TrackerFieldDependencies.js +31 −29 Go to diff View file