06-19-2017 11:08 AM
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
06-20-2017 01:25 AM
How did you apply your customisation? Does the Surf extension module have some evaluator to determine when it should be applied? Did you apply the Surf extension module to both regular Share pages as well as Aikau-based pages? Which version of Aikau are you using?
06-22-2017 01:00 PM
Thanks for answer Axel Faust.
We are upgrading the Alfresco from 5.0.d to 5.2 201704 and for a while, we will use an old solution and configure the legacyMode.
I'm sure there a lot of configs missing and I have to learn and check everything.
Thank you very much for help.
12-11-2017 08:53 AM
HI,
I'm facing the same issue and even after upgraded from 5.0 to 5.2.
I have done the configs changes also but no success. Nothing got display for Edit site dialog.
Can you please let me know if you get the solution of the above issue?
Thanks a ton,
Simant
01-23-2018 07:41 AM
Sorry for late replay.
I'm still using the legacyMode. So far it has been enough for me.
Regards,
Luis
03-20-2018 05:32 PM
Hi, I have the same issue.
My solution : reset complelely the widgetsForEditSiteDialog and remove the elements you want (I have removed the Moderate option):
siteService.config.widgetsForEditSiteDialog = [
{
id : "EDIT_SITE_FIELD_TITLE",
name : "alfresco/forms/controls/TextBox",
config : {
fieldId : "TITLE",
label : "create-site.dialog.name.label",
name : "title",
requirementConfig : {
initialValue : true
},
validationConfig : [ {
validation : "maxLength",
length : 256,
errorMessage : "create-site.dialog.name.maxLength"
}, {
scopeValidation : true,
warnOnly : true,
validation : "validationTopic",
validationTopic : "ALF_VALIDATE_SITE_IDENTIFIER",
validationValueProperty : "title",
negate : true,
validateInitialValue : false,
validationResultProperty : "response.used",
errorMessage : "create-site-dialog.title.already.used"
} ]
}
},
{
id : "EDIT_SITE_FIELD_DESCRIPTION",
name : "alfresco/forms/controls/TextArea",
config : {
fieldId : "DESCRIPTION",
label : "create-site.dialog.description.label",
name : "description",
validationConfig : [ {
validation : "maxLength",
length : 512,
errorMessage : "create-site.dialog.description.maxLength"
} ]
}
},
{
id : "EDIT_SITE_FIELD_VISIBILITY",
name : "alfresco/forms/controls/RadioButtons",
config : {
fieldId : "VISIBILITY",
label : "create-site.dialog.visibility.label",
name : "visibility",
optionsConfig : {
fixed : [
{
label : "create-site.dialog.visibility.public",
description : "create-site.dialog.visibility.public.description",
value : "PUBLIC"
},
{
label : "create-site.dialog.visibility.private",
description : "create-site.dialog.visibility.private.description",
value : "PRIVATE"
} ]
}
}
} ];
08-04-2021 11:05 PM
Hello.
I was trying to perform the same kind of customization, and I got the same result as you described.
The widgetsForCreateSiteDialogOverrides works perfectly, but I could not find a way to use the similar widgetsForEditSiteDialog with the replace option.
So, in order to achieve the desired result, I had to use your solution, which is to complelely replace the widgets definition.
Thank you for sharing the workaround.
10-04-2021 02:05 AM
@douglascrp can you help me with paid support for this
11-25-2021 02:37 PM
After some months, I came back to this issue and finally found the solution for it.
Basically, I had to upgrade aikau for a version containing a fix delivered by @afaust
The details are available at https://github.com/Acosix/alfresco-site-hierarchy/issues/11#issuecomment-979438745
Explore our Alfresco products with the links below. Use labels to filter content by product module.