@nettyapps/ntybase 21.0.35-beta.9 → 21.0.35
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, inject, NgModule,
|
|
2
|
+
import { Component, Injectable, inject, NgModule, input, computed, signal, output, effect, linkedSignal, ViewChild, model, Input, InjectionToken, Optional, Inject } from '@angular/core';
|
|
3
3
|
import * as i1$3 from '@angular/common/http';
|
|
4
4
|
import { HttpErrorResponse, HttpResponse, HTTP_INTERCEPTORS, HttpClient, HttpHeaders } from '@angular/common/http';
|
|
5
5
|
import { of, throwError, Subject, lastValueFrom, map, catchError as catchError$1, finalize, take as take$1, takeUntil } from 'rxjs';
|
|
6
6
|
import { catchError, map as map$1, take, finalize as finalize$1 } from 'rxjs/operators';
|
|
7
7
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
8
8
|
import * as i2$1 from '@nettyapps/ntycontract';
|
|
9
|
-
import { EnvironmentProxy, injectNettyStandardProxy, injectNettyStandardLogProxy } from '@nettyapps/ntycontract';
|
|
9
|
+
import { EnvironmentProxy, injectNettyStandardProxy, injectNettyStandardLogProxy, injectNettyStandardFilterProxy } from '@nettyapps/ntycontract';
|
|
10
10
|
import { DatePipe, CommonModule, Location, DecimalPipe } from '@angular/common';
|
|
11
11
|
import { Buffer } from 'buffer';
|
|
12
12
|
import * as i1 from '@angular/material/dialog';
|
|
@@ -422,6 +422,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
422
422
|
}], ctorParameters: () => [{ type: i1$2.MatSnackBar }, { type: i1.MatDialog }, { type: i1$1.TranslateService }] });
|
|
423
423
|
|
|
424
424
|
class NettyAppsBase {
|
|
425
|
+
// ********************************************
|
|
426
|
+
// *** INPUTS ***
|
|
427
|
+
// ********************************************
|
|
428
|
+
embedded = input(false, ...(ngDevMode ? [{ debugName: "embedded" }] : [])); // Is the form embedded to an other component
|
|
429
|
+
_isEmbedded = computed(() => this.embedded() ?? false, ...(ngDevMode ? [{ debugName: "_isEmbedded" }] : []));
|
|
425
430
|
// ---------------------------------
|
|
426
431
|
// --- SERVICES ---
|
|
427
432
|
// ---------------------------------
|
|
@@ -537,12 +542,12 @@ class NettyAppsBase {
|
|
|
537
542
|
this.onDestroy$.complete();
|
|
538
543
|
}
|
|
539
544
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
540
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
545
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAppsBase, isStandalone: true, selector: "ntybase-netty-apps-base", inputs: { embedded: { classPropertyName: "embedded", publicName: "embedded", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: ``, isInline: true });
|
|
541
546
|
}
|
|
542
547
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsBase, decorators: [{
|
|
543
548
|
type: Component,
|
|
544
549
|
args: [{ selector: 'ntybase-netty-apps-base', imports: [], template: `` }]
|
|
545
|
-
}] });
|
|
550
|
+
}], propDecorators: { embedded: [{ type: i0.Input, args: [{ isSignal: true, alias: "embedded", required: false }] }] } });
|
|
546
551
|
|
|
547
552
|
class NettyHelper {
|
|
548
553
|
/**
|
|
@@ -1253,14 +1258,17 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1253
1258
|
// ********************************************
|
|
1254
1259
|
// *** INPUTS ***
|
|
1255
1260
|
// ********************************************
|
|
1256
|
-
readOnly = signal(true, ...(ngDevMode ? [{ debugName: "readOnly" }] : [])); // Is the form in readonly mode
|
|
1257
1261
|
popupFilterValid = input(false, ...(ngDevMode ? [{ debugName: "popupFilterValid" }] : [])); // Is the popup filter valid
|
|
1258
1262
|
popupValid = input(false, ...(ngDevMode ? [{ debugName: "popupValid" }] : [])); // Is the form in popup mode
|
|
1259
|
-
isEmbedded = input(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : [])); // Is the form embedded to an other component
|
|
1260
1263
|
// Parameters passed when the component is embeded into an other
|
|
1261
1264
|
componantParameterGUID = input('', ...(ngDevMode ? [{ debugName: "componantParameterGUID" }] : [])); // GUID of the parameter
|
|
1262
1265
|
componantParameterType = input('', ...(ngDevMode ? [{ debugName: "componantParameterType" }] : [])); // Type of the parameter (Field Name)
|
|
1263
1266
|
// ********************************************
|
|
1267
|
+
// *** Computed ***
|
|
1268
|
+
// ********************************************
|
|
1269
|
+
_isPopupFilterValid = computed(() => this.popupFilterValid() ?? false, ...(ngDevMode ? [{ debugName: "_isPopupFilterValid" }] : []));
|
|
1270
|
+
_isPopupValid = computed(() => this.popupValid() ?? false, ...(ngDevMode ? [{ debugName: "_isPopupValid" }] : []));
|
|
1271
|
+
// ********************************************
|
|
1264
1272
|
// *** EVENTS ***
|
|
1265
1273
|
// ********************************************
|
|
1266
1274
|
/*
|
|
@@ -1289,6 +1297,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1289
1297
|
authenticationList = [];
|
|
1290
1298
|
// User access writes
|
|
1291
1299
|
accessRightsProcessed = signal(false, ...(ngDevMode ? [{ debugName: "accessRightsProcessed" }] : []));
|
|
1300
|
+
readOnly = signal(true, ...(ngDevMode ? [{ debugName: "readOnly" }] : [])); // Is the form in readonly mode
|
|
1292
1301
|
allowAdd = signal(false, ...(ngDevMode ? [{ debugName: "allowAdd" }] : []));
|
|
1293
1302
|
allowEdit = signal(false, ...(ngDevMode ? [{ debugName: "allowEdit" }] : []));
|
|
1294
1303
|
allowDelete = signal(false, ...(ngDevMode ? [{ debugName: "allowDelete" }] : []));
|
|
@@ -1317,50 +1326,45 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1317
1326
|
backClicked() {
|
|
1318
1327
|
this.commonService.goBack();
|
|
1319
1328
|
}
|
|
1320
|
-
async refreshData() {
|
|
1321
|
-
try {
|
|
1322
|
-
this.loadData();
|
|
1323
|
-
await this.alertService.showAlert('@dataRefreshedSuccessfully');
|
|
1324
|
-
}
|
|
1325
|
-
catch (err) {
|
|
1326
|
-
this.alertService.showError(err);
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
1329
|
/** Set data into the grid */
|
|
1330
|
-
setData(data) {
|
|
1330
|
+
setData(data, initialize = false) {
|
|
1331
1331
|
this.recordList.set(data);
|
|
1332
1332
|
if (this.columnDefs() == null || this.columnDefs().length == 0) {
|
|
1333
1333
|
this.initAgGrid();
|
|
1334
1334
|
}
|
|
1335
1335
|
if (this.searchValue() && this.gridApi) {
|
|
1336
1336
|
this.gridApi.setGridOption('quickFilterText', this.searchValue());
|
|
1337
|
-
if (
|
|
1338
|
-
if (this.
|
|
1339
|
-
this.
|
|
1337
|
+
if (!initialize) {
|
|
1338
|
+
if (this.recordList() == undefined || this.recordList().length == 0) {
|
|
1339
|
+
if (!this._isEmbedded()) {
|
|
1340
|
+
this.alertService.showWarning('@recordNotFoundSearch');
|
|
1341
|
+
}
|
|
1340
1342
|
}
|
|
1341
1343
|
}
|
|
1342
1344
|
}
|
|
1343
1345
|
}
|
|
1344
|
-
async setAccessRights() {
|
|
1346
|
+
async setAccessRights(forLog = false) {
|
|
1345
1347
|
this.authenticationList = await lastValueFrom(this.sysFunctionProxy.getAuthentication(this.componentName())).catch((e) => {
|
|
1346
1348
|
return throwError(() => new Error(e));
|
|
1347
1349
|
});
|
|
1350
|
+
this.allowAdd.set(false);
|
|
1351
|
+
this.allowEdit.set(false);
|
|
1352
|
+
this.allowDelete.set(false);
|
|
1353
|
+
this.allowLog.set(false);
|
|
1348
1354
|
try {
|
|
1349
1355
|
this.allowRead.set(this.authenticationList.find((f) => f.action == 'read')?.allow ?? false);
|
|
1350
1356
|
if (this.allowRead() == false) {
|
|
1351
1357
|
this.commonService.userNotAllowedToRead();
|
|
1352
1358
|
return false;
|
|
1353
1359
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1360
|
+
if (!forLog) {
|
|
1361
|
+
this.allowAdd.set(this.authenticationList.find((f) => f.action == 'add')?.allow ?? false);
|
|
1362
|
+
this.allowEdit.set(this.authenticationList.find((f) => f.action == 'edit')?.allow ?? false);
|
|
1363
|
+
this.allowDelete.set(this.authenticationList.find((f) => f.action == 'delete')?.allow ?? false);
|
|
1364
|
+
this.allowLog.set(this.authenticationList.find((f) => f.action == 'logAccess')?.allow ?? false);
|
|
1365
|
+
}
|
|
1358
1366
|
}
|
|
1359
1367
|
catch (error) {
|
|
1360
|
-
this.allowAdd.set(false);
|
|
1361
|
-
this.allowEdit.set(false);
|
|
1362
|
-
this.allowDelete.set(false);
|
|
1363
|
-
this.allowLog.set(false);
|
|
1364
1368
|
return false;
|
|
1365
1369
|
}
|
|
1366
1370
|
this.accessRightsProcessed.set(true);
|
|
@@ -1415,6 +1419,10 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1415
1419
|
selectAll: 'filtered', hideDisabledCheckboxes: true, suppressRowClickSelection: false,
|
|
1416
1420
|
enableCellChangeFlash: true,
|
|
1417
1421
|
},
|
|
1422
|
+
getRowId: (params) => {
|
|
1423
|
+
const pkField = this.pkFieldName();
|
|
1424
|
+
return params.data[pkField];
|
|
1425
|
+
},
|
|
1418
1426
|
};
|
|
1419
1427
|
// Statusbar
|
|
1420
1428
|
statusBar = {
|
|
@@ -1472,10 +1480,27 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1472
1480
|
/**
|
|
1473
1481
|
* Update a single row in the grid
|
|
1474
1482
|
* @param rowData The updated row data
|
|
1475
|
-
* @param idField The field name that serves as unique identifier (default:
|
|
1483
|
+
* @param idField The field name that serves as unique identifier (default: pkFieldName())
|
|
1476
1484
|
*/
|
|
1477
|
-
updateRowInGrid(rowData, idField = '
|
|
1478
|
-
|
|
1485
|
+
updateRowInGrid(rowData, idField = '') {
|
|
1486
|
+
if (!this.gridApi || !rowData)
|
|
1487
|
+
return;
|
|
1488
|
+
const field = idField || this.pkFieldName();
|
|
1489
|
+
const id = rowData[field];
|
|
1490
|
+
if (id === undefined || id === null) {
|
|
1491
|
+
this.loadData();
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
let rowNode = this.gridApi.getRowNode(id.toString());
|
|
1495
|
+
// Robustness: If not found by ID (getRowNode), try finding by comparing the PK field manually
|
|
1496
|
+
if (!rowNode) {
|
|
1497
|
+
this.gridApi.forEachNode((node) => {
|
|
1498
|
+
const nodeData = node.data;
|
|
1499
|
+
if (nodeData && nodeData[field] === id) {
|
|
1500
|
+
rowNode = node;
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1479
1504
|
if (rowNode) {
|
|
1480
1505
|
rowNode.setData(rowData);
|
|
1481
1506
|
const params = { rowNodes: [rowNode], force: true, suppressFlash: false, };
|
|
@@ -1506,7 +1531,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1506
1531
|
this.nettyAgGridService.setAgGridTranslations(this.gridApi);
|
|
1507
1532
|
}
|
|
1508
1533
|
initAgGrid_extension() {
|
|
1509
|
-
if (this.allowEdit() == false &&
|
|
1534
|
+
if (this.allowEdit() == false && this._isPopupValid() == false) {
|
|
1510
1535
|
this.columnDefs().pop();
|
|
1511
1536
|
this.columnDefs().shift();
|
|
1512
1537
|
this.columnDefs().unshift({
|
|
@@ -1517,10 +1542,10 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1517
1542
|
});
|
|
1518
1543
|
this.gridApi.setGridOption('rowSelection', { mode: 'multiRow', checkboxes: true });
|
|
1519
1544
|
}
|
|
1520
|
-
if (this.
|
|
1545
|
+
if (this._isPopupValid() == true) {
|
|
1521
1546
|
this.columnDefs().pop();
|
|
1522
1547
|
this.columnDefs().shift();
|
|
1523
|
-
if (this.
|
|
1548
|
+
if (this._isPopupFilterValid() == true) {
|
|
1524
1549
|
if (this.allowEdit()) {
|
|
1525
1550
|
this.columnDefs().unshift({
|
|
1526
1551
|
headerName: '', sortable: false, resizable: false, filter: false,
|
|
@@ -1596,15 +1621,50 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1596
1621
|
var fields = this.columnDefs()
|
|
1597
1622
|
.filter((columnDef) => columnDef.ntyEmbeddedHide == 'x')
|
|
1598
1623
|
.map((columnDef) => columnDef.field);
|
|
1599
|
-
this.gridApi?.setColumnsVisible(fields, !this.
|
|
1624
|
+
this.gridApi?.setColumnsVisible(fields, !this._isEmbedded());
|
|
1625
|
+
}
|
|
1626
|
+
// *****************************************
|
|
1627
|
+
// *** Logging Functions ***
|
|
1628
|
+
// *****************************************
|
|
1629
|
+
logInputs(message) {
|
|
1630
|
+
if (!message || message.length < 1) {
|
|
1631
|
+
message = 'agGridBase - Inputs log';
|
|
1632
|
+
}
|
|
1633
|
+
const inputs = {
|
|
1634
|
+
"popupFilterValid": this.popupFilterValid(),
|
|
1635
|
+
"_isPopupFilterValid": this._isPopupFilterValid(),
|
|
1636
|
+
"popupValid": this.popupValid(),
|
|
1637
|
+
"_isPopupValid": this._isPopupValid(),
|
|
1638
|
+
"componantParameterGUID": this.componantParameterGUID(),
|
|
1639
|
+
"componantParameterType": this.componantParameterType(),
|
|
1640
|
+
"embedded": this.embedded(),
|
|
1641
|
+
"_isEmbedded": this._isEmbedded(),
|
|
1642
|
+
};
|
|
1643
|
+
console.log(message, inputs);
|
|
1644
|
+
}
|
|
1645
|
+
logAuthentication(message) {
|
|
1646
|
+
if (!message || message.length < 1) {
|
|
1647
|
+
message = 'agGridBase - Authentication log';
|
|
1648
|
+
}
|
|
1649
|
+
const inputs = {
|
|
1650
|
+
"authenticationList": this.authenticationList,
|
|
1651
|
+
"accessRightsProcessed": this.accessRightsProcessed(),
|
|
1652
|
+
"readOnly": this.readOnly(),
|
|
1653
|
+
"allowAdd": this.allowAdd(),
|
|
1654
|
+
"allowEdit": this.allowEdit(),
|
|
1655
|
+
"allowDelete": this.allowDelete(),
|
|
1656
|
+
"allowLog": this.allowLog(),
|
|
1657
|
+
"allowRead": this.allowRead(),
|
|
1658
|
+
};
|
|
1659
|
+
console.log(message, inputs);
|
|
1600
1660
|
}
|
|
1601
1661
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1602
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null },
|
|
1662
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridBase, isStandalone: true, selector: "ntybase-ag-grid-base", inputs: { popupFilterValid: { classPropertyName: "popupFilterValid", publicName: "popupFilterValid", isSignal: true, isRequired: false, transformFunction: null }, popupValid: { classPropertyName: "popupValid", publicName: "popupValid", isSignal: true, isRequired: false, transformFunction: null }, componantParameterGUID: { classPropertyName: "componantParameterGUID", publicName: "componantParameterGUID", isSignal: true, isRequired: false, transformFunction: null }, componantParameterType: { classPropertyName: "componantParameterType", publicName: "componantParameterType", isSignal: true, isRequired: false, transformFunction: null }, agGridSelectionMode: { classPropertyName: "agGridSelectionMode", publicName: "agGridSelectionMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onElementSelect: "onElementSelect", selectedElement: "selectedElement" }, host: { attributes: { "ntybase-id": "NettyAgGridBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
1603
1663
|
}
|
|
1604
1664
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridBase, decorators: [{
|
|
1605
1665
|
type: Component,
|
|
1606
1666
|
args: [{ selector: 'ntybase-ag-grid-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridBase' } }]
|
|
1607
|
-
}], propDecorators: { popupFilterValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupFilterValid", required: false }] }], popupValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupValid", required: false }] }],
|
|
1667
|
+
}], propDecorators: { popupFilterValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupFilterValid", required: false }] }], popupValid: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupValid", required: false }] }], componantParameterGUID: [{ type: i0.Input, args: [{ isSignal: true, alias: "componantParameterGUID", required: false }] }], componantParameterType: [{ type: i0.Input, args: [{ isSignal: true, alias: "componantParameterType", required: false }] }], onElementSelect: [{ type: i0.Output, args: ["onElementSelect"] }], selectedElement: [{ type: i0.Output, args: ["selectedElement"] }], agGridSelectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "agGridSelectionMode", required: false }] }] } });
|
|
1608
1668
|
|
|
1609
1669
|
class ButtonRenderer {
|
|
1610
1670
|
params = null;
|
|
@@ -1759,33 +1819,6 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1759
1819
|
// ********************************************
|
|
1760
1820
|
// *** INPUTS ***
|
|
1761
1821
|
// ********************************************
|
|
1762
|
-
// Filter section
|
|
1763
|
-
hasFilter = input(false, ...(ngDevMode ? [{ debugName: "hasFilter" }] : [])); // Does the component have a filter
|
|
1764
|
-
isFilterValid = signal(true, ...(ngDevMode ? [{ debugName: "isFilterValid" }] : [])); // Can the filter be used
|
|
1765
|
-
isFilterExpanded = linkedSignal({ ...(ngDevMode ? { debugName: "isFilterExpanded" } : {}), source: () => ({
|
|
1766
|
-
embedded: this.isEmbedded(),
|
|
1767
|
-
hasFilter: this.hasFilter(),
|
|
1768
|
-
valid: this.isFilterValid(),
|
|
1769
|
-
}),
|
|
1770
|
-
computation: (s) => {
|
|
1771
|
-
if (s.embedded || !s.hasFilter)
|
|
1772
|
-
return false;
|
|
1773
|
-
return s.valid;
|
|
1774
|
-
} });
|
|
1775
|
-
filterRefreshTrigger = signal(0, ...(ngDevMode ? [{ debugName: "filterRefreshTrigger" }] : []));
|
|
1776
|
-
/**
|
|
1777
|
-
* Triggers the filter component to refresh its data
|
|
1778
|
-
*/
|
|
1779
|
-
refreshFilterData() {
|
|
1780
|
-
let value = this.filterRefreshTrigger();
|
|
1781
|
-
if (value > 10000) {
|
|
1782
|
-
value = 0;
|
|
1783
|
-
}
|
|
1784
|
-
value++;
|
|
1785
|
-
this.filterRefreshTrigger.set(value);
|
|
1786
|
-
}
|
|
1787
|
-
// Open component management
|
|
1788
|
-
openEditComponentInPopup = signal(false, ...(ngDevMode ? [{ debugName: "openEditComponentInPopup" }] : []));
|
|
1789
1822
|
// Services
|
|
1790
1823
|
router = inject(Router);
|
|
1791
1824
|
routerActive = inject(ActivatedRoute);
|
|
@@ -1806,15 +1839,13 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1806
1839
|
* Component initialization lifecycle hook
|
|
1807
1840
|
*/
|
|
1808
1841
|
async ngOnInit() {
|
|
1809
|
-
this.nettyAppsProxy
|
|
1810
|
-
await this.setAccessRights();
|
|
1842
|
+
this.nettyAppsProxy.setURLPath(this.componentName());
|
|
1843
|
+
await this.setAccessRights(false);
|
|
1811
1844
|
const savedSearchValue = sessionStorage.getItem(this.searchValueName());
|
|
1812
1845
|
if (savedSearchValue) {
|
|
1813
1846
|
this.searchValue.set(savedSearchValue);
|
|
1814
1847
|
}
|
|
1815
|
-
|
|
1816
|
-
this.loadData();
|
|
1817
|
-
}
|
|
1848
|
+
this.loadData();
|
|
1818
1849
|
// Load user grid preferences
|
|
1819
1850
|
await this.nettyAgGridService.copyGridUserPereferenceToLocal(this.preferenceType());
|
|
1820
1851
|
await this.AfterOnInit();
|
|
@@ -1830,7 +1861,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1830
1861
|
}
|
|
1831
1862
|
return null;
|
|
1832
1863
|
}
|
|
1833
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.
|
|
1864
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
1834
1865
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
1835
1866
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
1836
1867
|
: this.environment.getBaseHref();
|
|
@@ -1903,10 +1934,9 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1903
1934
|
]);
|
|
1904
1935
|
}
|
|
1905
1936
|
toggleOpenMode() {
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
const message = newMode ? '@openInPopup' : '@openInSidenav';
|
|
1937
|
+
this.openInPopup.update(a => !a);
|
|
1938
|
+
localStorage.setItem('openInPopup', JSON.stringify(this.openInPopup()));
|
|
1939
|
+
const message = this.openInPopup() ? '@openInPopup' : '@openInSidenav';
|
|
1910
1940
|
this.alertService.showSuccess(message);
|
|
1911
1941
|
}
|
|
1912
1942
|
/**
|
|
@@ -1925,7 +1955,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1925
1955
|
};
|
|
1926
1956
|
const savedMode = localStorage.getItem('openInPopup');
|
|
1927
1957
|
if (savedMode !== null) {
|
|
1928
|
-
this.
|
|
1958
|
+
this.openInPopup.set(JSON.parse(savedMode) === true);
|
|
1929
1959
|
}
|
|
1930
1960
|
this.translateService.onLangChange.subscribe(() => {
|
|
1931
1961
|
this.setAgGridTranslations();
|
|
@@ -1943,8 +1973,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1943
1973
|
else if (this.hasValidValue(this.queryParameterType())) {
|
|
1944
1974
|
this.parameterType.set(this.queryParameterType());
|
|
1945
1975
|
}
|
|
1946
|
-
if (this.hasValidValue(this.parameterGUID)) {
|
|
1947
|
-
this.isFilterValid.set(false);
|
|
1976
|
+
if (this.hasValidValue(this.parameterGUID())) {
|
|
1948
1977
|
this.setFilter();
|
|
1949
1978
|
this.loadData();
|
|
1950
1979
|
}
|
|
@@ -1961,7 +1990,7 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1961
1990
|
switch (update.action) {
|
|
1962
1991
|
case 'add':
|
|
1963
1992
|
case 'update':
|
|
1964
|
-
this.updateRowInGrid(update.data);
|
|
1993
|
+
this.updateRowInGrid(update.data, this.pkFieldName());
|
|
1965
1994
|
break;
|
|
1966
1995
|
}
|
|
1967
1996
|
}
|
|
@@ -1969,13 +1998,10 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1969
1998
|
effect(() => { this.onElementSelect.emit(this.selectedRows()); });
|
|
1970
1999
|
// Manage filter expanded state
|
|
1971
2000
|
effect(() => {
|
|
1972
|
-
this.
|
|
2001
|
+
this._isEmbedded();
|
|
1973
2002
|
this.showHideEmbeddedColumnsAsync();
|
|
1974
2003
|
});
|
|
1975
2004
|
}
|
|
1976
|
-
onReverseIsFilterValid() {
|
|
1977
|
-
this.isFilterValid.update((a) => !a);
|
|
1978
|
-
}
|
|
1979
2005
|
/**
|
|
1980
2006
|
* Validates if the given value is equal to null,undefined or ''
|
|
1981
2007
|
* @param value
|
|
@@ -1994,17 +2020,21 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
1994
2020
|
// *** Data Management Functions ***
|
|
1995
2021
|
// *********************************************************
|
|
1996
2022
|
loadData() {
|
|
1997
|
-
if (this.hasFilter()) {
|
|
1998
|
-
this.setData([]);
|
|
1999
|
-
return;
|
|
2000
|
-
}
|
|
2001
2023
|
this.nettyAppsProxy.select(this.record).subscribe({
|
|
2002
2024
|
next: (data) => {
|
|
2003
|
-
this.setData(data);
|
|
2025
|
+
this.setData(data, false);
|
|
2004
2026
|
},
|
|
2005
2027
|
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
2006
2028
|
});
|
|
2007
2029
|
}
|
|
2030
|
+
async refreshData() {
|
|
2031
|
+
try {
|
|
2032
|
+
this.loadData();
|
|
2033
|
+
}
|
|
2034
|
+
catch (err) {
|
|
2035
|
+
this.alertService.showError(err);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2008
2038
|
async deleteSelected() {
|
|
2009
2039
|
if (!this.gridApi)
|
|
2010
2040
|
return;
|
|
@@ -2028,13 +2058,133 @@ class NettyAgGridListBase extends NettyAgGridBase {
|
|
|
2028
2058
|
error: (err) => this.alertService.showError(err),
|
|
2029
2059
|
});
|
|
2030
2060
|
}
|
|
2061
|
+
// *****************************************
|
|
2062
|
+
// *** Logging Functions ***
|
|
2063
|
+
// *****************************************
|
|
2064
|
+
logInputs(message) {
|
|
2065
|
+
if (!message || message.length < 1) {
|
|
2066
|
+
message = 'AgGridListBase - Inputs log';
|
|
2067
|
+
}
|
|
2068
|
+
const inputs = {
|
|
2069
|
+
"popupFilterValid": this.popupFilterValid(),
|
|
2070
|
+
"_isPopupFilterValid": this._isPopupFilterValid(),
|
|
2071
|
+
"popupValid": this.popupValid(),
|
|
2072
|
+
"_isPopupValid": this._isPopupValid(),
|
|
2073
|
+
"componantParameterGUID": this.componantParameterGUID(),
|
|
2074
|
+
"componantParameterType": this.componantParameterType(),
|
|
2075
|
+
"embedded": this.embedded(),
|
|
2076
|
+
"_isEmbedded": this._isEmbedded(),
|
|
2077
|
+
};
|
|
2078
|
+
console.log(message, inputs);
|
|
2079
|
+
}
|
|
2031
2080
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2032
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2081
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: NettyAgGridListBase, isStandalone: true, selector: "ntybase-ag-grid-list-base", host: { attributes: { "ntybase-id": "NettyAgGridListBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2033
2082
|
}
|
|
2034
2083
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListBase, decorators: [{
|
|
2035
2084
|
type: Component,
|
|
2036
2085
|
args: [{ selector: 'ntybase-ag-grid-list-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridListBase' } }]
|
|
2037
|
-
}], ctorParameters: () => []
|
|
2086
|
+
}], ctorParameters: () => [] });
|
|
2087
|
+
|
|
2088
|
+
ModuleRegistry.registerModules([AllCommunityModule, StatusBarModule, ClientSideRowModelModule, ClipboardModule, ExcelExportModule, ColumnMenuModule,
|
|
2089
|
+
ContextMenuModule, CellSelectionModule, HighlightChangesModule, RowSelectionModule,]);
|
|
2090
|
+
// AgGrid Dark Mode Row Style
|
|
2091
|
+
class NettyAgGridListFilterBase extends NettyAgGridListBase {
|
|
2092
|
+
// ********************************************
|
|
2093
|
+
// *** INPUTS ***
|
|
2094
|
+
// ********************************************
|
|
2095
|
+
// Filter section
|
|
2096
|
+
displayFilter = input(true, ...(ngDevMode ? [{ debugName: "displayFilter" }] : [])); // Does the component display it's filter section when embadded
|
|
2097
|
+
_displayFilter = computed(() => this.displayFilter() ?? true, ...(ngDevMode ? [{ debugName: "_displayFilter" }] : [])); // Computed version of displayFilter to prevent undefined
|
|
2098
|
+
isFilterValid = signal(true, ...(ngDevMode ? [{ debugName: "isFilterValid" }] : [])); // Can the filter be used
|
|
2099
|
+
isFilterExpanded = linkedSignal({ ...(ngDevMode ? { debugName: "isFilterExpanded" } : {}), // Is the filter component expanded
|
|
2100
|
+
source: () => ({
|
|
2101
|
+
embedded: this._isEmbedded(),
|
|
2102
|
+
displayFilter: this._displayFilter(),
|
|
2103
|
+
valid: this.isFilterValid(),
|
|
2104
|
+
}),
|
|
2105
|
+
computation: (s) => {
|
|
2106
|
+
if (s.embedded || !s.displayFilter)
|
|
2107
|
+
return false;
|
|
2108
|
+
return s.valid;
|
|
2109
|
+
} });
|
|
2110
|
+
filterRefreshTrigger = signal(0, ...(ngDevMode ? [{ debugName: "filterRefreshTrigger" }] : []));
|
|
2111
|
+
constructor() {
|
|
2112
|
+
super();
|
|
2113
|
+
effect(() => {
|
|
2114
|
+
if (this.hasValidValue(this.parameterGUID())) {
|
|
2115
|
+
this.isFilterExpanded.set(false);
|
|
2116
|
+
this.setFilter();
|
|
2117
|
+
this.loadData();
|
|
2118
|
+
}
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
2121
|
+
// *********************************************************
|
|
2122
|
+
// *** Data Management Functions ***
|
|
2123
|
+
// *********************************************************
|
|
2124
|
+
loadData() {
|
|
2125
|
+
if (this._displayFilter()) {
|
|
2126
|
+
this.setData([], true);
|
|
2127
|
+
return;
|
|
2128
|
+
}
|
|
2129
|
+
this.nettyAppsProxy.select(this.record).subscribe({
|
|
2130
|
+
next: (data) => {
|
|
2131
|
+
this.setData(data, false);
|
|
2132
|
+
},
|
|
2133
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
async refreshData() {
|
|
2137
|
+
try {
|
|
2138
|
+
this.refreshFilterData();
|
|
2139
|
+
}
|
|
2140
|
+
catch (err) {
|
|
2141
|
+
this.alertService.showError(err);
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
/**
|
|
2145
|
+
* Triggers the filter component to refresh its data
|
|
2146
|
+
*/
|
|
2147
|
+
refreshFilterData() {
|
|
2148
|
+
let value = this.filterRefreshTrigger();
|
|
2149
|
+
if (value > 10000) {
|
|
2150
|
+
value = 0;
|
|
2151
|
+
}
|
|
2152
|
+
value++;
|
|
2153
|
+
this.filterRefreshTrigger.set(value);
|
|
2154
|
+
}
|
|
2155
|
+
onReverseIsFilterValid() {
|
|
2156
|
+
this.isFilterValid.update((a) => !a);
|
|
2157
|
+
}
|
|
2158
|
+
// *****************************************
|
|
2159
|
+
// *** Logging Functions ***
|
|
2160
|
+
// *****************************************
|
|
2161
|
+
logInputs(message) {
|
|
2162
|
+
if (!message || message.length < 1) {
|
|
2163
|
+
message = 'AgGridListFilterBase - Inputs log';
|
|
2164
|
+
}
|
|
2165
|
+
const inputs = {
|
|
2166
|
+
"popupFilterValid": this.popupFilterValid(),
|
|
2167
|
+
"_isPopupFilterValid": this._isPopupFilterValid(),
|
|
2168
|
+
"popupValid": this.popupValid(),
|
|
2169
|
+
"_isPopupValid": this._isPopupValid(),
|
|
2170
|
+
"componantParameterGUID": this.componantParameterGUID(),
|
|
2171
|
+
"componantParameterType": this.componantParameterType(),
|
|
2172
|
+
"embedded": this.embedded(),
|
|
2173
|
+
"_isEmbedded": this._isEmbedded(),
|
|
2174
|
+
"displayFilter": this.displayFilter(),
|
|
2175
|
+
"_displayFilter": this._displayFilter(),
|
|
2176
|
+
"isFilterValid": this.isFilterValid(),
|
|
2177
|
+
"isFilterExpanded": this.isFilterExpanded(),
|
|
2178
|
+
};
|
|
2179
|
+
console.log(message, inputs);
|
|
2180
|
+
}
|
|
2181
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListFilterBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridListFilterBase, isStandalone: true, selector: "ntybase-ag-grid-list-filter-base", inputs: { displayFilter: { classPropertyName: "displayFilter", publicName: "displayFilter", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "ntybase-id": "NettyAgGridListFilterBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2183
|
+
}
|
|
2184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridListFilterBase, decorators: [{
|
|
2185
|
+
type: Component,
|
|
2186
|
+
args: [{ selector: 'ntybase-ag-grid-list-filter-base', imports: [], template: ``, host: { 'ntybase-id': 'NettyAgGridListFilterBase' } }]
|
|
2187
|
+
}], ctorParameters: () => [], propDecorators: { displayFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFilter", required: false }] }] } });
|
|
2038
2188
|
|
|
2039
2189
|
class NettyAgGridLogBase extends NettyAgGridBase {
|
|
2040
2190
|
// ---------------------------------------------------
|
|
@@ -2045,8 +2195,8 @@ class NettyAgGridLogBase extends NettyAgGridBase {
|
|
|
2045
2195
|
* Component initialization lifecycle hook
|
|
2046
2196
|
*/
|
|
2047
2197
|
async ngOnInit() {
|
|
2048
|
-
this.nettyAppsProxy
|
|
2049
|
-
await this.setAccessRights();
|
|
2198
|
+
this.nettyAppsProxy.setURLPath(this.componentName());
|
|
2199
|
+
await this.setAccessRights(true);
|
|
2050
2200
|
const savedSearchValue = sessionStorage.getItem(this.searchValueName());
|
|
2051
2201
|
if (savedSearchValue) {
|
|
2052
2202
|
this.searchValue.set(savedSearchValue);
|
|
@@ -2059,11 +2209,19 @@ class NettyAgGridLogBase extends NettyAgGridBase {
|
|
|
2059
2209
|
loadData() {
|
|
2060
2210
|
this.nettyAppsProxy.selectLog(this.record).subscribe({
|
|
2061
2211
|
next: (data) => {
|
|
2062
|
-
this.setData(data);
|
|
2212
|
+
this.setData(data, false);
|
|
2063
2213
|
},
|
|
2064
2214
|
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
2065
2215
|
});
|
|
2066
2216
|
}
|
|
2217
|
+
async refreshData() {
|
|
2218
|
+
try {
|
|
2219
|
+
this.loadData();
|
|
2220
|
+
}
|
|
2221
|
+
catch (err) {
|
|
2222
|
+
this.alertService.showError(err);
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2067
2225
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridLogBase, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2068
2226
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: NettyAgGridLogBase, isStandalone: true, selector: "ntybase-ag-grid-log-base", host: { attributes: { "ntybase-id": "NettyAgGridLogBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2069
2227
|
}
|
|
@@ -2082,8 +2240,6 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2082
2240
|
viewMode = signal('sidenav', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
|
|
2083
2241
|
// Input signals
|
|
2084
2242
|
parameters = input('', ...(ngDevMode ? [{ debugName: "parameters" }] : []));
|
|
2085
|
-
embedded = input(false, ...(ngDevMode ? [{ debugName: "embedded" }] : []));
|
|
2086
|
-
isEmbedded = input(false, ...(ngDevMode ? [{ debugName: "isEmbedded" }] : []));
|
|
2087
2243
|
// ---------------------------------------------------
|
|
2088
2244
|
// --- RECORD LIST ---
|
|
2089
2245
|
// ---------------------------------------------------
|
|
@@ -2117,7 +2273,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2117
2273
|
* Initialize parameters. This method is called in ngOnInit or constructor
|
|
2118
2274
|
*/
|
|
2119
2275
|
initParameters(urlPath) {
|
|
2120
|
-
this.nettyAppsProxy
|
|
2276
|
+
this.nettyAppsProxy.setURLPath(urlPath);
|
|
2121
2277
|
this.recordType.set(urlPath);
|
|
2122
2278
|
}
|
|
2123
2279
|
/**
|
|
@@ -2305,18 +2461,24 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2305
2461
|
* Handles both new record creation and existing record editing
|
|
2306
2462
|
* guid - Unique identifier of the record
|
|
2307
2463
|
*/
|
|
2308
|
-
loadDetailData() {
|
|
2464
|
+
async loadDetailData() {
|
|
2309
2465
|
const guid = this.getGuidFromParameters();
|
|
2310
2466
|
if (!guid) {
|
|
2311
2467
|
// If no GUID provided, initialize a new record
|
|
2312
|
-
|
|
2468
|
+
let newRecord = this.createNewRecord();
|
|
2469
|
+
newRecord = await lastValueFrom(this.nettyAppsProxy.initRecord(newRecord))
|
|
2470
|
+
.catch((er) => {
|
|
2471
|
+
console.error('@initRecordFailed:', er);
|
|
2472
|
+
return this.createNewRecord();
|
|
2473
|
+
});
|
|
2313
2474
|
this.initializeFormData(newRecord);
|
|
2314
2475
|
this.updateValid.set(true);
|
|
2315
2476
|
return;
|
|
2316
2477
|
}
|
|
2317
2478
|
// Fetch existing record from API
|
|
2318
2479
|
this.nettyAppsProxy.selectGUID(guid).subscribe({
|
|
2319
|
-
next: (
|
|
2480
|
+
next: (data) => {
|
|
2481
|
+
const record = this.createItemInstance(data);
|
|
2320
2482
|
if (!record || !record.getPK()) {
|
|
2321
2483
|
this.alertService.showError('@recordNotFound');
|
|
2322
2484
|
const cleanPath = this.commonService.getCleanUrlPath();
|
|
@@ -2344,7 +2506,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2344
2506
|
// ***************************************************
|
|
2345
2507
|
// *** gotoURL Methods ***
|
|
2346
2508
|
// ***************************************************
|
|
2347
|
-
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this.
|
|
2509
|
+
gotoURL(routePrefix, rightSidenav = [], parameters, type, dialogComponent = null, isNewTab = false, isPopup = this._isEmbedded()) {
|
|
2348
2510
|
const baseHref = this.environment.getBaseHref().endsWith('/')
|
|
2349
2511
|
? this.environment.getBaseHref().slice(0, -1) // Sondaki / işaretini kaldır
|
|
2350
2512
|
: this.environment.getBaseHref();
|
|
@@ -2417,12 +2579,12 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2417
2579
|
]);
|
|
2418
2580
|
}
|
|
2419
2581
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2420
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }
|
|
2582
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAgGridSaveBase, isStandalone: true, selector: "ntybase-ag-grid-save-base", inputs: { parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "saveForm", first: true, predicate: ["saveForm"], descendants: true }], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
2421
2583
|
}
|
|
2422
2584
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAgGridSaveBase, decorators: [{
|
|
2423
2585
|
type: Component,
|
|
2424
2586
|
args: [{ selector: 'ntybase-ag-grid-save-base', imports: [], template: `` }]
|
|
2425
|
-
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }],
|
|
2587
|
+
}], ctorParameters: () => [], propDecorators: { parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], saveForm: [{
|
|
2426
2588
|
type: ViewChild,
|
|
2427
2589
|
args: ['saveForm']
|
|
2428
2590
|
}] } });
|
|
@@ -4237,30 +4399,29 @@ class NettyMenuService {
|
|
|
4237
4399
|
i18nService = inject(I18nService);
|
|
4238
4400
|
menuName = signal('', ...(ngDevMode ? [{ debugName: "menuName" }] : []));
|
|
4239
4401
|
menu = signal(null, ...(ngDevMode ? [{ debugName: "menu" }] : []));
|
|
4240
|
-
constructor() {
|
|
4241
|
-
effect(() => {
|
|
4242
|
-
const currentMenuName = this.menuName();
|
|
4243
|
-
const currentLang = this.i18nService.currentLang();
|
|
4244
|
-
if (!currentMenuName.trim()) {
|
|
4245
|
-
return;
|
|
4246
|
-
}
|
|
4247
|
-
let functionUrl = this.environmentProxy.getAdminLink('/GetMenu');
|
|
4248
|
-
if (currentMenuName.trim().length > 0) {
|
|
4249
|
-
functionUrl += '/' + currentMenuName.trim();
|
|
4250
|
-
}
|
|
4251
|
-
this.http.get(functionUrl).subscribe({
|
|
4252
|
-
next: (data) => this.menu.set(data),
|
|
4253
|
-
error: (err) => {
|
|
4254
|
-
console.error('Failed to fetch menu:', err);
|
|
4255
|
-
this.menu.set(null);
|
|
4256
|
-
},
|
|
4257
|
-
});
|
|
4258
|
-
});
|
|
4259
|
-
}
|
|
4260
4402
|
setMenuName(name) {
|
|
4261
4403
|
if (name && name.trim()) {
|
|
4262
4404
|
this.menuName.set(name.trim());
|
|
4405
|
+
this.getMenu();
|
|
4406
|
+
}
|
|
4407
|
+
}
|
|
4408
|
+
getMenu() {
|
|
4409
|
+
const currentMenuName = this.menuName();
|
|
4410
|
+
const currentLang = this.i18nService.currentLang();
|
|
4411
|
+
if (!currentMenuName.trim()) {
|
|
4412
|
+
return;
|
|
4413
|
+
}
|
|
4414
|
+
let functionUrl = this.environmentProxy.getAdminLink('/GetMenu');
|
|
4415
|
+
if (currentMenuName.trim().length > 0) {
|
|
4416
|
+
functionUrl += '/' + currentMenuName.trim();
|
|
4263
4417
|
}
|
|
4418
|
+
this.http.get(functionUrl).subscribe({
|
|
4419
|
+
next: (data) => this.menu.set(data),
|
|
4420
|
+
error: (err) => {
|
|
4421
|
+
console.error('Failed to fetch menu:', err);
|
|
4422
|
+
this.menu.set(null);
|
|
4423
|
+
},
|
|
4424
|
+
});
|
|
4264
4425
|
}
|
|
4265
4426
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4266
4427
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyMenuService, providedIn: 'root' });
|
|
@@ -4270,7 +4431,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4270
4431
|
args: [{
|
|
4271
4432
|
providedIn: 'root',
|
|
4272
4433
|
}]
|
|
4273
|
-
}]
|
|
4434
|
+
}] });
|
|
4435
|
+
|
|
4436
|
+
class NettyAppsFilterBase extends NettyAppsBase {
|
|
4437
|
+
// *********************************************************
|
|
4438
|
+
// *** Input / Output ***
|
|
4439
|
+
// *********************************************************
|
|
4440
|
+
isFilterExpanded = model(true, ...(ngDevMode ? [{ debugName: "isFilterExpanded" }] : []));
|
|
4441
|
+
filteredRecords = output();
|
|
4442
|
+
refresh = input(0, ...(ngDevMode ? [{ debugName: "refresh" }] : []));
|
|
4443
|
+
fileName = input('nettyapps_', ...(ngDevMode ? [{ debugName: "fileName" }] : []));
|
|
4444
|
+
// *********************************************************
|
|
4445
|
+
// *** Service ***
|
|
4446
|
+
// *********************************************************
|
|
4447
|
+
filterProxy = injectNettyStandardFilterProxy(this.componentName());
|
|
4448
|
+
// *********************************************************
|
|
4449
|
+
// *** Signals ***
|
|
4450
|
+
// *********************************************************
|
|
4451
|
+
currentItem = signal(this.createNewFilter(), ...(ngDevMode ? [{ debugName: "currentItem" }] : []));
|
|
4452
|
+
// *********************************************************
|
|
4453
|
+
// *** Constructor ***
|
|
4454
|
+
// *********************************************************
|
|
4455
|
+
constructor() {
|
|
4456
|
+
super();
|
|
4457
|
+
effect(() => {
|
|
4458
|
+
if (this.refresh() > 0) {
|
|
4459
|
+
this.onApply();
|
|
4460
|
+
}
|
|
4461
|
+
});
|
|
4462
|
+
}
|
|
4463
|
+
// *********************************************************
|
|
4464
|
+
// *** Functions ***
|
|
4465
|
+
// *********************************************************
|
|
4466
|
+
async ngOnInit() {
|
|
4467
|
+
this.afterOnInit();
|
|
4468
|
+
}
|
|
4469
|
+
onApply() {
|
|
4470
|
+
this.filterProxy.selectFilter(this.currentItem()).subscribe({
|
|
4471
|
+
next: (result) => {
|
|
4472
|
+
this.filteredRecords.emit(result);
|
|
4473
|
+
this.isFilterExpanded.set(false);
|
|
4474
|
+
},
|
|
4475
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4476
|
+
});
|
|
4477
|
+
}
|
|
4478
|
+
onReset() {
|
|
4479
|
+
this.filterProxy.initFilter().subscribe({
|
|
4480
|
+
next: (filter) => {
|
|
4481
|
+
this.currentItem.set(filter);
|
|
4482
|
+
},
|
|
4483
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4484
|
+
});
|
|
4485
|
+
}
|
|
4486
|
+
onExport() {
|
|
4487
|
+
this.filterProxy.downloadXLS(this.currentItem()).subscribe({
|
|
4488
|
+
next: (response) => {
|
|
4489
|
+
this.downloadBlobFile(response, 'application/zip', this.translateService.instant('@00000072') + '.zip');
|
|
4490
|
+
},
|
|
4491
|
+
error: (err) => this.alertService.showError('@dataLoadFailed', err),
|
|
4492
|
+
});
|
|
4493
|
+
}
|
|
4494
|
+
async afterOnInit() { }
|
|
4495
|
+
// *****************************************
|
|
4496
|
+
// *** Logging Functions ***
|
|
4497
|
+
// *****************************************
|
|
4498
|
+
logInputs(message) {
|
|
4499
|
+
if (!message || message.length < 1) {
|
|
4500
|
+
message = 'NettyAppsFilterBase - Inputs log';
|
|
4501
|
+
}
|
|
4502
|
+
const inputs = {
|
|
4503
|
+
"isFilterExpanded": this.isFilterExpanded(),
|
|
4504
|
+
"refresh": this.refresh(),
|
|
4505
|
+
"fileName": this.fileName(),
|
|
4506
|
+
};
|
|
4507
|
+
console.log(message, inputs);
|
|
4508
|
+
}
|
|
4509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsFilterBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4510
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NettyAppsFilterBase, isStandalone: true, selector: "ntybase-netty-apps-base", inputs: { isFilterExpanded: { classPropertyName: "isFilterExpanded", publicName: "isFilterExpanded", isSignal: true, isRequired: false, transformFunction: null }, refresh: { classPropertyName: "refresh", publicName: "refresh", isSignal: true, isRequired: false, transformFunction: null }, fileName: { classPropertyName: "fileName", publicName: "fileName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isFilterExpanded: "isFilterExpandedChange", filteredRecords: "filteredRecords" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
4511
|
+
}
|
|
4512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NettyAppsFilterBase, decorators: [{
|
|
4513
|
+
type: Component,
|
|
4514
|
+
args: [{ selector: 'ntybase-netty-apps-base', imports: [], template: `` }]
|
|
4515
|
+
}], ctorParameters: () => [], propDecorators: { isFilterExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFilterExpanded", required: false }] }, { type: i0.Output, args: ["isFilterExpandedChange"] }], filteredRecords: [{ type: i0.Output, args: ["filteredRecords"] }], refresh: [{ type: i0.Input, args: [{ isSignal: true, alias: "refresh", required: false }] }], fileName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileName", required: false }] }] } });
|
|
4274
4516
|
|
|
4275
4517
|
/*
|
|
4276
4518
|
* Public API Surface of ntybase
|
|
@@ -4280,5 +4522,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4280
4522
|
* Generated bundle index. Do not edit.
|
|
4281
4523
|
*/
|
|
4282
4524
|
|
|
4283
|
-
export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridListBase, NettyAgGridLogBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
|
|
4525
|
+
export { AlertService, AuthenticationGuard, AuthenticationInterceptor, AuthenticationService, ButtonRenderer, CanDeactivateGuard, CheckboxRenderer, CommonService, ConfirmDialog, CredentialsService, CurrentUserPreference, ENVIRONMENT_CONFIG, EnvironmentInfo, EnvironmentInfoService, ExcelImportBase, ForgotPassword, Login, LoginDto, MFACodeDto, MfaLogin, NettyAgGridBase, NettyAgGridListBase, NettyAgGridListFilterBase, NettyAgGridLogBase, NettyAgGridSaveBase, NettyAgGridService, NettyAppsBase, NettyAppsFilterBase, NettyBaseApp, NettyHelper, NettyImageService, NettyMenuService, NtyLoadingComponent, NtyLoadingInterceptor, Ntybase, NtybaseModule, RangeDateTimeFilter, RangeNumberFilter, RangeStringFilter, UrlHelperService, ntyAuthenticationInterceptor };
|
|
4284
4526
|
//# sourceMappingURL=nettyapps-ntybase.mjs.map
|