Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6f46b274
Commit
6f46b274
authored
Aug 13, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated discussion loading to be deferred and in the state
parent
95c8e747
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+6
-2
app/assets/javascripts/diffs/store/mutations.js
app/assets/javascripts/diffs/store/mutations.js
+9
-7
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
6f46b274
...
@@ -112,7 +112,6 @@ export default {
...
@@ -112,7 +112,6 @@ export default {
},
},
created
()
{
created
()
{
this
.
adjustView
();
this
.
adjustView
();
eventHub
.
$once
(
'
renderedFiles
'
,
this
.
assignDiscussionsToDiff
);
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
diffs
'
,
[
...
mapActions
(
'
diffs
'
,
[
...
@@ -130,7 +129,12 @@ export default {
...
@@ -130,7 +129,12 @@ export default {
this
.
startRenderDiffsQueue
()
this
.
startRenderDiffsQueue
()
.
then
(()
=>
{
.
then
(()
=>
{
console
.
log
(
'
Done rendering Que
'
);
console
.
log
(
'
Done rendering Que
'
);
this
.
assignDiscussionsToDiff
(
this
.
discussionsStructuredByLineCode
);
requestIdleCallback
(
()
=>
{
this
.
assignDiscussionsToDiff
(
this
.
discussionsStructuredByLineCode
);
},
{
timeout
:
1000
},
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
createFlash
(
__
(
'
Something went wrong on our end. Please try again!
'
));
createFlash
(
__
(
'
Something went wrong on our end. Please try again!
'
));
...
...
app/assets/javascripts/diffs/store/mutations.js
View file @
6f46b274
...
@@ -24,13 +24,18 @@ export default {
...
@@ -24,13 +24,18 @@ export default {
let
i
;
let
i
;
for
(
i
=
0
;
i
<
filesLength
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
filesLength
;
i
+=
1
)
{
const
file
=
diffData
.
diffFiles
[
i
];
const
file
=
diffData
.
diffFiles
[
i
];
if
(
file
.
parallelDiffLines
)
{
if
(
file
.
parallelDiffLines
)
{
const
linesLength
=
file
.
parallelDiffLines
.
length
;
const
linesLength
=
file
.
parallelDiffLines
.
length
;
let
u
=
0
;
let
u
=
0
;
for
(
u
=
0
;
u
<
linesLength
;
u
+=
1
)
{
for
(
u
=
0
;
u
<
linesLength
;
u
+=
1
)
{
const
line
=
file
.
parallelDiffLines
[
u
];
const
line
=
file
.
parallelDiffLines
[
u
];
if
(
line
.
left
)
delete
line
.
left
.
text
;
if
(
line
.
left
)
{
if
(
line
.
right
)
delete
line
.
right
.
text
;
line
.
left
=
trimFirstCharOfLineContent
(
line
.
left
);
}
if
(
line
.
right
)
{
line
.
right
=
trimFirstCharOfLineContent
(
line
.
right
);
}
}
}
}
}
...
@@ -38,14 +43,11 @@ export default {
...
@@ -38,14 +43,11 @@ export default {
const
linesLength
=
file
.
highlightedDiffLines
.
length
;
const
linesLength
=
file
.
highlightedDiffLines
.
length
;
let
u
;
let
u
;
for
(
u
=
0
;
u
<
linesLength
;
u
+=
1
)
{
for
(
u
=
0
;
u
<
linesLength
;
u
+=
1
)
{
const
line
=
file
.
highlightedDiffLines
[
u
];
trimFirstCharOfLineContent
(
file
.
highlightedDiffLines
[
u
]);
delete
line
.
text
;
}
}
}
if
(
file
.
highlightedDiffLines
)
{
showingLines
+=
file
.
parallelDiffLines
.
length
;
showingLines
+=
file
.
parallelDiffLines
.
length
;
}
}
Object
.
assign
(
file
,
{
Object
.
assign
(
file
,
{
renderIt
:
showingLines
<
LINES_TO_BE_RENDERED_DIRECTLY
,
renderIt
:
showingLines
<
LINES_TO_BE_RENDERED_DIRECTLY
,
collapsed
:
file
.
text
&&
showingLines
>
MAX_LINES_TO_BE_RENDERED
,
collapsed
:
file
.
text
&&
showingLines
>
MAX_LINES_TO_BE_RENDERED
,
...
...
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