cancel
Showing results for 
Search instead for 
Did you mean: 

disable action in Document Library in Share (amp)

sa_ah
Champ in-the-making
Champ in-the-making

Hi,

i want to disable a standard action in the document library.

I've got a custom-doclib-extension File in my amp, where i want to hide the standard action with the id "document-edit-offline".

I added the disableAction-Evaluator to the action, but nothing happens. The action is still shown.

This is the configuration:

<module>
     <id>Document Libarary Actions - My custom view</id>
     <version>1.0</version>
     <auto-deploy>true</auto-deploy>
     <configurations>                                  
        <config evaluator="string-compare" condition="DocLibActions">
              <actions>
                 <!-- Edit offline -->
               <action id="document-edit-offline" type="javascript" label="actions.document.edit-offline">
               <evaluator>evaluator.doclib.action.disableAction</evaluator>
               </action>
          </actions>
          </config>
      </configurations>            
</module>     

thanks for your help!

5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator

It looks like you are combining share config with a module extension. I'm not sure that is possible. If it is, cool.

Another way to do it is to move that config block to your share-config-custom.xml file that's in your AMP.

douglascrp
World-Class Innovator
World-Class Innovator

‌ Yes, share config can be used inside an extension module.

I use it in order to configure things like, a different sets of properties to be shown in forms based in conditions like the user's group.

jpotts
World-Class Innovator
World-Class Innovator

Well this old dog learned a new trick.

douglascrp
World-Class Innovator
World-Class Innovator

In that case, I believe you should do what ‌ said, putting your configuration inside the share-config-custom.xml file.

If you want to use the extension module, you should/could be adding condition to define when your custom code is applied, but in that case, I believe you will have to add the replace option.

But remember that if you use replace, you will have to copy the full configuration section inside your config file.

sa_ah
Champ in-the-making
Champ in-the-making

I put it in my share-config-custom.xml in my amp and now it works! thanks!

‌ I use the the share config in the extension module for in a similar case. I have two amps with different form configs for the same custom content type and in that case it works very well. That's why i was wondering that it didn't work for the action config.