cancel
Showing results for 
Search instead for 
Did you mean: 

Remove MyActivities Dashlet

Lvit
Champ in-the-making
Champ in-the-making

Hi,

i need to disable MyActivities dashlet from Dashboard of all users.

How i can do this? Thanks.

1 ACCEPTED ANSWER

abhinavmishra14
World-Class Innovator
World-Class Innovator

Try below given steps and see if that works. Not tested 

Extend the "my-activities.get.js" component and disable the dashlet.

1- Create surf extension:

<extension>
    <modules>
        <module>
            <id>Dashlets extension</id>
            <version>1.0</version>
            <auto-deploy>true</auto-deploy>
            <customizations>                
                <!-- Disable my activities for all users -->				
		<customization>
		      <targetPackageRoot>org.alfresco.components.dashlets</targetPackageRoot>
		      <sourcePackageRoot>com.demo.components.dashlets</sourcePackageRoot>
		</customization>
				
            </customizations>
        </module>
    </modules>
</extension>

2- Create a file named "my-activities.get.js" under <shareModule>\src\main\resources\alfresco\web-extension\site-webscripts\com\demo\components\dashlets 

3- Add the following content in the file:

//Hide the dashlet for all users always
model.showDashlet = false;

Seems like "showDashlet" flag is not provided in 'my-activities.get.html.ftl' so we have to override and enable it.

4- Create a file named "my-activities.get.html.ftl" under <shareModule>\src\main\resources\alfresco\web-extension\site-webscripts\com\demo\components\dashlets and add the following:

<@markup id="custom-myact-html" target="html" action="replace">
   <@uniqueIdDiv>
     <#-- Added the flag to show/hide the dashlet -->
     <#if showDashlet>
      <#assign id = args.htmlid>
      <div class="dashlet activities">
         <div class="title">${msg("header")}</div>
         <div class="toolbar flat-button">
            <div class="hidden">
               <span class="align-left yui-button yui-menu-button" id="${id}-user">
                  <span class="first-child">
                     <button type="button" tabindex="0"></button>
                  </span>
               </span>
               <select id="${id}-user-menu">
               <#list filterTypes as filter>
                  <option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
               </#list>
               </select>
               <span class="align-left yui-button yui-menu-button" id="${id}-activities">
                  <span class="first-child">
                     <button type="button" tabindex="0"></button>
                  </span>
               </span>
               <select id="${id}-activities-menu">
               <#list filterActivities as filter>
                  <option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
               </#list>
               </select>
               <span class="align-left yui-button yui-menu-button" id="${id}-range">
                  <span class="first-child">
                     <button type="button" tabindex="0"></button>
                  </span>
               </span>
               <select id="${id}-range-menu">
               <#list filterRanges as filter>
                  <option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
               </#list>
               </select>
               <div class="clear"></div>
            </div>
         </div>
         <div id="${id}-activityList" class="body scrollableList" <#if args.height??>style="height: ${args.height?html}px;"</#if>></div>
      </div>
      
      <#-- Empty results list template -->
      <div id="${id}-empty" style="display: none">
         <div class="empty"><h3>${msg("empty.title")}</h3><span>${msg("empty.description")}</span></div>
      </div>
      
     </#if>
   </@>
</@>

Documentation :

https://docs.alfresco.com/content-services/6.0/develop/share-ext-points/surf-dashlets/

https://docs.alfresco.com/content-services/6.0/develop/share-ext-points/surf-extension-modules/

https://docs.alfresco.com/content-services/6.0/develop/share-ext-points/modify-ootb-code/

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View answer in original post

2 REPLIES 2

abhinavmishra14
World-Class Innovator
World-Class Innovator

Try below given steps and see if that works. Not tested 

Extend the "my-activities.get.js" component and disable the dashlet.

1- Create surf extension:

<extension>
    <modules>
        <module>
            <id>Dashlets extension</id>
            <version>1.0</version>
            <auto-deploy>true</auto-deploy>
            <customizations>                
                <!-- Disable my activities for all users -->				
		<customization>
		      <targetPackageRoot>org.alfresco.components.dashlets</targetPackageRoot>
		      <sourcePackageRoot>com.demo.components.dashlets</sourcePackageRoot>
		</customization>
				
            </customizations>
        </module>
    </modules>
</extension>

2- Create a file named "my-activities.get.js" under <shareModule>\src\main\resources\alfresco\web-extension\site-webscripts\com\demo\components\dashlets 

3- Add the following content in the file:

//Hide the dashlet for all users always
model.showDashlet = false;

Seems like "showDashlet" flag is not provided in 'my-activities.get.html.ftl' so we have to override and enable it.

4- Create a file named "my-activities.get.html.ftl" under <shareModule>\src\main\resources\alfresco\web-extension\site-webscripts\com\demo\components\dashlets and add the following:

<@markup id="custom-myact-html" target="html" action="replace">
   <@uniqueIdDiv>
     <#-- Added the flag to show/hide the dashlet -->
     <#if showDashlet>
      <#assign id = args.htmlid>
      <div class="dashlet activities">
         <div class="title">${msg("header")}</div>
         <div class="toolbar flat-button">
            <div class="hidden">
               <span class="align-left yui-button yui-menu-button" id="${id}-user">
                  <span class="first-child">
                     <button type="button" tabindex="0"></button>
                  </span>
               </span>
               <select id="${id}-user-menu">
               <#list filterTypes as filter>
                  <option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
               </#list>
               </select>
               <span class="align-left yui-button yui-menu-button" id="${id}-activities">
                  <span class="first-child">
                     <button type="button" tabindex="0"></button>
                  </span>
               </span>
               <select id="${id}-activities-menu">
               <#list filterActivities as filter>
                  <option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
               </#list>
               </select>
               <span class="align-left yui-button yui-menu-button" id="${id}-range">
                  <span class="first-child">
                     <button type="button" tabindex="0"></button>
                  </span>
               </span>
               <select id="${id}-range-menu">
               <#list filterRanges as filter>
                  <option value="${filter.type?html}">${msg("filter." + filter.label)}</option>
               </#list>
               </select>
               <div class="clear"></div>
            </div>
         </div>
         <div id="${id}-activityList" class="body scrollableList" <#if args.height??>style="height: ${args.height?html}px;"</#if>></div>
      </div>
      
      <#-- Empty results list template -->
      <div id="${id}-empty" style="display: none">
         <div class="empty"><h3>${msg("empty.title")}</h3><span>${msg("empty.description")}</span></div>
      </div>
      
     </#if>
   </@>
</@>

Documentation :

https://docs.alfresco.com/content-services/6.0/develop/share-ext-points/surf-dashlets/

https://docs.alfresco.com/content-services/6.0/develop/share-ext-points/surf-extension-modules/

https://docs.alfresco.com/content-services/6.0/develop/share-ext-points/modify-ootb-code/

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

abhinavmishra14
World-Class Innovator
World-Class Innovator

@aoneter12 wrote:

Well thats somewhat terrifying. I can see this going the way of Wave. Didnt realize tracked apps being opened and when


What is that actually you are looking for @aoneter12 , Can't understand your issue related to this post. Please provide proper info. 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)