Commit 58b560fa authored by Regis's avatar Regis

resolve discussion

parent 5fb98734
......@@ -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,
},
}),
......
......@@ -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"
......
......@@ -16,10 +16,6 @@
- if issue.assignee
%li
= 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
......
......@@ -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
......
......@@ -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
});
});
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