foreman-tasks 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_tasks/api/tasks_controller.rb +1 -4
- data/app/lib/actions/observable_action.rb +1 -1
- data/db/migrate/20180927120509_add_user_id.foreman_tasks.rb +4 -2
- data/lib/foreman_tasks/version.rb +1 -1
- data/test/controllers/api/tasks_controller_test.rb +1 -1
- data/test/controllers/tasks_controller_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bb66102c3571249534dc929d2f1515666d393d4d9f7987c098e529849bfeca7
|
4
|
+
data.tar.gz: 01c53850b401aaf7c50f4807a5947956bdfe0fa99582c778bd615fba922286f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc272bf14fd55504672179272d3b26123b0d3c68cc6ddd97a8181bf9cfc1dd257e809501b9cb4d94cfe5730e8098c2fa0232fe26b35d227921520a66d976ae39
|
7
|
+
data.tar.gz: 4b264080240f04e2544af9d026026df2c70f126f4168cef1f74a21fd0d810c21b7696f8fc7520c107d4402ea5bfad0762c75c93d6679c841e406e4d0898c23bd
|
@@ -253,10 +253,7 @@ module ForemanTasks
|
|
253
253
|
if search_params[:user_id].blank?
|
254
254
|
raise BadRequest, _('User search_params requires user_id to be specified')
|
255
255
|
end
|
256
|
-
scope.
|
257
|
-
{ name: ::ForemanTasks::Lock::OWNER_LOCK_NAME,
|
258
|
-
resource_type: 'User',
|
259
|
-
resource_id: search_params[:user_id] })
|
256
|
+
scope.search_for("user_id = #{search_params[:user_id]}")
|
260
257
|
when 'resource'
|
261
258
|
if search_params[:resource_type].blank? || search_params[:resource_id].blank?
|
262
259
|
raise BadRequest,
|
@@ -70,7 +70,7 @@ module Actions
|
|
70
70
|
apipie :class, "An common ancestor action for observable actions" do
|
71
71
|
name 'Actions::ObservableAction'
|
72
72
|
refs 'Actions::ObservableAction'
|
73
|
-
sections only: %w[webhooks]
|
73
|
+
sections only: %w[all webhooks]
|
74
74
|
property :task, object_of: 'Task', desc: 'Returns the task to which this action belongs'
|
75
75
|
end
|
76
76
|
class Jail < Safemode::Jail
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class AddUserId < ActiveRecord::Migration[5.0]
|
2
|
+
OWNER_LOCK_NAME = :task_owner
|
3
|
+
|
2
4
|
def up
|
3
5
|
add_reference :foreman_tasks_tasks, :user, :foreign_key => true
|
4
6
|
|
@@ -29,7 +31,7 @@ class AddUserId < ActiveRecord::Migration[5.0]
|
|
29
31
|
private
|
30
32
|
|
31
33
|
def create_lock(user_id, task)
|
32
|
-
ForemanTasks::Lock.new(:name =>
|
34
|
+
ForemanTasks::Lock.new(:name => OWNER_LOCK_NAME,
|
33
35
|
:resource_type => User.name,
|
34
36
|
:resource_id => user_id,
|
35
37
|
:task_id => task.id,
|
@@ -37,6 +39,6 @@ class AddUserId < ActiveRecord::Migration[5.0]
|
|
37
39
|
end
|
38
40
|
|
39
41
|
def user_locks
|
40
|
-
ForemanTasks::Lock.where(:name =>
|
42
|
+
ForemanTasks::Lock.where(:name => OWNER_LOCK_NAME)
|
41
43
|
end
|
42
44
|
end
|
@@ -29,7 +29,7 @@ module ForemanTasks
|
|
29
29
|
|
30
30
|
it 'renders task ids when searching by resource id' do
|
31
31
|
task = FactoryBot.create(:dynflow_task, :product_create_task)
|
32
|
-
ForemanTasks::
|
32
|
+
ForemanTasks::Link.create!(resource_type: "Katello::Product", resource_id: 1, task_id: task.id)
|
33
33
|
get :index, params: { :search => "label = Actions::Katello::Product::Create and resource_id = 1" }
|
34
34
|
assert_response :success
|
35
35
|
data = JSON.parse(response.body)
|
@@ -44,8 +44,8 @@ module ForemanTasks
|
|
44
44
|
@locations = [0, 0].map { FactoryBot.create(:location) }
|
45
45
|
@tasks = [0, 0].map { FactoryBot.create(:some_task) }
|
46
46
|
@tasks.zip(@organizations, @locations).each do |task, org, loc|
|
47
|
-
|
48
|
-
|
47
|
+
Link.link!(org, task)
|
48
|
+
Link.link!(loc, task)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|