AnsweredAssumed Answered

Hide field on edit site

Question asked by luiscesarinfo on Jun 19, 2017
Latest reply on Mar 20, 2018 by guisup

I'm trying to hide some fields on create and edit site and I got success in my modification for create-site dialog, however for edit-site dialog, nothing happened and I don't know why.

In the below code, I'm removing the options "Public" and "Moderated" of visibility field.
 

I'm using alfresco community 201704.

 

Following my share-header.get.js

 

 

var siteService = widgetUtils.findObject(model.jsonModel, "id", "SITE_SERVICE");
if (siteService && siteService.config) {
   siteService.config.widgetsForCreateSiteDialogOverrides = [{
      id: "CREATE_SITE_FIELD_PRESET",
      replace: true,
      name: "alfresco/forms/controls/Select",
      config: {
         fieldId: "PRESET",
         label: "create-site.dialog.type.label",
         name: "sitePreset",
         optionsConfig: {
            fixed: "{sitePresets}"
         },
         visibilityConfig: {
            initialValue: false
         }
      }
   },{
      id: "CREATE_SITE_FIELD_VISIBILITY",
      replace: true,
      name: "alfresco/forms/controls/RadioButtons",
      config: {
         fieldId: "VISIBILITY",
         label: "create-site.dialog.visibility.label",
         name: "visibility",
         optionsConfig: {
            fixed: [{
               label: "create-site.dialog.visibility.private",
               description: "create-site.dialog.visibility.private.description",
               value: "PRIVATE"
            }]
         },
         visibilityConfig: {
            initialValue: false
         }
      }
   }];

   siteService.config.widgetsForEditSiteDialogOverrides = [{
      id: "EDIT_SITE_FIELD_VISIBILITY",
      replace: true,
      name: "alfresco/forms/controls/RadioButtons",
      config: {
         fieldId: "VISIBILITY",
         label: "VISIBIITY",
         name: "visibility",
         optionsConfig: {
            fixed: [{
               label: "create-site.dialog.visibility.private",
               description: "create-site.dialog.visibility.private.description",
               value: "PRIVATE"
            }]
         }
      }
   }];
}

 

Regards,

 

Luís Camargo

Outcomes