[ADF-5015] DocumentList - favorites properties (#5278)

* merge entry properties to target

* fix default properties undefined value

* tests
This commit is contained in:
Cilibiu Bogdan
2019-11-26 11:53:35 +02:00
committed by Eugenio Romano
parent 0fb954dd11
commit 90402ac43d
2 changed files with 127 additions and 8 deletions

View File

@@ -150,15 +150,19 @@ export class CustomResourcesService {
const page: FavoritePaging = {
list: {
entries: result.list.entries
.map(({ entry: { target } }: any) => ({
entry: target.file || target.folder
}))
.map(({ entry }: any) => {
entry.properties = {
'cm:title': entry.title,
'cm:description': entry.description
};
return { entry };
const target = entry.target.file || entry.target.folder;
target.properties = {
...(target.properties || {
'cm:title': entry.title || target.title,
'cm:description': entry.description || target.description
}),
...(entry.properties || {})
};
return {
entry: target
};
}),
pagination: result.list.pagination
}