Skip to content

Commit

Permalink
Dynamic Panel - Increase the max panel count fix #9000 (#9005)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov authored Nov 1, 2024
1 parent c945629 commit e057a58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ visualRegressionTests/screenshots
visualRegressionTests/artifacts
packages/survey-angular-ui/src/**/*.js
dist
junit.xml
junit.xml
playwright-report/*
test-results/*
2 changes: 1 addition & 1 deletion packages/survey-core/src/question_paneldynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,7 @@ Serializer.addClass(
{ name: "minPanelCount:number", default: 0, minValue: 0 },
{
name: "maxPanelCount:number",
default: settings.panel.maxPanelCount,
defaultFunc: () => settings.panel.maxPanelCount,
},
"defaultPanelValue:panelvalue",
"defaultValueFromLastPanel:boolean",
Expand Down
9 changes: 8 additions & 1 deletion packages/survey-core/tests/question_paneldynamic_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7590,4 +7590,11 @@ QUnit.test("Validation doesn't work if a user doensn't visit the page, Bug#8937"
assert.equal(survey.currentPageNo, 1, "move to page with panel");
const panel = <QuestionPanelDynamicModel>survey.getQuestionByName("panel");
assert.equal(panel.panels[0].getQuestionByName("question2").errors.length, 1, "has an error");
});
});
QUnit.test("default value for maxPanelCount, Bug#9000", function (assert) {
assert.equal(new QuestionPanelDynamicModel("q1").maxPanelCount, 100, "default value");
settings.panel.maxPanelCount = 300;
assert.equal(new QuestionPanelDynamicModel("q1").maxPanelCount, 300, "updated default value");
settings.panel.maxPanelCount = 100;
assert.equal(new QuestionPanelDynamicModel("q1").maxPanelCount, 100, "default value again");
});

0 comments on commit e057a58

Please sign in to comment.