@dataclouder/ngx-core 0.1.46 → 0.1.47
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.
|
@@ -85,11 +85,11 @@ var OptionValue;
|
|
|
85
85
|
OptionValue["ReverseAlphabetical"] = "reverseAlphabetical";
|
|
86
86
|
})(OptionValue || (OptionValue = {}));
|
|
87
87
|
const sortOptions = [
|
|
88
|
-
{ label: 'Más
|
|
89
|
-
{ label: 'Más
|
|
90
|
-
{ label: '
|
|
91
|
-
{ label: 'Z
|
|
92
|
-
{ label: '
|
|
88
|
+
{ label: 'Más Reciente', value: OptionValue.Newest },
|
|
89
|
+
{ label: 'Más Antiguo', value: OptionValue.Oldest },
|
|
90
|
+
{ label: 'Actualizado Recientemente', value: 'lastUpdated' },
|
|
91
|
+
{ label: 'Alfabético A-Z', value: OptionValue.Alphabetical },
|
|
92
|
+
{ label: 'Alfabético Inverso Z-A', value: OptionValue.ReverseAlphabetical },
|
|
93
93
|
];
|
|
94
94
|
const sortTypes = [
|
|
95
95
|
{ name: 'Recientes', code: 'newest', sort: { createdDate: -1 } },
|
|
@@ -336,7 +336,7 @@ class DCFilterBarComponent {
|
|
|
336
336
|
search(text) {
|
|
337
337
|
if (!text) {
|
|
338
338
|
this.placeholder = '';
|
|
339
|
-
this.
|
|
339
|
+
this.doItemAction({ action: 'search', item: null });
|
|
340
340
|
}
|
|
341
341
|
else {
|
|
342
342
|
this.doItemAction({ action: 'search', item: text });
|
|
@@ -1463,18 +1463,19 @@ class EntityBaseListV2Component extends PaginationBase {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
async doAction(actionEvent) {
|
|
1465
1465
|
const { item, action } = actionEvent;
|
|
1466
|
-
if (!item) {
|
|
1467
|
-
return;
|
|
1468
|
-
}
|
|
1469
1466
|
const id = item?._id || item?.id;
|
|
1470
1467
|
switch (action) {
|
|
1471
1468
|
case 'view':
|
|
1472
|
-
|
|
1469
|
+
if (id)
|
|
1470
|
+
this.router.navigate(['./details', id], { relativeTo: this.route });
|
|
1473
1471
|
break;
|
|
1474
1472
|
case 'edit':
|
|
1475
|
-
|
|
1473
|
+
if (id)
|
|
1474
|
+
this.router.navigate(['./edit', id], { relativeTo: this.route });
|
|
1476
1475
|
break;
|
|
1477
1476
|
case 'delete':
|
|
1477
|
+
if (!id)
|
|
1478
|
+
return;
|
|
1478
1479
|
const confirmed = confirm(`Are you sure you want to delete this item?`);
|
|
1479
1480
|
if (confirmed) {
|
|
1480
1481
|
try {
|
|
@@ -1492,6 +1493,8 @@ class EntityBaseListV2Component extends PaginationBase {
|
|
|
1492
1493
|
}
|
|
1493
1494
|
break;
|
|
1494
1495
|
case 'clone':
|
|
1496
|
+
if (!id)
|
|
1497
|
+
return;
|
|
1495
1498
|
// Clone usually requires specific logic, maybe 'create' with modified data
|
|
1496
1499
|
// Or if backend supports 'clone' action via operation?
|
|
1497
1500
|
// The user listed: 'findOne', 'find', 'create', 'updateOne', 'updateMany', 'deleteOne', 'deleteMany', 'aggregate'.
|
|
@@ -1505,10 +1508,22 @@ class EntityBaseListV2Component extends PaginationBase {
|
|
|
1505
1508
|
}
|
|
1506
1509
|
break;
|
|
1507
1510
|
case 'search':
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1511
|
+
if (item) {
|
|
1512
|
+
this.mongoState.query = { ...this.mongoState.query, $text: { $search: item } };
|
|
1513
|
+
}
|
|
1514
|
+
else {
|
|
1515
|
+
const { $text, ...rest } = this.mongoState.query;
|
|
1516
|
+
this.mongoState.query = rest;
|
|
1517
|
+
}
|
|
1518
|
+
this.first = 0;
|
|
1519
|
+
this.mongoState.options.skip = 0;
|
|
1520
|
+
await this.loadData();
|
|
1521
|
+
break;
|
|
1522
|
+
case 'changeView':
|
|
1523
|
+
this.toggleView();
|
|
1524
|
+
break;
|
|
1525
|
+
case 'filterChange':
|
|
1526
|
+
this.updateQueryFromFilter(item);
|
|
1512
1527
|
break;
|
|
1513
1528
|
default:
|
|
1514
1529
|
// this.handleCustomAction(actionEvent);
|