Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The text from question name (after change) is used for two lines in the Property grid caption #6543

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export class PropertyGridViewModel extends Base {
private updateTitle() {
let titleName = this.getTitle();
this.selectedElementName = titleName;
this.objectSelectionAction.title = titleName;
this.objectSelectionAction.tooltip = titleName;
this.objectSelectionAction.title = this.propertyGridModel.showOneCategoryInPropertyGrid ? "" : titleName;
}
private getTitle(): string {
var obj = this.getSelectedObj();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { settings } from "../../src/creator-settings";

test("Generate and update title correctly", () => {
const creator = new CreatorTester();
creator.showOneCategoryInPropertyGrid = false;
creator.JSON = {
elements: [
{
Expand All @@ -41,6 +42,27 @@ test("Generate and update title correctly", () => {
propertyGrid.survey.getQuestionByName("name").value = "Q2";
expect(model.objectSelectionAction.title).toEqual("Question:Q2");
});
test("showOneCategoryInPropertyGrid: Generate and update title correctly", () => {
const creator = new CreatorTester();
creator.JSON = { elements: [{ type: "text", name: "question1" }] };
const propertyGrid = creator["designerPropertyGrid"];
const model = new PropertyGridViewModel(propertyGrid, creator);
expect(model.objectSelectionAction.tooltip).toEqual("Survey");
propertyGrid.obj = creator.survey.getQuestionByName("question1");
expect(model.objectSelectionAction.tooltip).toEqual("question1");
propertyGrid.survey.getQuestionByName("name").value = "Q1";
expect(model.objectSelectionAction.tooltip).toEqual("Q1");
propertyGrid.options.getObjectDisplayName = (
obj: Base,
area: string,
reason: string,
displayName: string
) => {
return "Question:" + obj["name"];
};
propertyGrid.survey.getQuestionByName("name").value = "Q2";
expect(model.objectSelectionAction.tooltip).toEqual("Question:Q2");
});
test("Prev/next correctly, including columns via actions", () => {
const creator = new CreatorTester();
creator.propertyGridNavigationMode = "accordion";
Expand Down