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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix/project status flaws (#9138)
ulferts72abb4524949
diff --git a/docs/api/apiv3/endpoints/projects.apib b/docs/api/apiv3/endpoints/projects.apibindex 7bcf0cbbdd2..9bea240376e 100644--- a/docs/api/apiv3/endpoints/projects.apib+++ b/docs/api/apiv3/endpoints/projects.apib@@ -30,18 +30,18 @@ Depending on custom fields defined for projects, additional links might exist.## Local Properties-| Property | Description | Type | Constraints | Supported operations |-| :---------------------:| ------------- | ---- | ----------- | -------------------- |-| id | Projects's id | Integer | x > 0 | READ/WRITE |-| identifier | | String | | READ/WRITE |-| name | | String | | READ/WRITE |-| active | Indicates whether the project is currently active or already archived | Boolean | | READ/WRITE |-| status | Denotes the status of the project, so whether the project is on track, at risk is having trouble. | String | "on track", "at risk" or "off track" | READ/WRITE |-| statusExplanation | A text detailing and explaining why the project has the reported status | Formattable | | READ/WRITE |-| public | Indicates whether the project is accessible for everybody | Boolean | | READ/WRITE |-| description | | Formattable | | READ/WRITE |-| createdAt | Time of creation | DateTime | | READ |-| updatedAt | Time of the most recent change to the project | DateTime | | READ |+| Property | Description | Type | Constraints | Supported operations |+| :---------------------:| ------------- | ---- | ----------- | -------------------- |+| id | Projects' id | Integer | x > 0 | READ/WRITE |+| identifier | | String | | READ/WRITE |+| name | | String | | READ/WRITE |+| active | Indicates whether the project is currently active or already archived | Boolean | | READ/WRITE |+| status | Denotes the status of the project, so whether the project is on track, at risk or is having trouble. | String | "on track", "at risk" or "off track" | READ/WRITE |+| statusExplanation | A text detailing and explaining why the project has the reported status | Formattable | | READ/WRITE |+| public | Indicates whether the project is accessible for everybody | Boolean | | READ/WRITE |+| description | | Formattable | | READ/WRITE |+| createdAt | Time of creation | DateTime | | READ |+| updatedAt | Time of the most recent change to the project | DateTime | | READ |Depending on custom fields defined for projects, additional properties might exist.@@ -377,7 +377,7 @@ the project scheduled for deletion, it is archived at once."name": "Another project","active": false,"status": "off track",- "statusSxplanation": {+ "statusExplanation": {"format": "markdown","raw": "Uh **oh**","html": "<p>Uh <strong>oh</strong></p>"@@ -779,6 +779,13 @@ For more details and all possible responses see the general specification of [Fo"hasDefault": true,"writable": true},+ "statusExplanation": {+ "type": "Formattable",+ "name": "Status explanation",+ "required": false,+ "hasDefault": false,+ "writable": true+ },"parent": {"type": "Project","name": "Subproject of",diff --git a/frontend/src/app/modules/fields/display/display-field.initializer.ts b/frontend/src/app/modules/fields/display/display-field.initializer.tsindex ff775582a71..cbbebafdab5 100644--- a/frontend/src/app/modules/fields/display/display-field.initializer.ts+++ b/frontend/src/app/modules/fields/display/display-field.initializer.ts@@ -79,7 +79,6 @@ export function initializeCoreDisplayFields(displayFieldService:DisplayFieldServ.addFieldType(ProgressDisplayField, 'progress', ['percentageDone']).addFieldType(LinkedWorkPackageDisplayField, 'work_package', ['WorkPackage']).addFieldType(IdDisplayField, 'id', ['id'])- .addFieldType(ProjectStatusDisplayField, 'project_status', ['ProjectStatus']).addFieldType(UserDisplayField, 'user', ['User']);displayFieldService@@ -87,6 +86,7 @@ export function initializeCoreDisplayFields(displayFieldService:DisplayFieldServ.addSpecificFieldType('WorkPackage', WorkPackageSpentTimeDisplayField, 'spentTime', ['spentTime']).addSpecificFieldType('WorkPackage', CombinedDateDisplayField, 'combinedDate', ['combinedDate']).addSpecificFieldType('TimeEntry', PlainFormattableDisplayField, 'comment', ['comment'])+ .addSpecificFieldType('Project', ProjectStatusDisplayField, 'status', ['status']).addSpecificFieldType('TimeEntry', WorkPackageDisplayField, 'work_package', ['workPackage']);};}diff --git a/frontend/src/app/modules/fields/edit/edit-field.initializer.ts b/frontend/src/app/modules/fields/edit/edit-field.initializer.tsindex 1b11070699b..072d3835d1e 100644--- a/frontend/src/app/modules/fields/edit/edit-field.initializer.ts+++ b/frontend/src/app/modules/fields/edit/edit-field.initializer.ts@@ -72,13 +72,13 @@ export function initializeCoreEditFields(editFieldService:EditFieldService, sele.addFieldType(BooleanEditFieldComponent, 'boolean', ['Boolean']).addFieldType(DateEditFieldComponent, 'date', ['Date']).addFieldType(FormattableEditFieldComponent, 'wiki-textarea', ['Formattable'])- .addFieldType(ProjectStatusEditFieldComponent, 'project_status', ['ProjectStatus']).addFieldType(WorkPackageCommentFieldComponent, '_comment', ['comment']);editFieldService.addSpecificFieldType('WorkPackage', CombinedDateEditFieldComponent,'date',['combinedDate', 'startDate', 'dueDate', 'date'])+ .addSpecificFieldType('Project', ProjectStatusEditFieldComponent, 'status', ['status']).addSpecificFieldType('TimeEntry', PlainFormattableEditFieldComponent, 'comment', ['comment']).addSpecificFieldType('TimeEntry', TimeEntryWorkPackageEditFieldComponent, 'workPackage', ['WorkPackage']);diff --git a/lib/api/v3/projects/schemas/project_schema_representer.rb b/lib/api/v3/projects/schemas/project_schema_representer.rbindex f82098f5eb7..6e91df44f9e 100644--- a/lib/api/v3/projects/schemas/project_schema_representer.rb+++ b/lib/api/v3/projects/schemas/project_schema_representer.rb@@ -60,7 +60,7 @@ module APItype: 'Boolean'schema :status,- type: 'ProjectStatus',+ type: 'String',name_source: ->(*) { I18n.t('activerecord.attributes.projects/status.code') },required: false,writable: ->(*) { represented.writable?(:status) }diff --git a/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb b/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rbindex a6fd962f4c5..46e195f3bda 100644--- a/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb+++ b/spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb@@ -182,7 +182,7 @@ describe ::API::V3::Projects::Schemas::ProjectSchemaRepresenter dolet(:path) { 'status' }it_behaves_like 'has basic schema properties' do- let(:type) { 'ProjectStatus' }+ let(:type) { 'String' }let(:name) { I18n.t('activerecord.attributes.projects/status.code') }let(:required) { false }let(:writable) { true }