Skip to content
Permalink
Browse files

Fixes delete and delete recursive for artifacts

  • Loading branch information...
Markowski
Markowski committed Aug 8, 2018
1 parent 3f4719d commit bfc8c57ce61bff2f78c4a01e53ea3f315c3fb754
Showing with 10 additions and 25 deletions.
  1. +9 −24 app/controllers/re_artifact_properties_controller.rb
  2. +1 −1 config/routes.rb
@@ -379,7 +379,7 @@ def recursive_destroy
@children.each do |child|
child.destroy
end
@artifact_properties.destroy
#@artifact_properties.destroy

flash[:notice] = t(:re_deleted_artifact_and_children, :artifact => @artifact_properties.name)
redirect_to :controller => 'requirements', :action => 'index', :project_id => @project.id
@@ -393,38 +393,23 @@ def gather_artifact_and_relation_data_for_destroying

@children = gather_children(@artifact_properties)

# #@relationships_incoming.each do |rel|
# if rel.relation_type.eql? "parentchild"
# rel.delete
# end
# end
# @relationships_outgoing.each do |rel|
# if rel.relation_type.eql? "parentchild"
# rel.delete
# end
# end
@relationships_incoming.each do |rel|
rel.delete
end
@relationships_outgoing.each do |rel|
rel.delete
end
end

def how_to_delete
method = params[:mode]
@re_artifact_properties = ReArtifactProperties.find(params[:id])
@relationships_incoming = @re_artifact_properties.relationships_as_sink
@relationships_outgoing = @re_artifact_properties.relationships_as_source
@relationships_incoming = @re_artifact_properties.traces_as_sink
@relationships_outgoing = @re_artifact_properties.traces_as_source
@parent = @re_artifact_properties.parent

@children = gather_children(@re_artifact_properties)

# @relationships_incoming.each do |rel|
# if rel.relation_type.eql? "parentchild"
# rel.delete
# end
# end
# @relationships_outgoing.each do |rel|
# if rel.relation_type.eql? "parentchild"
# rel.delete
# end
# end

initialize_tree_data

if @re_artifact_properties.artifact_type == 'Project'
@@ -21,7 +21,7 @@
# ReArtifactProperties as "artifact"
resources :re_artifact_properties, :except => [:new, :index], :via => [:get, :post]

match 're_artifact_properties/:id/recursive_destroy' => 're_artifact_properties#recursive_destroy', :via => [:get, :post]
match 're_artifact_properties/:id/recursive_destroy' => 're_artifact_properties#recursive_destroy', :via => [:get, :post, :delete]
match 're_artifact_properties/:id/how_to_delete' => 're_artifact_properties#how_to_delete', :via => [:get, :post]
match 'projects/:project_id/requirements/remove/:artifactid/from_issue/:issueid' => 're_artifact_properties#remove_artifact_from_issue', :via => [:get, :post]
match 'projects/:project_id/requirements/artifact/new/:artifact_type' => 're_artifact_properties#new', :via => [:get, :post]

0 comments on commit bfc8c57

Please sign in to comment.
You can’t perform that action at this time.