Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/13.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Sep 19, 2023
2 parents 3696918 + a093a1a commit d22f50a
Show file tree
Hide file tree
Showing 12 changed files with 481 additions and 291 deletions.
6 changes: 5 additions & 1 deletion app/models/exports/formatters/custom_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ def retrieve_value(object)
# Print the value meant for export.
#
# - For boolean values, don't use the Yes/No formatting for the UI
# treat nil as false
# - For long text values, output the plain value
def format_for_export(object, custom_field)
case custom_field.field_format
when 'bool', 'text'
when 'bool'
value = object.typed_custom_value_for(custom_field)
value == nil ? false : value
when 'text'
object.typed_custom_value_for(custom_field)
else
object.formatted_custom_value_for(custom_field)
Expand Down
40 changes: 23 additions & 17 deletions app/models/work_package/pdf_export/work_package_detail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def attribute_data_list(work_package)
list = if respond_to?(:column_objects)
attributes_list_by_columns
else
attributes_list_by_wp
attributes_list_by_wp(work_package)
end
list
.map { |entry| entry.merge({ value: get_column_value_cell(work_package, entry[:name]) }) }
.map { |entry| entry.merge({ value: entry[:value] || get_column_value_cell(work_package, entry[:name]) }) }
.select { |attribute_data| can_show_attribute?(attribute_data) }
end

Expand All @@ -124,22 +124,28 @@ def attributes_list_by_columns
end
end

def attributes_list_by_wp
col_names = %i[
id
updated_at
type
created_at
status
due_date
duration
priority
assigned_to
responsible
]
col_names.map do |col_name|
{ label: WorkPackage.human_attribute_name(col_name), name: col_name }
def attributes_list_by_wp(work_package)
list = ::Query.available_columns(work_package.project)
.reject { |column| %i[subject project].include?(column.name) }
.map do |column|
{ label: column.caption || '', name: column.name }
end
spent_units = costs_attribute_spent_units(work_package)
list << spent_units unless spent_units.nil?
list
end

def costs_attribute_spent_units(work_package)
cost_helper = ::Costs::AttributesHelper.new(work_package, User.current)
values = cost_helper.summarized_cost_entries.map do |kvp|
cost_type = kvp[0]
volume = kvp[1]
type_unit = volume.to_d == 1.0.to_d ? cost_type.unit : cost_type.unit_plural
"#{volume} #{type_unit}"
end
return nil if values.empty?

{ label: I18n.t('activerecord.attributes.work_package.spent_units'), name: :spent_units, value: values.join(', ') }
end

def build_columns_table_cells(attribute_data)
Expand Down
24 changes: 24 additions & 0 deletions docs/development/environments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_navigation:
title: Environments
description: Get an overview of the different environemnts at play in the development phases of OpenProject
keywords: environments, CI, development
---



# OpenProject Environments

OpenProject is continuously tested and developed using the following environments

| **Environment** | **Description** | **Release Target** | **Deployment cycles** |
| ------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| Edge | automatic deployments through [GitHub actions](https://github.com/opf/openproject/blob/dev/.github/workflows/continuous-delivery.yml) for instances on openproject-edge.com<br />Subject for continuous QA, acceptance and regression testing. | Next minor or major release planned and developed in our [community instance](https://community.openproject.org/projects/openproject/) | On every push to `opf/openproject#dev` |
| Stage | automatic deployments through [GitHub actions](https://github.com/opf/openproject/blob/dev/.github/workflows/continuous-delivery.yml) for instances on openproject-stage.com.<br />Subject for QA and acceptance testing of bugfix prior to stable relases. | Next patch release of the current stable release following our [release plan](https://community.openproject.org/projects/openproject/work_packages?query_id=918) | On every push to `release/X.Y`, where `X.Y.` is the current stable release major and minor versions. |
| Production<br />(SaaS / Cloud) | Production cloud environments. Deployed manually with the latest stable release | Stable releases | Manually |
| Production<br />(Docker images) | [Official public OpenProject docker images](https://hub.docker.com/r/openproject/community)<br />Continuous delivery for development versions using `dev-*`tags.<br />Stable releases through major, minor, or patch level tags. | development (`dev`, `dev-slim` tag)<br />Stable releases (`X`, `X.Y`, `X.Y.Z`, `X-slim`, `X.Y-slim`, `X.Y.Z-slim`) | Automatically on new releases of the OpenProject application |
| Production<br />(Packages) | [Official public OpenProject Linux packages](https://www.openproject.org/docs/installation-and-operations/installation/packaged/) <br /><br />Stable releases for supported distributions | Stable releases | Automatically on new releases of the OpenProject application |
| PullPreview | Temporary instances for development of features scope to a pull request. | Feature branches | Automatically deployed when developers/QA request a pull preview instance by labelling pull requests with the `PullPreview` tag. |



4 changes: 4 additions & 0 deletions docs/development/git-workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ Bugfixes for one of the actively supported versions of OpenProject should be iss

A fix for the current version (called "Hotfix" and the branch ideally being named `fix/XYZ`) should target `release/*` and a fix for the former version (called "Backport" and the branch ideally being named `backport/XYZ`) should target `backport/*`. We will try to merge hotfixes into dev branch but if that is no trivial task, we might ask you to create another PR for that.


### Tagging

The stable/X branch with the highest number is the currently supported stable release. Its commits are tagged (e.g. v12.5.8) to pinpoint individual releases.
Loading

0 comments on commit d22f50a

Please sign in to comment.