Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Revert "Add alias conversion from `status_code` to `status`"

Aaron Contreras408adcb8cbc6
diff --git a/config/constants/ar_to_api_conversions.rb b/config/constants/ar_to_api_conversions.rb
index bc5a2fdde3c..9923b945f03 100644
--- a/config/constants/ar_to_api_conversions.rb
+++ b/config/constants/ar_to_api_conversions.rb
@@ -35,7 +35,6 @@ module Constants
assigned_to: 'assignee',
version: 'version',
done_ratio: 'percentageDone',
- status_code: 'status',
estimated_hours: 'estimatedTime',
remaining_hours: 'remainingTime',
spent_hours: 'spentTime',
diff --git a/lib/api/decorators/linked_resource.rb b/lib/api/decorators/linked_resource.rb
index a7bc30db1fc..b76d99deda4 100644
--- a/lib/api/decorators/linked_resource.rb
+++ b/lib/api/decorators/linked_resource.rb
@@ -60,16 +60,14 @@ module API
getter:,
setter:,
link:,
- as: name,
uncacheable_link: false,
show_if: ->(*) { true },
skip_render: nil,
embedded: true)
- link(link_attr(as, uncacheable_link), &link)
+ link(link_attr(name, uncacheable_link), &link)
property name,
- as:,
exec_context: :decorator,
getter:,
setter:,
diff --git a/lib/api/v3/projects/copy/project_copy_payload_representer.rb b/lib/api/v3/projects/copy/project_copy_payload_representer.rb
index 70c1e43d8a8..18563d0573a 100644
--- a/lib/api/v3/projects/copy/project_copy_payload_representer.rb
+++ b/lib/api/v3/projects/copy/project_copy_payload_representer.rb
@@ -39,6 +39,10 @@ module API
def meta_representer_class
ProjectCopyMetaRepresenter
end
+
+ def writable_attributes
+ super + %w[status]
+ end
end
end
end
diff --git a/lib/api/v3/projects/project_payload_representer.rb b/lib/api/v3/projects/project_payload_representer.rb
index 0956a775daa..079b35e5a35 100644
--- a/lib/api/v3/projects/project_payload_representer.rb
+++ b/lib/api/v3/projects/project_payload_representer.rb
@@ -33,6 +33,10 @@ module API
include ::API::Utilities::PayloadRepresenter
cached_representer disabled: true
+
+ def writable_attributes
+ super + %w[status]
+ end
end
end
end
diff --git a/lib/api/v3/projects/project_representer.rb b/lib/api/v3/projects/project_representer.rb
index a919d024462..27a8eba2bde 100644
--- a/lib/api/v3/projects/project_representer.rb
+++ b/lib/api/v3/projects/project_representer.rb
@@ -188,8 +188,7 @@ module API
date_time_property :updated_at
- resource :status_code,
- as: :status,
+ resource :status,
getter: ->(*) {
next unless represented.status_code