@wavemaker-ai/app-ng-runtime 12.1.0-rc.647821 → 12.1.1-rc.352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-task/fesm2022/index.mjs.map +1 -1
- package/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
- package/components/advanced/custom/fesm2022/index.mjs.map +1 -1
- package/components/advanced/login/fesm2022/index.mjs.map +1 -1
- package/components/advanced/marquee/fesm2022/index.mjs.map +1 -1
- package/components/base/bundles/index.umd.js +0 -6
- package/components/base/fesm2022/index.mjs +0 -6
- package/components/base/fesm2022/index.mjs.map +1 -1
- package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
- package/components/basic/audio/fesm2022/index.mjs.map +1 -1
- package/components/basic/html/fesm2022/index.mjs.map +1 -1
- package/components/basic/icon/fesm2022/index.mjs.map +1 -1
- package/components/basic/iframe/fesm2022/index.mjs.map +1 -1
- package/components/basic/label/bundles/index.umd.js +1 -1
- package/components/basic/label/fesm2022/index.mjs +2 -2
- package/components/basic/label/fesm2022/index.mjs.map +1 -1
- package/components/basic/picture/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-bar/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-circle/fesm2022/index.mjs.map +1 -1
- package/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
- package/components/basic/search/fesm2022/index.mjs.map +1 -1
- package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
- package/components/basic/tree/fesm2022/index.mjs.map +1 -1
- package/components/basic/video/fesm2022/index.mjs.map +1 -1
- package/components/chart/fesm2022/index.mjs.map +1 -1
- package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
- package/components/containers/layout-grid/fesm2022/index.mjs.map +1 -1
- package/components/containers/linear-layout/fesm2022/index.mjs.map +1 -1
- package/components/containers/panel/fesm2022/index.mjs.map +1 -1
- package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
- package/components/containers/tile/fesm2022/index.mjs.map +1 -1
- package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
- package/components/data/card/fesm2022/index.mjs.map +1 -1
- package/components/data/form/fesm2022/index.mjs.map +1 -1
- package/components/data/list/bundles/index.umd.js +5 -5
- package/components/data/list/fesm2022/index.mjs +5 -5
- package/components/data/list/fesm2022/index.mjs.map +1 -1
- package/components/data/live-table/fesm2022/index.mjs.map +1 -1
- package/components/data/pagination/bundles/index.umd.js +2 -1
- package/components/data/pagination/fesm2022/index.mjs +2 -1
- package/components/data/pagination/fesm2022/index.mjs.map +1 -1
- package/components/data/table/bundles/index.umd.js +73 -7
- package/components/data/table/fesm2022/index.mjs +73 -7
- package/components/data/table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/types/index.d.ts +10 -0
- package/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/login-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
- package/components/input/base-form/fesm2022/index.mjs.map +1 -1
- package/components/input/base-form-custom/fesm2022/index.mjs.map +1 -1
- package/components/input/button/fesm2022/index.mjs.map +1 -1
- package/components/input/button-group/fesm2022/index.mjs.map +1 -1
- package/components/input/calendar/fesm2022/index.mjs.map +1 -1
- package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
- package/components/input/checkboxset/fesm2022/index.mjs.map +1 -1
- package/components/input/chips/fesm2022/index.mjs.map +1 -1
- package/components/input/color-picker/fesm2022/index.mjs.map +1 -1
- package/components/input/composite/fesm2022/index.mjs.map +1 -1
- package/components/input/currency/fesm2022/index.mjs.map +1 -1
- package/components/input/dataset-aware-form/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/base-date-time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date-time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date-time-picker/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/picker/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/time/fesm2022/index.mjs.map +1 -1
- package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
- package/components/input/number/fesm2022/index.mjs.map +1 -1
- package/components/input/radioset/fesm2022/index.mjs.map +1 -1
- package/components/input/rating/fesm2022/index.mjs.map +1 -1
- package/components/input/select/fesm2022/index.mjs.map +1 -1
- package/components/input/slider/fesm2022/index.mjs.map +1 -1
- package/components/input/switch/fesm2022/index.mjs.map +1 -1
- package/components/input/text/fesm2022/index.mjs.map +1 -1
- package/components/input/textarea/fesm2022/index.mjs.map +1 -1
- package/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
- package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
- package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
- package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
- package/components/page/default/fesm2022/index.mjs.map +1 -1
- package/components/page/footer/fesm2022/index.mjs.map +1 -1
- package/components/page/header/fesm2022/index.mjs.map +1 -1
- package/components/page/left-panel/fesm2022/index.mjs.map +1 -1
- package/components/page/right-panel/fesm2022/index.mjs.map +1 -1
- package/components/page/top-nav/fesm2022/index.mjs.map +1 -1
- package/components/prefab/fesm2022/index.mjs.map +1 -1
- package/core/fesm2022/index.mjs.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/oAuth/fesm2022/index.mjs.map +1 -1
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/runtime/base/bundles/index.umd.js +44 -22
- package/runtime/base/fesm2022/index.mjs +44 -22
- package/runtime/base/fesm2022/index.mjs.map +1 -1
- package/runtime/base/types/index.d.ts +7 -4
- package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- package/scripts/datatable/datatable.js +237 -21
- package/security/fesm2022/index.mjs.map +1 -1
- package/variables/fesm2022/index.mjs.map +1 -1
|
@@ -742,6 +742,10 @@ $.widget('wm.datatable', {
|
|
|
742
742
|
colExpression = colDef.customExpression,
|
|
743
743
|
styles = "text-align: " + colDef.textAlignment + ";position: relative;"
|
|
744
744
|
|
|
745
|
+
if (!_.isUndefined(colDef.show) && !colDef.show) {
|
|
746
|
+
styles += "display: none;";
|
|
747
|
+
}
|
|
748
|
+
|
|
745
749
|
$htm = $('<td class="' + classes + '" data-col-id="' + colId + '" role="cell" tabindex="0"></td>');
|
|
746
750
|
this._setStyles($htm, styles);
|
|
747
751
|
|
|
@@ -1137,6 +1141,144 @@ $.widget('wm.datatable', {
|
|
|
1137
1141
|
this._setGridEditMode(false);
|
|
1138
1142
|
this.toggleNewRowActions(false);
|
|
1139
1143
|
},
|
|
1144
|
+
/*
|
|
1145
|
+
* Updates internal state (options.data, preparedData, custom expressions,
|
|
1146
|
+
* conditional class watchers, and summary row) without a full DOM re-render.
|
|
1147
|
+
* Used during quickedit inline save for model variables to avoid focus loss.
|
|
1148
|
+
*/
|
|
1149
|
+
softRefreshData: function (newData) {
|
|
1150
|
+
// With pagination, navigator / selection can emit the same page twice in one
|
|
1151
|
+
// save cycle. Full refresh skipped duplicate data via isEqual on option set;
|
|
1152
|
+
// soft refresh must do the same or onDataRender (datarender) fires twice.
|
|
1153
|
+
if (this.options.data && newData && _.isEqual(this.options.data, newData)) {
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
var self = this,
|
|
1158
|
+
isScrollOrOnDemand = this.options.isNavTypeScrollOrOndemand(),
|
|
1159
|
+
pageStartIndex = this.getPageStartIndex(),
|
|
1160
|
+
startRowIndex = this.options.startRowIndex || 0,
|
|
1161
|
+
selectedMap = {},
|
|
1162
|
+
preparedData;
|
|
1163
|
+
|
|
1164
|
+
// Preserve _selected state before _prepareData rebuilds preparedData
|
|
1165
|
+
this.preparedData.forEach(function (data, i) {
|
|
1166
|
+
if (data._selected) {
|
|
1167
|
+
selectedMap[i] = true;
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
this.options.data = newData;
|
|
1172
|
+
this._prepareData();
|
|
1173
|
+
|
|
1174
|
+
// Restore _selected state on new preparedData
|
|
1175
|
+
Object.keys(selectedMap).forEach(function (i) {
|
|
1176
|
+
if (self.preparedData[i]) {
|
|
1177
|
+
self.preparedData[i]._selected = true;
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
if (isScrollOrOnDemand) {
|
|
1182
|
+
preparedData = this.preparedData.slice(pageStartIndex);
|
|
1183
|
+
} else {
|
|
1184
|
+
preparedData = this.preparedData;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
// Update existing custom expression view contexts in-place
|
|
1188
|
+
// so Angular change detection picks up new data without DOM manipulation.
|
|
1189
|
+
if (_.isFunction(this.options.updateCustomExpressionContexts)) {
|
|
1190
|
+
this.options.updateCustomExpressionContexts(preparedData);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
// Update plain text cells with fresh data from preparedData.
|
|
1194
|
+
// hideRowEditMode runs before softRefreshData and may restore cells
|
|
1195
|
+
// before preparedData is updated, leaving them with stale values.
|
|
1196
|
+
self.gridElement.find('tr.' + self.options.cssClassNames.tableRow + ':not(.always-new-row)').each(function () {
|
|
1197
|
+
var $row = $(this),
|
|
1198
|
+
rowId = +$row.attr('data-row-id'),
|
|
1199
|
+
rowData = self.preparedData[rowId];
|
|
1200
|
+
if (!rowData) return;
|
|
1201
|
+
|
|
1202
|
+
$row.find('td.' + self.options.cssClassNames.tableCell + ':not(.cell-editing)').each(function () {
|
|
1203
|
+
var $cell = $(this),
|
|
1204
|
+
colId = +$cell.attr('data-col-id'),
|
|
1205
|
+
colDef = self.preparedHeaderData[colId],
|
|
1206
|
+
value;
|
|
1207
|
+
|
|
1208
|
+
if (colDef && !colDef.customExpression && colDef.type !== 'custom') {
|
|
1209
|
+
value = _.get(rowData, colDef.field);
|
|
1210
|
+
var newText;
|
|
1211
|
+
if (self.Utils.isDefined(value) && value !== null) {
|
|
1212
|
+
newText = '' + value;
|
|
1213
|
+
} else if (self.options.filterNullRecords && value === null) {
|
|
1214
|
+
newText = 'null';
|
|
1215
|
+
} else {
|
|
1216
|
+
newText = '';
|
|
1217
|
+
}
|
|
1218
|
+
if ($cell.text() !== newText) {
|
|
1219
|
+
$cell.text(newText);
|
|
1220
|
+
$cell.attr('title', newText);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
});
|
|
1225
|
+
|
|
1226
|
+
// Re-register conditional class watchers with fresh row clones
|
|
1227
|
+
_.forEach(preparedData, function (row, index) {
|
|
1228
|
+
var _row = _.clone(row),
|
|
1229
|
+
rowIndex = isScrollOrOnDemand ? startRowIndex + index - 1 : index;
|
|
1230
|
+
_row.$index = rowIndex + 1;
|
|
1231
|
+
|
|
1232
|
+
self.options.registerRowNgClassWatcher(_row, rowIndex);
|
|
1233
|
+
|
|
1234
|
+
self.preparedHeaderData.forEach(function (colDef, colId) {
|
|
1235
|
+
self.options.registerColNgClassWatcher(_row, colDef, rowIndex, colId);
|
|
1236
|
+
});
|
|
1237
|
+
});
|
|
1238
|
+
|
|
1239
|
+
// Reset action state flags (mirrors _getGridTemplate cleanup)
|
|
1240
|
+
if (!this.options.isdynamictable) {
|
|
1241
|
+
this.options.setLastActionPerformed(this.options.ACTIONS.DEFAULT);
|
|
1242
|
+
this.options.setIsDataUpdatedByUser(false);
|
|
1243
|
+
this.options.clearActionRowIndex();
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// Refresh row action buttons and expansion buttons with updated row data.
|
|
1247
|
+
// Scope to data rows only — exclude always-new-row which has no backing data entry.
|
|
1248
|
+
var $dataRows = self.gridElement.find('tr.' + self.options.cssClassNames.tableRow + ':not(.always-new-row)');
|
|
1249
|
+
this.options.clearRowActions();
|
|
1250
|
+
this._appendRowExpansionButtons($dataRows);
|
|
1251
|
+
this._appendRowActions($dataRows);
|
|
1252
|
+
// Regenerated action / expansion DOM — re-bind handlers (attachEventHandlers only runs on full render).
|
|
1253
|
+
this._bindRowActionsAndExpansionClickHandlers($dataRows);
|
|
1254
|
+
|
|
1255
|
+
// Re-render summary row if present
|
|
1256
|
+
if (this.options.summaryRow) {
|
|
1257
|
+
var $summaryRowHtm = $(this._getSummaryRowTemplate());
|
|
1258
|
+
this.tableContainer.find('tfoot').remove();
|
|
1259
|
+
if (this.options.data.length) {
|
|
1260
|
+
this.tableContainer.append($summaryRowHtm);
|
|
1261
|
+
}
|
|
1262
|
+
this.gridFooter = this.tableContainer.find('tfoot');
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
// Invalidate row detail (expansion) cache so collapse+re-expand
|
|
1266
|
+
// creates fresh views with updated data.
|
|
1267
|
+
if (_.isFunction(this.options.invalidateRowDetailCache)) {
|
|
1268
|
+
this.options.invalidateRowDetailCache(preparedData);
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
// Refresh this.items with fresh data references from the updated dataset
|
|
1272
|
+
// so that selecteditem / currentItem reflect the new values.
|
|
1273
|
+
if (_.isFunction(this.options.refreshSelectedItems)) {
|
|
1274
|
+
this.options.refreshSelectedItems();
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
// Fire datarender event callback
|
|
1278
|
+
if (_.isFunction(this.options.onDataRender)) {
|
|
1279
|
+
this.options.onDataRender();
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1140
1282
|
//Populate row data with default data
|
|
1141
1283
|
setDefaultRowData: function (rowData) {
|
|
1142
1284
|
_.forEach(this.preparedHeaderData, function (colDef) {
|
|
@@ -2031,8 +2173,8 @@ $.widget('wm.datatable', {
|
|
|
2031
2173
|
let $firstEl,
|
|
2032
2174
|
$target = e && $(e.target),
|
|
2033
2175
|
$focusEl;
|
|
2034
|
-
//If focused directly on the cell, focus the input in the cell
|
|
2035
|
-
if ($target && $target.hasClass('app-datagrid-cell')) {
|
|
2176
|
+
//If focused directly on the cell, focus the input in the cell (only when the element is still in the DOM)
|
|
2177
|
+
if ($target && $target.hasClass('app-datagrid-cell') && document.body.contains($target[0])) {
|
|
2036
2178
|
$firstEl = $target.find('input');
|
|
2037
2179
|
} else {
|
|
2038
2180
|
if (!$el) {
|
|
@@ -2082,9 +2224,9 @@ $.widget('wm.datatable', {
|
|
|
2082
2224
|
this.toggleNewRowActions(false);
|
|
2083
2225
|
},
|
|
2084
2226
|
//Method to save a row which is in editable state
|
|
2085
|
-
saveRow: function (callBack) {
|
|
2227
|
+
saveRow: function (callBack, skipFocus) {
|
|
2086
2228
|
this.gridElement.find('tr.app-datagrid-row.row-editing:not(.always-new-row)').each(function () {
|
|
2087
|
-
$(this).trigger('click', [undefined, {action: 'save', skipSelect: true, noMsg: true, success: callBack}]);
|
|
2229
|
+
$(this).trigger('click', [undefined, {action: 'save', skipSelect: true, noMsg: true, skipFocus: skipFocus, success: callBack}]);
|
|
2088
2230
|
});
|
|
2089
2231
|
},
|
|
2090
2232
|
//Method to make row editable with widgets
|
|
@@ -2229,7 +2371,8 @@ $.widget('wm.datatable', {
|
|
|
2229
2371
|
if (_.isFunction(options.success)) {
|
|
2230
2372
|
options.success(skipFocus, error);
|
|
2231
2373
|
}
|
|
2232
|
-
|
|
2374
|
+
// [WMS-31104] Do not refocus this table when the save was initiated from outside (e.g. clicking another table).
|
|
2375
|
+
if (!skipFocus && !options.skipFocus && (!advancedEdit || self.options.actionsEnabled.edit)) {
|
|
2233
2376
|
self.focusActiveRow();
|
|
2234
2377
|
}
|
|
2235
2378
|
}
|
|
@@ -2256,6 +2399,43 @@ $.widget('wm.datatable', {
|
|
|
2256
2399
|
});
|
|
2257
2400
|
return;
|
|
2258
2401
|
}
|
|
2402
|
+
if (advancedEdit) {
|
|
2403
|
+
// [WMS-31104] Close/save row in another quick-edit table before editing this row.
|
|
2404
|
+
$(document).find('tr.app-datagrid-row.always-new-row.row-editing').filter(function () {
|
|
2405
|
+
return $(this).closest(self.element).length === 0;
|
|
2406
|
+
}).each(function () {
|
|
2407
|
+
var $newRow = $(this),
|
|
2408
|
+
$otherGrid = $newRow.closest('.app-datagrid');
|
|
2409
|
+
if ($otherGrid.length) {
|
|
2410
|
+
$otherGrid.datatable('resetNewRow', $newRow);
|
|
2411
|
+
}
|
|
2412
|
+
});
|
|
2413
|
+
// [WMS-31104] Save the editing row in another table before opening the clicked row in this table.
|
|
2414
|
+
var $otherEditingRow = $(document).find('tr.app-datagrid-row.row-editing:not(.always-new-row)').filter(function () {
|
|
2415
|
+
return $(this).closest(self.element).length === 0;
|
|
2416
|
+
}).first();
|
|
2417
|
+
if ($otherEditingRow.length) {
|
|
2418
|
+
var rowId = $row.attr('data-row-id');
|
|
2419
|
+
$otherEditingRow.trigger('click', [undefined, {
|
|
2420
|
+
action: 'save',
|
|
2421
|
+
$row: $otherEditingRow,
|
|
2422
|
+
skipSelect: true,
|
|
2423
|
+
noMsg: true,
|
|
2424
|
+
skipFocus: true,
|
|
2425
|
+
success: function () {
|
|
2426
|
+
var $liveRow = self.gridElement.find('tr.app-datagrid-row[data-row-id="' + rowId + '"]');
|
|
2427
|
+
var $targetRow = $liveRow.length ? $liveRow : $row;
|
|
2428
|
+
self.toggleEditRow(e, _.extend({}, options, {
|
|
2429
|
+
action: 'edit',
|
|
2430
|
+
$row: $targetRow,
|
|
2431
|
+
skipFocus: true,
|
|
2432
|
+
focusAfterCrossTableSave: true
|
|
2433
|
+
}));
|
|
2434
|
+
}
|
|
2435
|
+
}]);
|
|
2436
|
+
return;
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2259
2439
|
$row.addClass('row-editing');
|
|
2260
2440
|
if (_.isFunction(this.options.beforeRowUpdate)) {
|
|
2261
2441
|
this.options.beforeRowUpdate(rowData, e);
|
|
@@ -2296,6 +2476,12 @@ $.widget('wm.datatable', {
|
|
|
2296
2476
|
if (_.isFunction(this.options.onFormRender)) {
|
|
2297
2477
|
this.options.onFormRender($row, e, options.operation || action, $row.hasClass('always-new-row'));
|
|
2298
2478
|
}
|
|
2479
|
+
// [WMS-31104] Focus target row after widgets render when edit opened from another table save.
|
|
2480
|
+
if (options.focusAfterCrossTableSave) {
|
|
2481
|
+
self.options.timeoutCall(function () {
|
|
2482
|
+
self.setFocusOnElement(undefined, $row.find('td.cell-editing'), true);
|
|
2483
|
+
});
|
|
2484
|
+
}
|
|
2299
2485
|
} else {
|
|
2300
2486
|
$editableElements = $row.find('td.cell-editing');
|
|
2301
2487
|
isNewRow = self._isNewRow($row);
|
|
@@ -2308,6 +2494,10 @@ $.widget('wm.datatable', {
|
|
|
2308
2494
|
}
|
|
2309
2495
|
|
|
2310
2496
|
if (isDataChanged) {
|
|
2497
|
+
editOptions.skipFocus = options.skipFocus;
|
|
2498
|
+
if (options.skipFocus) {
|
|
2499
|
+
self.options.activeRow = undefined;
|
|
2500
|
+
}
|
|
2311
2501
|
$editableElements.each(function () {
|
|
2312
2502
|
let $el = $(this),
|
|
2313
2503
|
colId = $el.attr('data-col-id'),
|
|
@@ -2930,6 +3120,28 @@ $.widget('wm.datatable', {
|
|
|
2930
3120
|
this.sortHandler(event);
|
|
2931
3121
|
}
|
|
2932
3122
|
},
|
|
3123
|
+
/**
|
|
3124
|
+
* Binds jQuery handlers on save/cancel row-action buttons and row-expansion controls.
|
|
3125
|
+
* Must run after DOM for those controls is replaced (e.g. softRefreshData).
|
|
3126
|
+
*/
|
|
3127
|
+
_bindRowActionsAndExpansionClickHandlers: function ($scope) {
|
|
3128
|
+
var self = this;
|
|
3129
|
+
if (this.options.rowActions.length) {
|
|
3130
|
+
$scope.find('.cancel-edit-row-button').off('click');
|
|
3131
|
+
$scope.find('.save-edit-row-button').off('click');
|
|
3132
|
+
$scope.find('.cancel-edit-row-button').on('click', {action: 'cancel'}, this.toggleEditRow.bind(this));
|
|
3133
|
+
$scope.find('.save-edit-row-button').on('click', {action: 'save'}, this.toggleEditRow.bind(this));
|
|
3134
|
+
}
|
|
3135
|
+
$scope.find('[data-identifier="rowExpansionButtons"]').off('click');
|
|
3136
|
+
$scope.find('[data-identifier="rowExpansionButtons"]').on('click', function (e) {
|
|
3137
|
+
var $row = $(e.target).closest('tr.app-datagrid-row');
|
|
3138
|
+
if ($(this).find('.app-button').attr('disabled')) {
|
|
3139
|
+
return;
|
|
3140
|
+
}
|
|
3141
|
+
self.toggleExpandRow(+$row.attr('data-row-id'), undefined, e);
|
|
3142
|
+
});
|
|
3143
|
+
},
|
|
3144
|
+
|
|
2933
3145
|
/* Attaches all event handlers for the table. */
|
|
2934
3146
|
attachEventHandlers: function ($htm) {
|
|
2935
3147
|
const self = this;
|
|
@@ -2956,12 +3168,7 @@ $.widget('wm.datatable', {
|
|
|
2956
3168
|
|
|
2957
3169
|
this._attachHeaderEventHandlers();
|
|
2958
3170
|
|
|
2959
|
-
|
|
2960
|
-
$htm.find('.cancel-edit-row-button').off('click');
|
|
2961
|
-
$htm.find('.save-edit-row-button').off('click');
|
|
2962
|
-
$htm.find('.cancel-edit-row-button').on('click', {action: 'cancel'}, this.toggleEditRow.bind(this));
|
|
2963
|
-
$htm.find('.save-edit-row-button').on('click', {action: 'save'}, this.toggleEditRow.bind(this));
|
|
2964
|
-
}
|
|
3171
|
+
this._bindRowActionsAndExpansionClickHandlers($htm);
|
|
2965
3172
|
if (self.options.editmode === self.CONSTANTS.QUICK_EDIT) {
|
|
2966
3173
|
$htm.on('focus', 'tr.app-datagrid-row', function (e) {
|
|
2967
3174
|
const $row = $(e.currentTarget);
|
|
@@ -2988,6 +3195,25 @@ $.widget('wm.datatable', {
|
|
|
2988
3195
|
isRelatedGridDifferent = relatedGrid && relatedGridId !== currentGridId,
|
|
2989
3196
|
invalidTargets = '.row-editing:not(".always-new-row"), .row-action-button, .app-datagrid-cell, .caption, button.btn-time, button.btn-date';
|
|
2990
3197
|
|
|
3198
|
+
// [WMS-31104] Do not insert the new row when focus moves to another table; that table's row-click handler will reset it.
|
|
3199
|
+
if ($row.hasClass('always-new-row')
|
|
3200
|
+
&& $relatedTarget.length
|
|
3201
|
+
&& !$relatedTarget.closest(self.element).length
|
|
3202
|
+
&& $relatedTarget.closest('.app-datagrid').length) {
|
|
3203
|
+
return;
|
|
3204
|
+
}
|
|
3205
|
+
// Focus moved to a date/time picker — the row is still being edited, do not save.
|
|
3206
|
+
if ($relatedTarget.closest('bs-datepicker-container, .btn-date, .btn-time').length) {
|
|
3207
|
+
return;
|
|
3208
|
+
}
|
|
3209
|
+
// [WMS-31104] For regular rows, do not save on focusout when focus leaves this table; the outside-click handler handles it.
|
|
3210
|
+
// The new row (always-new-row) is excluded from this guard so Tab-key save still works when focus moves to pagination.
|
|
3211
|
+
if (!$row.hasClass('always-new-row')
|
|
3212
|
+
&& $relatedTarget.length
|
|
3213
|
+
&& !$relatedTarget.closest(self.element).length) {
|
|
3214
|
+
return;
|
|
3215
|
+
}
|
|
3216
|
+
|
|
2991
3217
|
//Check if the focus out element is outside the grid or some special elements
|
|
2992
3218
|
function isInvalidTarget() {
|
|
2993
3219
|
// If relatedTarget is not in any grid, it's invalid (outside all tables)
|
|
@@ -3037,16 +3263,6 @@ $.widget('wm.datatable', {
|
|
|
3037
3263
|
});
|
|
3038
3264
|
});
|
|
3039
3265
|
}
|
|
3040
|
-
|
|
3041
|
-
// row selection
|
|
3042
|
-
$htm.find('[data-identifier="rowExpansionButtons"]').off("click");
|
|
3043
|
-
$htm.find('[data-identifier="rowExpansionButtons"]').on('click', function (e) {
|
|
3044
|
-
const $row = $(e.target).closest('tr.app-datagrid-row');
|
|
3045
|
-
if ($(this).find('.app-button').attr('disabled')) {
|
|
3046
|
-
return;
|
|
3047
|
-
}
|
|
3048
|
-
self.toggleExpandRow(+$row.attr('data-row-id'), undefined, e);
|
|
3049
|
-
});
|
|
3050
3266
|
},
|
|
3051
3267
|
/**
|
|
3052
3268
|
* Function which attaches all event handlers specifically for the table header.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../projects/security/src/security.service.ts"],"sourcesContent":["import { Injectable, Injector, OnDestroy } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport {\n AbstractHttpService,\n App,\n getClonedObject,\n getWmProjectProperties,\n triggerFn\n} from '@wm/core';\nimport {each, forEach, get, isEmpty, join, set} from \"lodash-es\";\ndeclare const _WM_APP_PROPERTIES;\n// Todo[Shubham]: Move below constants to a common file\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\n\n@Injectable()\nexport class SecurityService implements OnDestroy {\n config;\n lastLoggedInUser;\n loggedInUser;\n loadPromise: Promise<any>;\n requestQueue: any = {};\n private queryParamsSubscriptions: Array<{ unsubscribe: () => void }> = []; // MEMORY LEAK FIX: Track subscriptions\n private appSubscriptions: Array<() => void> = []; // MEMORY LEAK FIX: Track App subscriptions\n\n constructor(\n private readonly injector: Injector,\n private readonly $http: AbstractHttpService,\n private readonly routerService: Router,\n private readonly activatedRoute: ActivatedRoute,\n private readonly _location: Location\n ) {}\n\n isLoaded() {\n return this.config;\n }\n\n get() {\n return this.config;\n }\n\n load(forceFlag?: boolean) {\n if(this.loadPromise) {return this.loadPromise;}\n // Check securityEnabled flag in _WM_APP_PROPERTIES\n if (!_WM_APP_PROPERTIES?.securityEnabled) {\n return Promise.resolve(null);\n }\n if (!forceFlag && this.config) {return Promise.resolve(this.config);}\n this.loadPromise = new Promise((resolve, reject) => {\n this.$http.send({'url': 'services/security/info', 'method': 'GET'}).then((response) => {\n this.config = response.body;\n _WM_APP_PROPERTIES['securityInfo'] = this.config\n this.lastLoggedInUser = getClonedObject(this.loggedInUser);\n this.loggedInUser = this.config.userInfo;\n resolve(response.body);\n }).catch((err)=>{\n reject(err);\n }).finally(()=>{\n this.loadPromise = null;\n });\n });\n return this.loadPromise;\n }\n\n /**\n * gets the security config from the deployed app (backend call)\n * @param success\n * @param error\n */\n getWebConfig(success, error) {\n if (this.get()) {\n // if already fetched, return it\n triggerFn(success, this.get());\n return;\n }\n this.load()\n .then(config => {\n triggerFn(success, config);\n }, error);\n }\n\n /**\n * Returns security config\n * @param successCallback\n * @param failureCallback\n */\n getConfig(successCallback, failureCallback) {\n function invokeQueuedCallbacks(id, method, data) {\n forEach(this.requestQueue[id], fn => triggerFn(fn[method], data));\n this.requestQueue[id] = null;\n }\n\n function onSuccess(config) {\n config = config ? config : {}\n config.homePage = getWmProjectProperties().homePage;\n if (config.userInfo) {\n // Backend returns landingPage instead of homePage, hence this statement(for consistency)\n // config.userInfo.homePage = config.userInfo.landingPage;\n }\n this.config = config;\n this.lastLoggedInUser = getClonedObject(this.loggedInUser);\n this.loggedInUser = config.userInfo;\n invokeQueuedCallbacks.call(this, 'config', 'success', this.get());\n }\n\n function onError(error) {\n /*if ($rootScope.isMobileApplicationType) {\n this.config = {\n 'securityEnabled': false,\n 'authenticated': false,\n 'homePage': _WM_APP_PROPERTIES.homePage,\n 'userInfo': null,\n 'login': null\n };\n invokeQueuedCallbacks('config', 'success', this.get());\n } else {*/\n invokeQueuedCallbacks.call(this, 'config', 'error', error);\n // }\n }\n\n if (this.get()) {\n // if already fetched, return it\n triggerFn(successCallback, this.get());\n return;\n }\n\n // Queue check, if same queue is already in progress, do not send another request\n this.requestQueue.config = this.requestQueue.config || [];\n this.requestQueue.config.push({\n success: successCallback,\n error: failureCallback\n });\n if (this.requestQueue.config.length > 1) {\n return;\n }\n\n // for web project, return config returned from backend API call.\n this.getWebConfig(onSuccess.bind(this), onError.bind(this));\n /* else {\n /!*\n * for mobile app, first get the mobile config (saved in the apk)\n * - if security not enabled, just return mobile config (no backend call required)\n * - else, get Web config (will be the same API hit for login) and merge the config with _mobileconfig\n *!/\n getMobileConfig(function (mobileconfig) {\n if (!mobileconfig.securityEnabled) {\n onSuccess(mobileconfig);\n } else {\n getWebConfig(function (config) {\n config = mergeWebAndMobileConfig(config);\n onSuccess(config);\n }, function () {onSuccess(mobileconfig); });\n }\n }, onError);\n }*/\n }\n\n getLastLoggedInUsername() {\n return this.lastLoggedInUser?.userName;\n }\n\n /**\n * Returns the current page name\n * @returns {string}\n */\n getCurrentRoutePage() {\n const p = this._location.path();\n let lIndex = p.indexOf('?');\n lIndex = lIndex === -1 ? p.length : lIndex - 1;\n return p.substr(1, lIndex); // ignore the query params\n }\n\n /**\n * Returns Query params for specified param name in current Route\n * @param paramName, the param name whose query param value is to be retrieved\n * @returns {any}\n */\n getCurrentRouteQueryParam(paramName) {\n let paramVal;\n // MEMORY LEAK FIX: Store subscription for cleanup (though this is a synchronous read)\n // Note: This method is called synchronously, so the subscription completes immediately\n // but we still store it to be safe\n const subscription = this.activatedRoute.queryParams.subscribe(params => {\n paramVal = params[paramName];\n });\n subscription.unsubscribe(); // Immediate unsubscribe since we only need first value\n return paramVal;\n }\n\n isNoPageLoaded() {\n return !isEmpty(this.getCurrentRoutePage());\n }\n\n getPageByLoggedInUser() {\n const that = this;\n return new Promise((resolve) => {\n let page;\n that.getConfig((config) => {\n if (config.securityEnabled && config.authenticated) {\n page = config.userInfo.landingPage || getWmProjectProperties().homePage;\n // override the default xsrf cookie name and xsrf header names with WaveMaker specific values\n if (that.isXsrfEnabled()) {\n // this.$http.defaults.xsrfCookieName = XSRF_COOKIE;\n // this.$http.defaults.xsrfHeaderName = config.csrfHeaderName;\n }\n } else {\n page = getWmProjectProperties().homePage;\n }\n resolve(page);\n }, function () {\n resolve(getWmProjectProperties().homePage);\n });\n });\n }\n\n /**\n * Loads the App page as follows:\n * Security disabled:\n * - Home page\n * Security enabled:\n * - User is logged in, respective landing page is loaded\n * - Not logged in:\n * - Home page is public, loads the home page\n * - Home page not public, Login page(in config) is loaded\n * @param forcePageLoad\n * @returns {Promise<T>}\n */\n loadPageByUserRole(forcePageLoad?) {\n const that = this;\n return this.getPageByLoggedInUser().then(page => {\n if (that.isNoPageLoaded() || forcePageLoad) {\n // Reload the page when current page and post login landing page are same\n if (that.getCurrentRoutePage() === page) {\n (window.location as any).reload();\n } else {\n that.routerService.navigate([`/${page}`]);\n }\n }\n });\n }\n\n /**\n * Navigates to the current user's homePage based on the config in SecurityService\n * Assumption is the SecurityService is updated with the latest security config before making call to this function\n */\n navigateOnLogin() {\n this.loadPageByUserRole(true);\n }\n\n /**\n * Gets the page which needs to be redirected to on successful login\n * @param config,\n * @param page, page name for redirection\n * @returns {any|string}\n */\n getRedirectPage(config, page?) {\n const homePage = getWmProjectProperties().homePage,\n loginPage = get(config, 'loginConfig.pageName');\n let prevRedirectPage,\n redirectPage = page || this.getCurrentRoutePage();\n\n // if user is already on Home page or Login page, they should not be redirected to that page, hence return undefined\n if (redirectPage === homePage || redirectPage === loginPage) {\n /*\n * find previous redirect page from URL, if exists, user should redirect to that page.\n * USE CASE:\n * user is on http://localhost:8080/app/#/Login?redirectTo=page\n * a variable call fails resulting 401\n * in this case, redirectTo page should be 'page' and not undefined\n */\n prevRedirectPage = this.getCurrentRouteQueryParam('redirectTo');\n redirectPage = !isEmpty(prevRedirectPage) ? prevRedirectPage : undefined;\n }\n\n return redirectPage;\n }\n\n /**\n * Returns all the query params(including page params and redirect to params) associated with redirected page\n */\n getRedirectedRouteQueryParams() {\n let queryParams = {};\n // MEMORY LEAK FIX: Store subscription for cleanup (though this is a synchronous read)\n // Note: This method is called synchronously, so the subscription completes immediately\n // but we still store it to be safe\n const subscription = this.activatedRoute.queryParams.subscribe((paramVal) => {\n forEach(paramVal, (val, key) => {\n queryParams[key] = val;\n });\n });\n subscription.unsubscribe(); // Immediate unsubscribe since we only need first value\n return queryParams;\n }\n\n // accepts query object like {a:1, b:2} and returns a=1&b=2 string\n getQueryString(queryObject) {\n const params = [];\n forEach(queryObject, function (value, key) {\n params.push(key + '=' + value);\n });\n return join(params, '&');\n }\n\n appLogin(params, successCallback, failureCallback) {\n let payload = '';\n\n // encode all parameters\n each(params, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n\n return this.$http.send({\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n url: 'j_spring_security_check',\n 'data': payload\n }).then((response) => {\n const xsrfCookieValue = response.body ? response.body[XSRF_COOKIE_NAME] : '';\n\n // override the default xsrf cookie name and xsrf header names with WaveMaker specific values\n if (xsrfCookieValue) {\n }\n // After the successful login in device, this function triggers the pending onLoginCallbacks.\n this.injector.get(App).notify('userLoggedIn', {});\n triggerFn(successCallback, response);\n }, failureCallback);\n }\n\n /**\n * The API is used to check if the user is authenticated in the RUN mode.\n *\n * @param {function} successCallback to be called on success\n * @param {function} failureCallback to be called on failure\n */\n isAuthenticated(successCallback, failureCallback) {\n this.getConfig(function (config) {\n triggerFn(successCallback, config.authenticated);\n }, failureCallback);\n }\n\n /**\n * The API is used to logout of the app.\n *\n * @param {function} successCallback to be called on success\n * @param {function} failureCallback to be called on failure\n */\n appLogout(successCallback, failureCallback) {\n return this.$http.send({\n target: 'Security',\n url: 'j_spring_security_logout',\n method: 'POST',\n responseType: 'text',\n byPassResult: true\n }).then((response) => {\n set(this.get(), 'authenticated', false);\n set(this.get(), 'userInfo', null);\n this.injector.get(App).notify('userLoggedOut', {});\n triggerFn(successCallback, response);\n }, failureCallback);\n }\n\n /**\n * Checks and return the cookie\n * @param name, cookie key\n * @returns {string}\n */\n getCookieByName(name) {\n // Todo: Shubham Implement cookie native js\n return 'cookie';\n }\n\n /**\n * This function returns the cookieValue if xsrf is enabled.\n * In device, xsrf cookie is stored in localStorage.\n * @returns xsrf cookie value\n */\n isXsrfEnabled() {\n return this.getCookieByName(XSRF_COOKIE_NAME);\n }\n\n /**\n * This function returns a promise. Promise is resolved when security is\n * 1. disabled\n * 2. enabled and user is authenticated\n * 3. enabled and user is not authenticated, then promise is resolved on user login\n * @returns {*} promise\n */\n public onUserLogin(): Promise<any> {\n return new Promise<void>((resolve, reject) => {\n this.getConfig(config => {\n if (config.securityEnabled) {\n if (config.authenticated) {\n resolve();\n } else {\n // MEMORY LEAK FIX: Store unsubscribe function for cleanup\n const unsubscribe = this.injector.get(App).subscribe('userLoggedIn', () => {\n resolve();\n unsubscribe();\n // Remove from tracking array\n const index = this.appSubscriptions.indexOf(unsubscribe);\n if (index > -1) {\n this.appSubscriptions.splice(index, 1);\n }\n });\n this.appSubscriptions.push(unsubscribe);\n }\n } else {\n resolve();\n }\n }, reject);\n });\n }\n\n /**\n * @returns a promise that is resolved with logged-in-user\n */\n getLoggedInUser() {\n return new Promise<any>((resolve, reject) => {\n this.getConfig((config) => {\n if (config?.userInfo) {\n resolve(config.userInfo);\n } else {\n reject();\n }\n }, reject);\n });\n }\n\n /**\n * This is for mobile apps to authenticate via browser.\n *\n * @returns a promise that is resolved after login\n */\n authInBrowser(): Promise<any> {\n return Promise.reject('This authInBrowser should not be called');\n }\n\n ngOnDestroy() {\n // MEMORY LEAK FIX: Unsubscribe from all query params subscriptions\n this.queryParamsSubscriptions.forEach(sub => {\n if (sub?.unsubscribe) {\n sub.unsubscribe();\n }\n });\n this.queryParamsSubscriptions = [];\n\n // MEMORY LEAK FIX: Unsubscribe from all App subscriptions\n this.appSubscriptions.forEach(unsubscribe => {\n if (unsubscribe) {\n unsubscribe();\n }\n });\n this.appSubscriptions = [];\n\n // MEMORY LEAK FIX: Clear references\n this.config = null;\n this.lastLoggedInUser = null;\n this.loggedInUser = null;\n this.requestQueue = null;\n this.loadPromise = null;\n }\n}\n"],"mappings":";;;;;;;AAcA,MAAM,mBAAmB;AAGzB,IAAa,kBAAb,MAAa,gBAAe;CASxB,YACqB,UACA,OACA,eACA,gBACA,WAAmB;EAJnB,KAAA,WAAA;EACA,KAAA,QAAA;EACA,KAAA,gBAAA;EACA,KAAA,iBAAA;EACA,KAAA,YAAA;EATrB,KAAA,eAAoB,CAAA;EACZ,KAAA,2BAA+D,CAAA;EAC/D,KAAA,mBAAsC,CAAA;CAQ3C;CAEH,WAAQ;EACJ,OAAO,KAAK;CAChB;CAEA,MAAG;EACC,OAAO,KAAK;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KAAK,WAAW,WAAU;IACtB,IAAI,QAAQ,UACR,QAAQ,OAAO,QAAQ;SAEvB,OAAM;GAEd,GAAG,MAAM;EACb,CAAC;CACL;CAOA,gBAAa;EACT,OAAO,QAAQ,OAAO,yCAAyC;CACnE;CAEA,cAAW;EAEP,KAAK,yBAAyB,SAAQ,QAAM;GACxC,IAAI,KAAK,aACL,IAAI,YAAW;EAEvB,CAAC;EACD,KAAK,2BAA2B,CAAA;EAGhC,KAAK,iBAAiB,SAAQ,gBAAc;GACxC,IAAI,aACA,YAAW;EAEnB,CAAC;EACD,KAAK,mBAAmB,CAAA;EAGxB,KAAK,SAAS;EACd,KAAK,mBAAmB;EACxB,KAAK,eAAe;EACpB,KAAK,eAAe;EACpB,KAAK,cAAc;CACvB;CA9bS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,MAAA;IAAA,EAAA,OAAA,GAAA,SAAA;IAAA,EAAA,OAAA,GAAA,oBAAA;IAAA,EAAA,OAAA,GAAA,OAAA;IAAA,EAAA,OAAA,GAAA,eAAA;IAAA,EAAA,OAAA,GAAA,SAAA;GAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAf;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAe,CAAA;CAAA;;AAAf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA,EAD3B,MAAA,WAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../projects/security/src/security.service.ts"],"sourcesContent":["import { Injectable, Injector, OnDestroy } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport {\n AbstractHttpService,\n App,\n getClonedObject,\n getWmProjectProperties,\n triggerFn\n} from '@wm/core';\nimport {each, forEach, get, isEmpty, join, set} from \"lodash-es\";\ndeclare const _WM_APP_PROPERTIES;\n// Todo[Shubham]: Move below constants to a common file\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\n\n@Injectable()\nexport class SecurityService implements OnDestroy {\n config;\n lastLoggedInUser;\n loggedInUser;\n loadPromise: Promise<any>;\n requestQueue: any = {};\n private queryParamsSubscriptions: Array<{ unsubscribe: () => void }> = []; // MEMORY LEAK FIX: Track subscriptions\n private appSubscriptions: Array<() => void> = []; // MEMORY LEAK FIX: Track App subscriptions\n\n constructor(\n private readonly injector: Injector,\n private readonly $http: AbstractHttpService,\n private readonly routerService: Router,\n private readonly activatedRoute: ActivatedRoute,\n private readonly _location: Location\n ) {}\n\n isLoaded() {\n return this.config;\n }\n\n get() {\n return this.config;\n }\n\n load(forceFlag?: boolean) {\n if(this.loadPromise) {return this.loadPromise;}\n // Check securityEnabled flag in _WM_APP_PROPERTIES\n if (!_WM_APP_PROPERTIES?.securityEnabled) {\n return Promise.resolve(null);\n }\n if (!forceFlag && this.config) {return Promise.resolve(this.config);}\n this.loadPromise = new Promise((resolve, reject) => {\n this.$http.send({'url': 'services/security/info', 'method': 'GET'}).then((response) => {\n this.config = response.body;\n _WM_APP_PROPERTIES['securityInfo'] = this.config\n this.lastLoggedInUser = getClonedObject(this.loggedInUser);\n this.loggedInUser = this.config.userInfo;\n resolve(response.body);\n }).catch((err)=>{\n reject(err);\n }).finally(()=>{\n this.loadPromise = null;\n });\n });\n return this.loadPromise;\n }\n\n /**\n * gets the security config from the deployed app (backend call)\n * @param success\n * @param error\n */\n getWebConfig(success, error) {\n if (this.get()) {\n // if already fetched, return it\n triggerFn(success, this.get());\n return;\n }\n this.load()\n .then(config => {\n triggerFn(success, config);\n }, error);\n }\n\n /**\n * Returns security config\n * @param successCallback\n * @param failureCallback\n */\n getConfig(successCallback, failureCallback) {\n function invokeQueuedCallbacks(id, method, data) {\n forEach(this.requestQueue[id], fn => triggerFn(fn[method], data));\n this.requestQueue[id] = null;\n }\n\n function onSuccess(config) {\n config = config ? config : {}\n config.homePage = getWmProjectProperties().homePage;\n if (config.userInfo) {\n // Backend returns landingPage instead of homePage, hence this statement(for consistency)\n // config.userInfo.homePage = config.userInfo.landingPage;\n }\n this.config = config;\n this.lastLoggedInUser = getClonedObject(this.loggedInUser);\n this.loggedInUser = config.userInfo;\n invokeQueuedCallbacks.call(this, 'config', 'success', this.get());\n }\n\n function onError(error) {\n /*if ($rootScope.isMobileApplicationType) {\n this.config = {\n 'securityEnabled': false,\n 'authenticated': false,\n 'homePage': _WM_APP_PROPERTIES.homePage,\n 'userInfo': null,\n 'login': null\n };\n invokeQueuedCallbacks('config', 'success', this.get());\n } else {*/\n invokeQueuedCallbacks.call(this, 'config', 'error', error);\n // }\n }\n\n if (this.get()) {\n // if already fetched, return it\n triggerFn(successCallback, this.get());\n return;\n }\n\n // Queue check, if same queue is already in progress, do not send another request\n this.requestQueue.config = this.requestQueue.config || [];\n this.requestQueue.config.push({\n success: successCallback,\n error: failureCallback\n });\n if (this.requestQueue.config.length > 1) {\n return;\n }\n\n // for web project, return config returned from backend API call.\n this.getWebConfig(onSuccess.bind(this), onError.bind(this));\n /* else {\n /!*\n * for mobile app, first get the mobile config (saved in the apk)\n * - if security not enabled, just return mobile config (no backend call required)\n * - else, get Web config (will be the same API hit for login) and merge the config with _mobileconfig\n *!/\n getMobileConfig(function (mobileconfig) {\n if (!mobileconfig.securityEnabled) {\n onSuccess(mobileconfig);\n } else {\n getWebConfig(function (config) {\n config = mergeWebAndMobileConfig(config);\n onSuccess(config);\n }, function () {onSuccess(mobileconfig); });\n }\n }, onError);\n }*/\n }\n\n getLastLoggedInUsername() {\n return this.lastLoggedInUser?.userName;\n }\n\n /**\n * Returns the current page name\n * @returns {string}\n */\n getCurrentRoutePage() {\n const p = this._location.path();\n let lIndex = p.indexOf('?');\n lIndex = lIndex === -1 ? p.length : lIndex - 1;\n return p.substr(1, lIndex); // ignore the query params\n }\n\n /**\n * Returns Query params for specified param name in current Route\n * @param paramName, the param name whose query param value is to be retrieved\n * @returns {any}\n */\n getCurrentRouteQueryParam(paramName) {\n let paramVal;\n // MEMORY LEAK FIX: Store subscription for cleanup (though this is a synchronous read)\n // Note: This method is called synchronously, so the subscription completes immediately\n // but we still store it to be safe\n const subscription = this.activatedRoute.queryParams.subscribe(params => {\n paramVal = params[paramName];\n });\n subscription.unsubscribe(); // Immediate unsubscribe since we only need first value\n return paramVal;\n }\n\n isNoPageLoaded() {\n return !isEmpty(this.getCurrentRoutePage());\n }\n\n getPageByLoggedInUser() {\n const that = this;\n return new Promise((resolve) => {\n let page;\n that.getConfig((config) => {\n if (config.securityEnabled && config.authenticated) {\n page = config.userInfo.landingPage || getWmProjectProperties().homePage;\n // override the default xsrf cookie name and xsrf header names with WaveMaker specific values\n if (that.isXsrfEnabled()) {\n // this.$http.defaults.xsrfCookieName = XSRF_COOKIE;\n // this.$http.defaults.xsrfHeaderName = config.csrfHeaderName;\n }\n } else {\n page = getWmProjectProperties().homePage;\n }\n resolve(page);\n }, function () {\n resolve(getWmProjectProperties().homePage);\n });\n });\n }\n\n /**\n * Loads the App page as follows:\n * Security disabled:\n * - Home page\n * Security enabled:\n * - User is logged in, respective landing page is loaded\n * - Not logged in:\n * - Home page is public, loads the home page\n * - Home page not public, Login page(in config) is loaded\n * @param forcePageLoad\n * @returns {Promise<T>}\n */\n loadPageByUserRole(forcePageLoad?) {\n const that = this;\n return this.getPageByLoggedInUser().then(page => {\n if (that.isNoPageLoaded() || forcePageLoad) {\n // Reload the page when current page and post login landing page are same\n if (that.getCurrentRoutePage() === page) {\n (window.location as any).reload();\n } else {\n that.routerService.navigate([`/${page}`]);\n }\n }\n });\n }\n\n /**\n * Navigates to the current user's homePage based on the config in SecurityService\n * Assumption is the SecurityService is updated with the latest security config before making call to this function\n */\n navigateOnLogin() {\n this.loadPageByUserRole(true);\n }\n\n /**\n * Gets the page which needs to be redirected to on successful login\n * @param config,\n * @param page, page name for redirection\n * @returns {any|string}\n */\n getRedirectPage(config, page?) {\n const homePage = getWmProjectProperties().homePage,\n loginPage = get(config, 'loginConfig.pageName');\n let prevRedirectPage,\n redirectPage = page || this.getCurrentRoutePage();\n\n // if user is already on Home page or Login page, they should not be redirected to that page, hence return undefined\n if (redirectPage === homePage || redirectPage === loginPage) {\n /*\n * find previous redirect page from URL, if exists, user should redirect to that page.\n * USE CASE:\n * user is on http://localhost:8080/app/#/Login?redirectTo=page\n * a variable call fails resulting 401\n * in this case, redirectTo page should be 'page' and not undefined\n */\n prevRedirectPage = this.getCurrentRouteQueryParam('redirectTo');\n redirectPage = !isEmpty(prevRedirectPage) ? prevRedirectPage : undefined;\n }\n\n return redirectPage;\n }\n\n /**\n * Returns all the query params(including page params and redirect to params) associated with redirected page\n */\n getRedirectedRouteQueryParams() {\n let queryParams = {};\n // MEMORY LEAK FIX: Store subscription for cleanup (though this is a synchronous read)\n // Note: This method is called synchronously, so the subscription completes immediately\n // but we still store it to be safe\n const subscription = this.activatedRoute.queryParams.subscribe((paramVal) => {\n forEach(paramVal, (val, key) => {\n queryParams[key] = val;\n });\n });\n subscription.unsubscribe(); // Immediate unsubscribe since we only need first value\n return queryParams;\n }\n\n // accepts query object like {a:1, b:2} and returns a=1&b=2 string\n getQueryString(queryObject) {\n const params = [];\n forEach(queryObject, function (value, key) {\n params.push(key + '=' + value);\n });\n return join(params, '&');\n }\n\n appLogin(params, successCallback, failureCallback) {\n let payload = '';\n\n // encode all parameters\n each(params, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n\n return this.$http.send({\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n },\n url: 'j_spring_security_check',\n 'data': payload\n }).then((response) => {\n const xsrfCookieValue = response.body ? response.body[XSRF_COOKIE_NAME] : '';\n\n // override the default xsrf cookie name and xsrf header names with WaveMaker specific values\n if (xsrfCookieValue) {\n }\n // After the successful login in device, this function triggers the pending onLoginCallbacks.\n this.injector.get(App).notify('userLoggedIn', {});\n triggerFn(successCallback, response);\n }, failureCallback);\n }\n\n /**\n * The API is used to check if the user is authenticated in the RUN mode.\n *\n * @param {function} successCallback to be called on success\n * @param {function} failureCallback to be called on failure\n */\n isAuthenticated(successCallback, failureCallback) {\n this.getConfig(function (config) {\n triggerFn(successCallback, config.authenticated);\n }, failureCallback);\n }\n\n /**\n * The API is used to logout of the app.\n *\n * @param {function} successCallback to be called on success\n * @param {function} failureCallback to be called on failure\n */\n appLogout(successCallback, failureCallback) {\n return this.$http.send({\n target: 'Security',\n url: 'j_spring_security_logout',\n method: 'POST',\n responseType: 'text',\n byPassResult: true\n }).then((response) => {\n set(this.get(), 'authenticated', false);\n set(this.get(), 'userInfo', null);\n this.injector.get(App).notify('userLoggedOut', {});\n triggerFn(successCallback, response);\n }, failureCallback);\n }\n\n /**\n * Checks and return the cookie\n * @param name, cookie key\n * @returns {string}\n */\n getCookieByName(name) {\n // Todo: Shubham Implement cookie native js\n return 'cookie';\n }\n\n /**\n * This function returns the cookieValue if xsrf is enabled.\n * In device, xsrf cookie is stored in localStorage.\n * @returns xsrf cookie value\n */\n isXsrfEnabled() {\n return this.getCookieByName(XSRF_COOKIE_NAME);\n }\n\n /**\n * This function returns a promise. Promise is resolved when security is\n * 1. disabled\n * 2. enabled and user is authenticated\n * 3. enabled and user is not authenticated, then promise is resolved on user login\n * @returns {*} promise\n */\n public onUserLogin(): Promise<any> {\n return new Promise<void>((resolve, reject) => {\n this.getConfig(config => {\n if (config.securityEnabled) {\n if (config.authenticated) {\n resolve();\n } else {\n // MEMORY LEAK FIX: Store unsubscribe function for cleanup\n const unsubscribe = this.injector.get(App).subscribe('userLoggedIn', () => {\n resolve();\n unsubscribe();\n // Remove from tracking array\n const index = this.appSubscriptions.indexOf(unsubscribe);\n if (index > -1) {\n this.appSubscriptions.splice(index, 1);\n }\n });\n this.appSubscriptions.push(unsubscribe);\n }\n } else {\n resolve();\n }\n }, reject);\n });\n }\n\n /**\n * @returns a promise that is resolved with logged-in-user\n */\n getLoggedInUser() {\n return new Promise<any>((resolve, reject) => {\n this.getConfig((config) => {\n if (config?.userInfo) {\n resolve(config.userInfo);\n } else {\n reject();\n }\n }, reject);\n });\n }\n\n /**\n * This is for mobile apps to authenticate via browser.\n *\n * @returns a promise that is resolved after login\n */\n authInBrowser(): Promise<any> {\n return Promise.reject('This authInBrowser should not be called');\n }\n\n ngOnDestroy() {\n // MEMORY LEAK FIX: Unsubscribe from all query params subscriptions\n this.queryParamsSubscriptions.forEach(sub => {\n if (sub?.unsubscribe) {\n sub.unsubscribe();\n }\n });\n this.queryParamsSubscriptions = [];\n\n // MEMORY LEAK FIX: Unsubscribe from all App subscriptions\n this.appSubscriptions.forEach(unsubscribe => {\n if (unsubscribe) {\n unsubscribe();\n }\n });\n this.appSubscriptions = [];\n\n // MEMORY LEAK FIX: Clear references\n this.config = null;\n this.lastLoggedInUser = null;\n this.loggedInUser = null;\n this.requestQueue = null;\n this.loadPromise = null;\n }\n}\n"],"mappings":";;;;;;;AAcA,MAAM,mBAAmB;AAGzB,IAAa,kBAAb,MAAa,gBAAe;CASxB,YACqB,UACA,OACA,eACA,gBACA,WAAmB;EAJnB,KAAA,WAAA;EACA,KAAA,QAAA;EACA,KAAA,gBAAA;EACA,KAAA,iBAAA;EACA,KAAA,YAAA;EATrB,KAAA,eAAoB,CAAA;EACZ,KAAA,2BAA+D,CAAA;EAC/D,KAAA,mBAAsC,CAAA;CAQ3C;CAEH,WAAQ;EACJ,OAAO,KAAK;CAChB;CAEA,MAAG;EACC,OAAO,KAAK;CAChB;CAEA,KAAK,WAAmB;EACpB,IAAG,KAAK,aAAc,OAAO,KAAK;EAEnC,IAAI,CAAC,oBAAoB,iBACxB,OAAO,QAAQ,QAAQ,IAAI;EAE3B,IAAI,CAAC,aAAa,KAAK,QAAS,OAAO,QAAQ,QAAQ,KAAK,MAAM;EAClE,KAAK,cAAc,IAAI,SAAS,SAAS,WAAU;GAC3C,KAAK,MAAM,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