Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#60144] primerize wp types settings form #17704

Merged

Conversation

Kharonus
Copy link
Member

Ticket

OP#60144

What are you trying to accomplish?

  • harmonize look and feel of work package type forms

What approach did you choose and why?

  • remove old form for new and edit
  • add primer form component

- https://community.openproject.org/work_packages/60144
- remove old form for new and edit
- add primer form component
@Kharonus Kharonus requested a review from a team January 23, 2025 14:27
@Kharonus Kharonus self-assigned this Jan 23, 2025
Copy link
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look (literally) nice.

(Obviously assuming the failing spec will be fixed)

app/forms/work_packages/types/settings_form.rb Outdated Show resolved Hide resolved
- fetch correct parameter for copy workflow value on form submission
- initialize form with this parameter if available
- fix feature spec with new UI
@Kharonus Kharonus force-pushed the implementation/60144-primerize-work-package-type-settings-form branch from 979dc2a to af0a31d Compare January 27, 2025 14:58
app/views/types/new.html.erb Outdated Show resolved Hide resolved
app/components/work_packages/types/settings_component.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@mereghost mereghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of questions but nothing that should block the merge. :shipit:

app/components/work_packages/types/settings_component.rb Outdated Show resolved Hide resolved
CreateTypeService
.new(current_user)
.call(permitted_type_params, copy_workflow_from: params[:copy_workflow_from]) do |call|
.call(permitted_type_params, copy_workflow_from: params.dig(:type, :copy_workflow_from)) do |call|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Am I missing something here (most probably yes) but since we are feeding the all the permitted type params, why do we need to the copy_workflow_from as a special ❄️?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy_workflow_from is no property from the type record.

previously (as you can see from the change) it was passed not even inside params|type but directly on top level params.

Usually, having something like this, I'd rework the whole form to use a form model, as this is apparently what the create service wants. But for sake of simplicity I tried to keep the previous approach alive. But with the primer forms I no longer was able to define the form input field outside the "model".

app/controllers/types_controller.rb Show resolved Hide resolved
- use maybe to convert from parameter value to integer
- split create and update form options
- add 303 status to redirection in types controller
@Kharonus Kharonus merged commit f20fc43 into dev Jan 29, 2025
12 checks passed
@Kharonus Kharonus deleted the implementation/60144-primerize-work-package-type-settings-form branch January 29, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants