Skip to content

Commit 9f2a61c

Browse files
committed
Secure popover documentation display on all pages/modals
1 parent 04283ef commit 9f2a61c

File tree

11 files changed

+107
-82
lines changed

11 files changed

+107
-82
lines changed

source/src/main/java/org/cerberus/core/database/DocumentationDatabaseService.java

+40-40
Large diffs are not rendered by default.

source/src/main/webapp/js/global/global.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3319,9 +3319,9 @@ function cleanErratum(oldValue) {
33193319

33203320
function refreshPopoverDocumentation(containerid) {
33213321
//As the executors list is dynamically generated after the global popover initialization, need to init popover again on executors list only.
3322-
let popDefinition = {
3323-
'placement': 'auto',
3324-
'container': '#editApplicationModalForm'};
3322+
let popDefinition = {};
3323+
popDefinition.placement = "auto";
3324+
popDefinition.container = "#" + containerid;
33253325
$('#' + containerid + ' [data-toggle="popover"]').popover(popDefinition);
33263326
}
33273327

source/src/main/webapp/js/pages/ApplicationObjectList.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ function initPage() {
4242
var configurations = new TableConfigurationsServerSide(
4343
"applicationObjectsTable", "ReadApplicationObject", "contentTable", aoColumnsFunc("applicationObjectsTable"), [1, 'asc']);
4444
createDataTableWithPermissions(configurations, renderOptionsForApplicationObject, "#applicationObjectList", undefined, true);
45+
refreshPopoverDocumentation("applicationObjectList");
46+
4547

4648
if (application !== null) {
4749
clearIndividualFilter("applicationObjectsTable", undefined, true);
@@ -247,7 +249,7 @@ function aoColumnsFunc(tableId) {
247249
var currentCase = "<image "
248250
+ "onclick ='displayPictureOfMinitature(this)' "
249251
+ "style ='height: 25px;cursor: pointer;'"
250-
+ "src='ReadApplicationObjectImage?application=" + obj["application"] + "&object=" + obj["object"] + "&time=" + new Date().getTime()
252+
+ "src='ReadApplicationObjectImage?application=" + obj["application"] + "&object=" + obj["object"] + "&time=" + new Date().getTime()
251253
+ "'></image>"
252254
return currentCase;
253255
}

source/src/main/webapp/js/pages/CampaignList.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function aoColumnsFunc(tableId) {
152152
"bSortable": false,
153153
"bSearchable": false,
154154
"sWidth": "170px",
155-
"title": doc.getDocLabel("page_testcampaign", "button_col"),
155+
"title": doc.getDocOnline("page_testcampaign", "button_col"),
156156
"mRender": function (data, type, obj) {
157157
var hasPermissions = $("#" + tableId).attr("hasPermissions");
158158

@@ -185,125 +185,125 @@ function aoColumnsFunc(tableId) {
185185
"data": "campaign",
186186
"sName": "campaign",
187187
"sWidth": "80px",
188-
"title": doc.getDocLabel("page_testcampaign", "testcampaign_col")
188+
"title": doc.getDocOnline("page_testcampaign", "testcampaign_col")
189189
},
190190
{
191191
"data": "description",
192192
"sName": "description",
193193
"sWidth": "180px",
194-
"title": doc.getDocLabel("page_testcampaign", "description_col")
194+
"title": doc.getDocOnline("page_testcampaign", "description_col")
195195
},
196196
{
197197
"data": "longDescription",
198198
"visible": false,
199199
"sName": "longDescription",
200200
"sWidth": "180px",
201-
"title": doc.getDocLabel("campaign", "longDescription")
201+
"title": doc.getDocOnline("campaign", "longDescription")
202202
},
203203
{
204204
"data": "CIScoreThreshold",
205205
"visible": false,
206206
"sName": "CIScoreThreshold",
207207
"sWidth": "180px",
208-
"title": doc.getDocLabel("campaign", "CIScoreThreshold")
208+
"title": doc.getDocOnline("campaign", "CIScoreThreshold")
209209
},
210210
{
211211
"data": "group1",
212212
"visible": false,
213213
"sName": "group1",
214214
"sWidth": "80px",
215-
"title": doc.getDocLabel("campaign", "Group1")
215+
"title": doc.getDocOnline("campaign", "Group1")
216216
},
217217
{
218218
"data": "group2",
219219
"visible": false,
220220
"sName": "group2",
221221
"sWidth": "80px",
222-
"title": doc.getDocLabel("campaign", "Group2")
222+
"title": doc.getDocOnline("campaign", "Group2")
223223
},
224224
{
225225
"data": "group3",
226226
"visible": false,
227227
"sName": "group3",
228228
"sWidth": "80px",
229-
"title": doc.getDocLabel("campaign", "Group3")
229+
"title": doc.getDocOnline("campaign", "Group3")
230230
},
231231
{
232232
"data": "Tag",
233233
"visible": false,
234234
"sName": "Tag",
235235
"sWidth": "80px",
236-
"title": doc.getDocLabel("campaign", "tag")
236+
"title": doc.getDocOnline("campaign", "tag")
237237
},
238238
{
239239
"data": "Verbose",
240240
"visible": false,
241241
"sName": "Verbose",
242242
"sWidth": "80px",
243-
"title": doc.getDocLabel("campaign", "Verbose")
243+
"title": doc.getDocOnline("campaign", "Verbose")
244244
},
245245
{
246246
"data": "Screenshot",
247247
"visible": false,
248248
"sName": "Screenshot",
249249
"sWidth": "80px",
250-
"title": doc.getDocLabel("campaign", "Screenshot")
250+
"title": doc.getDocOnline("campaign", "Screenshot")
251251
},
252252
{
253253
"data": "Video",
254254
"visible": false,
255255
"sName": "Video",
256256
"sWidth": "80px",
257-
"title": doc.getDocLabel("campaign", "Video")
257+
"title": doc.getDocOnline("campaign", "Video")
258258
},
259259
{
260260
"data": "PageSource",
261261
"visible": false,
262262
"sName": "PageSource",
263263
"sWidth": "80px",
264-
"title": doc.getDocLabel("campaign", "PageSource")
264+
"title": doc.getDocOnline("campaign", "PageSource")
265265
},
266266
{
267267
"data": "RobotLog",
268268
"visible": false,
269269
"sName": "RobotLog",
270270
"sWidth": "80px",
271-
"title": doc.getDocLabel("campaign", "RobotLog")
271+
"title": doc.getDocOnline("campaign", "RobotLog")
272272
},
273273
{
274274
"data": "ConsoleLog",
275275
"visible": false,
276276
"sName": "ConsoleLog",
277277
"sWidth": "80px",
278-
"title": doc.getDocLabel("campaign", "ConsoleLog")
278+
"title": doc.getDocOnline("campaign", "ConsoleLog")
279279
},
280280
{
281281
"data": "Timeout",
282282
"visible": false,
283283
"sName": "Timeout",
284284
"sWidth": "80px",
285-
"title": doc.getDocLabel("campaign", "Timeout")
285+
"title": doc.getDocOnline("campaign", "Timeout")
286286
},
287287
{
288288
"data": "Retries",
289289
"visible": false,
290290
"sName": "Retries",
291291
"sWidth": "80px",
292-
"title": doc.getDocLabel("campaign", "Retries")
292+
"title": doc.getDocOnline("campaign", "Retries")
293293
},
294294
{
295295
"data": "Priority",
296296
"visible": false,
297297
"sName": "Priority",
298298
"sWidth": "80px",
299-
"title": doc.getDocLabel("campaign", "Priority")
299+
"title": doc.getDocOnline("campaign", "Priority")
300300
},
301301
{
302302
"data": "ManualExecution",
303303
"visible": false,
304304
"sName": "ManualExecution",
305305
"sWidth": "80px",
306-
"title": doc.getDocLabel("campaign", "ManualExecution")
306+
"title": doc.getDocOnline("campaign", "ManualExecution")
307307
},
308308
{
309309
"data": "UsrCreated",

source/src/main/webapp/js/pages/Environment.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ function loadChangeTable(selectSystem, selectCountry, selectEnvironment) {
534534
var configurations = new TableConfigurationsServerSide("lastChangeTable", contentUrl, "contentTable", aoColumnsFuncChange("lastChangeTable"), [0, "desc"]);
535535

536536
var table = createDataTableWithPermissions(configurations, undefined, "#lastChangeList", undefined, true);
537+
refreshPopoverDocumentation("lastChangeList");
538+
537539
return table;
538540
}
539541

@@ -549,6 +551,7 @@ function loadEventTable(selectSystem, selectCountry, selectEnvironment) {
549551
var configurations = new TableConfigurationsServerSide("lastEventTable", contentUrl, "contentTable", aoColumnsFuncEvent("lastEventTable"), [0, "desc"]);
550552

551553
var table = createDataTableWithPermissions(configurations, undefined, "#lastEventList", undefined, true);
554+
refreshPopoverDocumentation("lastEventList");
552555
return table;
553556
}
554557

@@ -560,7 +563,9 @@ function loadDatabaseTable(selectSystem, selectCountry, selectEnvironment) {
560563
obj.toDelete = false;
561564
appendDatabaseRow(obj);
562565
});
566+
refreshPopoverDocumentation("listPanelDatabase");
563567
}).fail(handleErrorAjaxAfterTimeout);
568+
564569
}
565570

566571
function appendDatabaseRow(dtb) {
@@ -618,6 +623,7 @@ function addNewDatabaseRow() {
618623
toDelete: false
619624
};
620625
appendDatabaseRow(newDatabase);
626+
refreshPopoverDocumentation("listPanelDatabase");
621627
}
622628

623629
function loadApplicationTable(selectSystem, selectCountry, selectEnvironment) {
@@ -628,6 +634,7 @@ function loadApplicationTable(selectSystem, selectCountry, selectEnvironment) {
628634
obj.toDelete = false;
629635
appendApplicationRow(obj, selectSystem);
630636
});
637+
refreshPopoverDocumentation("listPanelApplication");
631638
}).fail(handleErrorAjaxAfterTimeout);
632639
}
633640

@@ -679,13 +686,13 @@ function appendApplicationRow(app, selectSystem) {
679686
var secret2Name = $("<div class='form-group col-sm-4'></div>").append("<label for='secret2'>" + doc.getDocOnline("countryenvironmentparameters", "secret2") + "</label>").append(secret2Input);
680687
var mobileActivityName = $("<div class='form-group col-sm-6'></div>").append("<label for='var4'>" + doc.getDocOnline("countryenvironmentparameters", "mobileActivity") + "</label>").append(mobileActivity);
681688
var mobilePackageName = $("<div class='form-group col-sm-6'></div>").append("<label for='var4'>" + doc.getDocOnline("countryenvironmentparameters", "mobilePackage") + "</label>").append(mobilePackage);
682-
689+
683690
var drow1 = $("<div class='row'></div>").append(activeName).append(ipName).append(urlName).append(poolSizeName);
684691
var drow2 = $("<div class='row'></div>").append(var1Name).append(var2Name).append(secret1Name).append(expandName);
685692
var drow3 = $("<div class='row'></div>").append(loginName).append(domainName);
686693
var drow4 = $("<div class='row'></div>").append(var3Name).append(var4Name).append(secret2Name);
687694
var drow5 = $("<div class='row'></div>").append(mobileActivityName).append(mobilePackageName);
688-
695+
689696
var panelExtra = $("<div class='collapse' id='col" + nbRow + "'></div>").append(drow3).append(drow4).append(drow5);
690697

691698
var td3 = $("<td></td>").append(drow1).append(drow2).append(panelExtra);
@@ -773,6 +780,7 @@ function addNewApplicationRow(selectSystem) {
773780
toDelete: false
774781
};
775782
appendApplicationRow(newApplication, selectSystem);
783+
refreshPopoverDocumentation("listPanelApplication");
776784
}
777785

778786
function loadDependenciesTable(selectSystem, selectCountry, selectEnvironment) {
@@ -784,6 +792,7 @@ function loadDependenciesTable(selectSystem, selectCountry, selectEnvironment) {
784792
appendDependenciesRow(obj);
785793
});
786794
}).fail(handleErrorAjaxAfterTimeout);
795+
refreshPopoverDocumentation("listPanelDependencies");
787796
}
788797

789798
function appendDependenciesRow(env) {
@@ -838,6 +847,7 @@ function addNewDependenciesRow() {
838847
toDelete: false
839848
};
840849
appendDependenciesRow(newDependencies);
850+
refreshPopoverDocumentation("listPanelDependencies");
841851
}
842852

843853
function loadDeployTypeTable(selectSystem, selectCountry, selectEnvironment) {

source/src/main/webapp/js/pages/EventHookList.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function initPage() {
3434
//configure and create the dataTable
3535
var configurations = new TableConfigurationsServerSide("eventHooksTable", "ReadEventHook", "contentTable", aoColumnsFunc(), [1, 'asc']);
3636
createDataTableWithPermissions(configurations, renderOptionsForEventHook, "#eventHookList", undefined, true);
37+
refreshPopoverDocumentation("eventHookList");
3738
}
3839

3940
function displayPageLabel() {

source/src/main/webapp/js/pages/TestDataLibList.js

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function initPage() {
5454
//creates the main table and draws the management buttons if the user has the permissions
5555
$.when(createDataTableWithPermissions(configurations, renderOptionsForTestDataLib, "#testdatalib", undefined, true)).then(function () {
5656
$("#listOfTestDataLib_wrapper div.ColVis .ColVis_MasterButton").addClass("btn btn-default");
57+
refreshPopoverDocumentation("testDataLibList");
5758
});
5859

5960
}

source/src/main/webapp/js/transversalobject/ApplicationObject.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ function initModalApplicationObject(page, application) {
5252
$("[name='objectField']").html(doc.getDocOnline("page_applicationObject", "Object"));
5353
$("[name='applicationField']").html(doc.getDocOnline("page_applicationObject", "Application"));
5454
$("[name='screenshotfilenameField']").html(doc.getDocOnline("page_applicationObject", "ScreenshotFileName"));
55+
$("[name='xOffsetField']").html(doc.getDocOnline("page_applicationObject", "XOffset"));
56+
$("[name='yOffsetField']").html(doc.getDocOnline("page_applicationObject", "YOffset"));
5557

5658
//displayApplicationList('application', undefined, application, undefined);
5759
$('[name="application"]').select2(getComboConfigApplication(false));
@@ -67,6 +69,9 @@ function initModalApplicationObject(page, application) {
6769
});
6870

6971
setUpDragAndDrop('#editApplicationObjectModal');
72+
73+
refreshPopoverDocumentation("editApplicationObjectModal");
74+
7075
}
7176

7277
function editApplicationObjectClick(applicationObject, value) {
@@ -151,12 +156,12 @@ function confirmApplicationObjectModalHandler(page, mode) {
151156
// data = JSON.parse(data);
152157
if (getAlertType(data.messageType) === "success") {
153158
if (page == "applicationObject") {
154-
159+
155160
var oTable = $("#applicationObjectsTable").dataTable();
156161
oTable.fnDraw(false);
157-
162+
158163
} else if (page == "testCaseScript") {
159-
164+
160165
//TestCaseScript.js must be loaded so getTags exist
161166
var Tags = getTags();
162167
for (var i = 0; i < Tags.length; i++) {
@@ -165,7 +170,7 @@ function confirmApplicationObjectModalHandler(page, mode) {
165170
}
166171
}
167172
$("div.step-action .content div.fieldRow div:nth-child(n+2) input").trigger("input");
168-
173+
169174
}
170175
$('#editApplicationObjectModal').data("Saved", true);
171176
$('#editApplicationObjectModal').modal('hide');

source/src/main/webapp/js/transversalobject/Campaign.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function viewEntryClick(param) {
248248
formEdit.modal('show');
249249

250250
});
251-
251+
refreshPopoverDocumentation("editTestcampaignModal");
252252
}
253253

254254
function viewStatEntryClick(param) {
@@ -1147,7 +1147,7 @@ function loadSchedulerTable(name) {
11471147
appendSchedulerRow(obj);
11481148
});
11491149
}
1150-
1150+
refreshPopoverDocumentation("schedulerTable");
11511151
}
11521152

11531153
function loadEventHookTable(name) {
@@ -1159,7 +1159,7 @@ function loadEventHookTable(name) {
11591159
appendEventHookRow(obj);
11601160
});
11611161
}
1162-
1162+
refreshPopoverDocumentation("eventHookTable");
11631163
}
11641164

11651165

@@ -1361,6 +1361,7 @@ function addNewSchedulerRow() {
13611361
toDelete: false
13621362
};
13631363
appendSchedulerRow(newScheduler);
1364+
refreshPopoverDocumentation("schedulerTable");
13641365

13651366
}
13661367

@@ -1378,5 +1379,6 @@ function addNewEventHookRow() {
13781379
toDelete: false
13791380
};
13801381
appendEventHookRow(newEventHook);
1382+
refreshPopoverDocumentation("eventHookTable");
13811383

13821384
}

source/src/main/webapp/js/transversalobject/EventHook.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ function initModalEventHook() {
4545
$("[name='tabEH1']").html(doc.getDocLabel("page_eventhook", "title"));
4646
$("[name='tabsEH25']").html(doc.getDocLabel("page_global", "traca"));
4747

48-
$("[name='eventReferenceField']").html(doc.getDocLabel("page_eventhook", "eventReference"));
49-
$("[name='isActiveField']").html(doc.getDocLabel("page_eventhook", "isActive"));
50-
$("[name='objectKey1Field']").html(doc.getDocLabel("page_eventhook", "objectKey1"));
51-
$("[name='objectKey2Field']").html(doc.getDocLabel("page_eventhook", "objectKey2"));
52-
$("[name='hookConnectorField']").html(doc.getDocLabel("page_eventhook", "hookConnector"));
53-
$("[name='hookRecipientField']").html(doc.getDocLabel("page_eventhook", "hookRecipient"));
54-
$("[name='hookChannelField']").html(doc.getDocLabel("page_eventhook", "hookChannel"));
55-
$("[name='descriptionField']").html(doc.getDocLabel("page_eventhook", "description"));
48+
$("[name='eventReferenceField']").html(doc.getDocOnline("page_eventhook", "eventReference"));
49+
$("[name='isActiveField']").html(doc.getDocOnline("page_eventhook", "isActive"));
50+
$("[name='objectKey1Field']").html(doc.getDocOnline("page_eventhook", "objectKey1"));
51+
$("[name='objectKey2Field']").html(doc.getDocOnline("page_eventhook", "objectKey2"));
52+
$("[name='hookConnectorField']").html(doc.getDocOnline("page_eventhook", "hookConnector"));
53+
$("[name='hookRecipientField']").html(doc.getDocOnline("page_eventhook", "hookRecipient"));
54+
$("[name='hookChannelField']").html(doc.getDocOnline("page_eventhook", "hookChannel"));
55+
$("[name='descriptionField']").html(doc.getDocOnline("page_eventhook", "description"));
5656

5757
$("[name='lbl_created']").html(doc.getDocOnline("transversal", "DateCreated"));
5858
$("[name='lbl_creator']").html(doc.getDocOnline("transversal", "UsrCreated"));
@@ -234,6 +234,7 @@ function feedEventHookModal(eventid, modalId, mode) {
234234
} else {
235235
showUnexpectedError();
236236
}
237+
refreshPopoverDocumentation("editEventHookModal");
237238
},
238239
error: showUnexpectedError
239240
});

0 commit comments

Comments
 (0)