From 352cd13eb12aabe10b0826b2006fbd7e7f093547 Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Wed, 3 Jan 2024 16:26:38 +0200 Subject: [PATCH 1/7] Dropdown Matrix - When a column's Required If rule is configured, the required mark doesn't appear in Vertical column orientation mode fix #7615 --- src/question_matrixdropdownrendered.ts | 27 +-------- tests/question_matrixdropdownbasetests.ts | 5 +- .../matrixdropdown-column-non-required.png | Bin 0 -> 6855 bytes .../matrixdropdown-column-required.png | Bin 0 -> 7053 bytes .../tests/defaultV2/matrixdropdown.ts | 56 ++++++++++++++++++ 5 files changed, 62 insertions(+), 26 deletions(-) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-non-required.png create mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-required.png create mode 100644 visualRegressionTests/tests/defaultV2/matrixdropdown.ts diff --git a/src/question_matrixdropdownrendered.ts b/src/question_matrixdropdownrendered.ts index 47d4fe8bc8..7e144823b4 100644 --- a/src/question_matrixdropdownrendered.ts +++ b/src/question_matrixdropdownrendered.ts @@ -29,7 +29,6 @@ export class QuestionMatrixDropdownRenderedCell { public choiceIndex: number; public isOtherChoice: boolean; public matrix: QuestionMatrixDropdownModelBase; - public requiredText: string; public isEmpty: boolean; public colSpans: number = 1; public panel: PanelModel; @@ -42,6 +41,9 @@ export class QuestionMatrixDropdownRenderedCell { public constructor() { this.idValue = QuestionMatrixDropdownRenderedCell.counter++; } + public get requiredText(): string { + return this.column && this.column.isRenderedRequired ? this.column.requiredText : undefined; + } public get hasQuestion(): boolean { return !!this.question && !this.isErrorsCell; } @@ -867,9 +869,6 @@ export class QuestionMatrixDropdownRenderedTable extends Base { .append(hCell.className) .append(this.cssClasses.rowTextCell) .append(this.cssClasses.columnTitleCell).toString(); - if (!choice) { - this.setRequriedToHeaderCell(column, hCell); - } res.cells.push(hCell); } var rows = this.matrix.visibleRows; @@ -1014,7 +1013,6 @@ export class QuestionMatrixDropdownRenderedTable extends Base { cell: QuestionMatrixDropdownRenderedCell ) { this.setHeaderCellWidth(column, cell); - this.setRequriedToHeaderCell(column, cell); } private setHeaderCellWidth( column: MatrixDropdownColumn, @@ -1023,25 +1021,6 @@ export class QuestionMatrixDropdownRenderedTable extends Base { cell.minWidth = column != null ? this.matrix.getColumnWidth(column) : this.matrix.getRowTitleWidth(); cell.width = column != null ? column.width : this.matrix.getRowTitleWidth(); } - private setRequriedToHeaderCell( - column: MatrixDropdownColumn, - cell: QuestionMatrixDropdownRenderedCell - ) { - if (!!column && column.isRequired && this.matrix.survey) { - cell.requiredText = this.matrix.survey.requiredText; - } - } - private createRemoveRowCell( - row: MatrixDropdownRowModelBase - ): QuestionMatrixDropdownRenderedCell { - var res = new QuestionMatrixDropdownRenderedCell(); - res.row = row; - res.isRemoveRow = this.canRemoveRow(row); - if (!!this.cssClasses.cell) { - res.className = this.cssClasses.cell; - } - return res; - } private createTextCell( locTitle: LocalizableString ): QuestionMatrixDropdownRenderedCell { diff --git a/tests/question_matrixdropdownbasetests.ts b/tests/question_matrixdropdownbasetests.ts index 9ed4c04b5c..e92e5592ac 100644 --- a/tests/question_matrixdropdownbasetests.ts +++ b/tests/question_matrixdropdownbasetests.ts @@ -228,8 +228,9 @@ QUnit.test("column cell css classes for vertical layout", function (assert) { const matrix = survey.getQuestionByName("question1"); assert.equal(matrix.renderedTable.headerRow.cells.length, 3); - assert.equal(matrix.renderedTable.headerRow.cells[1].className, "sv_matrix_cell_header", "column 1"); - assert.equal(matrix.renderedTable.headerRow.cells[2].className, "sv_matrix_cell_header", "column 2"); + const cssHeader = survey.css.matrixdropdown.headerCell; + assert.equal(matrix.renderedTable.headerRow.cells[1].className, cssHeader, "column 1"); + assert.equal(matrix.renderedTable.headerRow.cells[2].className, cssHeader, "column 2"); }); QUnit.test("column cell css classes by matrix cellType test", function (assert) { diff --git a/visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-non-required.png b/visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-non-required.png new file mode 100644 index 0000000000000000000000000000000000000000..5dcacac8e4bd6713e35aa000e6687d834cc8cf1c GIT binary patch literal 6855 zcmds6XIPWllLt{zs#lSYh=eAggP~)igbopr-U%R`P(q6c!WHSgMNl9#2};bf|BymMS${h+ol+JoP$2R_b7mJg*}u&LBalv{I%N7=t`Qk`LVISzQJK>_Q~_o z&ziK$`PDv;AK};pce3d7#Xt5#kqwVN#FISl^17RNHHt_$(OUX`RL%Dg{_d*kCYMO3hDhAQh=%-V0~3<=yPddkwy+tNjqW#;IL+xvxy$G8zbU-C37R?F2T4gu zIVXYat4x@|PwpmxG?GA2!eRnONIj18jbRD!5{7)mEb{X?t>{hYRS+}@w1|KvMbL`Y zKU00h?4{k~SOtPUC)3eF(4>TZ$IC3{o|M2KNeGOEXZwW+5Htb!D3B6?UOh)9GeH3< z(44tpS7HK^ErdV<4smg0Smc5Z909R!^O5>fE2;ggrBeU;0?C!i^H6oStx z;}~`_7oUF4A=2Z7X?XmIE|;`-LG+Z1B&};Tks56ClX$d$fH&#McGRRJc?nz8xnt%z zRDOP#w<=nzD%*P`BEb3Dex?bf=f9ilvpl>uxAvwxz_GHU=wv~2$?`_wt}v>9LIoWr zaIxWVtqHi`d)r-Np8HQb5ho`yN2=d)HzBCzl)Ap7Zt=;b)=b>e(iF$(wwU7a>5s}( zp%iSl;B0AGpHsHwYcI>+Idys@Ay!S&IZaRB z8prKOZElr~>_N(&M3YVA{>d}T+`FH@*1R)YbgBw3Iy1@8+ViT7@5ryWsgB@>7dQXb zKE#n;wa0Re33nu3<)EC?IlXORmAB^|M)F`x9MqKv)Ju$A4jpKVKNJF&i`Q1g4xoP{ z#%1mf&ers4$8P?@JCJ zGsFq;0($|Cm(1arHD+l4sZ}2_`S|41>N!c^t2b8!y6h9d@k#JXU1qt_)nNz zEyFI+*C@@-bO|n0v;BVB3If~Hp|zgX=Yim5dVg?eY4oLruNy2a%-LAR1=KbIaXJ9{;LozngG=gNrWN@25lX2Dev ziH{03#KzlrC@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gClP(?Og4s2+Pp&Di~IEL9Jdw_B+8G4a|v50=Z3>&b`c1q#VKSL>~$5G z8?BK}pB>PqQGb|_VRxv4l*h{caBo$5p2{F4(zLi{D2kud90%t()*@3KKj};iQVyH8 zg|+s9i@l?oPM~9_6)94Vui^Jope!R5ace}ZLGixf1NW;CCzIP<=dwKpe_<*Swr73g zF+d@?#`0#n!X!Ac@;rZBVs=s!?fY5Vo-;Ly-Ieral+YJ3Pc2X&nH^tgHb4+?11+m zMJ+u&#Uxawby%k7Im!SC;E4t<=ir27)F=0;0Ea*Mz*f}K)onrEfBILS>t>dKvGqbPJykTmXoY|7$Vv|AZ`g0QRzL0C;XXe^C_rwGMJLkBRDy$A0hy}sOc8uwKmj~owNOLeNIFUYDMjW^%s$GD2 z)&4)O`20&%~_gudN>@At6> zpWtiN3!jsd70zQS7Vx)J?=`63@hoQy=+YVIT$u*<&Vp { + +}); + +const theme = "defaultV2"; + +frameworks.forEach(framework => { + fixture`${framework} ${title} ${theme}`.page`${url_test}${theme}/${framework}`.beforeEach(async t => { + await applyTheme(theme); + }); + test("Column requiredIf and vertical layout", async (t) => { + await wrapVisualTest(t, async (t, comparer) => { + await t.resizeWindow(900, 900); + await initSurvey(framework, { + "focusFirstQuestionAutomatic": true, + "elements": [{ + "type": "radiogroup", + "name": "question2", + "defaultValue": "Item1", + "choices": [ + "Item1", + "Item2", + "Item3" + ] + }, + { + "type": "matrixdropdown", + "name": "question1", + "columns": [ + { + "name": "Column 1", + "cellType": "text", + "requiredIf": "{question2} = 'Item1'" + } + ], + "columnLayout": "vertical", + "rows": [ + "Row 1", + "Row 2" + ] + }] } + ); + const matrixdynamicRoot = Selector(".sd-question").nth(1); + await takeElementScreenshot("matrixdropdown-column-required.png", matrixdynamicRoot, t, comparer); + await t.pressKey("down"); + await takeElementScreenshot("matrixdropdown-column-non-required.png", matrixdynamicRoot, t, comparer); + await t.pressKey("up"); + await takeElementScreenshot("matrixdropdown-column-required.png", matrixdynamicRoot, t, comparer); + }); + }); +}); \ No newline at end of file From 569d665ef30b2e0b14286a96ee3e64378de7fc2d Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Wed, 3 Jan 2024 17:35:00 +0200 Subject: [PATCH 2/7] Add mask #7615 --- .../matrixdropdown-column-required_mask.png | Bin 0 -> 1323 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-required_mask.png diff --git a/visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-required_mask.png b/visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-required_mask.png new file mode 100644 index 0000000000000000000000000000000000000000..d4ea0b3b27e6912b9080bce3c6126462f307ccbc GIT binary patch literal 1323 zcmeAS@N?(olHy`uVBq!ia0y~yU{+yZU}WTA1B!HhNnF9e!1Bq{#WAFU@$JEbyiA4+ z%o|L0{SDW%xv9XBGyk_314Bb2P;J5zMg|6nOrRz=DWK5AQK8Y07)=v2&I=mG Date: Thu, 4 Jan 2024 12:57:42 +0200 Subject: [PATCH 3/7] Replace visual test with functional test #7615 --- testCafe/questions/matrixdropdown.js | 46 ++++++++++++++ .../matrixdropdown-column-non-required.png | Bin 6855 -> 0 bytes .../matrixdropdown-column-required.png | Bin 7053 -> 0 bytes .../matrixdropdown-column-required_mask.png | Bin 1323 -> 0 bytes .../tests/defaultV2/matrixdropdown.ts | 56 ------------------ 5 files changed, 46 insertions(+), 56 deletions(-) delete mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-non-required.png delete mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-required.png delete mode 100644 visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-required_mask.png delete mode 100644 visualRegressionTests/tests/defaultV2/matrixdropdown.ts diff --git a/testCafe/questions/matrixdropdown.js b/testCafe/questions/matrixdropdown.js index 6696d3b893..e7e49ad22b 100644 --- a/testCafe/questions/matrixdropdown.js +++ b/testCafe/questions/matrixdropdown.js @@ -107,3 +107,49 @@ frameworks.forEach(framework => { }); }); }); + +const json2 = { + "focusFirstQuestionAutomatic": true, + "elements": [{ + "type": "radiogroup", + "name": "question2", + "defaultValue": "Item1", + "choices": [ + "Item1", + "Item2", + "Item3" + ] + }, + { + "type": "matrixdropdown", + "name": "question1", + "columns": [ + { + "name": "Column 1", + "cellType": "text", + "requiredIf": "{question2} = 'Item1'" + } + ], + "columnLayout": "vertical", + "rows": [ + "Row 1", + "Row 2" + ] + }] +}; +frameworks.forEach(framework => { + fixture`${framework} ${title}`.page`${url}${framework}`.beforeEach( + async t => { + await initSurvey(framework, json2); + } + ); + + test("Column requiredIf and vertical layout", async t => { + const requiredSpan = Selector("span").withExactText("*"); + await t.expect(requiredSpan.exists).ok(); + await t.pressKey("down"); + await t.expect(requiredSpan.exists).notOk(); + await t.pressKey("up"); + await t.expect(requiredSpan.exists).ok(); + }); +}); diff --git a/visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-non-required.png b/visualRegressionTests/tests/defaultV2/etalons/matrixdropdown-column-non-required.png deleted file mode 100644 index 5dcacac8e4bd6713e35aa000e6687d834cc8cf1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6855 zcmds6XIPWllLt{zs#lSYh=eAggP~)igbopr-U%R`P(q6c!WHSgMNl9#2};bf|BymMS${h+ol+JoP$2R_b7mJg*}u&LBalv{I%N7=t`Qk`LVISzQJK>_Q~_o z&ziK$`PDv;AK};pce3d7#Xt5#kqwVN#FISl^17RNHHt_$(OUX`RL%Dg{_d*kCYMO3hDhAQh=%-V0~3<=yPddkwy+tNjqW#;IL+xvxy$G8zbU-C37R?F2T4gu zIVXYat4x@|PwpmxG?GA2!eRnONIj18jbRD!5{7)mEb{X?t>{hYRS+}@w1|KvMbL`Y zKU00h?4{k~SOtPUC)3eF(4>TZ$IC3{o|M2KNeGOEXZwW+5Htb!D3B6?UOh)9GeH3< z(44tpS7HK^ErdV<4smg0Smc5Z909R!^O5>fE2;gg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}); - -const theme = "defaultV2"; - -frameworks.forEach(framework => { - fixture`${framework} ${title} ${theme}`.page`${url_test}${theme}/${framework}`.beforeEach(async t => { - await applyTheme(theme); - }); - test("Column requiredIf and vertical layout", async (t) => { - await wrapVisualTest(t, async (t, comparer) => { - await t.resizeWindow(900, 900); - await initSurvey(framework, { - "focusFirstQuestionAutomatic": true, - "elements": [{ - "type": "radiogroup", - "name": "question2", - "defaultValue": "Item1", - "choices": [ - "Item1", - "Item2", - "Item3" - ] - }, - { - "type": "matrixdropdown", - "name": "question1", - "columns": [ - { - "name": "Column 1", - "cellType": "text", - "requiredIf": "{question2} = 'Item1'" - } - ], - "columnLayout": "vertical", - "rows": [ - "Row 1", - "Row 2" - ] - }] } - ); - const matrixdynamicRoot = Selector(".sd-question").nth(1); - await takeElementScreenshot("matrixdropdown-column-required.png", matrixdynamicRoot, t, comparer); - await t.pressKey("down"); - await takeElementScreenshot("matrixdropdown-column-non-required.png", matrixdynamicRoot, t, comparer); - await t.pressKey("up"); - await takeElementScreenshot("matrixdropdown-column-required.png", matrixdynamicRoot, t, comparer); - }); - }); -}); \ No newline at end of file From d6fd8707b62f3d1802e6c095312adfca846a2e46 Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Thu, 4 Jan 2024 13:03:54 +0200 Subject: [PATCH 4/7] Fix lint error #7615 --- testCafe/questions/matrixdropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testCafe/questions/matrixdropdown.js b/testCafe/questions/matrixdropdown.js index e7e49ad22b..3edb42a2b7 100644 --- a/testCafe/questions/matrixdropdown.js +++ b/testCafe/questions/matrixdropdown.js @@ -135,7 +135,7 @@ const json2 = { "Row 1", "Row 2" ] - }] + }] }; frameworks.forEach(framework => { fixture`${framework} ${title}`.page`${url}${framework}`.beforeEach( From 85a06781dd70a6a9075d40bd17bac353adc50cbc Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Thu, 4 Jan 2024 14:18:12 +0200 Subject: [PATCH 5/7] Fix angular functional test #7615 --- .../src/questions/matrixdropdowncell.component.html | 2 +- .../src/questions/matrixdropdowncell.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.html b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.html index f94187de44..346a56c3db 100644 --- a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.html +++ b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.html @@ -34,7 +34,7 @@ - {{ cell.requiredText }} + {{ cell.requiredText }} diff --git a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts index d4c6d1a695..b3cf11f444 100644 --- a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts +++ b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts @@ -4,6 +4,7 @@ import { Question, QuestionMatrixDropdownModelBase, QuestionMatrixDropdownRenderedCell, + QuestionMatrixDropdownColumn, MatrixDropdownRowModelBase, SurveyModel } from "survey-core"; @@ -72,6 +73,9 @@ export class MatrixDropdownCellComponent extends BaseAngular { return { width: this.cell.width, minWidth: this.cell.minWidth }; return null; } + public get isRequiredCell(): boolean { + return !!this.cell.column && this.cell.column.isRenderedRequired; + } ngAfterViewInit() { if (!this.cell.hasQuestion || !this.question || !this.question.survey) return; const el = this.cellContainer.nativeElement; From 75bc222c18f69a6695fc4d12e86c108c225822d3 Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Thu, 4 Jan 2024 14:36:10 +0200 Subject: [PATCH 6/7] FIx Angular compilation #7615 --- .../src/questions/matrixdropdowncell.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts index b3cf11f444..782095f4b0 100644 --- a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts +++ b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts @@ -4,7 +4,6 @@ import { Question, QuestionMatrixDropdownModelBase, QuestionMatrixDropdownRenderedCell, - QuestionMatrixDropdownColumn, MatrixDropdownRowModelBase, SurveyModel } from "survey-core"; From f4c18e6240bd50396ff41154580dc474af3805a6 Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Thu, 4 Jan 2024 15:03:24 +0200 Subject: [PATCH 7/7] FIx angular functional test #7615 --- .../src/questions/matrixdropdowncell.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts index 782095f4b0..0f06139752 100644 --- a/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts +++ b/packages/survey-angular-ui/src/questions/matrixdropdowncell.component.ts @@ -23,6 +23,9 @@ export class MatrixDropdownCellComponent extends BaseAngular { if(this.cell.hasQuestion) { return this.cell.question; } + if(!!this.cell.column) { + return this.cell.column; + } return null as any; } public get row(): MatrixDropdownRowModelBase {