Skip to content

Commit

Permalink
more proper input stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Dec 3, 2024
1 parent 287b11d commit 0ea75ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions modules/costs/app/components/time_entries/time_entry_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ class TimeEntryForm < ApplicationForm
}
)

f.text_field name: :spent_on, label: "Date"
# TODO: Repalce with single date picker from
# https://github.com/opf/openproject/pull/17223/commits/db765ac3862ded78139e6b8827e33cf2b8b3bce8
f.text_field name: :spent_on,
type: "date",
label: "Date"

f.group(layout: :horizontal) do |g|
# TODO: Add a time picker based on the date picker linked above
g.text_field name: :start_time,
label: "Start time",
data: { "time-entry-target" => "startTimeInput" }
Expand All @@ -42,7 +47,8 @@ class TimeEntryForm < ApplicationForm
f.work_package_autocompleter name: :work_package_id,
label: "Work package",
autocomplete_options: {
append_to: "#time-entry-dialog"
append_to: "#time-entry-dialog",
filters: [{ name: "project_id", operator: "=", values: [model.project_id] }]

}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def dialog
# TODO: Properly handle authorization
TimeEntry.find_by(id: params[:time_entry_id])
else
TimeEntry.new(project: @project)
TimeEntry.new(project: @project, user: User.current)
end
end

Expand Down

0 comments on commit 0ea75ec

Please sign in to comment.