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

Change default value for logoPositionY #9460

Merged
merged 2 commits into from
Feb 17, 2025
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
2 changes: 1 addition & 1 deletion packages/survey-core/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Serializer.addClass(
{ name: "backgroundImageOpacity:number", minValue: 0, maxValue: 1, default: 1 },
{ name: "backgroundImageFit", default: "cover", choices: ["cover", "fill", "contain"] },
{ name: "logoPositionX", default: "left" },
{ name: "logoPositionY", default: "bottom" },
{ name: "logoPositionY", default: "top" },
{ name: "titlePositionX", default: "left" },
{ name: "titlePositionY", default: "bottom" },
{ name: "descriptionPositionX", default: "left" },
Expand Down
19 changes: 16 additions & 3 deletions packages/survey-core/tests/headerTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,24 @@ QUnit.test("grid cells - defaults", function (assert) {
cover.survey = getSurveyWithLogoTitleAndDescription();

cover.cells.forEach(cell => {
assert.equal(cell.showLogo, cell["positionX"] === "left" && cell["positionY"] === "bottom", "logo in bottom left");
assert.equal(cell.showLogo, cell["positionX"] === "left" && cell["positionY"] === "top", "logo in top left");
assert.equal(cell.showTitle, cell["positionX"] === "left" && cell["positionY"] === "bottom", "title in bottom left");
assert.equal(cell.showDescription, cell["positionX"] === "left" && cell["positionY"] === "bottom", "description in bottom left");
});

assert.equal(cover.cells[0].css, "sv-header__cell sv-header__cell--left sv-header__cell--top", "top left cell css");
assert.deepEqual(cover.cells[0].style, {
"gridColumn": 1,
"gridRow": 1,
"width": undefined
}, "top left cell style");
assert.deepEqual(cover.cells[0].contentStyle, {
"alignItems": "flex-start",
"justifyContent": "flex-start",
"textAlign": "start",
"maxWidth": undefined,
}, "top left cell content style");

assert.equal(cover.cells[6].css, "sv-header__cell sv-header__cell--left sv-header__cell--bottom", "bottom left cell css");
assert.deepEqual(cover.cells[6].style, {
"gridColumn": 1,
Expand All @@ -152,7 +165,7 @@ QUnit.test("grid cells - defaults", function (assert) {
"alignItems": "flex-start",
"justifyContent": "flex-end",
"textAlign": "start",
"maxWidth": undefined,
"maxWidth": "300%",
}, "bottom left cell content style");
});

Expand Down Expand Up @@ -213,7 +226,7 @@ QUnit.test("grid cells - empty survey", function (assert) {

cover.survey.logo = "logoURL";
cover.cells.forEach((cell, index) => {
assert.equal(cell.showLogo, index === 6, "logo, title and description: logo");
assert.equal(cell.showLogo, index === 0, "logo, title and description: logo");
assert.equal(cell.showTitle, index === 6, "logo, title and description: title");
assert.equal(cell.showDescription, index === 6, "logo, title and description: description");
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.