Skip to content

Commit

Permalink
#6329 Rename showOneCategoryInPropertyGrid
Browse files Browse the repository at this point in the history
Fixes #6329
  • Loading branch information
novikov82 committed Dec 25, 2024
1 parent 65941bf commit 7d062c9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,16 @@ export class SurveyCreatorModel extends Base
}
});
}
/**
*
*
*/
get propertyGridNavigationMode(): "buttons" | "accordion" {
return this.showOneCategoryInPropertyGrid ? "buttons" : "accordion";
}
set propertyGridNavigationMode(newValue: "buttons" | "accordion") {
this.showOneCategoryInPropertyGrid = newValue === "buttons";
}

get allowEditSurveyTitle(): boolean {
return this.getPropertyValue("allowEditSurveyTitle", true);
Expand Down
5 changes: 5 additions & 0 deletions packages/survey-creator-core/src/creator-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,9 @@ export interface ICreatorOptions {
* @see expandCollapseButtonVisibility
*/
collapseQuestions?: boolean;
/**
*
*
*/
propertyGridNavigationMode?: "buttons" | "accordion";
}
13 changes: 13 additions & 0 deletions packages/survey-creator-core/tests/creator-base.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4806,4 +4806,17 @@ test("ZoomIn/ZoomOut actions limits", (): any => {
zoom100Action.action();
expect(designerTabModel["surfaceScale"]).toBe(100);
expect(creator.survey.widthScale).toBe(100);
});

test("propertyGridNavigationMode property", (): any => {
const creator = new CreatorTester();
creator.propertyGridNavigationMode = "buttons";
expect(creator.showOneCategoryInPropertyGrid).toBeTruthy();
creator.propertyGridNavigationMode = "accordion";
expect(creator.showOneCategoryInPropertyGrid).toBeFalsy();

creator.showOneCategoryInPropertyGrid = true;
expect(creator.propertyGridNavigationMode).toBe("buttons");
creator.showOneCategoryInPropertyGrid = false;
expect(creator.propertyGridNavigationMode).toBe("accordion");
});

0 comments on commit 7d062c9

Please sign in to comment.