相关表列表支持显示自定义按钮 #2697

This commit is contained in:
baozhoutao 2022-01-15 11:38:40 +08:00
parent fb972b5aa5
commit 08bc891736

View File

@ -558,6 +558,22 @@ Creator.getRelatedObjectNames = (object_name, spaceId, userId)->
related_objects = Creator.getRelatedObjects(object_name, spaceId, userId)
return _.pluck(related_objects,"object_name")
Creator.getRelatedObjectListActions = (relatedObjectName, spaceId, userId)->
actions = Creator.getActions(relatedObjectName, spaceId, userId)
actions = _.filter actions, (action)->
if action.name == "standard_follow"
return false
if action.name == "standard_query"
return false
if action.on == "list"
if typeof action.visible == "function"
return action.visible()
else
return action.visible
else
return false
return actions
Creator.getActions = (object_name, spaceId, userId)->
if Meteor.isClient
if !object_name