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

[Op#54456] Display the mapped projects list in the project attributes detail view #15476

Conversation

akabiru
Copy link
Member

@akabiru akabiru commented May 6, 2024

https://community.openproject.org/work_packages/54456

Implementation

Dev Notes

🚧 An empty list is returned at present even though resolving the query locally returns results. I haven't dug into why this is happening yet

[2] pry(#<Settings::ProjectCustomFields::ProjectCustomFieldMapping::TableComponent>)> query
=> #<Queries::Projects::ProjectQuery:0x0000fffeeb34f608
 id: nil,
 name: "project-custom-field-mapping-14",
 user_id: nil,
 filters:
  [#<Queries::Projects::Filters::AvailableProjectAttributesFilter:0x0000fffef079ca30
    @context=#<Queries::Projects::ProjectQuery:0x0000fffeeb34f608 ...>,
    @name=:available_project_attributes,
    @operator="~",
    @values=["14"]>],
 selects: [],
 orders: [],
 created_at: nil,
 updated_at: nil>
[3] pry(#<Settings::ProjectCustomFields::ProjectCustomFieldMapping::TableComponent>)> query.results
  ProjectCustomFieldProjectMapping Pluck (0.8ms)  SELECT "project_custom_field_project_mappings"."custom_field_id" FROM "project_custom_field_project_mappings"
   app/models/queries/projects/filters/available_project_attributes_filter.rb:42:in `allowed_values'
=>   Project Load (0.3ms)  SELECT "projects".* FROM "projects" INNER JOIN "project_custom_field_project_mappings" ON "project_custom_field_project_mappings"."project_id" = "projects"."id" WHERE "project_custom_field_project_mappings"."custom_field_id" = $1 /* loading for pp */ ORDER BY "projects"."id" DESC LIMIT $2  [["custom_field_id", 14], ["LIMIT", 11]]
  ↳ app/components/projects/table_component.rb:43:in `before_render'
[#<Project:0x0000fffeeba92ca8
  id: 1,
  name: "Demo project",
  description: "This is a short summary of the goals of this demo project.",
  public: true,
  parent_id: nil,
  created_at: Thu, 25 Apr 2024 09:36:43.282536000 UTC +00:00,
  updated_at: Fri, 26 Apr 2024 09:08:58.217300000 UTC +00:00,
  identifier: "demo-project",
  lft: 11,
  rgt: 12,
  active: true,
  templated: false,
  status_code: "on_track",
  status_explanation: "All tasks are on schedule. The people involved know their tasks. The system is completely set up.">]

attributes-cmpt

project-mappings.mp4

@apfohl apfohl force-pushed the task/54456-develop-a-strategy-on-how-to-reuse-the-current-project-list-implementation branch from 7ccd435 to d85d12d Compare May 6, 2024 11:25
@akabiru akabiru force-pushed the task/54459-investigate-queries-and-filters-to-display-the-project-list-in-projects-attribute-settings-view branch from 2bd405c to 96ac329 Compare May 6, 2024 13:10
Co-authored-by: Pavel Balashou <p.balashou@openproject.com>
@akabiru akabiru force-pushed the task/54456-develop-a-strategy-on-how-to-reuse-the-current-project-list-implementation branch from 0a91220 to f9fd551 Compare May 14, 2024 15:14
Base automatically changed from task/54459-investigate-queries-and-filters-to-display-the-project-list-in-projects-attribute-settings-view to dev May 15, 2024 11:47
@akabiru akabiru changed the title [Op#54456] develop a strategy on how to reuse the current project list implementation [Op#54456] Display the mapped projects list in the project attributes detail view May 16, 2024
@akabiru akabiru marked this pull request as ready for review May 16, 2024 16:41
@akabiru akabiru requested review from apfohl and a team May 16, 2024 16:41
@akabiru akabiru added this to the 14.2.x milestone May 16, 2024
@akabiru akabiru merged commit 4abfa25 into dev May 21, 2024
9 checks passed
@akabiru akabiru deleted the task/54456-develop-a-strategy-on-how-to-reuse-the-current-project-list-implementation branch May 21, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants