cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove item under my activities dashlet

miraclesuki
Champ in-the-making
Champ in-the-making
[img]http://i.imgur.com/WtV0W.png[/img]

In Alfresco Share, I would like to know is there any way to delete, hidden or disable the items under the my activities dashlet?
let say, I only want to keep "My activities", others are set to invisible.

How to do it? and what file I need to change?

Thanks for help.

Mandy
17 REPLIES 17

afaust
Legendary Innovator
Legendary Innovator

In my recommendation you would not be add those two JS files in that specific path inside the JAR - ideally, you would use a clean Surf extension module to add a customisation script file (in a completely custom path within the JAR) for the dashlet, and not rely on JAR-packaging classloading black magic to override JS files based on path. The approach of trying to override client-side files via JAR files may work on one operation system and fail on the other (depending on file listing order which influences class loading order and thus the order in which JARs are checked for static files in the same path).

The concept of adding dependencies to any Surf component (like a dashlet) is explained in the documentation.

douglascrp
World-Class Innovator
World-Class Innovator

ESWBitto _‌ trying to help you to understand how to create the custom javascript extending the dashlet's widget, I recommend to you to read this blog post

Soft29 blog: Alfresco: extend Share javascript component 

This blog post describes everything you need to understand.

In your case, the widget you are going to extend is the Alfresco.dashlet.Activities, which is defined at share/activities.js at master · Alfresco/share · GitHub 

miraclesuki
Champ in-the-making
Champ in-the-making
Thanks Axel to give fast reply.

In case, the path "tomcat/shared/classes/alfresco/web-extension/" has not consist the sub-folder "site-webscripts/org/alfresco/components/dashlets/".
So, I would like to ask should I need to create one?

Thanks.

Regards
Mandy

miraclesuki
Champ in-the-making
Champ in-the-making
Thanks Axel for help.

I have successfully filtered the items except "mine" for now.
Highly appreciate to Axel's help!!!

Regards
Mandy

maggiehellstrom
Champ in-the-making
Champ in-the-making
Hi,

I would like to do something similar, but with a small twist:
A) all non-admin users should only be able to see their own activities in the "My activities" dashlet (on their own dashboard) and in the "Site activities" dashlet (on the dashboards of the sites they are a member of)
B) the admin user, however, should always be able to see the lists of activities in both "My activities" and "Site activities" dashlets

If I apply the solution outlined by Axel (which was indeed very useful to know about!), there is no distinction in the outcome between admin and non-admin users.

Obviously, the filter information is being loaded from an XML configuration file that is common to all users, and thus it isn't possible to define any user name-based selection in this step. So I figure this selection must be made in the JavaScript code, after reading the filter info from the config.

I've been checking out the JavaScript files in the ./tomcat/webapps/share/components/dashlets directory, for example activities.js, my-activities.get.js and site-activities.get.js, but couldn't figure out how to proceed.

Any hints about where I should be looking, and what to do, would be greatly appreciated!

/Maggie

PS I run Alfresco Community 5.0d under Linux (Ubuntu 14.04).

afaust
Legendary Innovator
Legendary Innovator
Hello,

in the JavaScript code for the my-activities.get.js you could use <a href="http://docs.alfresco.com/5.0/references/APISurf-rootscoped.html">Surf root objects</a> to determine the current user and ignore the filters accordingly (when they are being loaded from XML). I'd advise not to check for the user name "admin" explicitly, but use the "isAdmin" property of the user to check if he is either "admin" himself or a member of the admin group.

Regards
Axel

Thank you very much for this tip, Axel - I will try it out!

tom_nabors
Champ in-the-making
Champ in-the-making

After removing all filter elements from the filter-type element in the my-activities.get.config.xml except for the filter element with the type and label attributes "mine", this does limit the list to one entry in the drop-down.  However, it seems to be whatever the entry was last selected.  So, for example, if the entry had been "Everyone's activities" that shows with no drop down.  I was expecting only "My activities" to show.  Is there something needed on the alfresco side as well as the share side to force only My Activites to show?  I am running community edition 5.1.f.

Thanks.