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

Remove obsolete property `visibility`

Henriette Dingera5811fc13428
diff --git a/lib/api/decorators/allowed_values_by_collection_representer.rb b/lib/api/decorators/allowed_values_by_collection_representer.rb
index f9de49f1aea..256749e7762 100644
--- a/lib/api/decorators/allowed_values_by_collection_representer.rb
+++ b/lib/api/decorators/allowed_values_by_collection_representer.rb
@@ -46,7 +46,6 @@ module API
required: true,
has_default: false,
writable: true,
- visibility: nil,
attribute_group: nil,
current_user: nil,
allowed_values_getter: nil)
@@ -59,7 +58,6 @@ module API
required: required,
has_default: has_default,
writable: writable,
- visibility: visibility,
attribute_group: attribute_group,
current_user: current_user)
end
diff --git a/lib/api/decorators/property_schema_representer.rb b/lib/api/decorators/property_schema_representer.rb
index 6249d6011d6..2cd8d9ed22f 100644
--- a/lib/api/decorators/property_schema_representer.rb
+++ b/lib/api/decorators/property_schema_representer.rb
@@ -35,18 +35,13 @@ module API
class PropertySchemaRepresenter < ::API::Decorators::Single
def initialize(
type:, name:, required: true, has_default: false, writable: true,
- visibility: nil, attribute_group: nil, current_user: nil
+ attribute_group: nil, current_user: nil
)
@type = type
@name = name
@required = required
@has_default = has_default
@writable = writable
- @visibility = if visibility == false
- nil
- else
- visibility || 'default'
- end
@attribute_group = attribute_group
super(nil, current_user: current_user)
@@ -57,7 +52,6 @@ module API
:required,
:has_default,
:writable,
- :visibility,
:attribute_group,
:min_length,
:max_length,
@@ -69,7 +63,6 @@ module API
property :required, exec_context: :decorator
property :has_default, exec_context: :decorator
property :writable, exec_context: :decorator
- property :visibility, exec_context: :decorator
property :attribute_group, exec_context: :decorator
property :min_length, exec_context: :decorator
property :max_length, exec_context: :decorator
diff --git a/lib/api/decorators/schema_representer.rb b/lib/api/decorators/schema_representer.rb
index 55712312054..206eef1626f 100644
--- a/lib/api/decorators/schema_representer.rb
+++ b/lib/api/decorators/schema_representer.rb
@@ -58,7 +58,6 @@ module API
required: true,
has_default: false,
writable: default_writable_property(property),
- visibility: nil,
attribute_group: nil,
min_length: nil,
max_length: nil,
@@ -71,7 +70,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
min_length,
max_length,
@@ -96,7 +94,6 @@ module API
required: true,
has_default: false,
writable: default_writable_property(property),
- visibility: nil,
attribute_group: nil,
show_if: true)
getter = ->(*) do
@@ -105,7 +102,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
href_callback)
end
@@ -131,7 +127,6 @@ module API
required: true,
has_default: false,
writable: default_writable_property(property),
- visibility: nil,
attribute_group: nil,
show_if: true)
@@ -144,7 +139,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
values_callback,
nil)
@@ -169,7 +163,6 @@ module API
required: true,
has_default: false,
writable: default_writable_property(property),
- visibility: nil,
attribute_group: nil,
show_if: true)
getter = ->(*) do
@@ -181,7 +174,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
values_callback,
->(*) {
@@ -284,7 +276,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
min_length,
max_length,
@@ -297,7 +288,6 @@ module API
required: call_or_use(required),
has_default: call_or_use(has_default),
writable: call_or_use(writable),
- visibility: call_or_use(visibility),
attribute_group: call_or_use(attribute_group))
schema.min_length = min_length
schema.max_length = max_length
@@ -312,7 +302,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
href_callback)
representer = ::API::Decorators::AllowedValuesByLinkRepresenter
@@ -321,7 +310,6 @@ module API
required: call_or_use(required),
has_default: call_or_use(has_default),
writable: call_or_use(writable),
- visibility: call_or_use(visibility),
attribute_group: call_or_use(attribute_group))
if form_embedded
@@ -339,7 +327,6 @@ module API
required,
has_default,
writable,
- visibility,
attribute_group,
values_callback,
allowed_values_getter)
@@ -358,7 +345,6 @@ module API
required: call_or_use(required),
has_default: call_or_use(has_default),
writable: call_or_use(writable),
- visibility: call_or_use(visibility),
attribute_group: call_or_use(attribute_group) }
attributes[:allowed_values_getter] = allowed_values_getter if allowed_values_getter
diff --git a/lib/api/v3/memberships/schemas/membership_schema_representer.rb b/lib/api/v3/memberships/schemas/membership_schema_representer.rb
index dd58666fc91..2fb67835742 100644
--- a/lib/api/v3/memberships/schemas/membership_schema_representer.rb
+++ b/lib/api/v3/memberships/schemas/membership_schema_representer.rb
@@ -39,17 +39,14 @@ module API
end
schema :id,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :created_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema_with_allowed_link :project,
has_default: false,
required: true,
- visibility: false,
href_callback: ->(*) {
allowed_projects_href
}
@@ -57,7 +54,6 @@ module API
schema_with_allowed_link :principal,
has_default: false,
required: true,
- visibility: false,
href_callback: ->(*) {
allowed_principal_href
}
@@ -67,7 +63,6 @@ module API
name_source: :role,
has_default: false,
required: true,
- visibility: false,
href_callback: ->(*) {
api_v3_paths.path_for(:roles, filters: [{ unit: { operator: '=', values: ['project'] } }])
}
diff --git a/lib/api/v3/projects/schemas/project_schema_representer.rb b/lib/api/v3/projects/schemas/project_schema_representer.rb
index 8ecde8b072a..0c04bf2dd8b 100644
--- a/lib/api/v3/projects/schemas/project_schema_representer.rb
+++ b/lib/api/v3/projects/schemas/project_schema_representer.rb
@@ -37,45 +37,37 @@ module API
custom_field_injector type: :schema_representer
schema :id,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :name,
type: 'String',
- visibility: false,
min_length: 1,
max_length: 255
schema :identifier,
type: 'String',
- visibility: false,
min_length: 1,
max_length: 100
schema :description,
type: 'Formattable',
- visibility: false,
required: false
schema :public,
- type: 'Boolean',
- visibility: false
+ type: 'Boolean'
schema :active,
- type: 'Boolean',
- visibility: false
+ type: 'Boolean'
schema :status,
type: 'ProjectStatus',
name_source: ->(*) { I18n.t('activerecord.attributes.project/status.code') },
- visibility: false,
required: false,
writable: ->(*) { represented.writable?(:status) }
schema :status_explanation,
type: 'Formattable',
name_source: ->(*) { I18n.t('activerecord.attributes.project/status.explanation') },
- visibility: false,
required: false,
writable: ->(*) { represented.writable?(:status) }
@@ -93,12 +85,10 @@ module API
}
schema :created_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema :updated_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
def self.represented_class
::Project
diff --git a/lib/api/v3/queries/schemas/custom_option_filter_dependency_representer.rb b/lib/api/v3/queries/schemas/custom_option_filter_dependency_representer.rb
index 0542cc7be73..203fabf7f43 100644
--- a/lib/api/v3/queries/schemas/custom_option_filter_dependency_representer.rb
+++ b/lib/api/v3/queries/schemas/custom_option_filter_dependency_representer.rb
@@ -40,7 +40,6 @@ module API
writable: true,
has_default: false,
required: true,
- visibility: false,
values_callback: ->(*) {
represented.custom_field.custom_options
},
diff --git a/lib/api/v3/queries/schemas/filter_dependency_representer.rb b/lib/api/v3/queries/schemas/filter_dependency_representer.rb
index a61c4899683..a565a882020 100644
--- a/lib/api/v3/queries/schemas/filter_dependency_representer.rb
+++ b/lib/api/v3/queries/schemas/filter_dependency_representer.rb
@@ -46,7 +46,6 @@ module API
writable: true,
has_default: false,
required: true,
- visibility: false,
href_callback: ->(*) {
href_callback
},
diff --git a/lib/api/v3/queries/schemas/query_filter_instance_schema_representer.rb b/lib/api/v3/queries/schemas/query_filter_instance_schema_representer.rb
index 9aad277a799..186e159dadf 100644
--- a/lib/api/v3/queries/schemas/query_filter_instance_schema_representer.rb
+++ b/lib/api/v3/queries/schemas/query_filter_instance_schema_representer.rb
@@ -41,8 +41,7 @@ module API
type: 'String',
writable: false,
has_default: true,
- required: true,
- visibility: false
+ required: true
def self.filter_representer
::API::V3::Queries::Filters::QueryFilterRepresenter
@@ -61,7 +60,6 @@ module API
type: 'QueryFilter',
required: true,
writable: true,
- visibility: false,
values_callback: -> {
[filter]
},
@@ -86,7 +84,6 @@ module API
writable: true,
has_default: false,
required: true,
- visibility: false,
values_callback: -> {
filter.available_operators
},
diff --git a/lib/api/v3/queries/schemas/query_schema_representer.rb b/lib/api/v3/queries/schemas/query_schema_representer.rb
index 4cdaff48aed..70a7413bb8b 100644
--- a/lib/api/v3/queries/schemas/query_schema_representer.rb
+++ b/lib/api/v3/queries/schemas/query_schema_representer.rb
@@ -61,34 +61,28 @@ module API
end
schema :id,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :name,
type: 'String',
writable: true,
min_length: 1,
- max_length: 255,
- visibility: false
+ max_length: 255
schema :created_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema :updated_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema :user,
type: 'User',
- has_default: true,
- visibility: false
+ has_default: true
schema_with_allowed_link :project,
type: 'Project',
required: false,
writable: true,
- visibility: false,
href_callback: ->(*) {
api_v3_paths.query_available_projects
}
@@ -100,85 +94,73 @@ module API
represented.project,
global: represented.project.nil?)
end,
- has_default: true,
- visibility: false
+ has_default: true
schema :sums,
type: 'Boolean',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :timeline_visible,
type: 'Boolean',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :timeline_zoom_level,
type: 'String',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :timeline_labels,
type: 'QueryTimelineLabels',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :highlighting_mode,
type: 'String',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :display_representation,
type: 'String',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :show_hierarchies,
type: 'Boolean',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :starred,
type: 'Boolean',
required: false,
writable: false,
- has_default: true,
- visibility: false
+ has_default: true
schema :hidden,
type: 'Boolean',
required: true,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema :ordered_work_packages,
type: 'QueryOrder',
required: false,
writable: true,
- has_default: true,
- visibility: false
+ has_default: true
schema_with_allowed_collection :columns,
type: '[]QueryColumn',
required: false,
writable: true,
has_default: true,
- visibility: false,
values_callback: -> { represented.available_columns },
value_representer: ->(column) {
Columns::QueryColumnsFactory.representer(column)
@@ -204,7 +186,6 @@ module API
type: '[]QueryGroupBy',
required: false,
writable: true,
- visibility: false,
values_callback: -> { represented.groupable_columns },
value_representer: GroupBys::QueryGroupByRepresenter,
link_factory: ->(column) {
@@ -221,7 +202,6 @@ module API
required: false,
writable: true,
has_default: true,
- visibility: false,
values_callback: -> { represented.available_highlighting_columns },
value_representer: ->(column) {
Columns::QueryColumnsFactory.representer(column)
@@ -241,7 +221,6 @@ module API
required: false,
writable: true,
has_default: true,
- visibility: false,
values_callback: -> do
values = represented.sortable_columns.map do |column|
[SortBys::SortByDecorator.new(column, 'asc'),
@@ -263,8 +242,7 @@ module API
schema :results,
type: 'WorkPackageCollection',
required: false,
- writable: false,
- visibility: false
+ writable: false
property :filters_schemas,
embedded: true,
diff --git a/lib/api/v3/versions/schemas/version_schema_representer.rb b/lib/api/v3/versions/schemas/version_schema_representer.rb
index af889f922a1..af99e25b315 100644
--- a/lib/api/v3/versions/schemas/version_schema_representer.rb
+++ b/lib/api/v3/versions/schemas/version_schema_representer.rb
@@ -45,30 +45,25 @@ module API
end
schema :id,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :name,
type: 'String',
min_length: 1,
- max_length: 60,
- visibility: false
+ max_length: 60
schema :description,
type: 'Formattable',
- required: false,
- visibility: false
+ required: false
schema :start_date,
type: 'Date',
- required: false,
- visibility: false
+ required: false
schema :due_date,
as: 'endDate',
type: 'Date',
- required: false,
- visibility: false
+ required: false
schema_with_allowed_string_collection :status,
type: 'String'
@@ -80,7 +75,6 @@ module API
as: :definingProject,
has_default: false,
required: true,
- visibility: false,
href_callback: ->(*) {
next unless represented.new_record?
@@ -88,12 +82,10 @@ module API
}
schema :created_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema :updated_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
def self.represented_class
Version
diff --git a/modules/backlogs/lib/api/v3/queries/schemas/backlogs_type_dependency_representer.rb b/modules/backlogs/lib/api/v3/queries/schemas/backlogs_type_dependency_representer.rb
index 2e21973abef..9f49270e6c8 100644
--- a/modules/backlogs/lib/api/v3/queries/schemas/backlogs_type_dependency_representer.rb
+++ b/modules/backlogs/lib/api/v3/queries/schemas/backlogs_type_dependency_representer.rb
@@ -45,7 +45,6 @@ module API
writable: true,
has_default: false,
required: true,
- visibility: false,
values_callback: ->(*) {
represented.allowed_values
},
diff --git a/modules/grids/app/representers/api/v3/grids/schemas/grid_schema_representer.rb b/modules/grids/app/representers/api/v3/grids/schemas/grid_schema_representer.rb
index d7af33537f3..2bc14f592e7 100644
--- a/modules/grids/app/representers/api/v3/grids/schemas/grid_schema_representer.rb
+++ b/modules/grids/app/representers/api/v3/grids/schemas/grid_schema_representer.rb
@@ -41,38 +41,30 @@ module API
end
schema :id,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :created_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema :updated_at,
- type: 'DateTime',
- visibility: false
+ type: 'DateTime'
schema :row_count,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :column_count,
- type: 'Integer',
- visibility: false
+ type: 'Integer'
schema :name,
- type: 'String',
- visibility: false
+ type: 'String'
schema :options,
- type: 'JSON',
- visibility: false
+ type: 'JSON'
schema_with_allowed_collection :scope,
type: 'Href',
required: true,
has_default: false,
- visibility: false,
value_representer: false,
link_factory: ->(path) {
{
@@ -84,7 +76,6 @@ module API
type: '[]GridWidget',
required: true,
has_default: false,
- visibility: false,
values_callback: -> do
represented.assignable_widgets.map do |identifier|
OpenStruct.new(identifier: identifier, grid: represented.model, options: {})
diff --git a/spec/lib/api/v3/work_packages/schema/work_package_sums_schema_representer_spec.rb b/spec/lib/api/v3/work_packages/schema/work_package_sums_schema_representer_spec.rb
index 984d338b25a..6fa4013e9e0 100644
--- a/spec/lib/api/v3/work_packages/schema/work_package_sums_schema_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/schema/work_package_sums_schema_representer_spec.rb
@@ -65,7 +65,6 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSumsSchemaRepresenter do
it 'is represented' do
expected = { 'type': 'Duration',
'name': 'Estimated time',
- 'visibility': 'default',
'required': false,
'hasDefault': false,
'writable': false,
@@ -91,7 +90,6 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSumsSchemaRepresenter do
it 'is represented' do
expected = { 'type': 'Integer',
'name': custom_field.name,
- 'visibility': 'default',
'required': false,
'hasDefault': false,
'writable': false,
diff --git a/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb b/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb
index bbbe7e0fef5..fd0a30e9d55 100644
--- a/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb
+++ b/spec/requests/api/v3/work_packages/work_packages_schemas_resource_spec.rb
@@ -206,7 +206,6 @@ describe API::V3::WorkPackages::Schema::WorkPackageSchemasAPI, type: :request do
it 'should return the schema for estimated_hours' do
expected = { 'type': 'Duration',
'name': 'Estimated time',
- 'visibility': 'default',
'required': false,
'hasDefault': false,
'writable': false,