Hello fellow creators! I have problems with extending BaseSectionV2 schema. I want to disable View button , so I created a replacing module of BaseSectionV2 and wrote some code, but it's not working. Any advice would be much appreciated
define("BaseSectionV2",[],function(){
return {
entitySchemaName:"Base",
details:/**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
attributes:{},
methods:{
checkIsAdmin:function() {
var user = Terrasoft.SysValue.CURRENT_USER;
var name = user.displayValue;
if(name==='Supervisor')
return true;
return false;
}
},
diff:/**SCHEMA_DIFF*/[
{
"operation": "merge",
"name": "AnalyticsModeViewOptionsButton",
"parentName": "AnalyticsModeActionButtonsRightContainer",
"propertyName": "items",
"values": {
"itemType": Terrasoft.ViewItemType.BUTTON,
"caption": { "bindTo": "Resources.Strings.ViewOptionsButtonCaption"},
"enabled": { "bindTo": "checkIsAdmin"},
}
}
]/**SCHEMA_DIFF*/
};
});