diff --git a/app/assets/stylesheets/content/_in_place_editing.sass b/app/assets/stylesheets/content/_in_place_editing.sass index d76363054f..240b07077b 100644 --- a/app/assets/stylesheets/content/_in_place_editing.sass +++ b/app/assets/stylesheets/content/_in_place_editing.sass @@ -29,6 +29,8 @@ $inplace-edit--border-color: #ddd $inplace-edit--dark-background: #f8f8f8 $inplace-edit--color--very-dark: #cacaca +$inplace-edit--color--disabled: #999 +$inplace-edit--bg-color--disabled: #eee $inplace-edit--color-highlight: $primary-color $inplace-edit--selected-date-border-color: $primary-color-dark @@ -278,6 +280,15 @@ a.inplace-editing--trigger-link, color: #888 font-size: 1rem + // Disabled comment submit styles when empty + .inplace-edit--control--save[disabled], + .inplace-edit--control--send[disabled] + background-color: $inplace-edit--bg-color--disabled + + span + color: $inplace-edit--color--disabled + cursor: not-allowed + // this aligns the title for the WP .work-packages--details--title margin-left: -0.375rem diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml index 664be84e0b..e8475403dd 100644 --- a/config/locales/js-en.yml +++ b/config/locales/js-en.yml @@ -333,6 +333,7 @@ en: image: "Image" work_packages: button_clear: "Clear" + comment_send_failed: "An error has occured. Could not submit the comment." description_filter: "Filter" description_enter_text: "Enter text" description_options_hide: "Hide options" diff --git a/doc/apiv3-documentation.apib b/doc/apiv3-documentation.apib index b6c73f54b2..35b952ecdc 100644 --- a/doc/apiv3-documentation.apib +++ b/doc/apiv3-documentation.apib @@ -4542,7 +4542,7 @@ Gets a list of revisions that are linked to this work package, e.g., because it } -## Work Package activities [/api/v3/work_packages/{id}/activities] +## Work Package activities [/api/v3/work_packages/{id}/activities{?notify}] + Model + Body @@ -4636,6 +4636,10 @@ updated activity. + Parameters + id (required, integer, `1`) ... Work package id + + notify = `true` (optional, boolean, `false`) ... Indicates whether change notifications (e.g. via E-Mail) should be sent. + Note that this controls notifications for all users interested in changes to the work package (e.g. watchers, author and assignee), + not just the current user. + + Request (application/json) { diff --git a/frontend/app/services/activity-service.js b/frontend/app/services/activity-service.js index 5b01fb0b02..29c30bc0a9 100644 --- a/frontend/app/services/activity-service.js +++ b/frontend/app/services/activity-service.js @@ -29,16 +29,14 @@ module.exports = function(HALAPIResource, $http, PathHelper){ var ActivityService = { - createComment: function(workPackage, activities, descending, comment) { - var options = { - ajax: { - method: "POST", - data: JSON.stringify({ comment: comment }), - contentType: "application/json; charset=utf-8" - } - }; + createComment: function(workPackage, activities, comment, notify) { - return workPackage.links.addComment.fetch(options); + return $http({ + url: URI(workPackage.links.addComment.url()).addSearch('notify', notify).toString(), + method: 'POST', + data: JSON.stringify({ comment: comment }), + headers: { 'Content-Type': 'application/json; charset=UTF-8' } + }); }, updateComment: function(activity, comment) { diff --git a/frontend/app/templates/work_packages/comment_field.html b/frontend/app/templates/work_packages/comment_field.html index ce30755e39..2844908bcc 100644 --- a/frontend/app/templates/work_packages/comment_field.html +++ b/frontend/app/templates/work_packages/comment_field.html @@ -1,4 +1,4 @@ -