Fix/project status flaws (#9138)

* fix documentation on project statusExplanation

* correctly denote the type of the project status

* don`t reloy on faulty backend type
pull/9151/head
ulferts 4 years ago committed by GitHub
parent a46de71009
commit 72abb45249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      docs/api/apiv3/endpoints/projects.apib
  2. 2
      frontend/src/app/modules/fields/display/display-field.initializer.ts
  3. 2
      frontend/src/app/modules/fields/edit/edit-field.initializer.ts
  4. 2
      lib/api/v3/projects/schemas/project_schema_representer.rb
  5. 2
      spec/lib/api/v3/projects/schemas/project_schema_representer_spec.rb

@ -32,11 +32,11 @@ Depending on custom fields defined for projects, additional links might exist.
| Property | Description | Type | Constraints | Supported operations |
| :---------------------:| ------------- | ---- | ----------- | -------------------- |
| id | Projects's id | Integer | x > 0 | READ/WRITE |
| 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 is having trouble. | String | "on track", "at risk" or "off track" | 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 |
@ -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",

@ -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']);
};
}

@ -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']);

@ -60,7 +60,7 @@ module API
type: 'Boolean'
schema :status,
type: 'ProjectStatus',
type: 'String',
name_source: ->(*) { I18n.t('activerecord.attributes.projects/status.code') },
required: false,
writable: ->(*) { represented.writable?(:status) }

@ -182,7 +182,7 @@ describe ::API::V3::Projects::Schemas::ProjectSchemaRepresenter do
let(: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 }

Loading…
Cancel
Save