Skip to content

Commit

Permalink
correct filter search depending on object and add wrapper for dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Nov 29, 2024
1 parent 60f1771 commit f207f06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ def search_key
end

def filters
[
filters = [
{ name: "type", operator: "=", values: ["User", "Group", "PlaceholderUser"] },
{ name: "member", operator: "=", values: [@object.id.to_s] },
{ name: "status", operator: "!", values: [Principal.statuses["locked"].to_s] }
]

if @object.is_a?(Project)
filters << { name: "member", operator: "=", values: [@object.id.to_s] }
elsif @object.respond_to?(:project_id)
filters << { name: "member", operator: "=", values: [@object.project_id.to_s] }
end

filters
end
end
4 changes: 4 additions & 0 deletions modules/costs/app/components/time_entries/time_entry_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class TimeEntryForm < ApplicationForm
render_custom_fields(form: f)
end

def additional_custom_field_input_arguments
{ wrapper_id: "time-entry-dialog" }
end

private

delegate :project, :work_package, to: :model
Expand Down

0 comments on commit f207f06

Please sign in to comment.