diff options
Diffstat (limited to 'app/assets/javascripts/work_items/components/work_item_title.vue')
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_title.vue | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/work_items/components/work_item_title.vue b/app/assets/javascripts/work_items/components/work_item_title.vue index c52a6854fad..9b5803421dd 100644 --- a/app/assets/javascripts/work_items/components/work_item_title.vue +++ b/app/assets/javascripts/work_items/components/work_item_title.vue @@ -1,10 +1,12 @@ <script> -import * as Sentry from '@sentry/browser'; +import * as Sentry from '~/sentry/sentry_browser_wrapper'; import Tracking from '~/tracking'; import { sprintfWorkItem, I18N_WORK_ITEM_ERROR_UPDATING, TRACKING_CATEGORY_SHOW, + WORK_ITEM_TITLE_MAX_LENGTH, + I18N_MAX_CHARS_IN_WORK_ITEM_TITLE_MESSAGE, } from '../constants'; import { getUpdateWorkItemMutation } from './update_work_item'; import ItemTitle from './item_title.vue'; @@ -56,6 +58,11 @@ export default { return; } + if (updatedTitle.length > WORK_ITEM_TITLE_MAX_LENGTH) { + this.$emit('error', sprintfWorkItem(I18N_MAX_CHARS_IN_WORK_ITEM_TITLE_MESSAGE)); + return; + } + const input = { id: this.workItemId, title: updatedTitle, |