How to use getItems method in storybook-root

Best JavaScript code snippet using storybook-root

Layout.qunit.js

Source:Layout.qunit.js Github

copy

Full Screen

...94 wait(1000).then(function () {95 assert.ok(this.oEditor.isReady(), "Editor is ready");96 var oPanel = this.oEditor.getAggregation("_formContent")[0];97 var oHBox1 = oPanel.getContent()[0];98 var oLabel1 = oHBox1.getItems()[0].getItems()[0];99 var oField1 = oHBox1.getItems()[1].getItems()[0];100 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");101 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");102 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");103 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");104 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");105 oField1._descriptionIcon.onmouseover();106 var oDescriptionText = this.oEditor._getPopover().getContent()[0];107 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");108 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");109 oField1._descriptionIcon.onmouseout();110 var oHBox2 = oPanel.getContent()[1];111 var oLabel2 = oHBox2.getItems()[0].getItems()[0];112 var oField2 = oHBox2.getItems()[1].getItems()[0];113 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");114 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");115 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");116 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");117 var oHBox3 = oPanel.getContent()[2];118 var oLabel3 = oHBox3.getItems()[0];119 var oField3 = oHBox3.getItems()[1].getItems()[0];120 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");121 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");122 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");123 var oHBox4 = oPanel.getContent()[3];124 var oLabel4 = oHBox4.getItems()[0];125 var oField4 = oHBox4.getItems()[1].getItems()[0];126 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");127 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");128 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");129 var oHBox5 = oPanel.getContent()[4];130 var oLabel5 = oHBox5.getItems()[0];131 var oField5 = oHBox5.getItems()[1].getItems()[0];132 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");133 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");134 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");135 var oHBox6 = oPanel.getContent()[5];136 var oLabel6 = oHBox6.getItems()[0];137 var oField6 = oHBox6.getItems()[1].getItems()[0];138 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");139 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");140 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");141 var oHBox7 = oPanel.getContent()[6];142 var oLabel7 = oHBox7.getItems()[0];143 var oField7 = oHBox7.getItems()[1].getItems()[0];144 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");145 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");146 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");147 var oHBox8 = oPanel.getContent()[7];148 var oLabel8 = oHBox8.getItems()[0];149 var oField8 = oHBox8.getItems()[1].getItems()[0];150 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");151 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");152 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");153 resolve();154 }.bind(this));155 }.bind(this));156 }.bind(this));157 });158 QUnit.test("No Wrap With Cols1", function (assert) {159 this.oEditor.setJson({160 "baseUrl": sBaseUrl,161 "manifest": {162 "sap.app": {163 "id": "test.sample",164 "i18n": "../i18n/i18n.properties"165 },166 "sap.card": {167 "designtime": "designtime/noWrapWithCols1",168 "type": "List",169 "configuration": {170 "parameters": {171 "booleanParameter": {},172 "booleanParameterWithSwitch": {},173 "dateParameter": {},174 "datetimeParameter": {},175 "stringArray": [],176 "numberParameter": 0,177 "stringParameter": ""178 }179 }180 }181 }182 });183 return new Promise(function (resolve, reject) {184 this.oEditor.attachReady(function () {185 wait(1000).then(function () {186 assert.ok(this.oEditor.isReady(), "Editor is ready");187 var oPanel = this.oEditor.getAggregation("_formContent")[0];188 var oHBox1 = oPanel.getContent()[0].getItems()[0];189 var oLabel1 = oHBox1.getItems()[0].getItems()[0];190 var oField1 = oHBox1.getItems()[1].getItems()[0];191 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");192 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");193 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");194 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");195 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");196 oField1._descriptionIcon.onmouseover();197 var oDescriptionText = this.oEditor._getPopover().getContent()[0];198 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");199 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");200 oField1._descriptionIcon.onmouseout();201 var oHBox2 = oPanel.getContent()[0].getItems()[1];202 var oLabel2 = oHBox2.getItems()[0].getItems()[0];203 var oField2 = oHBox2.getItems()[1].getItems()[0];204 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");205 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");206 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");207 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");208 var oHBox3 = oPanel.getContent()[1].getItems()[0];209 var oLabel3 = oHBox3.getItems()[0];210 var oField3 = oHBox3.getItems()[1].getItems()[0];211 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");212 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");213 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");214 var oHBox4 = oPanel.getContent()[1].getItems()[1];215 var oLabel4 = oHBox4.getItems()[0];216 var oField4 = oHBox4.getItems()[1].getItems()[0];217 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");218 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");219 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");220 var oHBox5 = oPanel.getContent()[2].getItems()[0];221 var oLabel5 = oHBox5.getItems()[0];222 var oField5 = oHBox5.getItems()[1].getItems()[0];223 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");224 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");225 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");226 var oHBox6 = oPanel.getContent()[2].getItems()[1];227 var oLabel6 = oHBox6.getItems()[0];228 var oField6 = oHBox6.getItems()[1].getItems()[0];229 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");230 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");231 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");232 var oHBox7 = oPanel.getContent()[3].getItems()[0];233 var oLabel7 = oHBox7.getItems()[0];234 var oField7 = oHBox7.getItems()[1].getItems()[0];235 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");236 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");237 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");238 var oHBox8 = oPanel.getContent()[3].getItems()[1];239 var oLabel8 = oHBox8.getItems()[0];240 var oField8 = oHBox8.getItems()[1].getItems()[0];241 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");242 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");243 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");244 resolve();245 }.bind(this));246 }.bind(this));247 }.bind(this));248 });249 QUnit.test("Position With Cols2", function (assert) {250 this.oEditor.setJson({251 "baseUrl": sBaseUrl,252 "manifest": {253 "sap.app": {254 "id": "test.sample",255 "i18n": "../i18n/i18n.properties"256 },257 "sap.card": {258 "designtime": "designtime/noWrapPositionWithCols2",259 "type": "List",260 "configuration": {261 "parameters": {262 "booleanParameter": {},263 "booleanParameterWithSwitch": {},264 "dateParameter": {},265 "datetimeParameter": {},266 "stringArray": [],267 "numberParameter": 0,268 "stringParameter": ""269 }270 }271 }272 }273 });274 return new Promise(function (resolve, reject) {275 this.oEditor.attachReady(function () {276 wait(1000).then(function () {277 assert.ok(this.oEditor.isReady(), "Editor is ready");278 var oPanel = this.oEditor.getAggregation("_formContent")[0];279 var oHBox1 = oPanel.getContent()[0];280 var oField1 = oHBox1.getItems()[0];281 var oLabel1 = oHBox1.getItems()[1].getItems()[0].getItems()[0];282 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");283 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");284 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");285 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");286 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");287 oField1._descriptionIcon.onmouseover();288 var oDescriptionText = this.oEditor._getPopover().getContent()[0];289 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");290 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");291 oField1._descriptionIcon.onmouseout();292 var oHBox2 = oPanel.getContent()[1];293 var oField2 = oHBox2.getItems()[0];294 var oLabel2 = oHBox2.getItems()[1].getItems()[0].getItems()[0];295 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");296 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");297 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");298 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");299 var oHBox3 = oPanel.getContent()[2];300 var oField3 = oHBox3.getItems()[0];301 var oLabel3 = oHBox3.getItems()[1].getItems()[0];302 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");303 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");304 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");305 var oHBox4 = oPanel.getContent()[3];306 var oField4 = oHBox4.getItems()[0];307 var oLabel4 = oHBox4.getItems()[1].getItems()[0];308 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");309 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");310 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");311 var oHBox5 = oPanel.getContent()[4];312 var oField5 = oHBox5.getItems()[0];313 var oLabel5 = oHBox5.getItems()[1].getItems()[0];314 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");315 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");316 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");317 var oHBox6 = oPanel.getContent()[5];318 var oField6 = oHBox6.getItems()[0];319 var oLabel6 = oHBox6.getItems()[1].getItems()[0];320 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");321 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");322 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");323 var oHBox7 = oPanel.getContent()[6];324 var oField7 = oHBox7.getItems()[0];325 var oLabel7 = oHBox7.getItems()[1].getItems()[0];326 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");327 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");328 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");329 var oHBox8 = oPanel.getContent()[7];330 var oField8 = oHBox8.getItems()[0];331 var oLabel8 = oHBox8.getItems()[1].getItems()[0];332 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");333 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");334 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");335 resolve();336 }.bind(this));337 }.bind(this));338 }.bind(this));339 });340 QUnit.test("Position With Cols1", function (assert) {341 this.oEditor.setJson({342 "baseUrl": sBaseUrl,343 "manifest": {344 "sap.app": {345 "id": "test.sample",346 "i18n": "../i18n/i18n.properties"347 },348 "sap.card": {349 "designtime": "designtime/noWrapPositionWithCols1",350 "type": "List",351 "configuration": {352 "parameters": {353 "booleanParameter": {},354 "booleanParameterWithSwitch": {},355 "dateParameter": {},356 "datetimeParameter": {},357 "stringArray": [],358 "numberParameter": 0,359 "stringParameter": ""360 }361 }362 }363 }364 });365 return new Promise(function (resolve, reject) {366 this.oEditor.attachReady(function () {367 wait(1000).then(function () {368 assert.ok(this.oEditor.isReady(), "Editor is ready");369 var oPanel = this.oEditor.getAggregation("_formContent")[0];370 var oHBox1 = oPanel.getContent()[0].getItems()[0];371 var oField1 = oHBox1.getItems()[0];372 var oLabel1 = oHBox1.getItems()[1].getItems()[0].getItems()[0];373 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");374 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");375 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");376 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");377 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");378 oField1._descriptionIcon.onmouseover();379 var oDescriptionText = this.oEditor._getPopover().getContent()[0];380 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");381 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");382 oField1._descriptionIcon.onmouseout();383 var oHBox2 = oPanel.getContent()[0].getItems()[1];384 var oField2 = oHBox2.getItems()[0];385 var oLabel2 = oHBox2.getItems()[1].getItems()[0].getItems()[0];386 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");387 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");388 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");389 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");390 var oHBox3 = oPanel.getContent()[1].getItems()[0];391 var oField3 = oHBox3.getItems()[0];392 var oLabel3 = oHBox3.getItems()[1].getItems()[0];393 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");394 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");395 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");396 var oHBox4 = oPanel.getContent()[1].getItems()[1];397 var oField4 = oHBox4.getItems()[0];398 var oLabel4 = oHBox4.getItems()[1].getItems()[0];399 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");400 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");401 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");402 var oHBox5 = oPanel.getContent()[2].getItems()[0];403 var oField5 = oHBox5.getItems()[0];404 var oLabel5 = oHBox5.getItems()[1].getItems()[0];405 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");406 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");407 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");408 var oHBox6 = oPanel.getContent()[2].getItems()[1];409 var oField6 = oHBox6.getItems()[0];410 var oLabel6 = oHBox6.getItems()[1].getItems()[0];411 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");412 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");413 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");414 var oHBox7 = oPanel.getContent()[3].getItems()[0];415 var oField7 = oHBox7.getItems()[0];416 var oLabel7 = oHBox7.getItems()[1].getItems()[0];417 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");418 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");419 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");420 var oHBox8 = oPanel.getContent()[3].getItems()[1];421 var oField8 = oHBox8.getItems()[0];422 var oLabel8 = oHBox8.getItems()[1].getItems()[0];423 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");424 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");425 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");426 resolve();427 }.bind(this));428 }.bind(this));429 }.bind(this));430 });431 QUnit.test("Alignment With Cols2", function (assert) {432 this.oEditor.setJson({433 "baseUrl": sBaseUrl,434 "manifest": {435 "sap.app": {436 "id": "test.sample",437 "i18n": "../i18n/i18n.properties"438 },439 "sap.card": {440 "designtime": "designtime/noWrapAlignmentWithCols2",441 "type": "List",442 "configuration": {443 "parameters": {444 "booleanParameter": {},445 "booleanParameterWithSwitch": {},446 "dateParameter": {},447 "datetimeParameter": {},448 "stringArray": [],449 "numberParameter": 0,450 "stringParameter": ""451 }452 }453 }454 }455 });456 return new Promise(function (resolve, reject) {457 this.oEditor.attachReady(function () {458 wait(1000).then(function () {459 assert.ok(this.oEditor.isReady(), "Editor is ready");460 var oPanel = this.oEditor.getAggregation("_formContent")[0];461 var oHBox1 = oPanel.getContent()[0];462 var oLabel1 = oHBox1.getItems()[0].getItems()[0];463 var oField1 = oHBox1.getItems()[1].getItems()[0];464 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");465 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");466 assert.ok(oLabel1.getTextAlign() === "End", "Label: Alignment End");467 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");468 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");469 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");470 assert.ok(oField1.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");471 oField1._descriptionIcon.onmouseover();472 var oDescriptionText = this.oEditor._getPopover().getContent()[0];473 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");474 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");475 oField1._descriptionIcon.onmouseout();476 var oHBox2 = oPanel.getContent()[1];477 var oLabel2 = oHBox2.getItems()[0].getItems()[0];478 var oField2 = oHBox2.getItems()[1].getItems()[0];479 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");480 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");481 assert.ok(oLabel2.getTextAlign() === "End", "Label: Alignment End");482 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");483 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");484 assert.ok(oField2.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");485 var oHBox3 = oPanel.getContent()[2];486 var oLabel3 = oHBox3.getItems()[0];487 var oField3 = oHBox3.getItems()[1].getItems()[0];488 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");489 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");490 assert.ok(oLabel3.getTextAlign() === "End", "Label: Alignment End");491 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");492 assert.ok(oField3.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");493 var oHBox4 = oPanel.getContent()[3];494 var oLabel4 = oHBox4.getItems()[0];495 var oField4 = oHBox4.getItems()[1].getItems()[0];496 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");497 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");498 assert.ok(oLabel4.getTextAlign() === "End", "Label: Alignment End");499 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");500 assert.ok(oField4.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");501 var oHBox5 = oPanel.getContent()[4];502 var oLabel5 = oHBox5.getItems()[0];503 var oField5 = oHBox5.getItems()[1].getItems()[0];504 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");505 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");506 assert.ok(oLabel5.getTextAlign() === "End", "Label: Alignment End");507 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");508 assert.ok(oField5.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");509 var oHBox6 = oPanel.getContent()[5];510 var oLabel6 = oHBox6.getItems()[0];511 var oField6 = oHBox6.getItems()[1].getItems()[0];512 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");513 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");514 assert.ok(oLabel6.getTextAlign() === "End", "Label: Alignment End");515 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");516 assert.ok(oField6.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");517 var oHBox7 = oPanel.getContent()[6];518 var oLabel7 = oHBox7.getItems()[0];519 var oField7 = oHBox7.getItems()[1].getItems()[0];520 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");521 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");522 assert.ok(oLabel7.getTextAlign() === "End", "Label: Alignment End");523 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");524 assert.ok(oField7.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");525 var oHBox8 = oPanel.getContent()[7];526 var oLabel8 = oHBox8.getItems()[0];527 var oField8 = oHBox8.getItems()[1].getItems()[0];528 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");529 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");530 assert.ok(oLabel8.getTextAlign() === "End", "Label: Alignment End");531 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");532 assert.ok(oField8.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");533 resolve();534 }.bind(this));535 }.bind(this));536 }.bind(this));537 });538 QUnit.test("Alignment With Cols1", function (assert) {539 this.oEditor.setJson({540 "baseUrl": sBaseUrl,541 "manifest": {542 "sap.app": {543 "id": "test.sample",544 "i18n": "../i18n/i18n.properties"545 },546 "sap.card": {547 "designtime": "designtime/noWrapAlignmentWithCols1",548 "type": "List",549 "configuration": {550 "parameters": {551 "booleanParameter": {},552 "booleanParameterWithSwitch": {},553 "dateParameter": {},554 "datetimeParameter": {},555 "stringArray": [],556 "numberParameter": 0,557 "stringParameter": ""558 }559 }560 }561 }562 });563 return new Promise(function (resolve, reject) {564 this.oEditor.attachReady(function () {565 wait(1000).then(function () {566 assert.ok(this.oEditor.isReady(), "Editor is ready");567 var oPanel = this.oEditor.getAggregation("_formContent")[0];568 var oHBox1 = oPanel.getContent()[0].getItems()[0];569 var oLabel1 = oHBox1.getItems()[0].getItems()[0];570 var oField1 = oHBox1.getItems()[1].getItems()[0];571 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");572 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");573 assert.ok(oLabel1.getTextAlign() === "End", "Label: Alignment End");574 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");575 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");576 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");577 assert.ok(oField1.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");578 oField1._descriptionIcon.onmouseover();579 var oDescriptionText = this.oEditor._getPopover().getContent()[0];580 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");581 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");582 oField1._descriptionIcon.onmouseout();583 var oHBox2 = oPanel.getContent()[0].getItems()[1];584 var oLabel2 = oHBox2.getItems()[0].getItems()[0];585 var oField2 = oHBox2.getItems()[1].getItems()[0];586 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");587 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");588 assert.ok(oLabel2.getTextAlign() === "End", "Label: Alignment End");589 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");590 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");591 assert.ok(oField2.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");592 var oHBox3 = oPanel.getContent()[1].getItems()[0];593 var oLabel3 = oHBox3.getItems()[0];594 var oField3 = oHBox3.getItems()[1].getItems()[0];595 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");596 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");597 assert.ok(oLabel3.getTextAlign() === "End", "Label: Alignment End");598 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");599 assert.ok(oField3.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");600 var oHBox4 = oPanel.getContent()[1].getItems()[1];601 var oLabel4 = oHBox4.getItems()[0];602 var oField4 = oHBox4.getItems()[1].getItems()[0];603 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");604 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");605 assert.ok(oLabel4.getTextAlign() === "End", "Label: Alignment End");606 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");607 assert.ok(oField4.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");608 var oHBox5 = oPanel.getContent()[2].getItems()[0];609 var oLabel5 = oHBox5.getItems()[0];610 var oField5 = oHBox5.getItems()[1].getItems()[0];611 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");612 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");613 assert.ok(oLabel5.getTextAlign() === "End", "Label: Alignment End");614 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");615 assert.ok(oField5.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");616 var oHBox6 = oPanel.getContent()[2].getItems()[1];617 var oLabel6 = oHBox6.getItems()[0];618 var oField6 = oHBox6.getItems()[1].getItems()[0];619 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");620 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");621 assert.ok(oLabel6.getTextAlign() === "End", "Label: Alignment End");622 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");623 assert.ok(oField6.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");624 var oHBox7 = oPanel.getContent()[3].getItems()[0];625 var oLabel7 = oHBox7.getItems()[0];626 var oField7 = oHBox7.getItems()[1].getItems()[0];627 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");628 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");629 assert.ok(oLabel7.getTextAlign() === "End", "Label: Alignment End");630 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");631 assert.ok(oField7.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");632 var oHBox8 = oPanel.getContent()[3].getItems()[1];633 var oLabel8 = oHBox8.getItems()[0];634 var oField8 = oHBox8.getItems()[1].getItems()[0];635 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");636 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");637 assert.ok(oLabel8.getTextAlign() === "End", "Label: Alignment End");638 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");639 assert.ok(oField8.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");640 resolve();641 }.bind(this));642 }.bind(this));643 }.bind(this));644 });645 QUnit.test("Width With Cols2", function (assert) {646 this.oEditor.setJson({647 "baseUrl": sBaseUrl,648 "manifest": {649 "sap.app": {650 "id": "test.sample",651 "i18n": "../i18n/i18n.properties"652 },653 "sap.card": {654 "designtime": "designtime/noWrapWidthWithCols2",655 "type": "List",656 "configuration": {657 "parameters": {658 "booleanParameter": {},659 "booleanParameterWithSwitch": {},660 "dateParameter": {},661 "datetimeParameter": {},662 "stringArray": [],663 "numberParameter": 0,664 "stringParameter": ""665 }666 }667 }668 }669 });670 return new Promise(function (resolve, reject) {671 this.oEditor.attachReady(function () {672 wait(1000).then(function () {673 assert.ok(this.oEditor.isReady(), "Editor is ready");674 var oPanel = this.oEditor.getAggregation("_formContent")[0];675 var oHBox1 = oPanel.getContent()[0];676 var oLabel1 = oHBox1.getItems()[0].getItems()[0];677 var oField1 = oHBox1.getItems()[1].getItems()[0];678 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");679 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");680 assert.ok(oHBox1.getItems()[0].getLayoutData().getMaxWidth() === "9.5%", "Label HBox: Has max width from label");681 assert.ok(oHBox1.getItems()[1].getLayoutData().getMaxWidth() === "89.5%", "Field HBox: Has max width from field HBox");682 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");683 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");684 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");685 oField1._descriptionIcon.onmouseover();686 var oDescriptionText = this.oEditor._getPopover().getContent()[0];687 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");688 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");689 oField1._descriptionIcon.onmouseout();690 var oHBox2 = oPanel.getContent()[1];691 var oLabel2 = oHBox2.getItems()[0].getItems()[0];692 var oField2 = oHBox2.getItems()[1].getItems()[0];693 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");694 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");695 assert.ok(oHBox2.getItems()[0].getLayoutData().getMaxWidth() === "19.5%", "Label HBox: Has max width from label");696 assert.ok(oHBox2.getItems()[1].getLayoutData().getMaxWidth() === "79.5%", "Field HBox: Has max width from field HBox");697 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");698 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");699 var oHBox3 = oPanel.getContent()[2];700 var oLabel3 = oHBox3.getItems()[0];701 var oField3 = oHBox3.getItems()[1].getItems()[0];702 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");703 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");704 assert.ok(oHBox3.getItems()[0].getLayoutData().getMaxWidth() === "29.5%", "Label HBox: Has max width from label");705 assert.ok(oHBox3.getItems()[1].getLayoutData().getMaxWidth() === "69.5%", "Field HBox: Has max width from field HBox");706 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");707 var oHBox4 = oPanel.getContent()[3];708 var oLabel4 = oHBox4.getItems()[0];709 var oField4 = oHBox4.getItems()[1].getItems()[0];710 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");711 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");712 assert.ok(oHBox4.getItems()[0].getLayoutData().getMaxWidth() === "39.5%", "Label HBox: Has max width from label");713 assert.ok(oHBox4.getItems()[1].getLayoutData().getMaxWidth() === "59.5%", "Field HBox: Has max width from field HBox");714 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");715 var oHBox5 = oPanel.getContent()[4];716 var oLabel5 = oHBox5.getItems()[0];717 var oField5 = oHBox5.getItems()[1].getItems()[0];718 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");719 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");720 assert.ok(oHBox5.getItems()[0].getLayoutData().getMaxWidth() === "49.5%", "Label: Has max width from label");721 assert.ok(oHBox5.getItems()[1].getLayoutData().getMaxWidth() === "49.5%", "Field HBox: Has max width from field HBox");722 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");723 var oHBox6 = oPanel.getContent()[5];724 var oLabel6 = oHBox6.getItems()[0];725 var oField6 = oHBox6.getItems()[1].getItems()[0];726 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");727 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");728 assert.ok(oHBox6.getItems()[0].getLayoutData().getMaxWidth() === "59.5%", "Label HBox: Has max width from label");729 assert.ok(oHBox6.getItems()[1].getLayoutData().getMaxWidth() === "39.5%", "Field HBox: Has max width from field HBox");730 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");731 var oHBox7 = oPanel.getContent()[6];732 var oLabel7 = oHBox7.getItems()[0];733 var oField7 = oHBox7.getItems()[1].getItems()[0];734 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");735 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");736 assert.ok(oHBox7.getItems()[0].getLayoutData().getMaxWidth() === "69.5%", "Label HBox: Has max width from label");737 assert.ok(oHBox7.getItems()[1].getLayoutData().getMaxWidth() === "29.5%", "Field HBox: Has max width from field HBox");738 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");739 var oHBox8 = oPanel.getContent()[7];740 var oLabel8 = oHBox8.getItems()[0];741 var oField8 = oHBox8.getItems()[1].getItems()[0];742 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");743 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");744 assert.ok(oHBox8.getItems()[0].getLayoutData().getMaxWidth() === "79.5%", "Label HBox: Has max width from label");745 assert.ok(oHBox8.getItems()[1].getLayoutData().getMaxWidth() === "19.5%", "Field HBox: Has max width from field HBox");746 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");747 resolve();748 }.bind(this));749 }.bind(this));750 }.bind(this));751 });752 QUnit.test("Width With Cols1", function (assert) {753 this.oEditor.setJson({754 "baseUrl": sBaseUrl,755 "manifest": {756 "sap.app": {757 "id": "test.sample",758 "i18n": "../i18n/i18n.properties"759 },760 "sap.card": {761 "designtime": "designtime/noWrapWidthWithCols1",762 "type": "List",763 "configuration": {764 "parameters": {765 "booleanParameter": {},766 "booleanParameterWithSwitch": {},767 "dateParameter": {},768 "datetimeParameter": {},769 "stringArray": [],770 "numberParameter": 0,771 "stringParameter": ""772 }773 }774 }775 }776 });777 return new Promise(function (resolve, reject) {778 this.oEditor.attachReady(function () {779 wait(1000).then(function () {780 assert.ok(this.oEditor.isReady(), "Editor is ready");781 var oPanel = this.oEditor.getAggregation("_formContent")[0];782 var oHBox1 = oPanel.getContent()[0].getItems()[0];783 var oLabel1 = oHBox1.getItems()[0].getItems()[0];784 var oField1 = oHBox1.getItems()[1].getItems()[0];785 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");786 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");787 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");788 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");789 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");790 assert.ok(oHBox1.getItems()[0].getLayoutData().getMaxWidth() === "10%", "Label HBox: Has max width from label");791 assert.ok(oHBox1.getItems()[1].getLayoutData().getMaxWidth() === "90%", "Field HBox: Has max width from field HBox");792 oField1._descriptionIcon.onmouseover();793 var oDescriptionText = this.oEditor._getPopover().getContent()[0];794 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");795 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");796 oField1._descriptionIcon.onmouseout();797 var oHBox2 = oPanel.getContent()[0].getItems()[1];798 var oLabel2 = oHBox2.getItems()[0].getItems()[0];799 var oField2 = oHBox2.getItems()[1].getItems()[0];800 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");801 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");802 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");803 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");804 assert.ok(oHBox2.getItems()[0].getLayoutData().getMaxWidth() === "20%", "Label HBox: Has max width from label");805 assert.ok(oHBox2.getItems()[1].getLayoutData().getMaxWidth() === "80%", "Field HBox: Has max width from field HBox");806 var oHBox3 = oPanel.getContent()[1].getItems()[0];807 var oLabel3 = oHBox3.getItems()[0];808 var oField3 = oHBox3.getItems()[1].getItems()[0];809 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");810 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");811 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");812 assert.ok(oHBox3.getItems()[0].getLayoutData().getMaxWidth() === "30%", "Label HBox: Has max width from label");813 assert.ok(oHBox3.getItems()[1].getLayoutData().getMaxWidth() === "70%", "Field HBox: Has max width from field HBox");814 var oHBox4 = oPanel.getContent()[1].getItems()[1];815 var oLabel4 = oHBox4.getItems()[0];816 var oField4 = oHBox4.getItems()[1].getItems()[0];817 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");818 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");819 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");820 assert.ok(oHBox4.getItems()[0].getLayoutData().getMaxWidth() === "40%", "Label HBox: Has max width from label");821 assert.ok(oHBox4.getItems()[1].getLayoutData().getMaxWidth() === "60%", "Field HBox: Has max width from field HBox");822 var oHBox5 = oPanel.getContent()[2].getItems()[0];823 var oLabel5 = oHBox5.getItems()[0];824 var oField5 = oHBox5.getItems()[1].getItems()[0];825 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");826 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");827 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");828 assert.ok(oHBox5.getItems()[0].getLayoutData().getMaxWidth() === "50%", "Label HBox: Has max width from label");829 assert.ok(oHBox5.getItems()[1].getLayoutData().getMaxWidth() === "50%", "Field HBox: Has max width from field HBox");830 var oHBox6 = oPanel.getContent()[2].getItems()[1];831 var oLabel6 = oHBox6.getItems()[0];832 var oField6 = oHBox6.getItems()[1].getItems()[0];833 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");834 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");835 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");836 assert.ok(oHBox6.getItems()[0].getLayoutData().getMaxWidth() === "60%", "Label HBox: Has max width from label");837 assert.ok(oHBox6.getItems()[1].getLayoutData().getMaxWidth() === "40%", "Field HBox: Has max width from field HBox");838 var oHBox7 = oPanel.getContent()[3].getItems()[0];839 var oLabel7 = oHBox7.getItems()[0];840 var oField7 = oHBox7.getItems()[1].getItems()[0];841 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");842 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");843 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");844 assert.ok(oHBox7.getItems()[0].getLayoutData().getMaxWidth() === "70%", "Label HBox: Has max width from label");845 assert.ok(oHBox7.getItems()[1].getLayoutData().getMaxWidth() === "30%", "Field HBox: Has max width from field HBox");846 var oHBox8 = oPanel.getContent()[3].getItems()[1];847 var oLabel8 = oHBox8.getItems()[0];848 var oField8 = oHBox8.getItems()[1].getItems()[0];849 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");850 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");851 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");852 assert.ok(oHBox8.getItems()[0].getLayoutData().getMaxWidth() === "80%", "Label HBox: Has max width from label");853 assert.ok(oHBox8.getItems()[1].getLayoutData().getMaxWidth() === "20%", "Field HBox: Has max width from field HBox");854 resolve();855 }.bind(this));856 }.bind(this));857 }.bind(this));858 });859 });860 QUnit.module("Layout in sub group(panel)", {861 beforeEach: function () {862 this.oHost = new Host("host");863 this.oContextHost = new ContextHost("contexthost");864 this.oEditor = new Editor();865 var oContent = document.getElementById("content");866 if (!oContent) {867 oContent = document.createElement("div");868 oContent.style.position = "absolute";869 oContent.style.top = "200px";870 oContent.setAttribute("id", "content");871 document.body.appendChild(oContent);872 document.body.style.zIndex = 1000;873 }874 this.oEditor.placeAt(oContent);875 },876 afterEach: function () {877 this.oEditor.destroy();878 this.oHost.destroy();879 this.oContextHost.destroy();880 sandbox.restore();881 var oContent = document.getElementById("content");882 if (oContent) {883 oContent.innerHTML = "";884 document.body.style.zIndex = "unset";885 }886 }887 }, function () {888 QUnit.test("No Wrap With Cols2", function (assert) {889 this.oEditor.setJson({890 "baseUrl": sBaseUrl,891 "manifest": {892 "sap.app": {893 "id": "test.sample",894 "i18n": "../i18n/i18n.properties"895 },896 "sap.card": {897 "designtime": "designtime/noWrapWithCols2InSubPanel",898 "type": "List",899 "configuration": {900 "parameters": {901 "booleanParameter": {},902 "booleanParameterWithSwitch": {},903 "dateParameter": {},904 "datetimeParameter": {},905 "stringArray": [],906 "numberParameter": 0,907 "stringParameter": ""908 }909 }910 }911 }912 });913 return new Promise(function (resolve, reject) {914 this.oEditor.attachReady(function () {915 wait(1000).then(function () {916 assert.ok(this.oEditor.isReady(), "Editor is ready");917 var oPanel = this.oEditor.getAggregation("_formContent")[0];918 var oSubPanel = oPanel.getContent()[0];919 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");920 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");921 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");922 var oHBox1 = oSubPanel.getContent()[0];923 var oLabel1 = oHBox1.getItems()[0].getItems()[0];924 var oField1 = oHBox1.getItems()[1].getItems()[0];925 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");926 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");927 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");928 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");929 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");930 oField1._descriptionIcon.onmouseover();931 var oDescriptionText = this.oEditor._getPopover().getContent()[0];932 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");933 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");934 oField1._descriptionIcon.onmouseout();935 var oHBox2 = oSubPanel.getContent()[1];936 var oLabel2 = oHBox2.getItems()[0].getItems()[0];937 var oField2 = oHBox2.getItems()[1].getItems()[0];938 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");939 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");940 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");941 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");942 var oHBox3 = oSubPanel.getContent()[2];943 var oLabel3 = oHBox3.getItems()[0];944 var oField3 = oHBox3.getItems()[1].getItems()[0];945 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");946 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");947 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");948 var oHBox4 = oSubPanel.getContent()[3];949 var oLabel4 = oHBox4.getItems()[0];950 var oField4 = oHBox4.getItems()[1].getItems()[0];951 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");952 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");953 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");954 var oHBox5 = oSubPanel.getContent()[4];955 var oLabel5 = oHBox5.getItems()[0];956 var oField5 = oHBox5.getItems()[1].getItems()[0];957 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");958 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");959 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");960 var oHBox6 = oSubPanel.getContent()[5];961 var oLabel6 = oHBox6.getItems()[0];962 var oField6 = oHBox6.getItems()[1].getItems()[0];963 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");964 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");965 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");966 var oHBox7 = oSubPanel.getContent()[6];967 var oLabel7 = oHBox7.getItems()[0];968 var oField7 = oHBox7.getItems()[1].getItems()[0];969 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");970 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");971 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");972 var oHBox8 = oSubPanel.getContent()[7];973 var oLabel8 = oHBox8.getItems()[0];974 var oField8 = oHBox8.getItems()[1].getItems()[0];975 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");976 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");977 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");978 resolve();979 }.bind(this));980 }.bind(this));981 }.bind(this));982 });983 QUnit.test("No Wrap With Cols1", function (assert) {984 this.oEditor.setJson({985 "baseUrl": sBaseUrl,986 "manifest": {987 "sap.app": {988 "id": "test.sample",989 "i18n": "../i18n/i18n.properties"990 },991 "sap.card": {992 "designtime": "designtime/noWrapWithCols1InSubPanel",993 "type": "List",994 "configuration": {995 "parameters": {996 "booleanParameter": {},997 "booleanParameterWithSwitch": {},998 "dateParameter": {},999 "datetimeParameter": {},1000 "stringArray": [],1001 "numberParameter": 0,1002 "stringParameter": ""1003 }1004 }1005 }1006 }1007 });1008 return new Promise(function (resolve, reject) {1009 this.oEditor.attachReady(function () {1010 wait(1000).then(function () {1011 assert.ok(this.oEditor.isReady(), "Editor is ready");1012 var oPanel = this.oEditor.getAggregation("_formContent")[0];1013 var oSubPanel = oPanel.getContent()[0];1014 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1015 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1016 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1017 var oHBox1 = oSubPanel.getContent()[0].getItems()[0];1018 var oLabel1 = oHBox1.getItems()[0].getItems()[0];1019 var oField1 = oHBox1.getItems()[1].getItems()[0];1020 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1021 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1022 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1023 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1024 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1025 oField1._descriptionIcon.onmouseover();1026 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1027 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1028 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1029 oField1._descriptionIcon.onmouseout();1030 var oHBox2 = oSubPanel.getContent()[0].getItems()[1];1031 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1032 var oField2 = oHBox2.getItems()[1].getItems()[0];1033 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1034 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1035 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1036 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1037 var oHBox3 = oSubPanel.getContent()[1].getItems()[0];1038 var oLabel3 = oHBox3.getItems()[0];1039 var oField3 = oHBox3.getItems()[1].getItems()[0];1040 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1041 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1042 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1043 var oHBox4 = oSubPanel.getContent()[1].getItems()[1];1044 var oLabel4 = oHBox4.getItems()[0];1045 var oField4 = oHBox4.getItems()[1].getItems()[0];1046 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1047 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1048 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1049 var oHBox5 = oSubPanel.getContent()[2].getItems()[0];1050 var oLabel5 = oHBox5.getItems()[0];1051 var oField5 = oHBox5.getItems()[1].getItems()[0];1052 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1053 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1054 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1055 var oHBox6 = oSubPanel.getContent()[2].getItems()[1];1056 var oLabel6 = oHBox6.getItems()[0];1057 var oField6 = oHBox6.getItems()[1].getItems()[0];1058 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1059 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1060 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1061 var oHBox7 = oSubPanel.getContent()[3].getItems()[0];1062 var oLabel7 = oHBox7.getItems()[0];1063 var oField7 = oHBox7.getItems()[1].getItems()[0];1064 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1065 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1066 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1067 var oHBox8 = oSubPanel.getContent()[3].getItems()[1];1068 var oLabel8 = oHBox8.getItems()[0];1069 var oField8 = oHBox8.getItems()[1].getItems()[0];1070 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1071 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1072 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1073 resolve();1074 }.bind(this));1075 }.bind(this));1076 }.bind(this));1077 });1078 QUnit.test("Position With Cols2", function (assert) {1079 this.oEditor.setJson({1080 "baseUrl": sBaseUrl,1081 "manifest": {1082 "sap.app": {1083 "id": "test.sample",1084 "i18n": "../i18n/i18n.properties"1085 },1086 "sap.card": {1087 "designtime": "designtime/noWrapPositionWithCols2InSubPanel",1088 "type": "List",1089 "configuration": {1090 "parameters": {1091 "booleanParameter": {},1092 "booleanParameterWithSwitch": {},1093 "dateParameter": {},1094 "datetimeParameter": {},1095 "stringArray": [],1096 "numberParameter": 0,1097 "stringParameter": ""1098 }1099 }1100 }1101 }1102 });1103 return new Promise(function (resolve, reject) {1104 this.oEditor.attachReady(function () {1105 wait(1000).then(function () {1106 assert.ok(this.oEditor.isReady(), "Editor is ready");1107 var oPanel = this.oEditor.getAggregation("_formContent")[0];1108 var oSubPanel = oPanel.getContent()[0];1109 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1110 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1111 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1112 var oHBox1 = oSubPanel.getContent()[0];1113 var oField1 = oHBox1.getItems()[0];1114 var oLabel1 = oHBox1.getItems()[1].getItems()[0].getItems()[0];1115 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1116 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1117 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1118 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1119 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1120 oField1._descriptionIcon.onmouseover();1121 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1122 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1123 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1124 oField1._descriptionIcon.onmouseout();1125 var oHBox2 = oSubPanel.getContent()[1];1126 var oField2 = oHBox2.getItems()[0];1127 var oLabel2 = oHBox2.getItems()[1].getItems()[0].getItems()[0];1128 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1129 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1130 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1131 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1132 var oHBox3 = oSubPanel.getContent()[2];1133 var oField3 = oHBox3.getItems()[0];1134 var oLabel3 = oHBox3.getItems()[1].getItems()[0];1135 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1136 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1137 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1138 var oHBox4 = oSubPanel.getContent()[3];1139 var oField4 = oHBox4.getItems()[0];1140 var oLabel4 = oHBox4.getItems()[1].getItems()[0];1141 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1142 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1143 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1144 var oHBox5 = oSubPanel.getContent()[4];1145 var oField5 = oHBox5.getItems()[0];1146 var oLabel5 = oHBox5.getItems()[1].getItems()[0];1147 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1148 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1149 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1150 var oHBox6 = oSubPanel.getContent()[5];1151 var oField6 = oHBox6.getItems()[0];1152 var oLabel6 = oHBox6.getItems()[1].getItems()[0];1153 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1154 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1155 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1156 var oHBox7 = oSubPanel.getContent()[6];1157 var oField7 = oHBox7.getItems()[0];1158 var oLabel7 = oHBox7.getItems()[1].getItems()[0];1159 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1160 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1161 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1162 var oHBox8 = oSubPanel.getContent()[7];1163 var oField8 = oHBox8.getItems()[0];1164 var oLabel8 = oHBox8.getItems()[1].getItems()[0];1165 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1166 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1167 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1168 resolve();1169 }.bind(this));1170 }.bind(this));1171 }.bind(this));1172 });1173 QUnit.test("Position With Cols1", function (assert) {1174 this.oEditor.setJson({1175 "baseUrl": sBaseUrl,1176 "manifest": {1177 "sap.app": {1178 "id": "test.sample",1179 "i18n": "../i18n/i18n.properties"1180 },1181 "sap.card": {1182 "designtime": "designtime/noWrapPositionWithCols1InSubPanel",1183 "type": "List",1184 "configuration": {1185 "parameters": {1186 "booleanParameter": {},1187 "booleanParameterWithSwitch": {},1188 "dateParameter": {},1189 "datetimeParameter": {},1190 "stringArray": [],1191 "numberParameter": 0,1192 "stringParameter": ""1193 }1194 }1195 }1196 }1197 });1198 return new Promise(function (resolve, reject) {1199 this.oEditor.attachReady(function () {1200 wait(1000).then(function () {1201 assert.ok(this.oEditor.isReady(), "Editor is ready");1202 var oPanel = this.oEditor.getAggregation("_formContent")[0];1203 var oSubPanel = oPanel.getContent()[0];1204 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1205 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1206 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1207 var oHBox1 = oSubPanel.getContent()[0].getItems()[0];1208 var oField1 = oHBox1.getItems()[0];1209 var oLabel1 = oHBox1.getItems()[1].getItems()[0].getItems()[0];1210 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1211 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1212 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1213 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1214 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1215 oField1._descriptionIcon.onmouseover();1216 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1217 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1218 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1219 oField1._descriptionIcon.onmouseout();1220 var oHBox2 = oSubPanel.getContent()[0].getItems()[1];1221 var oField2 = oHBox2.getItems()[0];1222 var oLabel2 = oHBox2.getItems()[1].getItems()[0].getItems()[0];1223 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1224 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1225 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1226 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1227 var oHBox3 = oSubPanel.getContent()[1].getItems()[0];1228 var oField3 = oHBox3.getItems()[0];1229 var oLabel3 = oHBox3.getItems()[1].getItems()[0];1230 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1231 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1232 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1233 var oHBox4 = oSubPanel.getContent()[1].getItems()[1];1234 var oField4 = oHBox4.getItems()[0];1235 var oLabel4 = oHBox4.getItems()[1].getItems()[0];1236 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1237 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1238 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1239 var oHBox5 = oSubPanel.getContent()[2].getItems()[0];1240 var oField5 = oHBox5.getItems()[0];1241 var oLabel5 = oHBox5.getItems()[1].getItems()[0];1242 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1243 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1244 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1245 var oHBox6 = oSubPanel.getContent()[2].getItems()[1];1246 var oField6 = oHBox6.getItems()[0];1247 var oLabel6 = oHBox6.getItems()[1].getItems()[0];1248 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1249 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1250 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1251 var oHBox7 = oSubPanel.getContent()[3].getItems()[0];1252 var oField7 = oHBox7.getItems()[0];1253 var oLabel7 = oHBox7.getItems()[1].getItems()[0];1254 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1255 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1256 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1257 var oHBox8 = oSubPanel.getContent()[3].getItems()[1];1258 var oField8 = oHBox8.getItems()[0];1259 var oLabel8 = oHBox8.getItems()[1].getItems()[0];1260 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1261 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1262 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1263 resolve();1264 }.bind(this));1265 }.bind(this));1266 }.bind(this));1267 });1268 QUnit.test("Alignment With Cols2", function (assert) {1269 this.oEditor.setJson({1270 "baseUrl": sBaseUrl,1271 "manifest": {1272 "sap.app": {1273 "id": "test.sample",1274 "i18n": "../i18n/i18n.properties"1275 },1276 "sap.card": {1277 "designtime": "designtime/noWrapAlignmentWithCols2InSubPanel",1278 "type": "List",1279 "configuration": {1280 "parameters": {1281 "booleanParameter": {},1282 "booleanParameterWithSwitch": {},1283 "dateParameter": {},1284 "datetimeParameter": {},1285 "stringArray": [],1286 "numberParameter": 0,1287 "stringParameter": ""1288 }1289 }1290 }1291 }1292 });1293 return new Promise(function (resolve, reject) {1294 this.oEditor.attachReady(function () {1295 wait(1000).then(function () {1296 assert.ok(this.oEditor.isReady(), "Editor is ready");1297 var oPanel = this.oEditor.getAggregation("_formContent")[0];1298 var oSubPanel = oPanel.getContent()[0];1299 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1300 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1301 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1302 var oHBox1 = oSubPanel.getContent()[0];1303 var oLabel1 = oHBox1.getItems()[0].getItems()[0];1304 var oField1 = oHBox1.getItems()[1].getItems()[0];1305 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1306 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1307 assert.ok(oLabel1.getTextAlign() === "End", "Label: Alignment End");1308 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1309 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1310 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1311 assert.ok(oField1.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1312 oField1._descriptionIcon.onmouseover();1313 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1314 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1315 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1316 oField1._descriptionIcon.onmouseout();1317 var oHBox2 = oSubPanel.getContent()[1];1318 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1319 var oField2 = oHBox2.getItems()[1].getItems()[0];1320 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1321 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1322 assert.ok(oLabel2.getTextAlign() === "End", "Label: Alignment End");1323 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1324 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1325 assert.ok(oField2.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1326 var oHBox3 = oSubPanel.getContent()[2];1327 var oLabel3 = oHBox3.getItems()[0];1328 var oField3 = oHBox3.getItems()[1].getItems()[0];1329 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1330 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1331 assert.ok(oLabel3.getTextAlign() === "End", "Label: Alignment End");1332 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1333 assert.ok(oField3.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1334 var oHBox4 = oSubPanel.getContent()[3];1335 var oLabel4 = oHBox4.getItems()[0];1336 var oField4 = oHBox4.getItems()[1].getItems()[0];1337 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1338 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1339 assert.ok(oLabel4.getTextAlign() === "End", "Label: Alignment End");1340 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1341 assert.ok(oField4.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1342 var oHBox5 = oSubPanel.getContent()[4];1343 var oLabel5 = oHBox5.getItems()[0];1344 var oField5 = oHBox5.getItems()[1].getItems()[0];1345 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1346 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1347 assert.ok(oLabel5.getTextAlign() === "End", "Label: Alignment End");1348 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1349 assert.ok(oField5.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1350 var oHBox6 = oSubPanel.getContent()[5];1351 var oLabel6 = oHBox6.getItems()[0];1352 var oField6 = oHBox6.getItems()[1].getItems()[0];1353 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1354 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1355 assert.ok(oLabel6.getTextAlign() === "End", "Label: Alignment End");1356 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1357 assert.ok(oField6.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1358 var oHBox7 = oSubPanel.getContent()[6];1359 var oLabel7 = oHBox7.getItems()[0];1360 var oField7 = oHBox7.getItems()[1].getItems()[0];1361 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1362 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1363 assert.ok(oLabel7.getTextAlign() === "End", "Label: Alignment End");1364 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1365 assert.ok(oField7.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1366 var oHBox8 = oSubPanel.getContent()[7];1367 var oLabel8 = oHBox8.getItems()[0];1368 var oField8 = oHBox8.getItems()[1].getItems()[0];1369 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1370 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1371 assert.ok(oLabel8.getTextAlign() === "End", "Label: Alignment End");1372 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1373 assert.ok(oField8.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1374 resolve();1375 }.bind(this));1376 }.bind(this));1377 }.bind(this));1378 });1379 QUnit.test("Alignment With Cols1", function (assert) {1380 this.oEditor.setJson({1381 "baseUrl": sBaseUrl,1382 "manifest": {1383 "sap.app": {1384 "id": "test.sample",1385 "i18n": "../i18n/i18n.properties"1386 },1387 "sap.card": {1388 "designtime": "designtime/noWrapAlignmentWithCols1InSubPanel",1389 "type": "List",1390 "configuration": {1391 "parameters": {1392 "booleanParameter": {},1393 "booleanParameterWithSwitch": {},1394 "dateParameter": {},1395 "datetimeParameter": {},1396 "stringArray": [],1397 "numberParameter": 0,1398 "stringParameter": ""1399 }1400 }1401 }1402 }1403 });1404 return new Promise(function (resolve, reject) {1405 this.oEditor.attachReady(function () {1406 wait(1000).then(function () {1407 assert.ok(this.oEditor.isReady(), "Editor is ready");1408 var oPanel = this.oEditor.getAggregation("_formContent")[0];1409 var oSubPanel = oPanel.getContent()[0];1410 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1411 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1412 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1413 var oHBox1 = oSubPanel.getContent()[0].getItems()[0];1414 var oLabel1 = oHBox1.getItems()[0].getItems()[0];1415 var oField1 = oHBox1.getItems()[1].getItems()[0];1416 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1417 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1418 assert.ok(oLabel1.getTextAlign() === "End", "Label: Alignment End");1419 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1420 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1421 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1422 assert.ok(oField1.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1423 oField1._descriptionIcon.onmouseover();1424 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1425 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1426 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1427 oField1._descriptionIcon.onmouseout();1428 var oHBox2 = oSubPanel.getContent()[0].getItems()[1];1429 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1430 var oField2 = oHBox2.getItems()[1].getItems()[0];1431 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1432 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1433 assert.ok(oLabel2.getTextAlign() === "End", "Label: Alignment End");1434 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1435 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1436 assert.ok(oField2.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1437 var oHBox3 = oSubPanel.getContent()[1].getItems()[0];1438 var oLabel3 = oHBox3.getItems()[0];1439 var oField3 = oHBox3.getItems()[1].getItems()[0];1440 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1441 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1442 assert.ok(oLabel3.getTextAlign() === "End", "Label: Alignment End");1443 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1444 assert.ok(oField3.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1445 var oHBox4 = oSubPanel.getContent()[1].getItems()[1];1446 var oLabel4 = oHBox4.getItems()[0];1447 var oField4 = oHBox4.getItems()[1].getItems()[0];1448 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1449 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1450 assert.ok(oLabel4.getTextAlign() === "End", "Label: Alignment End");1451 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1452 assert.ok(oField4.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1453 var oHBox5 = oSubPanel.getContent()[2].getItems()[0];1454 var oLabel5 = oHBox5.getItems()[0];1455 var oField5 = oHBox5.getItems()[1].getItems()[0];1456 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1457 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1458 assert.ok(oLabel5.getTextAlign() === "End", "Label: Alignment End");1459 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1460 assert.ok(oField5.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1461 var oHBox6 = oSubPanel.getContent()[2].getItems()[1];1462 var oLabel6 = oHBox6.getItems()[0];1463 var oField6 = oHBox6.getItems()[1].getItems()[0];1464 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1465 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1466 assert.ok(oLabel6.getTextAlign() === "End", "Label: Alignment End");1467 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1468 assert.ok(oField6.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1469 var oHBox7 = oSubPanel.getContent()[3].getItems()[0];1470 var oLabel7 = oHBox7.getItems()[0];1471 var oField7 = oHBox7.getItems()[1].getItems()[0];1472 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1473 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1474 assert.ok(oLabel7.getTextAlign() === "End", "Label: Alignment End");1475 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1476 assert.ok(oField7.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1477 var oHBox8 = oSubPanel.getContent()[3].getItems()[1];1478 var oLabel8 = oHBox8.getItems()[0];1479 var oField8 = oHBox8.getItems()[1].getItems()[0];1480 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1481 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1482 assert.ok(oLabel8.getTextAlign() === "End", "Label: Alignment End");1483 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1484 assert.ok(oField8.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");1485 resolve();1486 }.bind(this));1487 }.bind(this));1488 }.bind(this));1489 });1490 QUnit.test("Width With Cols2", function (assert) {1491 this.oEditor.setJson({1492 "baseUrl": sBaseUrl,1493 "manifest": {1494 "sap.app": {1495 "id": "test.sample",1496 "i18n": "../i18n/i18n.properties"1497 },1498 "sap.card": {1499 "designtime": "designtime/noWrapWidthWithCols2InSubPanel",1500 "type": "List",1501 "configuration": {1502 "parameters": {1503 "booleanParameter": {},1504 "booleanParameterWithSwitch": {},1505 "dateParameter": {},1506 "datetimeParameter": {},1507 "stringArray": [],1508 "numberParameter": 0,1509 "stringParameter": ""1510 }1511 }1512 }1513 }1514 });1515 return new Promise(function (resolve, reject) {1516 this.oEditor.attachReady(function () {1517 wait(1000).then(function () {1518 assert.ok(this.oEditor.isReady(), "Editor is ready");1519 var oPanel = this.oEditor.getAggregation("_formContent")[0];1520 var oSubPanel = oPanel.getContent()[0];1521 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1522 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1523 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1524 var oHBox1 = oSubPanel.getContent()[0];1525 var oLabel1 = oHBox1.getItems()[0].getItems()[0];1526 var oField1 = oHBox1.getItems()[1].getItems()[0];1527 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1528 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1529 assert.ok(oHBox1.getItems()[0].getLayoutData().getMaxWidth() === "9.5%", "Label HBox: Has max width from label");1530 assert.ok(oHBox1.getItems()[1].getLayoutData().getMaxWidth() === "89.5%", "Field HBox: Has max width from field HBox");1531 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1532 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1533 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1534 oField1._descriptionIcon.onmouseover();1535 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1536 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1537 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1538 oField1._descriptionIcon.onmouseout();1539 var oHBox2 = oSubPanel.getContent()[1];1540 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1541 var oField2 = oHBox2.getItems()[1].getItems()[0];1542 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1543 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1544 assert.ok(oHBox2.getItems()[0].getLayoutData().getMaxWidth() === "19.5%", "Label HBox: Has max width from label");1545 assert.ok(oHBox2.getItems()[1].getLayoutData().getMaxWidth() === "79.5%", "Field HBox: Has max width from field HBox");1546 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1547 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1548 var oHBox3 = oSubPanel.getContent()[2];1549 var oLabel3 = oHBox3.getItems()[0];1550 var oField3 = oHBox3.getItems()[1].getItems()[0];1551 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1552 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1553 assert.ok(oHBox3.getItems()[0].getLayoutData().getMaxWidth() === "29.5%", "Label HBox: Has max width from label");1554 assert.ok(oHBox3.getItems()[1].getLayoutData().getMaxWidth() === "69.5%", "Field HBox: Has max width from field HBox");1555 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1556 var oHBox4 = oSubPanel.getContent()[3];1557 var oLabel4 = oHBox4.getItems()[0];1558 var oField4 = oHBox4.getItems()[1].getItems()[0];1559 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1560 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1561 assert.ok(oHBox4.getItems()[0].getLayoutData().getMaxWidth() === "39.5%", "Label HBox: Has max width from label");1562 assert.ok(oHBox4.getItems()[1].getLayoutData().getMaxWidth() === "59.5%", "Field HBox: Has max width from field HBox");1563 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1564 var oHBox5 = oSubPanel.getContent()[4];1565 var oLabel5 = oHBox5.getItems()[0];1566 var oField5 = oHBox5.getItems()[1].getItems()[0];1567 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1568 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1569 assert.ok(oHBox5.getItems()[0].getLayoutData().getMaxWidth() === "49.5%", "Label: Has max width from label");1570 assert.ok(oHBox5.getItems()[1].getLayoutData().getMaxWidth() === "49.5%", "Field HBox: Has max width from field HBox");1571 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1572 var oHBox6 = oSubPanel.getContent()[5];1573 var oLabel6 = oHBox6.getItems()[0];1574 var oField6 = oHBox6.getItems()[1].getItems()[0];1575 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1576 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1577 assert.ok(oHBox6.getItems()[0].getLayoutData().getMaxWidth() === "59.5%", "Label HBox: Has max width from label");1578 assert.ok(oHBox6.getItems()[1].getLayoutData().getMaxWidth() === "39.5%", "Field HBox: Has max width from field HBox");1579 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1580 var oHBox7 = oSubPanel.getContent()[6];1581 var oLabel7 = oHBox7.getItems()[0];1582 var oField7 = oHBox7.getItems()[1].getItems()[0];1583 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1584 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1585 assert.ok(oHBox7.getItems()[0].getLayoutData().getMaxWidth() === "69.5%", "Label HBox: Has max width from label");1586 assert.ok(oHBox7.getItems()[1].getLayoutData().getMaxWidth() === "29.5%", "Field HBox: Has max width from field HBox");1587 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1588 var oHBox8 = oSubPanel.getContent()[7];1589 var oLabel8 = oHBox8.getItems()[0];1590 var oField8 = oHBox8.getItems()[1].getItems()[0];1591 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1592 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1593 assert.ok(oHBox8.getItems()[0].getLayoutData().getMaxWidth() === "79.5%", "Label HBox: Has max width from label");1594 assert.ok(oHBox8.getItems()[1].getLayoutData().getMaxWidth() === "19.5%", "Field HBox: Has max width from field HBox");1595 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1596 resolve();1597 }.bind(this));1598 }.bind(this));1599 }.bind(this));1600 });1601 QUnit.test("Width With Cols1", function (assert) {1602 this.oEditor.setJson({1603 "baseUrl": sBaseUrl,1604 "manifest": {1605 "sap.app": {1606 "id": "test.sample",1607 "i18n": "../i18n/i18n.properties"1608 },1609 "sap.card": {1610 "designtime": "designtime/noWrapWidthWithCols1InSubPanel",1611 "type": "List",1612 "configuration": {1613 "parameters": {1614 "booleanParameter": {},1615 "booleanParameterWithSwitch": {},1616 "dateParameter": {},1617 "datetimeParameter": {},1618 "stringArray": [],1619 "numberParameter": 0,1620 "stringParameter": ""1621 }1622 }1623 }1624 }1625 });1626 return new Promise(function (resolve, reject) {1627 this.oEditor.attachReady(function () {1628 wait(1000).then(function () {1629 assert.ok(this.oEditor.isReady(), "Editor is ready");1630 var oPanel = this.oEditor.getAggregation("_formContent")[0];1631 var oSubPanel = oPanel.getContent()[0];1632 assert.ok(oSubPanel.isA("sap.m.Panel"), "Item 1 of Default Panel is sub panel");1633 assert.ok(oSubPanel.getExpanded(), "Group collapsed by default");1634 assert.ok(oSubPanel.getHeaderText() === "Sub group", "Sub group text");1635 var oHBox1 = oSubPanel.getContent()[0].getItems()[0];1636 var oLabel1 = oHBox1.getItems()[0].getItems()[0];1637 var oField1 = oHBox1.getItems()[1].getItems()[0];1638 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1639 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1640 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1641 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1642 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1643 assert.ok(oHBox1.getItems()[0].getLayoutData().getMaxWidth() === "10%", "Label HBox: Has max width from label");1644 assert.ok(oHBox1.getItems()[1].getLayoutData().getMaxWidth() === "90%", "Field HBox: Has max width from field HBox");1645 oField1._descriptionIcon.onmouseover();1646 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1647 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1648 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1649 oField1._descriptionIcon.onmouseout();1650 var oHBox2 = oSubPanel.getContent()[0].getItems()[1];1651 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1652 var oField2 = oHBox2.getItems()[1].getItems()[0];1653 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1654 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1655 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1656 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1657 assert.ok(oHBox2.getItems()[0].getLayoutData().getMaxWidth() === "20%", "Label HBox: Has max width from label");1658 assert.ok(oHBox2.getItems()[1].getLayoutData().getMaxWidth() === "80%", "Field HBox: Has max width from field HBox");1659 var oHBox3 = oSubPanel.getContent()[1].getItems()[0];1660 var oLabel3 = oHBox3.getItems()[0];1661 var oField3 = oHBox3.getItems()[1].getItems()[0];1662 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1663 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1664 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1665 assert.ok(oHBox3.getItems()[0].getLayoutData().getMaxWidth() === "30%", "Label HBox: Has max width from label");1666 assert.ok(oHBox3.getItems()[1].getLayoutData().getMaxWidth() === "70%", "Field HBox: Has max width from field HBox");1667 var oHBox4 = oSubPanel.getContent()[1].getItems()[1];1668 var oLabel4 = oHBox4.getItems()[0];1669 var oField4 = oHBox4.getItems()[1].getItems()[0];1670 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1671 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1672 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1673 assert.ok(oHBox4.getItems()[0].getLayoutData().getMaxWidth() === "40%", "Label HBox: Has max width from label");1674 assert.ok(oHBox4.getItems()[1].getLayoutData().getMaxWidth() === "60%", "Field HBox: Has max width from field HBox");1675 var oHBox5 = oSubPanel.getContent()[2].getItems()[0];1676 var oLabel5 = oHBox5.getItems()[0];1677 var oField5 = oHBox5.getItems()[1].getItems()[0];1678 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1679 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1680 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1681 assert.ok(oHBox5.getItems()[0].getLayoutData().getMaxWidth() === "50%", "Label HBox: Has max width from label");1682 assert.ok(oHBox5.getItems()[1].getLayoutData().getMaxWidth() === "50%", "Field HBox: Has max width from field HBox");1683 var oHBox6 = oSubPanel.getContent()[2].getItems()[1];1684 var oLabel6 = oHBox6.getItems()[0];1685 var oField6 = oHBox6.getItems()[1].getItems()[0];1686 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1687 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1688 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1689 assert.ok(oHBox6.getItems()[0].getLayoutData().getMaxWidth() === "60%", "Label HBox: Has max width from label");1690 assert.ok(oHBox6.getItems()[1].getLayoutData().getMaxWidth() === "40%", "Field HBox: Has max width from field HBox");1691 var oHBox7 = oSubPanel.getContent()[3].getItems()[0];1692 var oLabel7 = oHBox7.getItems()[0];1693 var oField7 = oHBox7.getItems()[1].getItems()[0];1694 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1695 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1696 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1697 assert.ok(oHBox7.getItems()[0].getLayoutData().getMaxWidth() === "70%", "Label HBox: Has max width from label");1698 assert.ok(oHBox7.getItems()[1].getLayoutData().getMaxWidth() === "30%", "Field HBox: Has max width from field HBox");1699 var oHBox8 = oSubPanel.getContent()[3].getItems()[1];1700 var oLabel8 = oHBox8.getItems()[0];1701 var oField8 = oHBox8.getItems()[1].getItems()[0];1702 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1703 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1704 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1705 assert.ok(oHBox8.getItems()[0].getLayoutData().getMaxWidth() === "80%", "Label HBox: Has max width from label");1706 assert.ok(oHBox8.getItems()[1].getLayoutData().getMaxWidth() === "20%", "Field HBox: Has max width from field HBox");1707 resolve();1708 }.bind(this));1709 }.bind(this));1710 }.bind(this));1711 });1712 });1713 QUnit.module("Layout in sub group(tab)", {1714 beforeEach: function () {1715 this.oHost = new Host("host");1716 this.oContextHost = new ContextHost("contexthost");1717 this.oEditor = new Editor();1718 var oContent = document.getElementById("content");1719 if (!oContent) {1720 oContent = document.createElement("div");1721 oContent.style.position = "absolute";1722 oContent.style.top = "200px";1723 oContent.setAttribute("id", "content");1724 document.body.appendChild(oContent);1725 document.body.style.zIndex = 1000;1726 }1727 this.oEditor.placeAt(oContent);1728 },1729 afterEach: function () {1730 this.oEditor.destroy();1731 this.oHost.destroy();1732 this.oContextHost.destroy();1733 sandbox.restore();1734 var oContent = document.getElementById("content");1735 if (oContent) {1736 oContent.innerHTML = "";1737 document.body.style.zIndex = "unset";1738 }1739 }1740 }, function () {1741 QUnit.test("No Wrap With Cols2", function (assert) {1742 this.oEditor.setJson({1743 "baseUrl": sBaseUrl,1744 "manifest": {1745 "sap.app": {1746 "id": "test.sample",1747 "i18n": "../i18n/i18n.properties"1748 },1749 "sap.card": {1750 "designtime": "designtime/noWrapWithCols2InSubTab",1751 "type": "List",1752 "configuration": {1753 "parameters": {1754 "booleanParameter": {},1755 "booleanParameterWithSwitch": {},1756 "dateParameter": {},1757 "datetimeParameter": {},1758 "stringArray": [],1759 "numberParameter": 0,1760 "stringParameter": ""1761 }1762 }1763 }1764 }1765 });1766 return new Promise(function (resolve, reject) {1767 this.oEditor.attachReady(function () {1768 wait(1000).then(function () {1769 assert.ok(this.oEditor.isReady(), "Editor is ready");1770 var oPanel = this.oEditor.getAggregation("_formContent")[0];1771 var oSubTab = oPanel.getContent()[1];1772 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");1773 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");1774 var oSubTabFilter = oSubTab.getItems()[0];1775 var oHBox1 = oSubTabFilter.getContent()[0];1776 var oLabel1 = oHBox1.getItems()[0].getItems()[0];1777 var oField1 = oHBox1.getItems()[1].getItems()[0];1778 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1779 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1780 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1781 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1782 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1783 oField1._descriptionIcon.onmouseover();1784 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1785 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1786 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1787 oField1._descriptionIcon.onmouseout();1788 var oHBox2 = oSubTabFilter.getContent()[1];1789 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1790 var oField2 = oHBox2.getItems()[1].getItems()[0];1791 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1792 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1793 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1794 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1795 var oHBox3 = oSubTabFilter.getContent()[2];1796 var oLabel3 = oHBox3.getItems()[0];1797 var oField3 = oHBox3.getItems()[1].getItems()[0];1798 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1799 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1800 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1801 var oHBox4 = oSubTabFilter.getContent()[3];1802 var oLabel4 = oHBox4.getItems()[0];1803 var oField4 = oHBox4.getItems()[1].getItems()[0];1804 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1805 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1806 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1807 var oHBox5 = oSubTabFilter.getContent()[4];1808 var oLabel5 = oHBox5.getItems()[0];1809 var oField5 = oHBox5.getItems()[1].getItems()[0];1810 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1811 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1812 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1813 var oHBox6 = oSubTabFilter.getContent()[5];1814 var oLabel6 = oHBox6.getItems()[0];1815 var oField6 = oHBox6.getItems()[1].getItems()[0];1816 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1817 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1818 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1819 var oHBox7 = oSubTabFilter.getContent()[6];1820 var oLabel7 = oHBox7.getItems()[0];1821 var oField7 = oHBox7.getItems()[1].getItems()[0];1822 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1823 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1824 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1825 var oHBox8 = oSubTabFilter.getContent()[7];1826 var oLabel8 = oHBox8.getItems()[0];1827 var oField8 = oHBox8.getItems()[1].getItems()[0];1828 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1829 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1830 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1831 resolve();1832 }.bind(this));1833 }.bind(this));1834 }.bind(this));1835 });1836 QUnit.test("No Wrap With Cols1", function (assert) {1837 this.oEditor.setJson({1838 "baseUrl": sBaseUrl,1839 "manifest": {1840 "sap.app": {1841 "id": "test.sample",1842 "i18n": "../i18n/i18n.properties"1843 },1844 "sap.card": {1845 "designtime": "designtime/noWrapWithCols1InSubTab",1846 "type": "List",1847 "configuration": {1848 "parameters": {1849 "booleanParameter": {},1850 "booleanParameterWithSwitch": {},1851 "dateParameter": {},1852 "datetimeParameter": {},1853 "stringArray": [],1854 "numberParameter": 0,1855 "stringParameter": ""1856 }1857 }1858 }1859 }1860 });1861 return new Promise(function (resolve, reject) {1862 this.oEditor.attachReady(function () {1863 wait(1000).then(function () {1864 assert.ok(this.oEditor.isReady(), "Editor is ready");1865 var oPanel = this.oEditor.getAggregation("_formContent")[0];1866 var oSubTab = oPanel.getContent()[1];1867 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");1868 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");1869 var oSubTabFilter = oSubTab.getItems()[0];1870 var oHBox1 = oSubTabFilter.getContent()[0];1871 var oLabel1 = oHBox1.getItems()[0].getItems()[0].getItems()[0];1872 var oField1 = oHBox1.getItems()[0].getItems()[1].getItems()[0];1873 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1874 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1875 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1876 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1877 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1878 oField1._descriptionIcon.onmouseover();1879 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1880 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1881 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1882 oField1._descriptionIcon.onmouseout();1883 var oHBox2 = oSubTabFilter.getContent()[0].getItems()[1];1884 var oLabel2 = oHBox2.getItems()[0].getItems()[0];1885 var oField2 = oHBox2.getItems()[1].getItems()[0];1886 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1887 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1888 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1889 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1890 var oHBox3 = oSubTabFilter.getContent()[1].getItems()[0];1891 var oLabel3 = oHBox3.getItems()[0];1892 var oField3 = oHBox3.getItems()[1].getItems()[0];1893 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1894 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1895 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1896 var oHBox4 = oSubTabFilter.getContent()[1].getItems()[1];1897 var oLabel4 = oHBox4.getItems()[0];1898 var oField4 = oHBox4.getItems()[1].getItems()[0];1899 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1900 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1901 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1902 var oHBox5 = oSubTabFilter.getContent()[2].getItems()[0];1903 var oLabel5 = oHBox5.getItems()[0];1904 var oField5 = oHBox5.getItems()[1].getItems()[0];1905 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");1906 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");1907 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");1908 var oHBox6 = oSubTabFilter.getContent()[2].getItems()[1];1909 var oLabel6 = oHBox6.getItems()[0];1910 var oField6 = oHBox6.getItems()[1].getItems()[0];1911 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");1912 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");1913 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");1914 var oHBox7 = oSubTabFilter.getContent()[3].getItems()[0];1915 var oLabel7 = oHBox7.getItems()[0];1916 var oField7 = oHBox7.getItems()[1].getItems()[0];1917 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");1918 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");1919 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");1920 var oHBox8 = oSubTabFilter.getContent()[3].getItems()[1];1921 var oLabel8 = oHBox8.getItems()[0];1922 var oField8 = oHBox8.getItems()[1].getItems()[0];1923 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");1924 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");1925 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");1926 resolve();1927 }.bind(this));1928 }.bind(this));1929 }.bind(this));1930 });1931 QUnit.test("Position With Cols2", function (assert) {1932 this.oEditor.setJson({1933 "baseUrl": sBaseUrl,1934 "manifest": {1935 "sap.app": {1936 "id": "test.sample",1937 "i18n": "../i18n/i18n.properties"1938 },1939 "sap.card": {1940 "designtime": "designtime/noWrapPositionWithCols2InSubTab",1941 "type": "List",1942 "configuration": {1943 "parameters": {1944 "booleanParameter": {},1945 "booleanParameterWithSwitch": {},1946 "dateParameter": {},1947 "datetimeParameter": {},1948 "stringArray": [],1949 "numberParameter": 0,1950 "stringParameter": ""1951 }1952 }1953 }1954 }1955 });1956 return new Promise(function (resolve, reject) {1957 this.oEditor.attachReady(function () {1958 wait(1000).then(function () {1959 assert.ok(this.oEditor.isReady(), "Editor is ready");1960 var oPanel = this.oEditor.getAggregation("_formContent")[0];1961 var oSubTab = oPanel.getContent()[1];1962 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");1963 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");1964 var oSubTabFilter = oSubTab.getItems()[0];1965 var oHBox1 = oSubTabFilter.getContent()[0];1966 var oField1 = oHBox1.getItems()[0];1967 var oLabel1 = oHBox1.getItems()[1].getItems()[0].getItems()[0];1968 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");1969 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");1970 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1971 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");1972 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");1973 oField1._descriptionIcon.onmouseover();1974 var oDescriptionText = this.oEditor._getPopover().getContent()[0];1975 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");1976 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");1977 oField1._descriptionIcon.onmouseout();1978 var oHBox2 = oSubTabFilter.getContent()[1];1979 var oField2 = oHBox2.getItems()[0];1980 var oLabel2 = oHBox2.getItems()[1].getItems()[0].getItems()[0];1981 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");1982 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");1983 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");1984 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");1985 var oHBox3 = oSubTabFilter.getContent()[2];1986 var oField3 = oHBox3.getItems()[0];1987 var oLabel3 = oHBox3.getItems()[1].getItems()[0];1988 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");1989 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");1990 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");1991 var oHBox4 = oSubTabFilter.getContent()[3];1992 var oField4 = oHBox4.getItems()[0];1993 var oLabel4 = oHBox4.getItems()[1].getItems()[0];1994 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");1995 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");1996 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");1997 var oHBox5 = oSubTabFilter.getContent()[4];1998 var oField5 = oHBox5.getItems()[0];1999 var oLabel5 = oHBox5.getItems()[1].getItems()[0];2000 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");2001 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");2002 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");2003 var oHBox6 = oSubTabFilter.getContent()[5];2004 var oField6 = oHBox6.getItems()[0];2005 var oLabel6 = oHBox6.getItems()[1].getItems()[0];2006 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");2007 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");2008 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");2009 var oHBox7 = oSubTabFilter.getContent()[6];2010 var oField7 = oHBox7.getItems()[0];2011 var oLabel7 = oHBox7.getItems()[1].getItems()[0];2012 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");2013 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");2014 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");2015 var oHBox8 = oSubTabFilter.getContent()[7];2016 var oField8 = oHBox8.getItems()[0];2017 var oLabel8 = oHBox8.getItems()[1].getItems()[0];2018 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");2019 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");2020 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");2021 resolve();2022 }.bind(this));2023 }.bind(this));2024 }.bind(this));2025 });2026 QUnit.test("Position With Cols1", function (assert) {2027 this.oEditor.setJson({2028 "baseUrl": sBaseUrl,2029 "manifest": {2030 "sap.app": {2031 "id": "test.sample",2032 "i18n": "../i18n/i18n.properties"2033 },2034 "sap.card": {2035 "designtime": "designtime/noWrapPositionWithCols1InSubTab",2036 "type": "List",2037 "configuration": {2038 "parameters": {2039 "booleanParameter": {},2040 "booleanParameterWithSwitch": {},2041 "dateParameter": {},2042 "datetimeParameter": {},2043 "stringArray": [],2044 "numberParameter": 0,2045 "stringParameter": ""2046 }2047 }2048 }2049 }2050 });2051 return new Promise(function (resolve, reject) {2052 this.oEditor.attachReady(function () {2053 wait(1000).then(function () {2054 assert.ok(this.oEditor.isReady(), "Editor is ready");2055 var oPanel = this.oEditor.getAggregation("_formContent")[0];2056 var oSubTab = oPanel.getContent()[1];2057 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");2058 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");2059 var oSubTabFilter = oSubTab.getItems()[0];2060 var oHBox1 = oSubTabFilter.getContent()[0];2061 var oField1 = oHBox1.getItems()[0].getItems()[0];2062 var oLabel1 = oHBox1.getItems()[0].getItems()[1].getItems()[0].getItems()[0];2063 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");2064 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");2065 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2066 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");2067 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");2068 oField1._descriptionIcon.onmouseover();2069 var oDescriptionText = this.oEditor._getPopover().getContent()[0];2070 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");2071 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");2072 oField1._descriptionIcon.onmouseout();2073 var oHBox2 = oSubTabFilter.getContent()[0].getItems()[1];2074 var oField2 = oHBox2.getItems()[0];2075 var oLabel2 = oHBox2.getItems()[1].getItems()[0].getItems()[0];2076 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");2077 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");2078 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2079 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");2080 var oHBox3 = oSubTabFilter.getContent()[1].getItems()[0];2081 var oField3 = oHBox3.getItems()[0];2082 var oLabel3 = oHBox3.getItems()[1].getItems()[0];2083 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");2084 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");2085 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");2086 var oHBox4 = oSubTabFilter.getContent()[1].getItems()[1];2087 var oField4 = oHBox4.getItems()[0];2088 var oLabel4 = oHBox4.getItems()[1].getItems()[0];2089 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");2090 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");2091 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");2092 var oHBox5 = oSubTabFilter.getContent()[2].getItems()[0];2093 var oField5 = oHBox5.getItems()[0];2094 var oLabel5 = oHBox5.getItems()[1].getItems()[0];2095 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");2096 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");2097 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");2098 var oHBox6 = oSubTabFilter.getContent()[2].getItems()[1];2099 var oField6 = oHBox6.getItems()[0];2100 var oLabel6 = oHBox6.getItems()[1].getItems()[0];2101 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");2102 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");2103 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");2104 var oHBox7 = oSubTabFilter.getContent()[3].getItems()[0];2105 var oField7 = oHBox7.getItems()[0];2106 var oLabel7 = oHBox7.getItems()[1].getItems()[0];2107 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");2108 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");2109 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");2110 var oHBox8 = oSubTabFilter.getContent()[3].getItems()[1];2111 var oField8 = oHBox8.getItems()[0];2112 var oLabel8 = oHBox8.getItems()[1].getItems()[0];2113 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");2114 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");2115 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");2116 resolve();2117 }.bind(this));2118 }.bind(this));2119 }.bind(this));2120 });2121 QUnit.test("Alignment With Cols2", function (assert) {2122 this.oEditor.setJson({2123 "baseUrl": sBaseUrl,2124 "manifest": {2125 "sap.app": {2126 "id": "test.sample",2127 "i18n": "../i18n/i18n.properties"2128 },2129 "sap.card": {2130 "designtime": "designtime/noWrapAlignmentWithCols2InSubTab",2131 "type": "List",2132 "configuration": {2133 "parameters": {2134 "booleanParameter": {},2135 "booleanParameterWithSwitch": {},2136 "dateParameter": {},2137 "datetimeParameter": {},2138 "stringArray": [],2139 "numberParameter": 0,2140 "stringParameter": ""2141 }2142 }2143 }2144 }2145 });2146 return new Promise(function (resolve, reject) {2147 this.oEditor.attachReady(function () {2148 wait(1000).then(function () {2149 assert.ok(this.oEditor.isReady(), "Editor is ready");2150 var oPanel = this.oEditor.getAggregation("_formContent")[0];2151 var oSubTab = oPanel.getContent()[1];2152 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");2153 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");2154 var oSubTabFilter = oSubTab.getItems()[0];2155 var oHBox1 = oSubTabFilter.getContent()[0];2156 var oLabel1 = oHBox1.getItems()[0].getItems()[0];2157 var oField1 = oHBox1.getItems()[1].getItems()[0];2158 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");2159 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");2160 assert.ok(oLabel1.getTextAlign() === "End", "Label: Alignment End");2161 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2162 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");2163 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");2164 assert.ok(oField1.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2165 oField1._descriptionIcon.onmouseover();2166 var oDescriptionText = this.oEditor._getPopover().getContent()[0];2167 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");2168 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");2169 oField1._descriptionIcon.onmouseout();2170 var oHBox2 = oSubTabFilter.getContent()[1];2171 var oLabel2 = oHBox2.getItems()[0].getItems()[0];2172 var oField2 = oHBox2.getItems()[1].getItems()[0];2173 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");2174 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");2175 assert.ok(oLabel2.getTextAlign() === "End", "Label: Alignment End");2176 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2177 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");2178 assert.ok(oField2.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2179 var oHBox3 = oSubTabFilter.getContent()[2];2180 var oLabel3 = oHBox3.getItems()[0];2181 var oField3 = oHBox3.getItems()[1].getItems()[0];2182 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");2183 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");2184 assert.ok(oLabel3.getTextAlign() === "End", "Label: Alignment End");2185 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");2186 assert.ok(oField3.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2187 var oHBox4 = oSubTabFilter.getContent()[3];2188 var oLabel4 = oHBox4.getItems()[0];2189 var oField4 = oHBox4.getItems()[1].getItems()[0];2190 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");2191 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");2192 assert.ok(oLabel4.getTextAlign() === "End", "Label: Alignment End");2193 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");2194 assert.ok(oField4.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2195 var oHBox5 = oSubTabFilter.getContent()[4];2196 var oLabel5 = oHBox5.getItems()[0];2197 var oField5 = oHBox5.getItems()[1].getItems()[0];2198 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");2199 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");2200 assert.ok(oLabel5.getTextAlign() === "End", "Label: Alignment End");2201 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");2202 assert.ok(oField5.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2203 var oHBox6 = oSubTabFilter.getContent()[5];2204 var oLabel6 = oHBox6.getItems()[0];2205 var oField6 = oHBox6.getItems()[1].getItems()[0];2206 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");2207 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");2208 assert.ok(oLabel6.getTextAlign() === "End", "Label: Alignment End");2209 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");2210 assert.ok(oField6.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2211 var oHBox7 = oSubTabFilter.getContent()[6];2212 var oLabel7 = oHBox7.getItems()[0];2213 var oField7 = oHBox7.getItems()[1].getItems()[0];2214 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");2215 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");2216 assert.ok(oLabel7.getTextAlign() === "End", "Label: Alignment End");2217 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");2218 assert.ok(oField7.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2219 var oHBox8 = oSubTabFilter.getContent()[7];2220 var oLabel8 = oHBox8.getItems()[0];2221 var oField8 = oHBox8.getItems()[1].getItems()[0];2222 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");2223 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");2224 assert.ok(oLabel8.getTextAlign() === "End", "Label: Alignment End");2225 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");2226 assert.ok(oField8.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2227 resolve();2228 }.bind(this));2229 }.bind(this));2230 }.bind(this));2231 });2232 QUnit.test("Alignment With Cols1", function (assert) {2233 this.oEditor.setJson({2234 "baseUrl": sBaseUrl,2235 "manifest": {2236 "sap.app": {2237 "id": "test.sample",2238 "i18n": "../i18n/i18n.properties"2239 },2240 "sap.card": {2241 "designtime": "designtime/noWrapAlignmentWithCols1InSubTab",2242 "type": "List",2243 "configuration": {2244 "parameters": {2245 "booleanParameter": {},2246 "booleanParameterWithSwitch": {},2247 "dateParameter": {},2248 "datetimeParameter": {},2249 "stringArray": [],2250 "numberParameter": 0,2251 "stringParameter": ""2252 }2253 }2254 }2255 }2256 });2257 return new Promise(function (resolve, reject) {2258 this.oEditor.attachReady(function () {2259 wait(1000).then(function () {2260 assert.ok(this.oEditor.isReady(), "Editor is ready");2261 var oPanel = this.oEditor.getAggregation("_formContent")[0];2262 var oSubTab = oPanel.getContent()[1];2263 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");2264 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");2265 var oSubTabFilter = oSubTab.getItems()[0];2266 var oHBox1 = oSubTabFilter.getContent()[0];2267 var oLabel1 = oHBox1.getItems()[0].getItems()[0].getItems()[0];2268 var oField1 = oHBox1.getItems()[0].getItems()[1].getItems()[0];2269 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");2270 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");2271 assert.ok(oLabel1.getTextAlign() === "End", "Label: Alignment End");2272 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2273 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");2274 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");2275 assert.ok(oField1.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2276 oField1._descriptionIcon.onmouseover();2277 var oDescriptionText = this.oEditor._getPopover().getContent()[0];2278 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");2279 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");2280 oField1._descriptionIcon.onmouseout();2281 var oHBox2 = oSubTabFilter.getContent()[0].getItems()[1];2282 var oLabel2 = oHBox2.getItems()[0].getItems()[0];2283 var oField2 = oHBox2.getItems()[1].getItems()[0];2284 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");2285 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");2286 assert.ok(oLabel2.getTextAlign() === "End", "Label: Alignment End");2287 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2288 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");2289 assert.ok(oField2.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2290 var oHBox3 = oSubTabFilter.getContent()[1].getItems()[0];2291 var oLabel3 = oHBox3.getItems()[0];2292 var oField3 = oHBox3.getItems()[1].getItems()[0];2293 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");2294 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");2295 assert.ok(oLabel3.getTextAlign() === "End", "Label: Alignment End");2296 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");2297 assert.ok(oField3.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2298 var oHBox4 = oSubTabFilter.getContent()[1].getItems()[1];2299 var oLabel4 = oHBox4.getItems()[0];2300 var oField4 = oHBox4.getItems()[1].getItems()[0];2301 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");2302 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");2303 assert.ok(oLabel4.getTextAlign() === "End", "Label: Alignment End");2304 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");2305 assert.ok(oField4.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2306 var oHBox5 = oSubTabFilter.getContent()[2].getItems()[0];2307 var oLabel5 = oHBox5.getItems()[0];2308 var oField5 = oHBox5.getItems()[1].getItems()[0];2309 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");2310 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");2311 assert.ok(oLabel5.getTextAlign() === "End", "Label: Alignment End");2312 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");2313 assert.ok(oField5.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2314 var oHBox6 = oSubTabFilter.getContent()[2].getItems()[1];2315 var oLabel6 = oHBox6.getItems()[0];2316 var oField6 = oHBox6.getItems()[1].getItems()[0];2317 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");2318 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");2319 assert.ok(oLabel6.getTextAlign() === "End", "Label: Alignment End");2320 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");2321 assert.ok(oField6.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2322 var oHBox7 = oSubTabFilter.getContent()[3].getItems()[0];2323 var oLabel7 = oHBox7.getItems()[0];2324 var oField7 = oHBox7.getItems()[1].getItems()[0];2325 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");2326 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");2327 assert.ok(oLabel7.getTextAlign() === "End", "Label: Alignment End");2328 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");2329 assert.ok(oField7.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2330 var oHBox8 = oSubTabFilter.getContent()[3].getItems()[1];2331 var oLabel8 = oHBox8.getItems()[0];2332 var oField8 = oHBox8.getItems()[1].getItems()[0];2333 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");2334 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");2335 assert.ok(oLabel8.getTextAlign() === "End", "Label: Alignment End");2336 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");2337 assert.ok(oField8.hasStyleClass("sapUiIntegrationEditorFieldAlignEnd"), "Field: Alignment End");2338 resolve();2339 }.bind(this));2340 }.bind(this));2341 }.bind(this));2342 });2343 QUnit.test("Width With Cols2", function (assert) {2344 this.oEditor.setJson({2345 "baseUrl": sBaseUrl,2346 "manifest": {2347 "sap.app": {2348 "id": "test.sample",2349 "i18n": "../i18n/i18n.properties"2350 },2351 "sap.card": {2352 "designtime": "designtime/noWrapWidthWithCols2InSubTab",2353 "type": "List",2354 "configuration": {2355 "parameters": {2356 "booleanParameter": {},2357 "booleanParameterWithSwitch": {},2358 "dateParameter": {},2359 "datetimeParameter": {},2360 "stringArray": [],2361 "numberParameter": 0,2362 "stringParameter": ""2363 }2364 }2365 }2366 }2367 });2368 return new Promise(function (resolve, reject) {2369 this.oEditor.attachReady(function () {2370 wait(1000).then(function () {2371 assert.ok(this.oEditor.isReady(), "Editor is ready");2372 var oPanel = this.oEditor.getAggregation("_formContent")[0];2373 var oSubTab = oPanel.getContent()[1];2374 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");2375 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");2376 var oSubTabFilter = oSubTab.getItems()[0];2377 var oHBox1 = oSubTabFilter.getContent()[0];2378 var oLabel1 = oHBox1.getItems()[0].getItems()[0];2379 var oField1 = oHBox1.getItems()[1].getItems()[0];2380 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");2381 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");2382 assert.ok(oHBox1.getItems()[0].getLayoutData().getMaxWidth() === "9.5%", "Label HBox: Has max width from label");2383 assert.ok(oHBox1.getItems()[1].getLayoutData().getMaxWidth() === "89.5%", "Field HBox: Has max width from field HBox");2384 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2385 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");2386 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");2387 oField1._descriptionIcon.onmouseover();2388 var oDescriptionText = this.oEditor._getPopover().getContent()[0];2389 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");2390 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");2391 oField1._descriptionIcon.onmouseout();2392 var oHBox2 = oSubTabFilter.getContent()[1];2393 var oLabel2 = oHBox2.getItems()[0].getItems()[0];2394 var oField2 = oHBox2.getItems()[1].getItems()[0];2395 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");2396 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");2397 assert.ok(oHBox2.getItems()[0].getLayoutData().getMaxWidth() === "19.5%", "Label HBox: Has max width from label");2398 assert.ok(oHBox2.getItems()[1].getLayoutData().getMaxWidth() === "79.5%", "Field HBox: Has max width from field HBox");2399 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2400 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");2401 var oHBox3 = oSubTabFilter.getContent()[2];2402 var oLabel3 = oHBox3.getItems()[0];2403 var oField3 = oHBox3.getItems()[1].getItems()[0];2404 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");2405 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");2406 assert.ok(oHBox3.getItems()[0].getLayoutData().getMaxWidth() === "29.5%", "Label HBox: Has max width from label");2407 assert.ok(oHBox3.getItems()[1].getLayoutData().getMaxWidth() === "69.5%", "Field HBox: Has max width from field HBox");2408 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");2409 var oHBox4 = oSubTabFilter.getContent()[3];2410 var oLabel4 = oHBox4.getItems()[0];2411 var oField4 = oHBox4.getItems()[1].getItems()[0];2412 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");2413 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");2414 assert.ok(oHBox4.getItems()[0].getLayoutData().getMaxWidth() === "39.5%", "Label HBox: Has max width from label");2415 assert.ok(oHBox4.getItems()[1].getLayoutData().getMaxWidth() === "59.5%", "Field HBox: Has max width from field HBox");2416 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");2417 var oHBox5 = oSubTabFilter.getContent()[4];2418 var oLabel5 = oHBox5.getItems()[0];2419 var oField5 = oHBox5.getItems()[1].getItems()[0];2420 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");2421 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");2422 assert.ok(oHBox5.getItems()[0].getLayoutData().getMaxWidth() === "49.5%", "Label: Has max width from label");2423 assert.ok(oHBox5.getItems()[1].getLayoutData().getMaxWidth() === "49.5%", "Field HBox: Has max width from field HBox");2424 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");2425 var oHBox6 = oSubTabFilter.getContent()[5];2426 var oLabel6 = oHBox6.getItems()[0];2427 var oField6 = oHBox6.getItems()[1].getItems()[0];2428 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");2429 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");2430 assert.ok(oHBox6.getItems()[0].getLayoutData().getMaxWidth() === "59.5%", "Label HBox: Has max width from label");2431 assert.ok(oHBox6.getItems()[1].getLayoutData().getMaxWidth() === "39.5%", "Field HBox: Has max width from field HBox");2432 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");2433 var oHBox7 = oSubTabFilter.getContent()[6];2434 var oLabel7 = oHBox7.getItems()[0];2435 var oField7 = oHBox7.getItems()[1].getItems()[0];2436 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");2437 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");2438 assert.ok(oHBox7.getItems()[0].getLayoutData().getMaxWidth() === "69.5%", "Label HBox: Has max width from label");2439 assert.ok(oHBox7.getItems()[1].getLayoutData().getMaxWidth() === "29.5%", "Field HBox: Has max width from field HBox");2440 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");2441 var oHBox8 = oSubTabFilter.getContent()[7];2442 var oLabel8 = oHBox8.getItems()[0];2443 var oField8 = oHBox8.getItems()[1].getItems()[0];2444 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");2445 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");2446 assert.ok(oHBox8.getItems()[0].getLayoutData().getMaxWidth() === "79.5%", "Label HBox: Has max width from label");2447 assert.ok(oHBox8.getItems()[1].getLayoutData().getMaxWidth() === "19.5%", "Field HBox: Has max width from field HBox");2448 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");2449 resolve();2450 }.bind(this));2451 }.bind(this));2452 }.bind(this));2453 });2454 QUnit.test("Width With Cols1", function (assert) {2455 this.oEditor.setJson({2456 "baseUrl": sBaseUrl,2457 "manifest": {2458 "sap.app": {2459 "id": "test.sample",2460 "i18n": "../i18n/i18n.properties"2461 },2462 "sap.card": {2463 "designtime": "designtime/noWrapWidthWithCols1InSubTab",2464 "type": "List",2465 "configuration": {2466 "parameters": {2467 "booleanParameter": {},2468 "booleanParameterWithSwitch": {},2469 "dateParameter": {},2470 "datetimeParameter": {},2471 "stringArray": [],2472 "numberParameter": 0,2473 "stringParameter": ""2474 }2475 }2476 }2477 }2478 });2479 return new Promise(function (resolve, reject) {2480 this.oEditor.attachReady(function () {2481 wait(1000).then(function () {2482 assert.ok(this.oEditor.isReady(), "Editor is ready");2483 var oPanel = this.oEditor.getAggregation("_formContent")[0];2484 var oSubTab = oPanel.getContent()[1];2485 assert.ok(oSubTab.isA("sap.m.IconTabBar"), "Item 1 of Default Panel is sub tab");2486 assert.ok(oSubTab.getExpanded(), "Tab expanded by setting");2487 var oSubTabFilter = oSubTab.getItems()[0];2488 var oHBox1 = oSubTabFilter.getContent()[0];2489 var oLabel1 = oHBox1.getItems()[0].getItems()[0].getItems()[0];2490 var oField1 = oHBox1.getItems()[0].getItems()[1].getItems()[0];2491 assert.ok(oLabel1.isA("sap.m.Label"), "Label: VBox contains a Label");2492 assert.ok(oLabel1.getText() === "booleanParameter", "Label: Has booleanParameter label from label");2493 assert.ok(oField1.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2494 assert.ok(oField1.getAggregation("_field").isA("sap.m.CheckBox"), "Field: Boolean Field control is CheckBox");2495 assert.ok(!oField1.getAggregation("_field").getSelected(), "Field: Value false since No Value and Default Value");2496 assert.ok(oHBox1.getItems()[0].getItems()[0].getLayoutData().getMaxWidth() === "10%", "Label HBox: Has max width from label");2497 assert.ok(oHBox1.getItems()[0].getItems()[1].getLayoutData().getMaxWidth() === "90%", "Field HBox: Has max width from field HBox");2498 oField1._descriptionIcon.onmouseover();2499 var oDescriptionText = this.oEditor._getPopover().getContent()[0];2500 assert.ok(oDescriptionText.isA("sap.m.Text"), "Text: Text Field");2501 assert.ok(oDescriptionText.getText() === "Description", "Text: Description OK");2502 oField1._descriptionIcon.onmouseout();2503 var oHBox2 = oSubTabFilter.getContent()[0].getItems()[1];2504 var oLabel2 = oHBox2.getItems()[0].getItems()[0];2505 var oField2 = oHBox2.getItems()[1].getItems()[0];2506 assert.ok(oLabel2.isA("sap.m.Label"), "Label: VBox contains a Label");2507 assert.ok(oLabel2.getText() === "booleanParameterWithSwitch", "Label: Has booleanParameterWithSwitch label from label");2508 assert.ok(oField2.isA("sap.ui.integration.editor.fields.BooleanField"), "Field: Boolean Field");2509 assert.ok(oField2.getAggregation("_field").isA("sap.m.Switch"), "Field: Boolean Field control is Switch");2510 assert.ok(oHBox2.getItems()[0].getLayoutData().getMaxWidth() === "20%", "Label HBox: Has max width from label");2511 assert.ok(oHBox2.getItems()[1].getLayoutData().getMaxWidth() === "80%", "Field HBox: Has max width from field HBox");2512 var oHBox3 = oSubTabFilter.getContent()[1].getItems()[0];2513 var oLabel3 = oHBox3.getItems()[0];2514 var oField3 = oHBox3.getItems()[1].getItems()[0];2515 assert.ok(oLabel3.isA("sap.m.Label"), "Label: VBox contains a Label");2516 assert.ok(oLabel3.getText() === "dateParameter", "Label: Has dateParameter label from label");2517 assert.ok(oField3.isA("sap.ui.integration.editor.fields.DateField"), "Field: Date Field");2518 assert.ok(oHBox3.getItems()[0].getLayoutData().getMaxWidth() === "30%", "Label HBox: Has max width from label");2519 assert.ok(oHBox3.getItems()[1].getLayoutData().getMaxWidth() === "70%", "Field HBox: Has max width from field HBox");2520 var oHBox4 = oSubTabFilter.getContent()[1].getItems()[1];2521 var oLabel4 = oHBox4.getItems()[0];2522 var oField4 = oHBox4.getItems()[1].getItems()[0];2523 assert.ok(oLabel4.isA("sap.m.Label"), "Label: VBox contains a Label");2524 assert.ok(oLabel4.getText() === "datetimeParameter", "Label: Has datetimeParameter label from label");2525 assert.ok(oField4.isA("sap.ui.integration.editor.fields.DateTimeField"), "Field: DateTime Field");2526 assert.ok(oHBox4.getItems()[0].getLayoutData().getMaxWidth() === "40%", "Label HBox: Has max width from label");2527 assert.ok(oHBox4.getItems()[1].getLayoutData().getMaxWidth() === "60%", "Field HBox: Has max width from field HBox");2528 var oHBox5 = oSubTabFilter.getContent()[2].getItems()[0];2529 var oLabel5 = oHBox5.getItems()[0];2530 var oField5 = oHBox5.getItems()[1].getItems()[0];2531 assert.ok(oLabel5.isA("sap.m.Label"), "Label: VBox contains a Label");2532 assert.ok(oLabel5.getText() === "integerParameter", "Label: Has integerParameter label from label");2533 assert.ok(oField5.isA("sap.ui.integration.editor.fields.IntegerField"), "Field: IntegerField Field");2534 assert.ok(oHBox5.getItems()[0].getLayoutData().getMaxWidth() === "50%", "Label HBox: Has max width from label");2535 assert.ok(oHBox5.getItems()[1].getLayoutData().getMaxWidth() === "50%", "Field HBox: Has max width from field HBox");2536 var oHBox6 = oSubTabFilter.getContent()[2].getItems()[1];2537 var oLabel6 = oHBox6.getItems()[0];2538 var oField6 = oHBox6.getItems()[1].getItems()[0];2539 assert.ok(oLabel6.isA("sap.m.Label"), "Label: VBox contains a Label");2540 assert.ok(oLabel6.getText() === "stringArray", "Label: Has stringArray label from label");2541 assert.ok(oField6.isA("sap.ui.integration.editor.fields.StringListField"), "Field: StringListField Field");2542 assert.ok(oHBox6.getItems()[0].getLayoutData().getMaxWidth() === "60%", "Label HBox: Has max width from label");2543 assert.ok(oHBox6.getItems()[1].getLayoutData().getMaxWidth() === "40%", "Field HBox: Has max width from field HBox");2544 var oHBox7 = oSubTabFilter.getContent()[3].getItems()[0];2545 var oLabel7 = oHBox7.getItems()[0];2546 var oField7 = oHBox7.getItems()[1].getItems()[0];2547 assert.ok(oLabel7.isA("sap.m.Label"), "Label: VBox contains a Label");2548 assert.ok(oLabel7.getText() === "numberParameter", "Label: Has numberParameter label from label");2549 assert.ok(oField7.isA("sap.ui.integration.editor.fields.NumberField"), "Field: NumberField Field");2550 assert.ok(oHBox7.getItems()[0].getLayoutData().getMaxWidth() === "70%", "Label HBox: Has max width from label");2551 assert.ok(oHBox7.getItems()[1].getLayoutData().getMaxWidth() === "30%", "Field HBox: Has max width from field HBox");2552 var oHBox8 = oSubTabFilter.getContent()[3].getItems()[1];2553 var oLabel8 = oHBox8.getItems()[0];2554 var oField8 = oHBox8.getItems()[1].getItems()[0];2555 assert.ok(oLabel8.isA("sap.m.Label"), "Label: VBox contains a Label");2556 assert.ok(oLabel8.getText() === "stringParameter", "Label: Has stringParameter label from label");2557 assert.ok(oField8.isA("sap.ui.integration.editor.fields.StringField"), "Field: StringField Field");2558 assert.ok(oHBox8.getItems()[0].getLayoutData().getMaxWidth() === "80%", "Label HBox: Has max width from label");2559 assert.ok(oHBox8.getItems()[1].getLayoutData().getMaxWidth() === "20%", "Field HBox: Has max width from field HBox");2560 resolve();2561 }.bind(this));2562 }.bind(this));2563 }.bind(this));2564 });2565 });2566 QUnit.done(function () {2567 document.getElementById("qunit-fixture").style.display = "none";2568 });...

Full Screen

Full Screen

triggersModule.js

Source:triggersModule.js Github

copy

Full Screen

...6970 isDirtyFormTrigger = function () {71 $("input,select,textarea").blur();72 $("div.pmui-window-body.pmui-background").css('overflow', '');73 var formcustom = triggerWindow.getItems()[1];74 var formwizard = triggerWindow.getItems()[2];75 var formcopy = triggerWindow.getItems()[3];76 var formeditcode = triggerWindow.getItems()[4];77 var accordionnewtrigger = triggerWindow.getItems()[5];78 var flag = false;7980 var finalData = {81 tri_uid: getData2PMUI(formEditTriggerCustom.html).uid,82 tri_title: getData2PMUI(formEditTriggerCustom.html).title,83 tri_description: getData2PMUI(formEditTriggerCustom.html).description,84 tri_webbot: getData2PMUI(formEditTriggerCustom.html).code85 };8687 if (formcustom.isVisible() == true) {88 flag = (checkIfValuesAreEqual(triggerOriginDataForUpdate, finalData)) ? false : true;89 } else if (formwizard.isVisible() == true) {90 flag = formEditTriggerWizard.isDirty();91 } else if (formcopy.isVisible() == true) {92 flag = formCopyTrigger.isDirty();93 if (!flag) {94 $('.ctrlSpaceMessage').remove();95 }96 } else if (formeditcode.isVisible() == true) {97 flag = formeditcode.isDirty();98 var flagFormCustom = (checkIfValuesAreEqual(triggerOriginDataForUpdate, finalData)) ? false : true;99 if (!flag && formeditcode.getItems()[0].controls[0].value != "" || flagFormCustom) {100 flag = true;101 }102 }103104 if (flag == true) {105 var message_window = new PMUI.ui.MessageWindow({106 id: "cancelMessageTriggers",107 title: "Triggers".translate(),108 windowMessageType: 'warning',109 width: 490,110 message: 'Are you sure you want to discard your changes?'.translate(),111 footerItems: [112 {113 text: "No".translate(),114 handler: function () {115 message_window.close();116 },117 buttonType: "error"118 }, {119 text: "Yes".translate(),120 handler: function () {121 triggerOriginDataForUpdate = {};122 var formcustom = triggerWindow.getItems()[1];123 var formwizard = triggerWindow.getItems()[2];124 var formcopy = triggerWindow.getItems()[3];125 var formeditcode = triggerWindow.getItems()[4];126127 if (formcustom.isVisible() == true) {128 var uidInForm = formEditTriggerCustom.getFields()[0].getValue();129 formEditTriggerCustom.reset();130 openListTriggers();131 } else if (formwizard.isVisible() == true) {132 var uidInForm = formEditTriggerWizard.getFields()[0].getValue();133 formEditTriggerWizard.reset();134 openListTriggers();135 } else if (formcopy.isVisible() == true) {136 $('.ctrlSpaceMessage').remove();137 formCopyTrigger.reset();138 openListTriggers();139 } else if (formeditcode.isVisible() == true) {140 formeditcode.reset();141 openFormCustom("Edit".translate());142 }143 message_window.close();144 if (clickedClose) {145 triggerWindow.close();146 }147 },148 buttonType: "success"149 }150 ]151 });152 message_window.open();153 message_window.showFooter();154 } else {155 var formcustom = triggerWindow.getItems()[1];156 var formwizard = triggerWindow.getItems()[2];157 var formcopy = triggerWindow.getItems()[3];158 var formeditcode = triggerWindow.getItems()[4];159 var accordionnewtrigger = triggerWindow.getItems()[5];160161 if (formcustom.isVisible() == true) {162 var uidInForm = formEditTriggerCustom.getFields()[0].getValue();163 formEditTriggerCustom.reset();164 openListTriggers();165 } else if (formwizard.isVisible() == true) {166 var uidInForm = formEditTriggerWizard.getFields()[0].getValue();167 formEditTriggerWizard.reset();168 openListTriggers();169 } else if (formcopy.isVisible() == true) {170 formCopyTrigger.reset();171 openListTriggers();172 } else if (formeditcode.isVisible() == true) {173 formeditcode.reset();174 openFormCustom("Edit".translate());175 } else if (accordionnewtrigger.isVisible() == true) {176 openListTriggers();177 }178 if (clickedClose) {179 triggerWindow.close();180 }181 }182 };183 //GRID List Case Scheduler184 gridListTrigger = new PMUI.grid.GridPanel({185 id: "listTriggers",186 pageSize: 10,187 width: "96%",188 style: {189 cssClasses: ["mafe-gridPanel"]190 },191 filterPlaceholder: 'Search ...'.translate(),192 nextLabel: 'Next'.translate(),193 previousLabel: 'Previous'.translate(),194 tableContainerHeight: 374,195 customStatusBar: function (currentPage, pageSize, numberItems, criteria, filter) {196 return messagePageGrid(currentPage, pageSize, numberItems, criteria, filter);197 },198 columns: [199 {200 id: 'listTriggersButtonShow',201 title: '',202 dataType: 'button',203 searchable: false,204 buttonLabel: 'Show ID'.translate(),205 buttonStyle: {206 cssClasses: [207 'mafe-button-show'208 ]209 },210 id: 'copyuid',211 onButtonClick: function (row, grid) {212 var dataRow = row.getData();213 messageWindow = new PMUI.ui.MessageWindow({214 id: 'dynaformMessageWindowUID',215 windowMessageType: 'info',216 width: 490,217 title: "Triggers".translate(),218 message: dataRow.tri_uid,219 footerItems: [220 {221 text: 'OK'.translate(),222 handler: function () {223 messageWindow.close();224 },225 buttonType: "success"226 }227 ]228 });229 messageWindow.setTitle("ID".translate());230 messageWindow.open();231 messageWindow.showFooter();232 $(messageWindow.dom.icon).removeClass();233 }234 },235 {236 title: 'Title'.translate(),237 id: "title",238 dataType: 'string',239 width: "407px",240 visible: true,241 columnData: "tri_title",242 searcheable: true,243 sortable: true,244 alignmentCell: 'left'245 },246 {247 title: 'Type'.translate(),248 id: "type",249 dataType: 'string',250 width: "225px",251 visible: true,252 alignmentCell: 'left',253 columnData: function (data) {254 if (typeof(data.tri_param) == "object" && typeof(data.tri_param.params) == "object") {255 var wizardData = data.tri_param.params;256257 return wizardData.LIBRARY_NAME;258 } else {259 return "Custom";260 }261 },262 searcheable: true,263 sortable: true264 },265 {266 id: "editButton",267 title: '',268 dataType: 'button',269 messageTooltip: "Edit".translate(),270 buttonLabel: "Edit".translate(),271 buttonStyle: {272 cssClasses: [273 'mafe-button-edit'274 ]275 },276 onButtonClick: function (row, grid) {277 triggerOriginDataForUpdate = {};278 var data = row.getData();279 triggerOriginDataForUpdate = data;280 var fields;281 if (data.tri_param == "") {282283 openFormCustom("Edit".translate());284 formEditTriggerCustom.showFooter();285286 var codeMirrorControl, cmControlCopyTrigger;287 codeMirrorControl = formEditTriggerCustom.getItems()[1].controls[0].cm;288289 if (codeMirrorControl != undefined) {290 codeMirrorControl.setSize(580, 160);291 }292 formEditTriggerCustom.getItems()[1].setHeight(170);293 fields = formEditTriggerCustom.getItems()[0];294 fields.getItems()[0].setValue(data.tri_uid);295 fields.getItems()[1].setValue(data.tri_title);296 fields.getItems()[2].setValue(data.tri_description);297 formEditTriggerCustom.getItems()[1].setValue(data.tri_webbot);298299 codeMirrorControl.setValue(data.tri_webbot);300 codeMirrorControl.refresh();301 } else {302 openFormWizardEditMode();303304 var wizardData = data.tri_param.params;305306 var lib = wizardData.LIBRARY_CLASS;307 lib = lib.split('.');308 lib = lib[1];309 fields = formEditTriggerWizard.getFields();310 fields[0].setValue(data.tri_uid);311 fields[1].setValue(lib);312 fields[2].setValue(wizardData.PMFUNTION_NAME);313 fields[3].setValue(wizardData.LIBRARY_NAME + " (" + wizardData.PMFUNTION_LABEL + ")");314 fields[4].setValue(data.tri_title);315 fields[5].setValue(data.tri_description);316 fields[6].setValue(data.tri_webbot);317318 var inputItems = [];319 var outputItems = [];320321 restClient = new PMRestClient({322 endpoint: "trigger-wizard/" + lib + "/" + wizardData.PMFUNTION_NAME,323 typeRequest: 'get',324 functionSuccess: function (xhr, response) {325 if (response.fn_params.input != undefined) {326 for (j = 0; j < response.fn_params.input.length; j++) {327 var nameInput = response.fn_params.input[j].name;328329 var inp = new CriteriaField({330 id: nameInput,331 pmType: "text",332 name: nameInput,333 label: response.fn_params.input[j].label,334 value: wizardData[nameInput].toString(),335 controlsWidth: 400,336 labelWidth: '27%',337 helper: response.fn_params.input[j].description,338 required: response.fn_params.input[j].name === "unpauseDate" ? true : response.fn_params.input[j].required339 });340341 inputItems.push(inp);342 }343 }344 if (response.fn_params.output != undefined) {345 for (k = 0; k < response.fn_params.output.length; k++) {346 var nameOutput = response.fn_params.output[k].name;347348 var out = new CriteriaField({349 id: nameOutput,350 pmType: "text",351 name: nameOutput,352 label: response.fn_params.output[k].label,353 value: wizardData.TRI_ANSWER.toString(),354 controlsWidth: 400,355 labelWidth: '27%',356 helper: response.fn_params.output[k].description,357 required: response.fn_params.output[k].required358 });359360 outputItems.push(out);361 }362 }363 triggerWindow.setTitle("Edit".translate() + " " + wizardData.LIBRARY_NAME);364 if (inputItems.length > 0) {365 formEditTriggerWizard.getItems()[1].setVisible(true);366 formEditTriggerWizard.getItems()[2].setVisible(true);367 formEditTriggerWizard.getItems()[3].setVisible(true);368 formEditTriggerWizard.getItems()[3].clearItems();369 formEditTriggerWizard.getItems()[3].setItems(inputItems);370 } else {371 formEditTriggerWizard.getItems()[1].setVisible(false);372 formEditTriggerWizard.getItems()[2].setVisible(false);373 formEditTriggerWizard.getItems()[3].setVisible(false);374 formEditTriggerWizard.getItems()[3].clearItems();375 }376 if (outputItems.length > 0) {377 formEditTriggerWizard.getItems()[4].setVisible(true);378 formEditTriggerWizard.getItems()[5].setVisible(true);379 formEditTriggerWizard.getItems()[6].setVisible(true);380 formEditTriggerWizard.getItems()[6].clearItems();381 formEditTriggerWizard.getItems()[6].setItems(outputItems);382 } else {383 formEditTriggerWizard.getItems()[4].setVisible(false);384 formEditTriggerWizard.getItems()[5].setVisible(false);385 formEditTriggerWizard.getItems()[6].setVisible(false);386 formEditTriggerWizard.getItems()[6].clearItems();387 }388 labelInputs.dom.labelTextContainer.style.display = "none";389 labelOutputs.dom.labelTextContainer.style.display = "none";390 },391 functionFailure: function (xhr, response) {392 PMDesigner.msgWinError(response.error.message);393 },394 messageError: "There are problems getting the triggers wizard list, please try again.".translate()395 });396 restClient.executeRestClient();397 }398 }399 },400 {401 id: "deleteButton",402 title: '',403 dataType: 'button',404 messageTooltip: "Delete".translate(),405 buttonLabel: "Delete".translate(),406 buttonStyle: {407 cssClasses: [408 'mafe-button-delete'409 ]410 },411 onButtonClick: function (row, grid) {412 var questionWindow, dataRow = row.getData();413414 questionWindow = new PMUI.ui.MessageWindow({415 id: "questionDeleteWindow",416 title: "Triggers".translate(),417 windowMessageType: 'warning',418 width: 490,419 message: "Do you want to delete this Trigger?".translate(),420 footerItems: [421 {422 id: 'questionDeleteWindowButtonNo',423 text: "No".translate(),424 visible: true,425 handler: function () {426 questionWindow.close();427 },428 buttonType: "error"429 }, {430 id: 'questionDeleteWindowButtonYes',431 text: "Yes".translate(),432 visible: true,433 handler: function () {434 questionWindow.close();435 restClient = new PMRestClient({436 endpoint: "trigger/" + dataRow.tri_uid,437 typeRequest: 'remove',438 functionSuccess: function (xhr, response) {439 grid.removeItem(row);440 },441 functionFailure: function (xhr, response) {442 PMDesigner.msgWinError(response.error.message);443 },444 messageSuccess: "Trigger deleted successfully".translate(),445 flashContainer: gridListTrigger446 });447 restClient.executeRestClient();448 },449 buttonType: "success"450 },451 ]452 });453454 questionWindow.open();455 questionWindow.dom.titleContainer.style.height = "17px";456 questionWindow.showFooter();457 }458 }459 ],460 dataItems: listTriggers,461 onRowClick: function (row, data) {462463 }464 });465466 getListTrigger = function () {467 var restClient = new PMRestClient({468 endpoint: 'triggers',469 typeRequest: 'get',470 functionSuccess: function (xhr, response) {471 listTriggers = response;472 gridListTrigger.setDataItems(listTriggers);473 },474 functionFailure: function (xhr, response) {475 PMDesigner.msgWinError(response.error.message);476 },477 messageError: "There are problems getting the Triggers list, please try again.".translate()478 });479 restClient.executeRestClient();480 };481482 addNumberTriggerWizard = function (value, position) {483 coutTriggers = document.createElement("span");484 coutTriggers.textContent = value;485 headerAccordion = triggerWindow.getItems()[5].getItems()[position].header.html;486 headerAccordion.appendChild(coutTriggers);487 coutTriggers.style.float = "right";488 coutTriggers.style.color = "white";489 coutTriggers.style.fontSize = "13px";490 coutTriggers.style.marginRight = "6px";491 coutTriggers.style.marginTop = "3px";492 };493494 newTriggerOptions = function () {495496 var acItemCustom = accordionNewTrigger.getItems()[0];497 var acItemCopy = accordionNewTrigger.getItems()[1];498 acItemCustom.setIconClosed('pmcustomtrigger');499 acItemCustom.setIconExpanded('pmcustomtrigger');500 acItemCopy.setIconClosed('pmcopytrigger');501 acItemCopy.setIconExpanded('pmcopytrigger');502503 var itemCustom = jQuery("#custom > .pmui-accordion-item-header > span")[1];504 itemCustom.style.width = "0px";505 var itemCopy = jQuery("#copy > .pmui-accordion-item-header > span")[1];506 itemCopy.style.width = "0px";507508 var numOfItems = accordionNewTrigger.getItems();509510 var lengthLibFunctions = [];511 if (numOfItems.length <= 2) {512 restClient = new PMRestClient({513 endpoint: "trigger-wizards",514 typeRequest: 'get',515 functionSuccess: function (xhr, response) {516 for (i = 0; i < response.length; i++) {517 var functTree = response[i].lib_functions;518 lengthLibFunctions[i] = functTree.length;519 var newTreeItems = [];520 for (h = 0; h < functTree.length; h++) {521 newTreeItems.push({522 label: functTree[h].fn_label,523 id: functTree[h].fn_name,524 onClick: function () {525 for (s = 0; s < response.length; s++) {526 for (p = 0; p < response[s].lib_functions.length; p++) {527 if (response[s].lib_functions[p].fn_name == this.id) {528 var fn = response[s].lib_functions[p].fn_params;529 var fnLabel = response[s].lib_functions[p].fn_label;530 var fnName = response[s].lib_functions[p].fn_name;531 var libName = response[s].lib_name;532 var libTitle = response[s].lib_title;533 p = response[s].lib_functions.length;534 s = response.length - 1;535 }536 }537 }538 var inputItems = [];539 if (fn.input != undefined) {540 for (j = 0; j < fn.input.length; j++) {541 var val = "";542 if (fn.input[j].type == "array") {543 val = "array('')";544 }545 var inp = new CriteriaField({546 id: fn.input[j].name,547 pmType: "text",548 name: fn.input[j].name,549 label: fn.input[j].label,550 controlsWidth: 400,551 labelWidth: '27%',552 value: val,553 helper: fn.input[j].description,554 required: fn.input[j].name === "unpauseDate" ? true : fn.input[j].required555 });556557 inputItems.push(inp);558 }559 }560561 var outputItems = [];562 if (fn.output != undefined) {563 for (k = 0; k < fn.output.length; k++) {564 var out = new CriteriaField({565 id: fn.output[k].name,566 pmType: "text",567 name: fn.output[k].name,568 label: fn.output[k].label,569 controlsWidth: 400,570 labelWidth: '27%',571 helper: fn.output[k].description,572 required: fn.output[k].required573 });574575 outputItems.push(out);576 }577 }578 formEditTriggerWizard.reset();579 formEditTriggerWizard.setTitle(fnLabel + ' (' + fnName + ')');580 formEditTriggerWizard.getItems()[0].getItems()[1].setValue(libName);581 formEditTriggerWizard.getItems()[0].getItems()[2].setValue(fnName);582 formEditTriggerWizard.getItems()[0].getItems()[3].setValue(libTitle + ' (' + fnLabel + ')');583584 if (inputItems.length > 0) {585 formEditTriggerWizard.getItems()[1].setVisible(true);586 formEditTriggerWizard.getItems()[2].setVisible(true);587 formEditTriggerWizard.getItems()[3].setVisible(true);588 formEditTriggerWizard.getItems()[3].clearItems();589 formEditTriggerWizard.getItems()[3].setItems(inputItems);590 } else {591 formEditTriggerWizard.getItems()[1].setVisible(false);592 formEditTriggerWizard.getItems()[2].setVisible(false);593 formEditTriggerWizard.getItems()[3].setVisible(false);594 formEditTriggerWizard.getItems()[3].clearItems();595 }596 if (outputItems.length > 0) {597 formEditTriggerWizard.getItems()[4].setVisible(true);598 formEditTriggerWizard.getItems()[5].setVisible(true);599 formEditTriggerWizard.getItems()[6].setVisible(true);600 formEditTriggerWizard.getItems()[6].clearItems();601 formEditTriggerWizard.getItems()[6].setItems(outputItems);602 } else {603 formEditTriggerWizard.getItems()[4].setVisible(false);604 formEditTriggerWizard.getItems()[5].setVisible(false);605 formEditTriggerWizard.getItems()[6].setVisible(false);606 formEditTriggerWizard.getItems()[6].clearItems();607 }608 openFormWizard();609 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});610 triggerWindow.setTitle("Create".translate() + " " + libTitle);611 }612 });613 }614 labelInputs.dom.labelTextContainer.style.display = "none";615 labelOutputs.dom.labelTextContainer.style.display = "none";616 allTreesItems[i] = newTreeItems;617618 var arrayTriggerWizards = [619 "pmFunctions",620 "pmSugar",621 "pmTalend",622 "pmTrAlfresco",623 "pmTrSharepoint",624 "pmZimbra"625 ];626627 if (arrayTriggerWizards.indexOf(response[i].lib_name) == -1) {628 $("head").append("<style type=\"text/css\">." + response[i].lib_name + " {background: url(" + response[i].lib_icon + ") no-repeat 50% 50%;}</style>");629 }630631 //Accordion632 var newAccordionItem = [];633 newAccordionItem = {634 iconClass: response[i].lib_name,635 id: response[i].lib_name,636 title: response[i].lib_title,637 height: 'auto'638 };639 accordionNewTrigger.addItem(newAccordionItem);640 }641 },642 functionFailure: function (xhr, response) {643 PMDesigner.msgWinError(response.error.message);644 },645 messageError: "There are problems getting the triggers wizard list, please try again.".translate()646 });647 restClient.executeRestClient();648 }649650 openNewTriggerOptions();651 var accordion = triggerWindow.getItems()[5].getItems();652 accordion[0].setVisible(false);653 accordion[1].setVisible(false);654 for (i = 0; i < accordion.length; i++) {655 accordion[i].header.html.style.backgroundColor = "#FFFFFF";656 if (i > 1) {657 addNumberTriggerWizard(lengthLibFunctions[i - 2], (i));658 }659 }660 };661662 allTreesItems = [];663 getListTrigger();664665 //Button NEW Trigger666 buttonNew = new PMUI.ui.Button({667 id: 'newTriggerButton',668 text: "Create".translate(),669 height: "36px",670 width: 100,671 handler: function (event) {672 openFormCustom("Create".translate());673 formEditTriggerCustom.getField("code").dom.labelTextContainer.style.width = "23.8%";674 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});675 formEditTriggerCustom.showFooter();676677 var codeMirrorControl, cmControlCopyTrigger;678 codeMirrorControl = formEditTriggerCustom.getItems()[1].controls[0].cm;679 formEditTriggerCustom.getItems()[1].html.style.padding = "10px";680 if (codeMirrorControl !== undefined) {681 codeMirrorControl.setSize(580, 150);682 }683 formEditTriggerCustom.getItems()[1].setHeight(170);684685 formEditTriggerCustom.reset();686687 fields = formEditTriggerCustom.getItems()[0];688 fields.getItems()[0].setValue("");689 fields.getItems()[1].setValue("");690 fields.getItems()[2].setValue("");691 formEditTriggerCustom.getItems()[1].setValue("");692 formEditTriggerCustom.getItems()[1].controls[0].cm.setValue("");693 codeMirrorControl.refresh();694 },695 style: {696 cssClasses: [697 'mafe-button-create'698 ]699 }700 });701702 //Button COPY Trigger703 buttonCopy = new PMUI.ui.Button({704 id: 'copyTriggerButton',705 text: "Copy".translate(),706 height: "36px",707 width: 100,708 handler: function (event) {709 getListProjects();710 openFormCopy();711 formCopyTrigger.getFields()[1].clearOptions();712 $("#Code .CodeMirror.cm-s-default.CodeMirror-wrap").css({'border': '1px solid #c0c0c0'});713 formCopyTrigger.getItems()[4].setHeight(160);714715 var cmControlCopyTrigger = formCopyTrigger.getFields()[4].controls[0].cm;716 cmControlCopyTrigger.setValue("");717 if (cmControlCopyTrigger !== undefined) {718 cmControlCopyTrigger.setSize(650, 140);719 }720 cmControlCopyTrigger.refresh();721 },722 style: {723 cssClasses: [724 'mafe-button-create'725 ]726 }727 });728729 //Button WIZARD Trigger730 buttonWizard = new PMUI.ui.Button({731 id: 'wizardTriggerButton',732 text: "Wizard".translate(),733 height: "36px",734 width: 100,735 handler: function (event) {736 newTriggerOptions();737 },738 style: {739 cssClasses: [740 'mafe-button-create'741 ]742 }743 });744745 openListTriggers = function () {746 triggerWindow.getItems()[0].setVisible(true);747 triggerWindow.getItems()[1].setVisible(false);748 triggerWindow.getItems()[2].setVisible(false);749 triggerWindow.getItems()[3].setVisible(false);750 triggerWindow.getItems()[4].setVisible(false);751 triggerWindow.getItems()[5].setVisible(false);752 triggerWindow.setTitle("Triggers".translate());753 triggerWindow.hideFooter();754 $(triggerWindow.body).removeClass("pmui-background");755 };756757 openFormCustom = function (typeTitle) {758 triggerWindow.getItems()[0].setVisible(false);759 triggerWindow.getItems()[1].setVisible(true);760 triggerWindow.getItems()[2].setVisible(false);761 triggerWindow.getItems()[3].setVisible(false);762 triggerWindow.getItems()[4].setVisible(false);763 triggerWindow.getItems()[5].setVisible(false);764 triggerWindow.footer.getItems()[0].setVisible(true); //button Cancel765 triggerWindow.footer.getItems()[1].setVisible(true); //button Save766 triggerWindow.footer.getItems()[2].setVisible(false); //Edit Source Code767 triggerWindow.footer.getItems()[3].setVisible(false); //button Aply768 triggerWindow.footer.getItems()[4].setVisible(false); //button Copy/import769770 triggerWindow.setTitle(typeTitle + " Custom Trigger".translate());771 triggerWindow.showFooter();772 $(triggerWindow.body).addClass("pmui-background");773 formEditTriggerCustom.setFocus();774775 $('.CodeMirror.cm-s-default')[0].style.border = "1px solid #c0c0c0";776 if (formEditTriggerCustom.getItems()[0].getItems()[1].visible == false) {777 var fields = formEditTriggerCustom.getItems()[0];778 fields.getItems()[1].setVisible(true);779 fields.getItems()[2].setVisible(true);780 formEditTriggerCustom.footer.getItems()[1].setVisible(true);781 }782 formEditTriggerCustom.getFields()[4].dom.labelTextContainer.style.marginLeft = "10px";783 formEditTriggerCustom.setAlignmentButtons('left');784785 $("#code").after($ctrlSpaceMessage.css({786 "margin": "5px 0 0 0",787 "text-align": "center",788 "width": "655px",789 "padding": ""790 }));791 };792793 openFormWizard = function () {794 triggerWindow.getItems()[0].setVisible(false);795 triggerWindow.getItems()[1].setVisible(false);796 triggerWindow.getItems()[2].setVisible(true);797 triggerWindow.getItems()[3].setVisible(false);798 triggerWindow.getItems()[4].setVisible(false);799 triggerWindow.getItems()[5].setVisible(false);800 triggerWindow.footer.getItems()[0].setVisible(true); //button Cancel801 triggerWindow.footer.getItems()[1].setVisible(true); //button Save802 triggerWindow.footer.getItems()[2].setVisible(false); //Edit Source Code803 triggerWindow.footer.getItems()[3].setVisible(false); //button Aply804 triggerWindow.footer.getItems()[4].setVisible(false); //button Copy/import805 triggerWindow.showFooter();806 $(triggerWindow.body).addClass("pmui-background");807 formEditTriggerWizard.setFocus();808 };809810 openFormWizardEditMode = function () {811 triggerWindow.getItems()[0].setVisible(false);812 triggerWindow.getItems()[1].setVisible(false);813 triggerWindow.getItems()[2].setVisible(true);814 triggerWindow.getItems()[3].setVisible(false);815 triggerWindow.getItems()[4].setVisible(false);816 triggerWindow.getItems()[5].setVisible(false);817 triggerWindow.footer.getItems()[0].setVisible(true); //button Cancel818 triggerWindow.footer.getItems()[1].setVisible(true); //button Save819 triggerWindow.footer.getItems()[2].setVisible(true); //Edit Source Code820 triggerWindow.footer.getItems()[3].setVisible(false); //button Aply821 triggerWindow.footer.getItems()[4].setVisible(false); //button Copy/import822 triggerWindow.showFooter();823 $(triggerWindow.body).addClass("pmui-background");824 formEditTriggerWizard.setFocus();825 };826827828 openFormCopy = function () {829 triggerWindow.getItems()[0].setVisible(false);830 triggerWindow.getItems()[1].setVisible(false);831 triggerWindow.getItems()[2].setVisible(false);832 triggerWindow.getItems()[3].setVisible(true);833 triggerWindow.getItems()[4].setVisible(false);834 triggerWindow.getItems()[5].setVisible(false);835 triggerWindow.setTitle("Copy Trigger".translate());836 triggerWindow.footer.getItems()[0].setVisible(true); //button Cancel837 triggerWindow.footer.getItems()[1].setVisible(false); //button Save838 triggerWindow.footer.getItems()[2].setVisible(false); //Edit Source Code839 triggerWindow.footer.getItems()[3].setVisible(false); //button Aply840 triggerWindow.footer.getItems()[4].setVisible(true); //button Copy/import841 triggerWindow.showFooter();842 $(triggerWindow.body).addClass("pmui-background");843 formCopyTrigger.setFocus();844845 $(".pmui-field").css("float", "left");846 $('#Code .pmui.pmui-pmcodemirrorcontrol').append($ctrlSpaceMessage.css({847 "margin-top": "10px",848 "text-align": "",849 "width": "655px",850 "padding": ""851 }));852 };853854 openFormEditCode = function () {855 triggerWindow.getItems()[0].setVisible(false);856 triggerWindow.getItems()[1].setVisible(false);857 triggerWindow.getItems()[2].setVisible(false);858 triggerWindow.getItems()[3].setVisible(false);859 triggerWindow.getItems()[4].setVisible(true);860 triggerWindow.getItems()[5].setVisible(false);861 triggerWindow.setTitle("Editor".translate());862 triggerWindow.footer.getItems()[0].setVisible(true); //button Cancel863 triggerWindow.footer.getItems()[1].setVisible(false); //button Save864 triggerWindow.footer.getItems()[2].setVisible(false); //Edit Source Code865 triggerWindow.footer.getItems()[3].setVisible(true); //button Aply866 triggerWindow.footer.getItems()[4].setVisible(false); //button Copy/import867 triggerWindow.showFooter();868 $(triggerWindow.body).addClass("pmui-background");869870 $($('#codeEditor .CodeMirror.cm-s-default.CodeMirror-wrap')[0]).after($ctrlSpaceMessage.css({871 "padding": "5px 0 0 10px",872 "text-align": ""873 }));874875 };876877 openNewTriggerOptions = function () {878 triggerWindow.getItems()[0].setVisible(false);879 triggerWindow.getItems()[1].setVisible(false);880 triggerWindow.getItems()[2].setVisible(false);881 triggerWindow.getItems()[3].setVisible(false);882 triggerWindow.getItems()[4].setVisible(false);883 triggerWindow.getItems()[5].setVisible(true);884 triggerWindow.setTitle("Create Predefined Trigger".translate());885 triggerWindow.footer.getItems()[0].setVisible(true); //button Cancel886 triggerWindow.footer.getItems()[1].setVisible(false); //button Save887 triggerWindow.footer.getItems()[2].setVisible(false); //Edit Source Code888 triggerWindow.footer.getItems()[3].setVisible(false); //button Aply889 triggerWindow.footer.getItems()[4].setVisible(false); //button Copy/import890 triggerWindow.showFooter();891 $(triggerWindow.body).removeClass("pmui-background");892 };893894 //obtaning the list of process to show it on the copy/import of a trigger dropdown895 listProjects = [];896 getListProjects = function () {897 restClient = new PMRestClient({898 typeRequest: 'get',899 functionSuccess: function (xhr, response) {900 listProjects = [];901 formCopyTrigger.getFields()[0].clearOptions();902 listProjects[0] = {903 label: "- Select a process -".translate(),904 value: "",905 disabled: true,906 selected: true907 };908 for (i = 0; i < response.length; i++) {909 listProjects.push({910 label: response[i].prj_name,911 value: response[i].prj_uid912 });913 }914 formCopyTrigger.getFields()[0].setOptions(listProjects);915 },916 functionFailure: function (xhr, response) {917 PMDesigner.msgWinError(response.error.message);918 },919 messageError: "There are problems getting the list of projects.".translate()920 });921 restClient.setBaseEndPoint('projects');922 restClient.executeRestClient();923 };924925 //form Copy/Import Trigger926 triggerSelectedData;927 formCopyTrigger = new PMUI.form.Form({928 id: "formCopyTriggers",929 border: true,930 width: '890px',931 height: 'auto',932 title: "",933 visibleHeader: false,934 items: [935 {936 pmType: 'dropdown',937 id: "processField",938 label: 'Process'.translate(),939 name: 'prj_uid',940 required: true,941 controlsWidth: 300,942 value: "",943 options: listProjects,944 onChange: function (newValue, prevValue) {945 var formFields = formCopyTrigger.getFields();946 formFields[2].setValue("");947 formFields[3].setValue("");948 formFields[4].controls[0].cm.setValue("");949950 var uidProj = newValue, myForm = this.form;951952 //obtaning the Trigger list of the process SELECTED953 restClient = new PMRestClient({954 typeRequest: 'get',955 functionSuccess: function (xhr, response) {956 triggerSelectedData = response;957 var listTriggersCopy = [];958 listTriggersCopy[0] = {959 label: "- Select a trigger -".translate(),960 value: "",961 disabled: true,962 selected: true963 };964965 for (i = 0; i < response.length; i++) {966 listTriggersCopy.push({967 label: response[i].tri_title,968 value: response[i].tri_uid969 });970 }971 formFields[1].setOptions(listTriggersCopy);972 },973 functionFailure: function (xhr, response) {974 PMDesigner.msgWinError(response.error.message);975 },976 messageError: "There are problems getting the list of triggers.".translate()977 });978 restClient.setBaseEndPoint("project/" + uidProj + "/triggers");979 restClient.executeRestClient();980 }981 },982 {983 pmType: 'dropdown',984 id: "triggerField",985 label: 'Trigger'.translate(),986 name: 'tri_uid',987 required: true,988 controlsWidth: 300,989 value: "",990 options: [],991 onChange: function (newValue, prevValue) {992 var formFields = formCopyTrigger.getFields();993 formFields[2].setValue("");994 formFields[3].setValue("");995 formFields[4].controls[0].cm.setValue("");996997 var uidTri = newValue;998999 for (i = 0; i < triggerSelectedData.length; i++) {1000 if (triggerSelectedData[i].tri_uid == uidTri) {1001 formFields[2].setValue(triggerSelectedData[i].tri_title);1002 formFields[3].setValue(triggerSelectedData[i].tri_description);1003 formFields[4].controls[0].cm.setValue(triggerSelectedData[i].tri_webbot);1004 }1005 }1006 }1007 },1008 {1009 pmType: "text",1010 id: "triTitle",1011 label: "Title of the new trigger".translate(),1012 placeholder: "Insert the title of the new trigger".translate(),1013 name: "tri_title",1014 required: true,1015 valueType: 'string',1016 controlsWidth: 300,1017 style: {1018 cssProperties: {1019 'float': 'left'1020 }1021 }1022 },1023 {1024 pmType: "textarea",1025 id: "triDescription",1026 rows: 80,1027 name: 'tri_description',1028 label: "Description of the new trigger".translate(),1029 valueType: 'string',1030 controlsWidth: 652,1031 style: {1032 cssClasses: ['mafe-textarea-resize'],1033 cssProperties: {'float': 'left'}1034 }1035 }1036 ]1037 });1038 codMirr = new PMCodeMirrorField();1039 codMirr.setLabel("Code".translate());1040 codMirr.setID("Code");1041 codMirr.setName('tri_webbot');1042 CodeMirror.commands.autocomplete = function (cm) {1043 CodeMirror.showHint(cm, CodeMirror.phpHint);1044 };1045 formCopyTrigger.addItem(codMirr);10461047 //Form to Edit the trigger with the WIZARD (we used a Form because we need buttons to save the changes)1048 formEditTriggerWizard = new PMUI.form.Form({1049 id: "formEditTriggerWizard",1050 border: true,1051 visibleHeader: false,1052 name: "formwizard",1053 width: 926,1054 title: "New Trigger".translate(),1055 items: [1056 {1057 id: "panelDetailsWizard",1058 pmType: "panel",1059 layout: 'vbox',1060 fieldset: false,1061 height: 'auto',1062 legend: "DETAILS".translate(),1063 items: [1064 {1065 id: "uid",1066 pmType: "text",1067 label: "ID".translate(),1068 value: "",1069 name: "uid",1070 visible: false,1071 valueType: 'string'1072 },1073 {1074 id: "libName",1075 pmType: "text",1076 label: "",1077 value: "",1078 name: "libName",1079 visible: false,1080 valueType: 'string'1081 },1082 {1083 id: "fnName",1084 pmType: "text",1085 label: "",1086 value: "",1087 name: "fnName",1088 visible: false,1089 valueType: 'string'1090 },1091 {1092 id: "type",1093 pmType: "text",1094 label: "Type".translate(),1095 value: "WIZARD",1096 controlsWidth: 450,1097 labelWidth: '27%',1098 readOnly: true,1099 name: "type",1100 valueType: 'string'1101 },1102 {1103 id: "titleDetailsWiz",1104 pmType: "text",1105 label: "Title".translate(),1106 value: "",1107 controlsWidth: 450,1108 labelWidth: '27%',1109 name: "titleDetails",1110 valueType: 'string',1111 required: true1112 },1113 {1114 id: "descriptionDetailsWiz",1115 pmType: "textarea",1116 label: "Description".translate(),1117 value: "",1118 rows: 90,1119 width: '300px',1120 controlsWidth: 450,1121 labelWidth: '27%',1122 name: "descriptionDetails",1123 valueType: 'string',1124 style: {cssClasses: ['mafe-textarea-resize']}1125 },1126 {1127 id: "webbot",1128 pmType: "text",1129 label: "Webbot".translate(),1130 value: "",1131 name: "webbot",1132 controlsWidth: 300,1133 labelWidth: '27%',1134 visible: false,1135 valueType: 'string'1136 }1137 ]1138 }1139 ]1140 });11411142 //adding a separator Inputs line1143 sepInputs = new PMSeparatorLineField({1144 controlHeight: '1px',1145 controlColor: "#CDCDCD",1146 controlsWidth: "890px",1147 marginLeft: '0%'1148 });1149 formEditTriggerWizard.addItem(sepInputs);11501151 //adding a label Inputs1152 labelInputs = new PMLabelField({1153 text: "PARAMETERS".translate(),1154 textMode: "plain",1155 style: {1156 cssProperties: {1157 color: "#AEAEAE",1158 'font-weight': 'bold'1159 }1160 },1161 controlsWidth: 8851162 });1163 formEditTriggerWizard.addItem(labelInputs);11641165 //adding the Inputs Items (PARAMETERS) Panel1166 paramPanel = new PMUI.form.FormPanel({1167 id: "panelParametersWizard",1168 layout: 'vbox',1169 fieldset: false,1170 height: 'auto',1171 visible: false,1172 legend: "__PARAMETERS__".translate(),1173 items: []1174 });1175 formEditTriggerWizard.addItem(paramPanel);11761177 //adding a separator Outputs line1178 sepOutputs = new PMSeparatorLineField({1179 controlHeight: 1,1180 controlColor: "#CDCDCD",1181 controlsWidth: "890px",1182 marginLeft: '0%'1183 });1184 formEditTriggerWizard.addItem(sepOutputs);11851186 //adding a label Outputs1187 labelOutputs = new PMLabelField({1188 text: "RETURN VALUE".translate(),1189 textMode: "plain",1190 style: {1191 cssProperties: {1192 color: "#AEAEAE",1193 'font-weight': 'bold'1194 }1195 },1196 controlsWidth: 8851197 });11981199 formEditTriggerWizard.addItem(labelOutputs);12001201 //adding the Output Items (Returns) Panel1202 returnPanel = new PMUI.form.FormPanel({1203 id: "panelReturnValWizard",1204 layout: 'vbox',1205 fieldset: false,1206 height: 'auto',1207 visible: false,1208 legend: "RETURN VALUE".translate(),1209 items: []1210 });1211 formEditTriggerWizard.addItem(returnPanel);121212131214 //treePanel New Trigger PMF1215 treeNewTrigger = new PMUI.panel.TreePanel({1216 id: "treeNewTrigger",1217 width: 'auto',1218 height: 'auto',1219 style: {1220 cssClasses: ['pmtrigger'],1221 cssProperties: {1222 'margin-top': '5px',1223 'margin-bottom': '4px'1224 }1225 },1226 items: []1227 });12281229 //Acordion Panel New Triggers Options1230 accordionNewTrigger = new PMUI.panel.AccordionPanel({1231 id: "accordionNewTrigger",1232 width: 885,1233 height: 'auto',1234 borderWidth: "0px",1235 hiddenTitle: true,1236 style: {1237 cssProperties: {1238 'margin-left': '30px'1239 }1240 },1241 items: [1242 {1243 iconClass: "",1244 id: 'custom',1245 title: "Custom Trigger".translate(),1246 height: '26px',1247 body: "",1248 style: {1249 cssProperties: {1250 "background-color": "#FDFDFD"1251 }1252 }1253 },1254 {1255 iconClass: "",1256 id: 'copy',1257 title: "Copy Trigger".translate(),1258 height: '26px',1259 body: "",1260 style: {1261 cssProperties: {1262 "background-color": "#FDFDFD"1263 }1264 }1265 }1266 ],1267 listeners: {1268 select: function (obj, event) {12691270 if (obj.id == "custom") {1271 openFormCustom("Create".translate());1272 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1273 formEditTriggerCustom.showFooter();12741275 var codeMirrorControl, cmControlCopyTrigger;1276 codeMirrorControl = formEditTriggerCustom.getItems()[1].controls[0].cm;12771278 if (codeMirrorControl != undefined) {1279 codeMirrorControl.setSize(580, 150); //CodeMirror Size1280 }1281 formEditTriggerCustom.getItems()[1].setHeight(170);12821283 formEditTriggerCustom.reset();12841285 fields = formEditTriggerCustom.getItems()[0];1286 fields.getItems()[0].setValue("");1287 fields.getItems()[1].setValue("");1288 fields.getItems()[2].setValue("");1289 formEditTriggerCustom.getItems()[1].setValue("");1290 formEditTriggerCustom.getItems()[1].controls[0].cm.setValue("");12911292 } else if (obj.id == "copy") {12931294 getListProjects();1295 openFormCopy();1296 $($('#Code .CodeMirror.cm-s-default.CodeMirror-wrap')[1]).css({'border': '1px solid #c0c0c0'});1297 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1298 formCopyTrigger.getItems()[4].setHeight(160);12991300 var cmControlCopyTrigger = formCopyTrigger.getFields()[4].controls[0].cm;1301 if (cmControlCopyTrigger != undefined) {1302 cmControlCopyTrigger.setSize(650, 140); //CodeMirror in formCopyTrigger Size1303 }1304 } else {1305 if (treeNewTrigger.getItems() == "" || treeNewTrigger.id != obj.id) {1306 var acItems = accordionNewTrigger.getItems();1307 var accordionActualItem = accordionNewTrigger.getItem(obj.id);13081309 for (i = 0; i < acItems.length; i++) {1310 if (acItems[i].id == accordionActualItem.id) {1311 var positionActualAcItem = i - 2;1312 }1313 }13141315 treeNewTrigger.setItems(allTreesItems[positionActualAcItem]);1316 treeNewTrigger.setID(obj.id);13171318 accordionActualItem.setBody(treeNewTrigger);1319 treeNewTrigger.defineEvents();1320 applyStyleTreePanel(treeNewTrigger, false);1321 }1322 }1323 }1324 }1325 });13261327 updateCustom = function (dataToSend, triggerUid) {1328 var restClient = new PMRestClient({1329 endpoint: "trigger/" + triggerUid,1330 typeRequest: 'update',1331 data: dataToSend,1332 functionSuccess: function (xhr, response) {1333 formEditTriggerCustom.setDirty(false);1334 getListTrigger();1335 openListTriggers();1336 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1337 },1338 functionFailure: function (xhr, response) {1339 var msg = response.error.message;1340 var arrayMatch = [];13411342 if ((arrayMatch = /^[\w\s]+\:\s*(.*)$/i.exec(msg))) {1343 msg = arrayMatch[1];1344 }13451346 PMDesigner.msgWinError(msg);1347 },1348 messageSuccess: "Trigger updated successfully".translate(),1349 flashContainer: gridListTrigger1350 });1351 restClient.executeRestClient();1352 };13531354 checkIfValuesAreEqual = function (initialData, finalData) {1355 if (typeof(initialData['tri_uid']) == "undefined" && finalData['tri_uid'] == '') {1356 if (finalData['tri_description'] != '' || finalData['tri_title'] != '' || finalData['tri_webbot'] != '') {1357 return false;1358 }1359 }1360 for (var key1 in initialData) {1361 for (var key2 in finalData) {1362 if (typeof(initialData[key1]) != "undefined" &&1363 typeof(finalData[key2]) != "undefined" &&1364 key1 == key2 &&1365 initialData[key1] != finalData[key2]1366 ) {1367 return false;1368 }1369 }1370 }1371 return true;1372 }13731374 //Buttons Save and Cancel for the 'formEditTriggerCustom' and 'formEditTriggerWizard'1375 buttonSave = new PMUI.ui.Button({1376 id: 'saveTriggerButton',1377 text: "Save".translate(),1378 handler: function (event) {1379 triggerOriginDataForUpdate = {};1380 var formcustom = triggerWindow.getItems()[1],1381 formwizard = triggerWindow.getItems()[2],1382 formTriggerData,1383 restClient,1384 dataToSend,1385 formTriggerData,1386 inputFields,1387 message_window,1388 outputV,1389 outputFields,1390 inputV,1391 dataToSend,1392 flagEdit;1393 if (formcustom.isVisible() == true) {1394 valuesCustom=formcustom.getItems()[0];1395 if (!formEditTriggerCustom.isValid( )) {1396 flagEdit = formEditTriggerCustom.visible;1397 } else {1398 flagEdit = formEditTriggerCustom.isValid();1399 }1400 if (flagEdit) {1401 if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {1402 formTriggerData = getData2PMUI(formEditTriggerCustom.html);1403 } else {1404 formTriggerData = formEditTriggerCustom.getData();1405 }1406 if (formTriggerData.title.trim() === "") {1407 return false;1408 }1409 dataToSend = {1410 tri_title: formTriggerData.title,1411 tri_description: formTriggerData.description,1412 tri_webbot: formTriggerData.code,1413 tri_param: ""1414 };14151416 if (formTriggerData.uid === "") {1417 restClient = new PMRestClient({1418 endpoint: 'trigger',1419 typeRequest: 'post',1420 data: dataToSend,1421 functionSuccess: function (xhr, response) {1422 formEditTriggerCustom.setDirty(false);1423 getListTrigger();1424 formEditTriggerCustom.getItems()[0].getItems()[0].setValue(response.tri_uid);1425 openListTriggers();1426 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1427 },1428 functionFailure: function (xhr, response) {1429 var msg = response.error.message,1430 arrayMatch = [];14311432 if ((arrayMatch = /^[\w\s]+\:\s*(.*)$/i.exec(msg))) {1433 msg = arrayMatch[1];1434 }14351436 PMDesigner.msgWinError(msg);1437 },1438 messageSuccess: "New Trigger saved successfully".translate(),1439 flashContainer: gridListTrigger1440 });1441 restClient.executeRestClient();1442 } else {1443 if (formTriggerData.wizzard != "") {1444 if (formEditTriggerCustom.isDirty()) {1445 message_window = new PMUI.ui.MessageWindow({1446 id: "wizzardToCustomTriggerWin",1447 windowMessageType: 'warning',1448 title: 'Triggers'.translate(),1449 width: 490,1450 message: 'Do you want to save the changes? This Trigger will be saved like a custom Trigger.'.translate(),1451 footerItems: [1452 {1453 text: "No".translate(),1454 handler: function () {1455 message_window.close();1456 openFormWizardEditMode();1457 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1458 formEditTriggerCustom.reset();1459 },1460 buttonType: "error"1461 },1462 {1463 text: "Yes".translate(),1464 handler: function () {1465 message_window.close();1466 updateCustom(dataToSend, formTriggerData.uid);1467 },1468 buttonType: "success"1469 }1470 ]14711472 });1473 message_window.open();1474 message_window.showFooter();1475 } else {1476 openListTriggers();1477 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1478 }1479 } else {1480 updateCustom(dataToSend, formTriggerData.uid);1481 }1482 }1483 }1484 } else if (formwizard.isVisible() == true) {1485 if (formEditTriggerWizard.isValid() || ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1))) {1486 if ((navigator.userAgent.indexOf("MSIE") != -1) || (navigator.userAgent.indexOf("Trident") != -1)) {1487 formTriggerData = getData2PMUI(formEditTriggerWizard.html);1488 } else {1489 formTriggerData = formEditTriggerWizard.getData();1490 }14911492 inputV = {};1493 inputFields = formEditTriggerWizard.getItems()[3];1494 for (i = 0; i < inputFields.getItems().length; i++) {1495 inputV[inputFields.getItems()[i].name] = formTriggerData[inputFields.getItems()[i].name];1496 }14971498 outputV = {};1499 outputFields = formEditTriggerWizard.getItems()[6];1500 for (j = 0; j < outputFields.getItems().length; j++) {1501 outputV[outputFields.getItems()[j].name] = formTriggerData[outputFields.getItems()[j].name];1502 }15031504 dataToSend = {1505 tri_title: formTriggerData.titleDetails,1506 tri_description: formTriggerData.descriptionDetails,1507 tri_type: "SCRIPT",1508 tri_params: {1509 input: inputV,1510 output: outputV1511 }1512 };15131514 if (formTriggerData.uid === "") {1515 restClient = new PMRestClient({1516 endpoint: 'trigger-wizard/' + formTriggerData.libName + '/' + formTriggerData.fnName,1517 typeRequest: 'post',1518 data: dataToSend,1519 functionSuccess: function (xhr, response) {1520 formEditTriggerWizard.setDirty(false);1521 getListTrigger();1522 formEditTriggerWizard.getFields()[0].setValue(response.tri_uid);1523 openListTriggers();1524 },1525 functionFailure: function (xhr, response) {1526 PMDesigner.msgWinError(response.error.message);1527 },1528 messageSuccess: "New Trigger saved successfully".translate(),1529 flashContainer: gridListTrigger1530 });1531 restClient.executeRestClient();1532 } else {1533 restClient = new PMRestClient({1534 endpoint: 'trigger-wizard/' + formTriggerData.libName + '/' + formTriggerData.fnName + '/' + formTriggerData.uid,1535 typeRequest: 'update',1536 data: dataToSend,1537 functionSuccess: function (xhr, response) {1538 formEditTriggerWizard.setDirty(false);1539 getListTrigger();1540 openListTriggers();1541 },1542 functionFailure: function (xhr, response) {1543 PMDesigner.msgWinError(response.error.message);1544 },1545 messageSuccess: "Trigger updated successfully".translate(),1546 flashContainer: gridListTrigger1547 });1548 restClient.executeRestClient();1549 }1550 }1551 }1552 },1553 buttonType: 'success'1554 });15551556 //Buttons Save and Cancel for the 'formEditTriggerCustom' and 'formEditTriggerWizard'1557 copyButton = new PMUI.ui.Button({1558 id: 'copyAndSaveButton',1559 text: "Copy Trigger".translate(),1560 buttonType: 'success',1561 handler: function (event) {1562 var data,1563 dataToSend,1564 restClient;1565 if (formCopyTrigger.isValid()) {1566 formCopyTrigger.setDirty(false);15671568 data = formCopyTrigger.getData();1569 dataToSend = {1570 tri_title: getData2PMUI(formCopyTrigger.html).tri_title.trim(),1571 tri_description: data.tri_description,1572 tri_webbot: data.tri_webbot,1573 tri_param: ""1574 };1575 restClient = new PMRestClient({1576 endpoint: 'trigger',1577 typeRequest: 'post',1578 data: dataToSend,1579 functionSuccess: function (xhr, response) {1580 getListTrigger();1581 formCopyTrigger.reset();1582 openListTriggers();1583 },1584 functionFailure: function (xhr, response) {1585 PMDesigner.msgWinError(response.error.message);1586 },1587 messageSuccess: "New Trigger saved successfully".translate(),1588 flashContainer: gridListTrigger1589 });1590 restClient.executeRestClient();1591 }1592 }1593 });15941595 //Buttons Apply for the Code Editor1596 applyButton = new PMUI.ui.Button({1597 id: 'applyButton',1598 text: "Apply".translate(),1599 buttonType: 'success',1600 handler: function (event) {16011602 $("div.pmui-window-body.pmui-background").css('overflow', '');1603 if (formEditCode.isValid()) {1604 var typeTitle = "Edit".translate();1605 if (triggerWindow.getItems()[1].getData().uid == "") {1606 typeTitle = "Create".translate();1607 }1608 openFormCustom(typeTitle);1609 formEditCode.setDirty(false);16101611 var editCode = formEditCode.getItems()[0].controls[0].cm;1612 editCodeValue = editCode.getValue();16131614 var codeMirrorCustom = formEditTriggerCustom.getItems()[1].controls[0].cm;16151616 if (codeMirrorCustom != undefined) {1617 codeMirrorCustom.setSize(580, 150); //CodeMirror Size1618 }1619 codeMirrorCustom.setValue(editCodeValue);1620 formEditTriggerCustom.getItems()[1].setValue(editCodeValue);16211622 editCode.setValue("");1623 editCodeValue = "";16241625 formEditCode.getItems()[0].setValue("");1626 }1627 }1628 });16291630 //Button Edit Source Code (this is showed just when the Trigger Wizzard is opened in edition mode)1631 btnEditSourceCode = new PMUI.ui.Button({1632 id: 'btnEditSourceCode',1633 text: "Edit Source Code".translate(),1634 buttonType: 'success',1635 handler: function (event) {16361637 var data = formEditTriggerWizard.getData();1638 var fields;1639 openFormCustom("Edit".translate());1640 formEditTriggerCustom.showFooter();16411642 var codeMirrorControl;1643 codeMirrorControl = formEditTriggerCustom.getItems()[1].controls[0].cm;16441645 if (codeMirrorControl !== undefined) {1646 codeMirrorControl.setSize(650, 280);1647 }1648 formEditTriggerCustom.getItems()[1].setHeight(170);16491650 fields = formEditTriggerCustom.getItems()[0];1651 fields.getItems()[0].setValue(data.uid);1652 fields.getItems()[1].setValue(data.titleDetails);1653 fields.getItems()[2].setValue(data.descriptionDetails);1654 fields.getItems()[3].setValue(data.webbot);1655 fields.getItems()[3].setVisible(false);1656 formEditTriggerCustom.getItems()[1].setValue(data.webbot);16571658 codeMirrorControl.setValue(data.webbot);16591660 formEditTriggerCustom.getItems()[1].setHeight(300);1661 fields.getItems()[1].setVisible(false);1662 fields.getItems()[2].setVisible(false);1663 formEditTriggerCustom.footer.getItems()[1].setVisible(false);1664 formEditTriggerCustom.footer.getItems()[0].style.addProperties({'margin-right': "10px"});1665 formEditTriggerCustom.footer.style.addProperties({width: '880px'});1666 codeMirrorControl.refresh();1667 }1668 });16691670 buttonCancel = new PMUI.ui.Button({1671 id: 'cancelTriggerButton',1672 text: "Cancel".translate(),1673 buttonType: 'error',1674 handler: function (event) {1675 clickedClose = false;1676 isDirtyFormTrigger();1677 }1678 });16791680 //Form to Edit the Custom trigger (we used a Form because we need buttons to save the changes)1681 formEditTriggerCustom = new PMUI.form.Form({1682 id: "formEditTriggerCustom",1683 border: true,1684 visibleHeader: false,1685 width: '900px',1686 height: "365px",1687 name: "formcustom",1688 title: "Custom Trigger".translate(),1689 items: [1690 {1691 id: "panelDetailsCustom",1692 pmType: "panel",1693 layout: 'vbox',1694 fieldset: false,1695 height: '380px',1696 legend: "DETAILS".translate(),1697 items: [1698 {1699 id: "uid",1700 pmType: "text",1701 label: "ID".translate(),1702 value: "",1703 name: "uid",1704 readOnly: true,1705 visible: false,1706 valueType: 'string'1707 },1708 {1709 id: "title",1710 pmType: "text",1711 label: "Title".translate(),1712 value: "",1713 required: true,1714 name: "title",1715 valueType: 'string'1716 },1717 {1718 id: "description",1719 pmType: "textarea",1720 rows: 70,1721 name: 'description',1722 label: "Description".translate(),1723 valueType: 'string',1724 style: {cssClasses: ['mafe-textarea-resize']}1725 },1726 {1727 id: "wizzard",1728 pmType: "text",1729 label: "Wizzard".translate(),1730 value: "",1731 name: "wizzard",1732 readOnly: true,1733 visible: false,1734 valueType: 'string'1735 }1736 ]1737 }1738 ],1739 buttons: [1740 {1741 text: "@@",1742 id: "selectPickerButton",1743 handler: function () {1744 var picker = new VariablePicker();1745 picker.open({1746 success: function (variable) {1747 var codeMirror = formEditTriggerCustom.getItems()[1].controls[0].cm;1748 var cursorPos = codeMirror.getCursor();1749 codeMirror.replaceSelection(variable);1750 codeMirror.setCursor(cursorPos.line, cursorPos.ch);1751 }1752 });1753 },1754 style: {1755 cssProperties: {1756 "margin-left": '208px',1757 "background": "rgb(30, 145, 209)",1758 "border": "0px solid rgb(30, 145, 209)"1759 }1760 }1761 }, {1762 text: "Open Editor".translate(),1763 id: "openEditorButton",1764 handler: function () {1765 openFormEditCode();1766 formEditCode.showFooter();17671768 var codeMirrorCustom = formEditTriggerCustom.getItems()[1].controls[0].cm;1769 var value = codeMirrorCustom.getValue();17701771 var codeMirrorCopy = formEditCode.getItems()[0].controls[0].cm;17721773 if (codeMirrorCopy != undefined) {1774 codeMirrorCopy.setSize(810, 315); //CodeMirror Size1775 $($('#codeEditor .CodeMirror.cm-s-default.CodeMirror-wrap')[0]).css({'border': '1px solid #c0c0c0'});17761777 }17781779 formEditCode.getItems()[0].setHeight(325);17801781 codeMirrorCopy.setValue(value);1782 formEditCode.getItems()[0].setValue(value);1783 formEditCode.setDirty(false);17841785 $('#codeEditor .pmui-field-label').hide();1786 $('#formEditCode').children().last().css({1787 'margin-top': '-352px',1788 'border': '0px',1789 'margin-right': '-15px'1790 }).find('a').css('padding', '10px 5px');1791 $($('#codeEditor .CodeMirror.cm-s-default.CodeMirror-wrap')[0]).css({1792 'margin-left': '10px',1793 'width': '850px',1794 'height': '360px'1795 });1796 $('#triggerWindow .pmui-window-body').css('overflow', 'hidden');1797 codeMirrorCopy.refresh();1798 },1799 style: {1800 cssProperties: {1801 "margin-right": 21802 }1803 }1804 }1805 ]1806 });1807 cd = new PMCodeMirrorField({1808 labelWidth: '23.8%'1809 });1810 cd.setLabel("Code".translate());1811 formEditTriggerCustom.addItem(cd);1812 formEditTriggerCustom.getItems()[1].setName('code');1813 formEditTriggerCustom.getItems()[1].setID('code');18141815 formEditCode = new PMUI.form.Form({1816 id: "formEditCode",1817 border: true,1818 visibleHeader: false,1819 width: '925px',1820 name: "formeditcode",1821 title: "Editor".translate(),1822 items: [],1823 buttons: [1824 {1825 text: "@@",1826 id: "selectPickerButton",1827 handler: function () {1828 var picker = new VariablePicker();1829 picker.open({1830 success: function (variable) {1831 var codeMirror = formEditCode.getItems()[0].controls[0].cm;1832 var cursorPos = codeMirror.getCursor();1833 codeMirror.replaceSelection(variable);1834 codeMirror.setCursor(cursorPos.line, cursorPos.ch);1835 }1836 });1837 },1838 style: {1839 cssProperties: {1840 "margin-left": '229px',1841 "background": "rgb(45, 62, 80)",1842 "border": "1px solid rgb(45, 62, 80)"1843 }1844 }1845 }1846 ]1847 });1848 editCode = new PMCodeMirrorField({1849 labelWidth: '9%'1850 });1851 editCode.setLabel("Code".translate());1852 formEditCode.addItem(editCode);1853 formEditCode.getItems()[0].setName('codeEditor');1854 formEditCode.getItems()[0].setID('codeEditor');18551856 //Trigger Window1857 triggerWindow = new PMUI.ui.Window({1858 id: "triggerWindow",1859 title: "Triggers".translate(),1860 width: DEFAULT_WINDOW_WIDTH,1861 height: DEFAULT_WINDOW_HEIGHT,1862 footerItems: [1863 buttonCancel,1864 buttonSave,1865 btnEditSourceCode,1866 applyButton,1867 copyButton1868 ],1869 buttonPanelPosition: "bottom",1870 footerAling: "right",1871 onBeforeClose: function () {1872 clickedClose = true;1873 isDirtyFormTrigger();1874 }1875 });187618771878 triggerWindow.addItem(gridListTrigger);1879 triggerWindow.addItem(formEditTriggerCustom);1880 triggerWindow.addItem(formEditTriggerWizard);1881 triggerWindow.addItem(formCopyTrigger);1882 triggerWindow.addItem(formEditCode);1883 triggerWindow.addItem(accordionNewTrigger);18841885 if (typeof listTriggers !== "undefined") {1886 triggerWindow.open();1887 codMirr.dom.labelTextContainer.style.width = "23.8%";1888 codMirr.html.style.padding = "10px";1889 formEditTriggerCustom.panel.html.style.padding = "10px 10px";1890 $('#listTriggers .pmui-textcontrol').css({'margin-top': '5px', width: '250px'});1891 applyStyleWindowForm(triggerWindow);1892 triggerWindow.hideFooter();1893 openListTriggers();18941895 gridListTrigger.dom.toolbar.appendChild(buttonNew.getHTML());1896 buttonNew.defineEvents();18971898 gridListTrigger.dom.toolbar.appendChild(buttonCopy.getHTML());1899 buttonCopy.defineEvents();19001901 gridListTrigger.dom.toolbar.appendChild(buttonWizard.getHTML());1902 buttonWizard.defineEvents();19031904 triggerWindow.defineEvents();1905 gridListTrigger.sort('tri_title', 'asc');1906 formEditTriggerCustom.panel.style.addProperties({'overflow': 'hidden'});19071908 formcustom = triggerWindow.getItems()[1];1909 valuesCustom=formcustom.getItems()[0];1910 }1911 };19121913 PMDesigner.trigger.create = function () {1914 var codeMirrorControl, cmControlCopyTrigger;1915 openFormCustom("Create".translate());1916 formEditTriggerCustom.getField("code").dom.labelTextContainer.style.width = "23.8%";1917 $('.pmui-pmseparatorlinefield .pmui-field-label').css({display: 'none'});1918 formEditTriggerCustom.showFooter();19191920 codeMirrorControl = formEditTriggerCustom.getItems()[1].controls[0].cm;1921 formEditTriggerCustom.getItems()[1].html.style.padding = "10px";1922 if (codeMirrorControl != undefined) {1923 codeMirrorControl.setSize(580, 150);1924 }1925 formEditTriggerCustom.getItems()[1].setHeight(170);1926 formEditTriggerCustom.reset();1927 }; ...

Full Screen

Full Screen

tree.js

Source:tree.js Github

copy

Full Screen

1var items = 0;var n = 0;var it;var root;2$('#jqxTree').jqxTree('addTo', { label: 'Dondomofon' });3items = $('#jqxTree').jqxTree('getItems');4root = items[n];5root.element.name = "17";6$('#jqxTree').jqxTree('checkItem', root.element, true);n++;7$('#jqxTree').jqxTree('addTo', { label: 'Ковры - основное' }, root.element);8items = $('#jqxTree').jqxTree('getItems');9it = items[n];10it.element.name = "147";11$('#jqxTree').jqxTree('checkItem', it.element, true);n++;12$('#jqxTree').jqxTree('addTo', { label: 'Ковры - страны производители Р' }, root.element);13items = $('#jqxTree').jqxTree('getItems');14it = items[n];15it.element.name = "148";16$('#jqxTree').jqxTree('checkItem', it.element, true);n++;17$('#jqxTree').jqxTree('addTo', { label: 'Ковры-материалы' }, root.element);18items = $('#jqxTree').jqxTree('getItems');19it = items[n];20it.element.name = "149";21$('#jqxTree').jqxTree('checkItem', it.element, true);n++;22$('#jqxTree').jqxTree('addTo', { label: 'Ковры-города' }, root.element);23items = $('#jqxTree').jqxTree('getItems');24it = items[n];25it.element.name = "150";26$('#jqxTree').jqxTree('checkItem', it.element, true);n++;27$('#jqxTree').jqxTree('addTo', { label: 'Ковры-типы, формы, цвета' }, root.element);28items = $('#jqxTree').jqxTree('getItems');29it = items[n];30it.element.name = "151";31$('#jqxTree').jqxTree('checkItem', it.element, true);n++;32$('#jqxTree').jqxTree('addTo', { label: 'Ковры-типы, формы Регионы' }, root.element);33items = $('#jqxTree').jqxTree('getItems');34it = items[n];35it.element.name = "152";36$('#jqxTree').jqxTree('checkItem', it.element, true);n++;37$('#jqxTree').jqxTree('addTo', { label: 'Ковры - страны производители' }, root.element);38items = $('#jqxTree').jqxTree('getItems');39it = items[n];40it.element.name = "153";41$('#jqxTree').jqxTree('checkItem', it.element, true);n++;42$('#jqxTree').jqxTree('addTo', { label: 'Ковры-материалы Регионы' }, root.element);43items = $('#jqxTree').jqxTree('getItems');44it = items[n];45it.element.name = "154";46$('#jqxTree').jqxTree('checkItem', it.element, true);n++;47$('#jqxTree').jqxTree('addTo', { label: 'Ковры - основное Регионы' }, root.element);48items = $('#jqxTree').jqxTree('getItems');49it = items[n];50it.element.name = "155";51$('#jqxTree').jqxTree('checkItem', it.element, true);n++;52$('#jqxTree').jqxTree('addTo', { label: 'Ковры - основное 1' }, root.element);53items = $('#jqxTree').jqxTree('getItems');54it = items[n];55it.element.name = "156";56$('#jqxTree').jqxTree('checkItem', it.element, true);n++;57$('#jqxTree').jqxTree('addTo', { label: 'Новая' }, root.element);58items = $('#jqxTree').jqxTree('getItems');59it = items[n];60it.element.name = "165";61$('#jqxTree').jqxTree('checkItem', it.element, true);n++;62$('#jqxTree').jqxTree('addTo', { label: 'Домофоны Москва' }, root.element);63items = $('#jqxTree').jqxTree('getItems');64it = items[n];65it.element.name = "166";66$('#jqxTree').jqxTree('checkItem', it.element, true);n++;67$('#jqxTree').jqxTree('addTo', { label: 'Домофоны Визит Москва' }, root.element);68items = $('#jqxTree').jqxTree('getItems');69it = items[n];70it.element.name = "167";71$('#jqxTree').jqxTree('checkItem', it.element, true);n++;72$('#jqxTree').jqxTree('addTo', { label: 'Домофоны Регионы' }, root.element);73items = $('#jqxTree').jqxTree('getItems');74it = items[n];75it.element.name = "168";76$('#jqxTree').jqxTree('checkItem', it.element, true);n++;77$('#jqxTree').jqxTree('addTo', { label: 'Домофоны Визит Регионы' }, root.element);78items = $('#jqxTree').jqxTree('getItems');79it = items[n];80it.element.name = "169";81$('#jqxTree').jqxTree('checkItem', it.element, true);n++;82$('#jqxTree').jqxTree('addTo', { label: 'Insidehome' });83items = $('#jqxTree').jqxTree('getItems');84root = items[n];85root.element.name = "18";86$('#jqxTree').jqxTree('checkItem', root.element, true);n++;87$('#jqxTree').jqxTree('addTo', { label: 'Производители' }, root.element);88items = $('#jqxTree').jqxTree('getItems');89it = items[n];90it.element.name = "157";91$('#jqxTree').jqxTree('checkItem', it.element, true);n++;92$('#jqxTree').jqxTree('addTo', { label: 'Категории: люстры, бра, светил' }, root.element);93items = $('#jqxTree').jqxTree('getItems');94it = items[n];95it.element.name = "158";96$('#jqxTree').jqxTree('checkItem', it.element, true);n++;97$('#jqxTree').jqxTree('addTo', { label: 'Стили' }, root.element);98items = $('#jqxTree').jqxTree('getItems');99it = items[n];100it.element.name = "159";101$('#jqxTree').jqxTree('checkItem', it.element, true);n++;102$('#jqxTree').jqxTree('addTo', { label: 'Регионы: люстры, бра, светильн' }, root.element);103items = $('#jqxTree').jqxTree('getItems');104it = items[n];105it.element.name = "160";106$('#jqxTree').jqxTree('checkItem', it.element, true);n++;107$('#jqxTree').jqxTree('addTo', { label: 'Регионы_ производители' }, root.element);108items = $('#jqxTree').jqxTree('getItems');109it = items[n];110it.element.name = "161";111$('#jqxTree').jqxTree('checkItem', it.element, true);n++;112$('#jqxTree').jqxTree('addTo', { label: 'Регионы_стили' }, root.element);113items = $('#jqxTree').jqxTree('getItems');114it = items[n];115it.element.name = "162";116$('#jqxTree').jqxTree('checkItem', it.element, true);n++;117$('#jqxTree').jqxTree('addTo', { label: 'Категории Москва - трафик' }, root.element);118items = $('#jqxTree').jqxTree('getItems');119it = items[n];120it.element.name = "163";121$('#jqxTree').jqxTree('checkItem', it.element, true);n++;122$('#jqxTree').jqxTree('addTo', { label: 'Категории Регионы - трафик' }, root.element);123items = $('#jqxTree').jqxTree('getItems');124it = items[n];125it.element.name = "164";126$('#jqxTree').jqxTree('checkItem', it.element, true);n++;...

Full Screen

Full Screen

generateFakeData.js

Source:generateFakeData.js Github

copy

Full Screen

...70 men: [71 {72 id: "men-shoes",73 title: "Shoes",74 items: getItems(10, "shoe")75 },76 {77 id: "men-socks",78 title: "Socks",79 items: getItems(10, "sock")80 },81 {82 id: "men-jeans",83 title: "Jeans",84 items: getItems(10, "jean")85 },86 {87 id: "men-trousers",88 title: "trousers",89 items: getItems(10, "trouser")90 },91 {92 id: "men-jackets",93 title: "Jackets",94 items: getItems(10, "jacket")95 },96 {97 id: "men-hats",98 title: "Hats",99 items: getItems(10, "hat")100 },101 {102 id: "men-shirt",103 title: "Shirt",104 items: getItems(10, "shirt")105 },106 {107 id: "men-tshirt",108 title: "T-shirt",109 items: getItems(10, "t-shirt")110 },111 {112 id: "men-watches",113 title: "watches",114 items: getItems(10, "watch")115 }116 ],117 women: [118 {119 id: "women-shoes",120 title: "Shoes",121 items: getItems(10, "shoe")122 },123 {124 id: "women-socks",125 title: "Socks",126 items: getItems(10, "sock")127 },128 {129 id: "women-jeans",130 title: "Jeans",131 items: getItems(10, "jean")132 },133 {134 id: "women-trousers",135 title: "trousers",136 items: getItems(10, "trouser")137 },138 {139 id: "women-jackets",140 title: "Jackets",141 items: getItems(10, "jacket")142 },143 {144 id: "women-hats",145 title: "Hats",146 items: getItems(10, "hat")147 },148 {149 id: "women-shirt",150 title: "Shirt",151 items: getItems(10, "shirt")152 },153 {154 id: "women-tshirt",155 title: "T-shirt",156 items: getItems(10, "t-shirt")157 },158 {159 id: "women-watches",160 title: "watches",161 items: getItems(10, "watch")162 }163 ],164 boys: [165 {166 id: "boys-shoes",167 title: "Shoes",168 items: getItems(10, "shoe")169 },170 {171 id: "boys-socks",172 title: "Socks",173 items: getItems(10, "sock")174 },175 {176 id: "boys-jeans",177 title: "Jeans",178 items: getItems(10, "jean")179 },180 {181 id: "boys-trousers",182 title: "trousers",183 items: getItems(10, "trouser")184 },185 {186 id: "boys-jackets",187 title: "Jackets",188 items: getItems(10, "jacket")189 },190 {191 id: "boys-hats",192 title: "Hats",193 items: getItems(10, "hat")194 },195 {196 id: "boys-shirt",197 title: "Shirt",198 items: getItems(10, "shirt")199 },200 {201 id: "boys-tshirt",202 title: "T-shirt",203 items: getItems(10, "t-shirt")204 },205 {206 id: "boys-watches",207 title: "watches",208 items: getItems(10, "watch")209 }210 ],211 girls: [212 {213 id: "girls-shoes",214 title: "Shoes",215 items: getItems(10, "shoe")216 },217 {218 id: "girls-socks",219 title: "Socks",220 items: getItems(10, "sock")221 },222 {223 id: "girls-jeans",224 title: "Jeans",225 items: getItems(10, "jean")226 },227 {228 id: "girls-trousers",229 title: "trousers",230 items: getItems(10, "trouser")231 },232 {233 id: "girls-jackets",234 title: "Jackets",235 items: getItems(10, "jacket")236 },237 {238 id: "girls-hats",239 title: "Hats",240 items: getItems(10, "hat")241 },242 {243 id: "girls-shirt",244 title: "Shirt",245 items: getItems(10, "shirt")246 },247 {248 id: "girls-tshirt",249 title: "T-shirt",250 items: getItems(10, "t-shirt")251 },252 {253 id: "girls-watches",254 title: "watches",255 items: getItems(10, "watch")256 }257 ],258 new: [259 {260 id: "new-shoes",261 title: "Shoes",262 items: getItems(10, "shoe")263 },264 {265 id: "new-socks",266 title: "Socks",267 items: getItems(10, "sock")268 },269 {270 id: "new-jeans",271 title: "Jeans",272 items: getItems(10, "jean")273 },274 {275 id: "new-trousers",276 title: "trousers",277 items: getItems(10, "trouser")278 },279 {280 id: "new-jackets",281 title: "Jackets",282 items: getItems(10, "jacket")283 },284 {285 id: "new-hats",286 title: "Hats",287 items: getItems(10, "hat")288 },289 {290 id: "new-shirt",291 title: "Shirt",292 items: getItems(10, "shirt")293 },294 {295 id: "new-tshirt",296 title: "T-shirt",297 items: getItems(10, "t-shirt")298 },299 {300 id: "new-watches",301 title: "watches",302 items: getItems(10, "watch")303 }304 ]305};306console.log(SHOP_DATA);307// fs.writeFile(308// "shop.data.json",309// JSON.stringify(SHOP_DATA, null, 2),310// "utf-8",311// err => {312// console.log(err);313// }314// );315const util = require("util");316// https://nodejs.org/en/knowledge/getting-started/how-to-use-util-inspect/...

Full Screen

Full Screen

Item_Getting.js

Source:Item_Getting.js Github

copy

Full Screen

...9 *10 * All rights reserved.11 */12QUnit.module('Getting and Matching Items');13test('Item#getItems()', function() {14 var group = new Group([new Path({ selected: true }), new Raster()]);15 equals(function() {16 return group.getItems({17 type: 'path'18 }).length;19 }, 1);20 equals(function() {21 return group.getItems({22 selected: true23 }).length;24 }, 1);25});26test('Item#matches()', function() {27 var path = new Path();28 equals(function() {29 return path.matches({30 visible: false31 });32 }, false);33 equals(function() {34 return path.matches({35 visible: true36 });37 }, true);38});39test('Project#getItems()', function() {40 var layer = new Layer();41 var matches = paper.project.getItems({42 class: Layer43 });44 equals(function() {45 return matches.length == 1 && matches[0] == layer;46 }, true);47 var matches = paper.project.getItems({48 class: Item49 });50 equals(function() {51 return matches.length == 1 && matches[0] == layer;52 }, true);53 var path = new Path();54 var matches = paper.project.getItems({55 class: Path56 });57 equals(function() {58 return matches.length == 1 && matches[0] == path;59 }, true);60 var group = new Group();61 var matches = paper.project.getItems({62 className: 'Group'63 });64 equals(function() {65 return matches.length == 1 && matches[0] === group;66 }, true);67 var matches = paper.project.getItems({68 type: 'group'69 });70 equals(function() {71 return matches.length == 1 && matches[0] === group;72 }, true);73 var raster = new Raster();74 var matches = paper.project.getItems({75 class: Raster76 });77 equals(function() {78 return matches.length == 1 && matches[0] === raster;79 }, true);80 equals(function() {81 return paper.project.getItems({82 selected: true83 }).length;84 }, 0);85 raster.selected = true;86 equals(function() {87 return paper.project.getItems({88 selected: true89 }).length;90 }, 2);91 raster.selected = true;92 equals(function() {93 return paper.project.getItems({94 selected: true,95 class: Raster96 }).length;97 }, 1);98});99test('Project#getItems() with compare function', function() {100 var firstPath = new Path();101 var path = new Path({102 opacity: 0.5103 });104 var items = paper.project.getItems({105 opacity: function(value) {106 return value < 1;107 }108 });109 equals(function() {110 return items.length == 1 && items[0] == path;111 }, true);112});113test('Project#getItems() with specific property value', function() {114 var path = new Path();115 var decoyPath = new Path({116 opacity: 0.5117 });118 var items = paper.project.getItems({119 opacity: 1,120 type: 'path'121 });122 equals(function() {123 return items.length == 1 && items[0] == path;124 }, true);125});126test('Project#getItems() with color', function() {127 var path = new Path({128 fillColor: 'red'129 });130 var decoyPath = new Path({131 fillColor: 'black'132 });133 var items = paper.project.getItems({134 fillColor: 'red',135 type: 'path'136 });137 equals(function() {138 return items.length == 1 && items[0] == path;139 }, true);140});141test('Project#getItems() with regex function', function() {142 var layer = paper.project.activeLayer;143 var stopPath = new Path({144 name: 'stop'145 });146 var pausePath = new Path({147 name: 'pause'148 });149 var startPath = new Path({150 name: 'starting'151 });152 var items = paper.project.getItems({153 name: /^start/g154 });155 // console.log(paper.project.activeLayer);156 equals(function() {157 return items.length == 1 && items[0] == startPath;158 }, true);159 equals(function() {160 var items = paper.project.getItems({161 name: /^st/g162 });163 return items.length == 2;164 }, true);165});166test('Project#getItems() empty: true', function() {167 var layer = new Layer();168 var empty1 = new Path();169 var empty2 = new Path();170 equals(function() {171 return layer.children.length;172 }, 2);173 equals(function() {174 return paper.project.getItems({175 empty: true176 }).length;177 }, 2);178});179test('Project#getItems() overlapping', function() {180 var path = new Path.Circle({181 radius: 100,182 center: [200, 200],183 fillColor: 'red'184 });185 equals(function() {186 var matches = project.getItems({187 class: Path,188 overlapping: [0, 0, 400, 400]189 });190 return matches.length == 1 && matches[0] == path;191 }, true);192 equals(function() {193 var matches = project.getItems({194 class: Path,195 overlapping: [200, 0, 400, 400]196 });197 return matches.length == 1 && matches[0] == path;198 }, true);199 equals(function() {200 var matches = project.getItems({201 class: Path,202 overlapping: [400, 0, 400, 400]203 });204 return matches.length == 0;205 }, true);206});207test('Project#getItems() inside', function() {208 var path = new Path.Circle({209 radius: 100,210 center: [200, 200],211 fillColor: 'red'212 });213 equals(function() {214 var matches = project.getItems({215 class: Path,216 inside: [0, 0, 400, 400]217 });218 return matches.length == 1 && matches[0] == path;219 }, true);220 equals(function() {221 var matches = project.getItems({222 class: Path,223 inside: [200, 0, 400, 400]224 });225 return matches.length == 0;226 }, true);...

Full Screen

Full Screen

list.js

Source:list.js Github

copy

Full Screen

1/*global define:false */2define([3 'troopjs-browser/component/widget',4 'troopjs-data/store/component',5 'troopjs-browser/store/adapter/local',6 'jquery',7 'template!./item.html',8 'poly/array'9], function ListModule(Widget, Store, Adapter, $, template) {10 /*jshint newcap:false*/11 'use strict';12 var ARRAY_SLICE = Array.prototype.slice;13 var ENTER_KEY = 13;14 var ESC_KEY = 27;15 var FILTER_ACTIVE = 'filter-active';16 var FILTER_COMPLETED = 'filter-completed';17 var KEY = 'todos-troopjs';18 var STORE = 'store';19 function filter(item) {20 return item !== null;21 }22 return Widget.extend(function ListWidget() {23 this[STORE] = Store(Adapter());24 }, {25 'sig/start': function () {26 var me = this;27 var store = me[STORE];28 return store.ready(function () {29 return store.get(KEY, function (getItems) {30 return store.set(KEY, getItems && getItems.filter(filter) || [], function (setItems) {31 setItems.forEach(function (item, i) {32 me.append(template, {33 i: i,34 item: item35 });36 });37 me.publish('todos/change', setItems);38 });39 });40 });41 },42 'hub/todos/add': function onAdd(title) {43 var me = this;44 var store = me[STORE];45 return store.ready(function () {46 return store.get(KEY, function (getItems) {47 var i = getItems.length;48 var item = getItems[i] = {49 completed: false,50 title: title51 };52 me.append(template, {53 i: i,54 item: item55 });56 return store.set(KEY, getItems, function (setItems) {57 me.publish('todos/change', setItems);58 });59 });60 })61 .yield(ARRAY_SLICE.call(arguments));62 },63 'hub/todos/mark': function onMark(value) {64 this.$element.find(':checkbox').prop('checked', value).change();65 },66 'hub/todos/clear': function onClear() {67 this.$element.find('.completed .destroy').click();68 },69 'hub:memory/todos/filter': function onFilter(filter) {70 var $element = this.$element;71 switch (filter) {72 case '/completed':73 $element74 .removeClass(FILTER_ACTIVE)75 .addClass(FILTER_COMPLETED);76 break;77 case '/active':78 $element79 .removeClass(FILTER_COMPLETED)80 .addClass(FILTER_ACTIVE);81 break;82 default:83 $element.removeClass([FILTER_ACTIVE, FILTER_COMPLETED].join(' '));84 }85 },86 'dom:.toggle/change': function onToggleChange($event) {87 var me = this;88 var store = me[STORE];89 var $target = $($event.currentTarget);90 var completed = $target.prop('checked');91 var $li = $target.closest('li');92 var index = $li.data('index');93 $li94 .toggleClass('completed', completed)95 .toggleClass('active', !completed);96 store.ready(function () {97 return store.get(KEY, function (getItems) {98 getItems[index].completed = completed;99 return store.set(KEY, getItems, function (setItems) {100 me.publish('todos/change', setItems);101 });102 });103 });104 },105 'dom:.destroy/click': function onDestroyClick($event) {106 var me = this;107 var store = me[STORE];108 var $li = $($event.currentTarget).closest('li');109 var index = $li.data('index');110 $li.remove();111 store.ready(function () {112 return store.get(KEY, function (getItems) {113 getItems[index] = null;114 return store.set(KEY, getItems, function (setItems) {115 me.publish('todos/change', setItems);116 });117 });118 });119 },120 'dom:.view label/dblclick': function onViewDblClick($event) {121 var me = this;122 var store = me[STORE];123 var $li = $($event.currentTarget).closest('li');124 var index = $li.data('index');125 var $input = $li.find('input');126 $li.addClass('editing');127 $input.prop('disabled', true);128 store.ready(function () {129 return store.get(KEY, function (items) {130 $input131 .val(items[index].title)132 .prop('disabled', false)133 .focus();134 });135 }, function () {136 $input.prop('disabled', false);137 $li.removeClass('editing');138 });139 },140 'dom:.edit/keyup': function onEditKeyUp($event) {141 var $li = $($event.currentTarget).closest('li');142 switch ($event.keyCode) {143 case ENTER_KEY:144 $li145 .find('input')146 .focusout();147 break;148 case ESC_KEY:149 $li150 .find('input')151 .val($li.find('label').text())152 .focusout();153 break;154 }155 },156 'dom:.edit/focusout': function onEditFocusOut($event) {157 var me = this;158 var store = me[STORE];159 var $target = $($event.currentTarget);160 var title = $target.val().trim();161 if (title === '') {162 $target163 .closest('li.editing')164 .removeClass('editing')165 .find('.destroy')166 .click();167 } else {168 $target.prop('disabled', true);169 store.ready(function () {170 return store.get(KEY, function (getItems) {171 var $li = $target.closest('li');172 var index = $li.data('index');173 getItems[index].title = title;174 return store.set(KEY, getItems, function (setItems) {175 $li176 .removeClass('editing')177 .find('label')178 .text(title);179 me.publish('todos/change', setItems);180 });181 })182 .ensure(function () {183 $target.prop('disabled', false);184 });185 });186 }187 }188 });...

Full Screen

Full Screen

getItems.js

Source:getItems.js Github

copy

Full Screen

...1112 var done = assert.async();13 var container = utils.createGrid();14 var grid = new Muuri(container, {dragEnabled: true});15 var items = grid.getItems();16 var item = items[0];17 var teardown = function () {18 grid.destroy();19 container.parentNode.removeChild(container);20 done();21 };2223 assert.notStrictEqual(idList(grid.getItems()), idList(grid._items), 'should return a new array and not a reference to the internal array');24 assert.deepEqual(idList(grid.getItems()), idList(grid._items), 'should return all items in correct order if no arguments are provided');25 assert.deepEqual(idList(grid.getItems(0)), idList([items[0]]), 'should allow providing an index as the first argument');26 assert.deepEqual(idList(grid.getItems(items[0].getElement())), idList([items[0]]), 'should allow providing an element as the first argument');27 assert.deepEqual(idList(grid.getItems(items[0])), idList([items[0]]), 'should allow providing an item as the first argument');28 assert.deepEqual(idList(grid.getItems([0, items[1].getElement(), items[2]])), idList([items[0], items[1], items[2]]), 'should allow providing an array of indices, elements and items as the first argument');2930 // Hidden/hiding state.31 grid.show(items, {instant: true, layout: 'instant'}).hide([0, 1], {instant: true, layout: 'instant'}).hide([2, 3], {layout: 'instant'});32 assert.deepEqual(idList(grid.getItems('hidden')), idList([items[0], items[1], items[2], items[3]]), 'should allow providing "hidden" state as the first argument');33 assert.deepEqual(idList(grid.getItems('hiding')), idList([items[2], items[3]]), 'should allow providing "hiding" state as the first argument');3435 // Visible/active/showing state.36 grid.hide(items, {instant: true, layout: 'instant'}).show([0, 1], {instant: true, layout: 'instant'}).show([2, 3], {layout: 'instant'});37 assert.deepEqual(idList(grid.getItems('visible')), idList([items[0], items[1], items[2], items[3]]), 'should allow providing "visible" state as the first argument');38 assert.deepEqual(idList(grid.getItems('active')), idList([items[0], items[1], items[2], items[3]]), 'should allow providing "active" state as the first argument');39 assert.deepEqual(idList(grid.getItems('showing')), idList([items[2], items[3]]), 'should allow providing "showing" state as the first argument');40 grid.show(items, {instant: true, layout: 'instant'});4142 // Positioning state.43 grid.move(6, 7, {action: 'swap'});44 utils.raf(function () {45 assert.deepEqual(idList(grid.getItems('positioning')), idList([items[7], items[6]]), 'should allow providing "positioning" state as the first argument');46 });4748 // Dragging/releasing state.49 grid.on('dragStart', function () {50 assert.deepEqual(idList(grid.getItems('dragging')), idList([item]), 'should allow providing "dragging" state as the first argument');51 });52 grid.on('dragReleaseStart', function () {53 assert.deepEqual(idList(grid.getItems('releasing')), idList([item]), 'should allow providing "releasing" state as the first argument');54 });55 utils.dragElement(item.getElement(), 100, 100, teardown);5657 });58 ...

Full Screen

Full Screen

browser_dbg-outline-filter.js

Source:browser_dbg-outline-filter.js Github

copy

Full Screen

1/* Any copyright is dedicated to the Public Domain.2 * http://creativecommons.org/publicdomain/zero/1.0/ */3function getItems(dbg) {4 return findAllElements(dbg, "outlineItems");5}6function getNthItem(dbg, index) {7 return findElement(dbg, "outlineItem", index);8}9// Tests the outline pane fuzzy filtering of outline items10add_task(async function() {11 const dbg = await initDebugger("doc-scripts.html", "long");12 await selectSource(dbg, "long", 1);13 findElementWithSelector(dbg, ".outline-tab").click();14 // turn off alphetical sort if active15 const alphabetizeButton = findElementWithSelector(16 dbg,17 ".outline-footer button"18 );19 if (alphabetizeButton.className === "active") {20 alphabetizeButton.click();21 }22 const outlineFilter = findElementWithSelector(dbg, ".outline-filter-input");23 ok(outlineFilter, "Outline filter is present");24 outlineFilter.blur();25 ok(26 !findElementWithSelector(dbg, ".outline-filter-input.focused"),27 "does not have class focused when not focused"28 );29 outlineFilter.focus();30 ok(31 findElementWithSelector(dbg, ".outline-filter-input.focused"),32 "has class focused when focused"33 );34 is(getItems(dbg).length, 9, "9 items in the unfiltered list");35 // filter all items starting with t36 type(dbg, "t");37 is(getItems(dbg).length, 4, "4 items in the list after 't' filter");38 ok(getItems(dbg)[0].textContent.includes("TodoModel(key)"), "item TodoModel");39 ok(40 getItems(dbg)[1].textContent.includes("toggleAll(checked)"),41 "item toggleAll"42 );43 ok(44 getItems(dbg)[2].textContent.includes("toggle(todoToToggle)"),45 "item toggle"46 );47 ok(getItems(dbg)[3].textContent.includes("testModel()"), "item testModel");48 // filter using term 'tog'49 type(dbg, "og");50 is(getItems(dbg).length, 2, "2 items in the list after 'tog' filter");51 ok(52 getItems(dbg)[0].textContent.includes("toggleAll(checked)"),53 "item toggleAll"54 );55 ok(56 getItems(dbg)[1].textContent.includes("toggle(todoToToggle)"),57 "item toggle"58 );59 pressKey(dbg, "Escape");60 is(getItems(dbg).length, 9, "9 items in the list after escape pressed");61 // Ensure no action is taken when Enter key is pressed62 pressKey(dbg, "Enter");63 is(getItems(dbg).length, 9, "9 items in the list after enter pressed");64 // check that the term 'todo' includes items with todo65 type(dbg, "todo");66 is(getItems(dbg).length, 2, "2 items in the list after 'todo' filter");67 ok(getItems(dbg)[0].textContent.includes("TodoModel(key)"), "item TodoModel");68 ok(getItems(dbg)[1].textContent.includes("addTodo(title)"), "item addTodo");...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { getItems } from 'storybook-root'2import { getItems } from 'storybook-root'3import { getItems } from 'storybook-root'4import { getItems } from 'storybook-root'5import { getItems } from 'storybook-root'6import { getItems } from 'storybook-root'7import { getItems } from 'storybook-root'8import { getItems } from 'storybook-root'9import { getItems

Full Screen

Using AI Code Generation

copy

Full Screen

1import React from 'react';2import {storiesOf} from '@storybook/react';3import {getItems} from 'storybook-root';4import MyComponent from './MyComponent';5storiesOf('My Component', module)6 .add('default', () => (7 <MyComponent items={getItems()} />8 ));9import {getItems} from 'storybook-root';10export const items = getItems({11});12import React from 'react';13import {storiesOf} from '@storybook/react';14import {getItems} from 'storybook-root';15import MyComponent from './MyComponent';16storiesOf('My Component', module)17 .add('default', () => (18 <MyComponent items={getItems()} />19 ));20MIT © [mattjennings](

Full Screen

Using AI Code Generation

copy

Full Screen

1import { getItems } from 'storybook-root';2console.log(getItems());3export { getItems } from './src/getItems';4export const getItems = () => {5 return 'Items';6};7export { getItems } from './getItems';8 "eslint-plugin-import": "^2.12.0",

Full Screen

Using AI Code Generation

copy

Full Screen

1import { getItems } from 'storybook-root';2const items = getItems();3console.log(items);4export { getItems } from './src/utils';5export { getItems } from './getItems';6export const getItems = () => {7 return ['item1', 'item2', 'item3'];8};9import { getItems } from './getItems';10describe('getItems', () => {11 it('should return items', () => {12 const items = getItems();13 expect(items).toEqual(['item1', 'item2', 'item3']);14 });15});16"scripts": {17},18{19}20{21 "rules": {22 {23 }24 "import/no-extraneous-dependencies": [25 {26 }27 },28 "env": {29 }30}31{32}

Full Screen

Using AI Code Generation

copy

Full Screen

1import {getItems} from 'storybook-root';2getItems().then((items) => {3});4import {getItems} from 'storybook-root';5export {getItems};6import {getItems} from 'storybook-root';7export {getItems};8{9}10import {getItems} from 'storybook-root';11export {getItems};12{13}14import {getItems} from 'storybook-root';15export {getItems};16{17}18import {getItems} from 'storybook-root';19export {getItems};20{21}22import {getItems} from 'storybook-root';23export {getItems};24{25}26import {getItems} from 'storybook-root';27export {getItems};28{29}30import {getItems} from 'storybook-root';31export {getItems};32{33}

Full Screen

Using AI Code Generation

copy

Full Screen

1export function getItems() {2 return items;3}4export function getItems() {5 return items;6}

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful