rez_core 4.0.209 → 4.0.210
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/package.json
CHANGED
|
@@ -78,35 +78,41 @@ export class EntityDynamicService {
|
|
|
78
78
|
attribute_key: 'created_date',
|
|
79
79
|
db_datatype: 'datetime',
|
|
80
80
|
element_type: 'date',
|
|
81
|
+
is_hidden: false,
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
84
|
attribute_key: 'created_by',
|
|
84
85
|
db_datatype: 'int',
|
|
85
86
|
element_type: 'number',
|
|
87
|
+
is_hidden: false,
|
|
86
88
|
},
|
|
87
89
|
{
|
|
88
90
|
attribute_key: 'organization_id',
|
|
89
91
|
db_datatype: 'datetime',
|
|
90
92
|
element_type: 'date',
|
|
93
|
+
is_hidden: false,
|
|
91
94
|
},
|
|
92
95
|
{
|
|
93
96
|
attribute_key: 'enterprise_id',
|
|
94
97
|
db_datatype: 'int',
|
|
95
98
|
element_type: 'number',
|
|
99
|
+
is_hidden: false,
|
|
96
100
|
},
|
|
97
|
-
{ attribute_key: 'level_type', db_datatype: 'int', element_type: 'text' },
|
|
98
|
-
{ attribute_key: 'level_id', db_datatype: 'int', element_type: 'number' },
|
|
99
|
-
{ attribute_key: 'status', db_datatype: 'varchar', element_type: 'text' },
|
|
101
|
+
{ attribute_key: 'level_type', db_datatype: 'int', element_type: 'text', is_hidden: false },
|
|
102
|
+
{ attribute_key: 'level_id', db_datatype: 'int', element_type: 'number', is_hidden: false },
|
|
103
|
+
{ attribute_key: 'status', db_datatype: 'varchar', element_type: 'text', is_hidden: false },
|
|
100
104
|
{
|
|
101
105
|
attribute_key: 'entity_type',
|
|
102
106
|
db_datatype: 'varchar',
|
|
103
107
|
element_type: 'text',
|
|
108
|
+
is_hidden: false,
|
|
104
109
|
},
|
|
105
|
-
{ attribute_key: 'code', db_datatype: 'varchar', element_type: 'text' },
|
|
110
|
+
{ attribute_key: 'code', db_datatype: 'varchar', element_type: 'text', is_hidden: false },
|
|
106
111
|
{
|
|
107
112
|
attribute_key: 'parent_id',
|
|
108
113
|
db_datatype: 'int',
|
|
109
114
|
element_type: 'number',
|
|
115
|
+
is_hidden: false,
|
|
110
116
|
},
|
|
111
117
|
];
|
|
112
118
|
|
|
@@ -453,49 +459,58 @@ export class EntityDynamicService {
|
|
|
453
459
|
attribute_key: 'created_date',
|
|
454
460
|
db_datatype: 'datetime',
|
|
455
461
|
element_type: 'date',
|
|
462
|
+
is_hidden: false,
|
|
456
463
|
},
|
|
457
464
|
{
|
|
458
465
|
attribute_key: 'created_by',
|
|
459
466
|
db_datatype: 'int',
|
|
460
467
|
element_type: 'number',
|
|
468
|
+
is_hidden: false,
|
|
461
469
|
},
|
|
462
470
|
{
|
|
463
471
|
attribute_key: 'modified_date',
|
|
464
472
|
db_datatype: 'datetime',
|
|
465
473
|
element_type: 'date',
|
|
474
|
+
is_hidden: false,
|
|
466
475
|
},
|
|
467
476
|
{
|
|
468
477
|
attribute_key: 'modified_by',
|
|
469
478
|
db_datatype: 'int',
|
|
470
479
|
element_type: 'number',
|
|
480
|
+
is_hidden: false,
|
|
471
481
|
},
|
|
472
482
|
{
|
|
473
483
|
attribute_key: 'organization_id',
|
|
474
484
|
db_datatype: 'int',
|
|
475
485
|
element_type: 'number',
|
|
486
|
+
is_hidden: false,
|
|
476
487
|
},
|
|
477
488
|
{
|
|
478
489
|
attribute_key: 'enterprise_id',
|
|
479
490
|
db_datatype: 'int',
|
|
480
491
|
element_type: 'number',
|
|
492
|
+
is_hidden: false,
|
|
481
493
|
},
|
|
482
494
|
{
|
|
483
495
|
attribute_key: 'level_type',
|
|
484
496
|
db_datatype: 'varchar',
|
|
485
497
|
element_type: 'text',
|
|
498
|
+
is_hidden: false,
|
|
486
499
|
},
|
|
487
|
-
{ attribute_key: 'level_id', db_datatype: 'int', element_type: 'number' },
|
|
488
|
-
{ attribute_key: 'status', db_datatype: 'varchar', element_type: 'text' },
|
|
500
|
+
{ attribute_key: 'level_id', db_datatype: 'int', element_type: 'number', is_hidden: false },
|
|
501
|
+
{ attribute_key: 'status', db_datatype: 'varchar', element_type: 'text', is_hidden: false },
|
|
489
502
|
{
|
|
490
503
|
attribute_key: 'entity_type',
|
|
491
504
|
db_datatype: 'varchar',
|
|
492
505
|
element_type: 'text',
|
|
506
|
+
is_hidden: false,
|
|
493
507
|
},
|
|
494
|
-
{ attribute_key: 'code', db_datatype: 'varchar', element_type: 'text' },
|
|
508
|
+
{ attribute_key: 'code', db_datatype: 'varchar', element_type: 'text', is_hidden: false },
|
|
495
509
|
{
|
|
496
510
|
attribute_key: 'parent_id',
|
|
497
511
|
db_datatype: 'int',
|
|
498
512
|
element_type: 'number',
|
|
513
|
+
is_hidden: false,
|
|
499
514
|
},
|
|
500
515
|
];
|
|
501
516
|
|
|
@@ -666,44 +681,30 @@ export class EntityDynamicService {
|
|
|
666
681
|
entityType: string,
|
|
667
682
|
organizationId: string,
|
|
668
683
|
isHidden = true,
|
|
669
|
-
)
|
|
670
|
-
{
|
|
671
|
-
attribute_key: string;
|
|
672
|
-
db_datatype: string;
|
|
673
|
-
element_type: string;
|
|
674
|
-
is_hidden?: boolean;
|
|
675
|
-
}[]
|
|
676
|
-
> {
|
|
684
|
+
) {
|
|
677
685
|
const qb = this.dataSource
|
|
678
686
|
.createQueryBuilder()
|
|
679
687
|
.select('fea.attribute_key', 'attribute_key')
|
|
680
688
|
.addSelect('MAX(fea.db_datatype)', 'db_datatype')
|
|
681
689
|
.addSelect('MAX(fea.element_type)', 'element_type')
|
|
682
|
-
.addSelect('
|
|
690
|
+
.addSelect('BOOL_OR(fea.is_hidden)', 'is_hidden') // ✅ FIXED for Postgres
|
|
683
691
|
.from('frm_entity_attribute', 'fea')
|
|
684
692
|
.where('fea.mapped_entity_type = :entityType', { entityType })
|
|
685
693
|
.andWhere('fea.organization_id = :organizationId', { organizationId });
|
|
686
694
|
|
|
687
|
-
// add hidden filter only when requested
|
|
688
695
|
if (isHidden) {
|
|
689
|
-
qb.andWhere('(fea.is_hidden IS NULL OR fea.is_hidden =
|
|
696
|
+
qb.andWhere('(fea.is_hidden IS NULL OR fea.is_hidden = false)');
|
|
690
697
|
}
|
|
691
698
|
|
|
692
699
|
qb.groupBy('fea.attribute_key');
|
|
693
700
|
|
|
694
701
|
const result = await qb.getRawMany();
|
|
695
702
|
|
|
696
|
-
if (!result.length) {
|
|
697
|
-
console.log(
|
|
698
|
-
`No attributes found for entity '${entityType}' and org '${organizationId}'`,
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
703
|
return result.map((row: any) => ({
|
|
703
704
|
attribute_key: row.attribute_key,
|
|
704
705
|
db_datatype: row.db_datatype,
|
|
705
706
|
element_type: row.element_type,
|
|
706
|
-
is_hidden: row.is_hidden != null ?
|
|
707
|
+
is_hidden: row.is_hidden != null ? row.is_hidden === true : undefined,
|
|
707
708
|
}));
|
|
708
709
|
}
|
|
709
710
|
|