Merge pull request #2493 from 0xF013/feature/17412-priority-editable

17412 priority editable
pull/2527/head
ulferts 10 years ago
commit 9bb62ff5e4
  1. 8
      frontend/app/services/overview-tab-inplace-editor-config.js
  2. 3
      frontend/app/ui_components/inplace-editor-dispatcher.js
  3. 3
      frontend/app/work_packages/controllers/details-tab-overview-controller.js
  4. 2
      frontend/tests/integration/mocks/work-packages/819.json
  5. 86
      frontend/tests/integration/mocks/work-packages/819_form.json
  6. 86
      frontend/tests/integration/mocks/work-packages/820_form.json
  7. 86
      frontend/tests/integration/mocks/work-packages/821_form.json
  8. 86
      frontend/tests/integration/mocks/work-packages/822_form.json
  9. 3
      frontend/tests/integration/work-package-details-spec.js
  10. 1
      spec/features/work_packages/select_work_package_row_spec.rb

@ -95,7 +95,13 @@ module.exports = function() {
placeholder: '-',
displayStrategy: 'version',
attributeTitle: I18n.t('js.work_packages.properties.version')
}
},
priority: {
type: 'select2',
attribute: 'priority.name',
embedded: true,
placeholder: '-'
},
};
}
};

@ -210,8 +210,9 @@ module.exports = function($sce, $http, $timeout, AutoCompleteHelper, TextileServ
}
},
setWriteValue: function($scope) {
var link = $scope.entity.form.embedded.payload.links[getAttribute($scope)];
$scope.dataObject = {
value: $scope.entity.form.embedded.payload.links[getAttribute($scope)].href
value: link ? link.href : null
};
}
}

@ -60,10 +60,9 @@ module.exports = function($scope,
function getPropertyValue(property, format) {
switch(format) {
case STATUS_TYPE:
case PRIORITY_TYPE:
return $scope.workPackage.embedded[property].props.name;
case USER_TYPE:
case CATEGORY_TYPE:
case PRIORITY_TYPE:
return $scope.workPackage.embedded[property];
case TIME_ENTRY_TYPE:
return getLinkedTimeEntryValue(property);

@ -136,7 +136,7 @@
"isClosed": false
},
"priority": {
"name": "high"
"name": "High"
},
"author": {
"_type": "User",

@ -26,6 +26,9 @@
},
"version": {
"href": "/api/v3/versions/1"
},
"priority": {
"href": "/api/v3/priorities/3"
}
},
"lockVersion": 119,
@ -286,6 +289,89 @@
"updatedAt": "01/21/2015/ 09:30 AM"
}]
}
},
"priority":{
"_links":{
"allowedValues":[
{
"href":"/api/v3/priorities/1",
"title":"Low"
},
{
"href":"/api/v3/priorities/2",
"title":"Normal"
},
{
"href":"/api/v3/priorities/3",
"title":"High"
},
{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
]
},
"type":"Priority",
"_embedded":{
"allowedValues":[
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/1",
"title":"Low"
}
},
"id":1,
"name":"Low",
"position":1,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/2",
"title":"Normal"
}
},
"id":2,
"name":"Normal",
"position":2,
"isDefault":true,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/3",
"title":"High"
}
},
"id":3,
"name":"High",
"position":3,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
},
"id":4,
"name":"Immediate",
"position":5,
"isDefault":false,
"isActive":true
}
]
}
}
},
"validationErrors": {}

@ -26,6 +26,9 @@
},
"version": {
"href": "/api/v3/versions/1"
},
"priority": {
"href": "/api/v3/priorities/3"
}
},
"lockVersion": 119,
@ -286,6 +289,89 @@
"updatedAt": "01/21/2015/ 09:30 AM"
}]
}
},
"priority":{
"_links":{
"allowedValues":[
{
"href":"/api/v3/priorities/1",
"title":"Low"
},
{
"href":"/api/v3/priorities/2",
"title":"Normal"
},
{
"href":"/api/v3/priorities/3",
"title":"High"
},
{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
]
},
"type":"Priority",
"_embedded":{
"allowedValues":[
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/1",
"title":"Low"
}
},
"id":1,
"name":"Low",
"position":1,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/2",
"title":"Normal"
}
},
"id":2,
"name":"Normal",
"position":2,
"isDefault":true,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/3",
"title":"High"
}
},
"id":3,
"name":"High",
"position":3,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
},
"id":4,
"name":"Immediate",
"position":5,
"isDefault":false,
"isActive":true
}
]
}
}
},
"validationErrors": {}

@ -26,6 +26,9 @@
},
"version": {
"href": "/api/v3/versions/1"
},
"priority": {
"href": "/api/v3/priorities/3"
}
},
"lockVersion": 119,
@ -286,6 +289,89 @@
"updatedAt": "01/21/2015/ 09:30 AM"
}]
}
},
"priority":{
"_links":{
"allowedValues":[
{
"href":"/api/v3/priorities/1",
"title":"Low"
},
{
"href":"/api/v3/priorities/2",
"title":"Normal"
},
{
"href":"/api/v3/priorities/3",
"title":"High"
},
{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
]
},
"type":"Priority",
"_embedded":{
"allowedValues":[
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/1",
"title":"Low"
}
},
"id":1,
"name":"Low",
"position":1,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/2",
"title":"Normal"
}
},
"id":2,
"name":"Normal",
"position":2,
"isDefault":true,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/3",
"title":"High"
}
},
"id":3,
"name":"High",
"position":3,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
},
"id":4,
"name":"Immediate",
"position":5,
"isDefault":false,
"isActive":true
}
]
}
}
},
"validationErrors": {}

@ -32,6 +32,9 @@
},
"version": {
"href": "/api/v3/versions/1"
},
"priority": {
"href": null
}
},
"lockVersion": 145,
@ -298,6 +301,89 @@
"updatedAt": "01/21/2015/ 09:30 AM"
}]
}
},
"priority":{
"_links":{
"allowedValues":[
{
"href":"/api/v3/priorities/1",
"title":"Low"
},
{
"href":"/api/v3/priorities/2",
"title":"Normal"
},
{
"href":"/api/v3/priorities/3",
"title":"High"
},
{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
]
},
"type":"Priority",
"_embedded":{
"allowedValues":[
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/1",
"title":"Low"
}
},
"id":1,
"name":"Low",
"position":1,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/2",
"title":"Normal"
}
},
"id":2,
"name":"Normal",
"position":2,
"isDefault":true,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/3",
"title":"High"
}
},
"id":3,
"name":"High",
"position":3,
"isDefault":false,
"isActive":true
},
{
"_type":"Priority",
"_links":{
"self":{
"href":"/api/v3/priorities/4",
"title":"Immediate"
}
},
"id":4,
"name":"Immediate",
"position":5,
"isDefault":false,
"isActive":true
}
]
}
}
},
"validationErrors": {}

@ -191,6 +191,9 @@ describe('OpenProject', function() {
describe('status', function() {
behaveLikeEmbeddedDropdown('status.name', 'specified');
});
describe('priority', function() {
behaveLikeEmbeddedDropdown('priority.name', 'High');
});
describe('version', function() {
var name = 'version.name';
var editor = $('[ined-attribute=\'' + name + '\'] .inplace-editor');

@ -326,6 +326,7 @@ describe 'Select work package row', type: :feature do
text: work_package_3.subject,
visible: false
)
end
it_behaves_like 'work package row selected' do

Loading…
Cancel
Save