User Portal - disable view dropdown

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jawaidk
    Junior Member
    • Nov 2024
    • 8

    User Portal - disable view dropdown

    I have a custom module, that is displaying correctly when a normal user or administrator log in and go into accounts, they can see the panel with relevant records, and without any options or dropdowns.

    However when the same layout (list small) is shown on the user portal, against each record is a dropdown with just the 'view' option. I would like to hide/disable this dropdown. Would appreciate any pointers to which file(s) I need to amend.

    I have tried to add "viewDisabled": true in the <custom_entity>.json within custom/Espo/Custom/Resources/metadata/clientDefs, but this has not made any difference in the user portal. I'm guessing there is an equivalent file/folder for the user portal, but not sure about this.

    Any assistance much appreciated.
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    can you share a screenshot.

    This could be due to permission, if the portal use has view record permission the drop down will have only view.

    i am afriad "viewDisabled": true in the <custom_entity>.json is not how things work in espocrm. you can create a custom view for the record and check if current user is portal them provide certain rowActions view.
    Rabii
    Web Dev

    Comment

    • jawaidk
      Junior Member
      • Nov 2024
      • 8

      #3
      Yes here are the screenshots:

      Click image for larger version

Name:	Screenshot From 2024-12-06 08-42-20.png
Views:	55
Size:	30.5 KB
ID:	112876

      Just don't want to see the dropdown on the right handside of each record, the only option on the dropdown is view as shown in the screenshot below:

      Click image for larger version

Name:	Screenshot From 2024-12-06 08-44-01.png
Views:	50
Size:	31.5 KB
ID:	112877
      Last edited by jawaidk; 12-06-2024, 08:51 AM.

      Comment


      • rabii
        rabii commented
        Editing a comment
        is this on a list view or this is a relationship panel ?
    • jawaidk
      Junior Member
      • Nov 2024
      • 8

      #4
      This is on list view.

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #5
        You can create a custom list view for your entity which extends the existing views/record/list and just disable the rowActions.

        Create a list.js under client/custom/src/views/your-entity/record and use code below

        For example to apply this to the list view you would create a list.js under client/custom/src/views/account/record and below the code you need to disable the rowActions fo the list view.

        PHP Code:
        define('custom:views/account/record/list', ['views/record/list'], ListView => {
        
            return class extends ListView {
            
                rowActionsDisabled = true
            
            }
        
        }); 
        

        Then assign this view in your clientDefs > account.json (under Espo/Custom/Resources/metadata/clientDefs folder) as below

        PHP Code:
        "recordViews": {
            "list": "custom:views/account/record/list"
        } 
        

        Hope this help
        Last edited by rabii; 12-17-2024, 04:51 PM.
        Rabii
        Web Dev

        Comment

        Working...