BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
edbf9880
Commit
edbf9880
authored
Apr 26, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update task_list n/n
parent
1f8226e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
25 deletions
+40
-25
issue_title_description.vue
...assets/javascripts/issue_show/issue_title_description.vue
+38
-25
issues_controller.rb
app/controllers/projects/issues_controller.rb
+2
-0
No files found.
app/assets/javascripts/issue_show/issue_title_description.vue
View file @
edbf9880
...
@@ -32,7 +32,9 @@ export default {
...
@@ -32,7 +32,9 @@ export default {
timeoutId
:
null
,
timeoutId
:
null
,
title
:
'<span></span>'
,
title
:
'<span></span>'
,
description
:
'<span></span>'
,
description
:
'<span></span>'
,
descriptionText
:
''
,
descriptionChange
:
false
,
descriptionChange
:
false
,
taskStatus
:
''
,
};
};
},
},
methods
:
{
methods
:
{
...
@@ -40,46 +42,35 @@ export default {
...
@@ -40,46 +42,35 @@ export default {
const
body
=
JSON
.
parse
(
res
.
body
);
const
body
=
JSON
.
parse
(
res
.
body
);
this
.
triggerAnimation
(
body
);
this
.
triggerAnimation
(
body
);
},
},
triggerAnimation
(
body
)
{
updateTaskHTML
(
body
)
{
// always reset to false before checking the change
this
.
taskStatus
=
body
.
task_status
;
this
.
descriptionChange
=
false
;
document
.
querySelector
(
'#task_status'
).
innerText
=
this
.
taskStatus
;
},
const
{
title
,
description
}
=
body
;
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
)
{
const
elementStack
=
[];
this
.
descriptionText
=
body
.
description_text
;
/**
* since opacity is changed, even if there is no diff for Vue to update
* we must check the title/description even on a 304 to ensure no visual change
*/
const
noTitleChange
=
this
.
title
===
title
;
const
noDescriptionChange
=
this
.
description
===
description
;
if
(
noTitleChange
&&
noDescriptionChange
)
return
;
const
elementsToVisualize
=
[];
if
(
!
noTitleChange
)
{
if
(
!
noTitleChange
)
{
element
sToVisualize
.
push
(
this
.
$el
.
querySelector
(
'.title'
));
element
Stack
.
push
(
this
.
$el
.
querySelector
(
'.title'
));
}
}
if
(
!
noDescriptionChange
)
{
if
(
!
noDescriptionChange
)
{
// only change to true when we need to bind TaskLists the html of description
// only change to true when we need to bind TaskLists the html of description
this
.
descriptionChange
=
true
;
this
.
descriptionChange
=
true
;
elementStack
.
push
(
this
.
$el
.
querySelector
(
'.wiki'
));
elementsToVisualize
.
push
(
this
.
$el
.
querySelector
(
'.wiki'
));
}
}
element
sToVisualize
.
forEach
((
element
)
=>
{
element
Stack
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'issue-realtime-trigger-pulse'
);
element
.
classList
.
remove
(
'issue-realtime-trigger-pulse'
);
element
.
classList
.
add
(
'issue-realtime-pre-pulse'
);
element
.
classList
.
add
(
'issue-realtime-pre-pulse'
);
});
});
return
elementStack
;
},
animate
(
title
,
description
,
elementsToVisualize
)
{
this
.
timeoutId
=
setTimeout
(()
=>
{
this
.
timeoutId
=
setTimeout
(()
=>
{
this
.
title
=
title
;
this
.
title
=
title
;
document
.
querySelector
(
'title'
).
innerText
=
title
;
this
.
description
=
description
;
this
.
description
=
description
;
document
.
querySelector
(
'title'
).
innerText
=
title
;
elementsToVisualize
.
forEach
((
element
)
=>
{
elementsToVisualize
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'issue-realtime-pre-pulse'
);
element
.
classList
.
remove
(
'issue-realtime-pre-pulse'
);
...
@@ -89,6 +80,29 @@ export default {
...
@@ -89,6 +80,29 @@ export default {
clearTimeout
(
this
.
timeoutId
);
clearTimeout
(
this
.
timeoutId
);
},
0
);
},
0
);
},
},
triggerAnimation
(
body
)
{
// always reset to false before checking the change
this
.
descriptionChange
=
false
;
const
{
title
,
description
}
=
body
;
this
.
descriptionText
=
body
.
description_text
;
this
.
updateTaskHTML
(
body
);
/**
* since opacity is changed, even if there is no diff for Vue to update
* we must check the title/description even on a 304 to ensure no visual change
*/
const
noTitleChange
=
this
.
title
===
title
;
const
noDescriptionChange
=
this
.
description
===
description
;
if
(
noTitleChange
&&
noDescriptionChange
)
return
;
const
elementsToVisualize
=
this
.
elementsToVisualize
(
noTitleChange
,
noDescriptionChange
,
);
this
.
animate
(
title
,
description
,
elementsToVisualize
);
},
},
},
computed
:
{
computed
:
{
descriptionClass
()
{
descriptionClass
()
{
...
@@ -118,7 +132,6 @@ export default {
...
@@ -118,7 +132,6 @@ export default {
});
});
$
(
this
.
$refs
[
'issue-content-container-gfm-entry'
]).
renderGFM
();
$
(
this
.
$refs
[
'issue-content-container-gfm-entry'
]).
renderGFM
();
return
tl
;
return
tl
;
}
}
return
null
;
return
null
;
...
...
app/controllers/projects/issues_controller.rb
View file @
edbf9880
...
@@ -198,10 +198,12 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -198,10 +198,12 @@ class Projects::IssuesController < Projects::ApplicationController
def
rendered_title
def
rendered_title
Gitlab
::
PollingInterval
.
set_header
(
response
,
interval:
3_000
)
Gitlab
::
PollingInterval
.
set_header
(
response
,
interval:
3_000
)
render
json:
{
render
json:
{
title:
view_context
.
markdown_field
(
@issue
,
:title
),
title:
view_context
.
markdown_field
(
@issue
,
:title
),
description:
view_context
.
markdown_field
(
@issue
,
:description
),
description:
view_context
.
markdown_field
(
@issue
,
:description
),
description_text:
@issue
.
description
,
description_text:
@issue
.
description
,
task_status:
@issue
.
task_status
,
}
}
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment