rez_core 7.1.86 → 7.1.87
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/dist/module/entity/meta/meta/service/listing-layout.service.js +8 -7
- package/dist/module/entity/meta/meta/service/listing-layout.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/entity/meta/meta/service/listing-layout.service.ts +15 -13
package/package.json
CHANGED
|
@@ -52,6 +52,13 @@ export class ListingLayoutService {
|
|
|
52
52
|
entityTableDto.list_type = listType;
|
|
53
53
|
entityTableDto.display_type = displayType;
|
|
54
54
|
|
|
55
|
+
// Get entity master data to check if flat JSON is enabled
|
|
56
|
+
const entityMaster = await this.entityMasterService.getEntityMasterData(
|
|
57
|
+
entityType,
|
|
58
|
+
loggedInUser,
|
|
59
|
+
);
|
|
60
|
+
const isFlatJson = entityMaster?.is_flat_json || false;
|
|
61
|
+
|
|
55
62
|
// Fetch columns from layout preference using service
|
|
56
63
|
const layoutPreference =
|
|
57
64
|
await this.layoutPreferenceService.getLayoutPreferenceByUserID(
|
|
@@ -63,12 +70,13 @@ export class ListingLayoutService {
|
|
|
63
70
|
);
|
|
64
71
|
|
|
65
72
|
// Mandatory columns that are used as fallback when no layout preference exists
|
|
73
|
+
// For flat JSON, prefix attribute_key with entity_type
|
|
66
74
|
const mandatoryColumns: { name: string; attribute_key: string }[] = [
|
|
67
|
-
{ name: 'Id', attribute_key: 'id' },
|
|
68
|
-
{ name: 'Code', attribute_key: 'code' },
|
|
69
|
-
{ name: 'Name', attribute_key: 'name' },
|
|
70
|
-
{ name: 'Status', attribute_key: 'status' },
|
|
71
|
-
{ name: 'Description', attribute_key: 'description' },
|
|
75
|
+
{ name: 'Id', attribute_key: isFlatJson ? `${entityType}__id` : 'id' },
|
|
76
|
+
{ name: 'Code', attribute_key: isFlatJson ? `${entityType}__code` : 'code' },
|
|
77
|
+
{ name: 'Name', attribute_key: isFlatJson ? `${entityType}__name` : 'name' },
|
|
78
|
+
{ name: 'Status', attribute_key: isFlatJson ? `${entityType}__status` : 'status' },
|
|
79
|
+
{ name: 'Description', attribute_key: isFlatJson ? `${entityType}__description` : 'description' },
|
|
72
80
|
{ name: 'Action', attribute_key: 'action' },
|
|
73
81
|
];
|
|
74
82
|
|
|
@@ -181,14 +189,8 @@ export class ListingLayoutService {
|
|
|
181
189
|
);
|
|
182
190
|
}
|
|
183
191
|
|
|
184
|
-
//
|
|
185
|
-
|
|
186
|
-
entityType,
|
|
187
|
-
loggedInUser,
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
// Add is_flat_json flag to response
|
|
191
|
-
entityTableDto.is_flat_json = entityMaster?.is_flat_json || false;
|
|
192
|
+
// Add is_flat_json flag to response (using entityMaster from earlier)
|
|
193
|
+
entityTableDto.is_flat_json = isFlatJson;
|
|
192
194
|
|
|
193
195
|
return entityTableDto;
|
|
194
196
|
}
|