Commit 58b560fa authored by Regis's avatar Regis

resolve discussion

parent 5fb98734
...@@ -4,13 +4,13 @@ import '../vue_shared/vue_resource_interceptor'; ...@@ -4,13 +4,13 @@ import '../vue_shared/vue_resource_interceptor';
(() => { (() => {
const issueTitleData = document.querySelector('.issue-title-data').dataset; const issueTitleData = document.querySelector('.issue-title-data').dataset;
const { canupdateissue, endpoint } = issueTitleData; const { canUpdateTasksClass, endpoint } = issueTitleData;
const vm = new Vue({ const vm = new Vue({
el: '.issue-title-entrypoint', el: '.issue-title-entrypoint',
render: createElement => createElement(IssueTitle, { render: createElement => createElement(IssueTitle, {
props: { props: {
canUpdateIssue: canupdateissue, canUpdateTasksClass,
endpoint, endpoint,
}, },
}), }),
......
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
required: true, required: true,
type: String, type: String,
}, },
canUpdateIssue: { canUpdateTasksClass: {
required: true, required: true,
type: String, type: String,
}, },
...@@ -112,19 +112,16 @@ export default { ...@@ -112,19 +112,16 @@ export default {
}, },
}, },
computed: { computed: {
descriptionClass() {
return `description ${this.canUpdateIssue} is-task-list-enabled`;
},
titleAnimationCss() { titleAnimationCss() {
return { return {
'title issue-realtime-pre-pulse': this.titleFlag.pre, 'issue-realtime-pre-pulse': this.titleFlag.pre,
'title issue-realtime-trigger-pulse': this.titleFlag.pulse, 'issue-realtime-trigger-pulse': this.titleFlag.pulse,
}; };
}, },
descriptionAnimationCss() { descriptionAnimationCss() {
return { return {
'wiki issue-realtime-pre-pulse': this.descriptionFlag.pre, 'issue-realtime-pre-pulse': this.descriptionFlag.pre,
'wiki issue-realtime-trigger-pulse': this.descriptionFlag.pulse, 'issue-realtime-trigger-pulse': this.descriptionFlag.pulse,
}; };
}, },
}, },
...@@ -165,16 +162,19 @@ export default { ...@@ -165,16 +162,19 @@ export default {
<template> <template>
<div> <div>
<h2 <h2
class="title"
:class="titleAnimationCss" :class="titleAnimationCss"
ref="issue-title" ref="issue-title"
v-html="title" v-html="title"
> >
</h2> </h2>
<div <div
:class="descriptionClass" class="description is-task-list-enabled"
:class="canUpdateTasksClass"
v-if="description" v-if="description"
> >
<div <div
class="wiki"
:class="descriptionAnimationCss" :class="descriptionAnimationCss"
v-html="description" v-html="description"
ref="issue-content-container-gfm-entry" ref="issue-content-container-gfm-entry"
......
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
- if issue.assignee - if issue.assignee
%li %li
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name") = link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")
- if issue.tasks?
&nbsp;
%span.task-status
= issue.task_status
= render 'shared/issuable_meta_data', issuable: issue = render 'shared/issuable_meta_data', issuable: issue
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
.issue-details.issuable-details .issue-details.issuable-details
.detail-page-description.content-block .detail-page-description.content-block
.issue-title-data.hidden{ "data" => { "endpoint" => rendered_title_namespace_project_issue_path(@project.namespace, @project, @issue), .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 .issue-title-entrypoint
......
...@@ -39,7 +39,6 @@ describe('Issue Title', () => { ...@@ -39,7 +39,6 @@ describe('Issue Title', () => {
}, },
}).$mount(); }).$mount();
// need setTimeout because of api call/v-html
setTimeout(() => { setTimeout(() => {
expect(document.querySelector('title').innerText).toContain('this is a title (#1)'); expect(document.querySelector('title').innerText).toContain('this is a title (#1)');
expect(issueShowComponent.$el.querySelector('.title').innerHTML).toContain('<p>this is a title</p>'); expect(issueShowComponent.$el.querySelector('.title').innerHTML).toContain('<p>this is a title</p>');
...@@ -57,6 +56,5 @@ describe('Issue Title', () => { ...@@ -57,6 +56,5 @@ describe('Issue Title', () => {
done(); done();
}); });
}); });
// 10ms is just long enough for the update hook to fire
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment