diff options
5 files changed, 12 insertions, 18 deletions
diff --git a/app/assets/javascripts/issue_show/index.js b/app/assets/javascripts/issue_show/index.js index 2de072c9778..eb20a597bb5 100644 --- a/app/assets/javascripts/issue_show/index.js +++ b/app/assets/javascripts/issue_show/index.js @@ -4,13 +4,13 @@ import '../vue_shared/vue_resource_interceptor'; (() => { const issueTitleData = document.querySelector('.issue-title-data').dataset; - const { canupdateissue, endpoint } = issueTitleData; + const { canUpdateTasksClass, endpoint } = issueTitleData; const vm = new Vue({ el: '.issue-title-entrypoint', render: createElement => createElement(IssueTitle, { props: { - canUpdateIssue: canupdateissue, + canUpdateTasksClass, endpoint, }, }), diff --git a/app/assets/javascripts/issue_show/issue_title_description.vue b/app/assets/javascripts/issue_show/issue_title_description.vue index e88ab69455b..f3437e2ef8b 100644 --- a/app/assets/javascripts/issue_show/issue_title_description.vue +++ b/app/assets/javascripts/issue_show/issue_title_description.vue @@ -10,7 +10,7 @@ export default { required: true, type: String, }, - canUpdateIssue: { + canUpdateTasksClass: { required: true, type: String, }, @@ -112,19 +112,16 @@ export default { }, }, computed: { - descriptionClass() { - return `description ${this.canUpdateIssue} is-task-list-enabled`; - }, titleAnimationCss() { return { - 'title issue-realtime-pre-pulse': this.titleFlag.pre, - 'title issue-realtime-trigger-pulse': this.titleFlag.pulse, + 'issue-realtime-pre-pulse': this.titleFlag.pre, + 'issue-realtime-trigger-pulse': this.titleFlag.pulse, }; }, descriptionAnimationCss() { return { - 'wiki issue-realtime-pre-pulse': this.descriptionFlag.pre, - 'wiki issue-realtime-trigger-pulse': this.descriptionFlag.pulse, + 'issue-realtime-pre-pulse': this.descriptionFlag.pre, + 'issue-realtime-trigger-pulse': this.descriptionFlag.pulse, }; }, }, @@ -165,16 +162,19 @@ export default { <template> <div> <h2 + class="title" :class="titleAnimationCss" ref="issue-title" v-html="title" > </h2> <div - :class="descriptionClass" + class="description is-task-list-enabled" + :class="canUpdateTasksClass" v-if="description" > <div + class="wiki" :class="descriptionAnimationCss" v-html="description" ref="issue-content-container-gfm-entry" diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index 064a7bd1f26..0e3902c066a 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -16,10 +16,6 @@ - if issue.assignee %li = link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name") - - if issue.tasks? - - %span.task-status - = issue.task_status = render 'shared/issuable_meta_data', issuable: issue diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index aa024be1c55..a7aefa08aa0 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -52,7 +52,7 @@ .issue-details.issuable-details .detail-page-description.content-block .issue-title-data.hidden{ "data" => { "endpoint" => rendered_title_namespace_project_issue_path(@project.namespace, @project, @issue), - "canUpdateIssue" => can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '', + "can-update-tasks-class" => can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '', } } .issue-title-entrypoint diff --git a/spec/javascripts/issue_show/issue_title_description_spec.js b/spec/javascripts/issue_show/issue_title_description_spec.js index 30455663e50..1ec4fe58b08 100644 --- a/spec/javascripts/issue_show/issue_title_description_spec.js +++ b/spec/javascripts/issue_show/issue_title_description_spec.js @@ -39,7 +39,6 @@ describe('Issue Title', () => { }, }).$mount(); - // need setTimeout because of api call/v-html setTimeout(() => { expect(document.querySelector('title').innerText).toContain('this is a title (#1)'); expect(issueShowComponent.$el.querySelector('.title').innerHTML).toContain('<p>this is a title</p>'); @@ -57,6 +56,5 @@ describe('Issue Title', () => { done(); }); }); - // 10ms is just long enough for the update hook to fire }); }); |