Skip to content

Commit

Permalink
Fix: exclude non-trackable models from checkCompletionStatusFor (fixes
Browse files Browse the repository at this point in the history
 #526).
  • Loading branch information
danielghost committed May 3, 2024
1 parent f6fe365 commit 8342e94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/models/adaptModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export default class AdaptModel extends LockingModel {
*/
checkCompletionStatusFor(completionAttribute = '_isComplete') {
let completed = false;
const children = this.getAvailableChildModels();
const children = this.getAvailableTrackableChildModels();
const requireCompletionOf = this.get('_requireCompletionOf');
const isOptional = this.get('_isOptional');
const isEveryChildOptional = children.every(child => child.get('_isOptional'));
Expand Down Expand Up @@ -651,6 +651,10 @@ export default class AdaptModel extends LockingModel {
});
}

getAvailableTrackableChildModels() {
return this.getAvailableChildModels().filter(child => child.get('_isTrackable') !== false);
}

getParent() {
if (this._parentModel) {
return this._parentModel;
Expand Down

0 comments on commit 8342e94

Please sign in to comment.