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
Léo-Paul Géneau
gitlab-ce
Commits
7aac4e5c
Commit
7aac4e5c
authored
Jun 05, 2019
by
Ondřej Budai
Committed by
Phil Hughes
Jun 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix whitespace changes visibility when the related file was initially collapsed
parent
b560ce1e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+2
-1
changelogs/unreleased/50106-hide-whitespace-changes.yml
changelogs/unreleased/50106-hide-whitespace-changes.yml
+5
-0
spec/javascripts/diffs/store/actions_spec.js
spec/javascripts/diffs/store/actions_spec.js
+6
-5
No files found.
app/assets/javascripts/diffs/store/actions.js
View file @
7aac4e5c
...
@@ -211,11 +211,12 @@ export const scrollToLineIfNeededParallel = (_, line) => {
...
@@ -211,11 +211,12 @@ export const scrollToLineIfNeededParallel = (_, line) => {
}
}
};
};
export
const
loadCollapsedDiff
=
({
commit
,
getters
},
file
)
=>
export
const
loadCollapsedDiff
=
({
commit
,
getters
,
state
},
file
)
=>
axios
axios
.
get
(
file
.
load_collapsed_diff_url
,
{
.
get
(
file
.
load_collapsed_diff_url
,
{
params
:
{
params
:
{
commit_id
:
getters
.
commitId
,
commit_id
:
getters
.
commitId
,
w
:
state
.
showWhitespace
?
'
0
'
:
'
1
'
,
},
},
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
...
...
changelogs/unreleased/50106-hide-whitespace-changes.yml
0 → 100644
View file @
7aac4e5c
---
title
:
Fix whitespace changes visibility when the related file was initially collapsed
merge_request
:
28950
author
:
Ondřej Budai
type
:
fixed
spec/javascripts/diffs/store/actions_spec.js
View file @
7aac4e5c
...
@@ -396,6 +396,7 @@ describe('DiffsStoreActions', () => {
...
@@ -396,6 +396,7 @@ describe('DiffsStoreActions', () => {
});
});
describe
(
'
loadCollapsedDiff
'
,
()
=>
{
describe
(
'
loadCollapsedDiff
'
,
()
=>
{
const
state
=
{
showWhitespace
:
true
};
it
(
'
should fetch data and call mutation with response and the give parameter
'
,
done
=>
{
it
(
'
should fetch data and call mutation with response and the give parameter
'
,
done
=>
{
const
file
=
{
hash
:
123
,
load_collapsed_diff_url
:
'
/load/collapsed/diff/url
'
};
const
file
=
{
hash
:
123
,
load_collapsed_diff_url
:
'
/load/collapsed/diff/url
'
};
const
data
=
{
hash
:
123
,
parallelDiffLines
:
[{
lineCode
:
1
}]
};
const
data
=
{
hash
:
123
,
parallelDiffLines
:
[{
lineCode
:
1
}]
};
...
@@ -403,7 +404,7 @@ describe('DiffsStoreActions', () => {
...
@@ -403,7 +404,7 @@ describe('DiffsStoreActions', () => {
const
commit
=
jasmine
.
createSpy
(
'
commit
'
);
const
commit
=
jasmine
.
createSpy
(
'
commit
'
);
mock
.
onGet
(
file
.
loadCollapsedDiffUrl
).
reply
(
200
,
data
);
mock
.
onGet
(
file
.
loadCollapsedDiffUrl
).
reply
(
200
,
data
);
loadCollapsedDiff
({
commit
,
getters
:
{
commitId
:
null
}
},
file
)
loadCollapsedDiff
({
commit
,
getters
:
{
commitId
:
null
}
,
state
},
file
)
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
commit
).
toHaveBeenCalledWith
(
types
.
ADD_COLLAPSED_DIFFS
,
{
file
,
data
});
expect
(
commit
).
toHaveBeenCalledWith
(
types
.
ADD_COLLAPSED_DIFFS
,
{
file
,
data
});
...
@@ -421,10 +422,10 @@ describe('DiffsStoreActions', () => {
...
@@ -421,10 +422,10 @@ describe('DiffsStoreActions', () => {
spyOn
(
axios
,
'
get
'
).
and
.
returnValue
(
Promise
.
resolve
({
data
:
{}
}));
spyOn
(
axios
,
'
get
'
).
and
.
returnValue
(
Promise
.
resolve
({
data
:
{}
}));
loadCollapsedDiff
({
commit
()
{},
getters
},
file
);
loadCollapsedDiff
({
commit
()
{},
getters
,
state
},
file
);
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
file
.
load_collapsed_diff_url
,
{
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
file
.
load_collapsed_diff_url
,
{
params
:
{
commit_id
:
null
},
params
:
{
commit_id
:
null
,
w
:
'
0
'
},
});
});
});
});
...
@@ -436,10 +437,10 @@ describe('DiffsStoreActions', () => {
...
@@ -436,10 +437,10 @@ describe('DiffsStoreActions', () => {
spyOn
(
axios
,
'
get
'
).
and
.
returnValue
(
Promise
.
resolve
({
data
:
{}
}));
spyOn
(
axios
,
'
get
'
).
and
.
returnValue
(
Promise
.
resolve
({
data
:
{}
}));
loadCollapsedDiff
({
commit
()
{},
getters
},
file
);
loadCollapsedDiff
({
commit
()
{},
getters
,
state
},
file
);
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
file
.
load_collapsed_diff_url
,
{
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
file
.
load_collapsed_diff_url
,
{
params
:
{
commit_id
:
'
123
'
},
params
:
{
commit_id
:
'
123
'
,
w
:
'
0
'
},
});
});
});
});
});
});
...
...
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