mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
On click of 'My Favorites' link under 'Documents' in the left panel of 'Document Library' page, all the links appear grayed out
This commit is contained in:
@@ -91,6 +91,15 @@ function doclist_getAllNodes(parsedArgs, filterParams, query, totalItemCount)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sanitizeJunkFavouriteKeys(favourites){
|
||||||
|
for (var key in favourites) {
|
||||||
|
if (!key || key.trim() === "") {
|
||||||
|
delete favourites[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return favourites;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point: Create collection of documents and folders in the given space
|
* Main entry point: Create collection of documents and folders in the given space
|
||||||
*
|
*
|
||||||
@@ -123,6 +132,32 @@ function doclist_main()
|
|||||||
|
|
||||||
if (logger.isLoggingEnabled())
|
if (logger.isLoggingEnabled())
|
||||||
logger.log("doclist.lib.js - NodeRef: " + parsedArgs.nodeRef + " Query: " + query);
|
logger.log("doclist.lib.js - NodeRef: " + parsedArgs.nodeRef + " Query: " + query);
|
||||||
|
|
||||||
|
favourites = sanitizeJunkFavouriteKeys(favourites);
|
||||||
|
logger.warn("Favourites : - " + jsonUtils.toJSONString(favourites));
|
||||||
|
|
||||||
|
if(Object.keys(favourites).length === 0 && query === null)
|
||||||
|
{
|
||||||
|
|
||||||
|
logger.warn("doclist.lib.js - Skipping search, no valid query for filter : " + filter);
|
||||||
|
|
||||||
|
return {
|
||||||
|
luceneQuery: "",
|
||||||
|
paging: {
|
||||||
|
totalRecords: 0,
|
||||||
|
startIndex: 0
|
||||||
|
},
|
||||||
|
container: parsedArgs.rootNode,
|
||||||
|
parent: null,
|
||||||
|
onlineEditing: utils.moduleInstalled("org.alfresco.module.vti"),
|
||||||
|
itemCount: {
|
||||||
|
folders: 0,
|
||||||
|
documents: 0
|
||||||
|
},
|
||||||
|
items: [],
|
||||||
|
customJSON: slingshotDocLib.getJSON()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var totalItemCount = filterParams.limitResults ? parseInt(filterParams.limitResults, 10) : -1;
|
var totalItemCount = filterParams.limitResults ? parseInt(filterParams.limitResults, 10) : -1;
|
||||||
// For all sites documentLibrary query we pull in all available results and post filter
|
// For all sites documentLibrary query we pull in all available results and post filter
|
||||||
|
@@ -182,11 +182,14 @@ var Filters =
|
|||||||
case "favourites":
|
case "favourites":
|
||||||
for (var favourite in favourites)
|
for (var favourite in favourites)
|
||||||
{
|
{
|
||||||
if (filterQuery)
|
if (favourite && favourite.trim() !== "")
|
||||||
{
|
{
|
||||||
filterQuery += " OR ";
|
if (filterQuery)
|
||||||
|
{
|
||||||
|
filterQuery += " OR ";
|
||||||
|
}
|
||||||
|
filterQuery += "ID:\"" + favourite + "\"";
|
||||||
}
|
}
|
||||||
filterQuery += "ID:\"" + favourite + "\"";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filterQuery.length !== 0)
|
if (filterQuery.length !== 0)
|
||||||
@@ -201,7 +204,13 @@ var Filters =
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// empty favourites query
|
// empty favourites query
|
||||||
filterQuery = "+ID:\"\"";
|
logger.warn("No favourites found for user: " + person.properties.userName);
|
||||||
|
return {
|
||||||
|
query: null,
|
||||||
|
limitResults: 0,
|
||||||
|
sort: [],
|
||||||
|
language: "lucene"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
filterParams.query = filterQuery;
|
filterParams.query = filterQuery;
|
||||||
|
Reference in New Issue
Block a user