end
def show_pane_list
- %w(Contents Permissions Advanced)
+ %w(Data_collections Jobs_and_pipelines Pipeline_templates Subprojects Other_objects Permissions Advanced)
end
def remove_item
end
@objects = @object.contents(limit: 50,
include_linked: true,
+ filters: params[:filters],
offset: params[:offset] || 0)
@share_links = Link.filter([['head_uuid', '=', @object.uuid],
['link_class', '=', 'permission']])
@logs = Log.limit(10).filter([['object_uuid', '=', @object.uuid]])
- @objects_and_names = []
- @objects.each do |object|
- if !(name_links = @objects.links_for(object, 'name')).empty?
- name_links.each do |name_link|
- @objects_and_names << [object, name_link]
- end
- elsif object.respond_to? :name
- @objects_and_names << [object, object]
- else
- @objects_and_names << [object,
- Link.new(owner_uuid: @object.uuid,
- tail_uuid: @object.uuid,
- head_uuid: object.uuid,
- link_class: "name",
- name: "")]
- end
- end
+ @objects_and_names = get_objects_and_names @objects
+
if params[:partial]
respond_to do |f|
f.json {
@updates = params['project']
super
end
+
+ helper_method :get_objects_and_names
+ def get_objects_and_names(objects)
+ objects_and_names = []
+ objects.each do |object|
+ if !(name_links = objects.links_for(object, 'name')).empty?
+ name_links.each do |name_link|
+ objects_and_names << [object, name_link]
+ end
+ elsif object.respond_to? :name
+ objects_and_names << [object, object]
+ else
+ objects_and_names << [object,
+ Link.new(owner_uuid: @object.uuid,
+ tail_uuid: @object.uuid,
+ head_uuid: object.uuid,
+ link_class: "name",
+ name: "")]
+ end
+ end
+ objects_and_names
+ end
+
end