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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ecae140f
Commit
ecae140f
authored
Nov 14, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mutation to change fileByFile setting
parent
79166d64
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
app/assets/javascripts/diffs/store/mutation_types.js
app/assets/javascripts/diffs/store/mutation_types.js
+1
-0
app/assets/javascripts/diffs/store/mutations.js
app/assets/javascripts/diffs/store/mutations.js
+5
-0
spec/frontend/diffs/store/mutations_spec.js
spec/frontend/diffs/store/mutations_spec.js
+14
-0
No files found.
app/assets/javascripts/diffs/store/mutation_types.js
View file @
ecae140f
...
@@ -28,6 +28,7 @@ export const SET_HIGHLIGHTED_ROW = 'SET_HIGHLIGHTED_ROW';
...
@@ -28,6 +28,7 @@ export const SET_HIGHLIGHTED_ROW = 'SET_HIGHLIGHTED_ROW';
export
const
SET_TREE_DATA
=
'
SET_TREE_DATA
'
;
export
const
SET_TREE_DATA
=
'
SET_TREE_DATA
'
;
export
const
SET_RENDER_TREE_LIST
=
'
SET_RENDER_TREE_LIST
'
;
export
const
SET_RENDER_TREE_LIST
=
'
SET_RENDER_TREE_LIST
'
;
export
const
SET_SHOW_WHITESPACE
=
'
SET_SHOW_WHITESPACE
'
;
export
const
SET_SHOW_WHITESPACE
=
'
SET_SHOW_WHITESPACE
'
;
export
const
SET_FILE_BY_FILE
=
'
SET_FILE_BY_FILE
'
;
export
const
TOGGLE_FILE_FINDER_VISIBLE
=
'
TOGGLE_FILE_FINDER_VISIBLE
'
;
export
const
TOGGLE_FILE_FINDER_VISIBLE
=
'
TOGGLE_FILE_FINDER_VISIBLE
'
;
export
const
REQUEST_FULL_DIFF
=
'
REQUEST_FULL_DIFF
'
;
export
const
REQUEST_FULL_DIFF
=
'
REQUEST_FULL_DIFF
'
;
...
...
app/assets/javascripts/diffs/store/mutations.js
View file @
ecae140f
...
@@ -36,6 +36,7 @@ export default {
...
@@ -36,6 +36,7 @@ export default {
projectPath
,
projectPath
,
dismissEndpoint
,
dismissEndpoint
,
showSuggestPopover
,
showSuggestPopover
,
viewDiffsFileByFile
,
}
=
options
;
}
=
options
;
Object
.
assign
(
state
,
{
Object
.
assign
(
state
,
{
endpoint
,
endpoint
,
...
@@ -45,6 +46,7 @@ export default {
...
@@ -45,6 +46,7 @@ export default {
projectPath
,
projectPath
,
dismissEndpoint
,
dismissEndpoint
,
showSuggestPopover
,
showSuggestPopover
,
viewDiffsFileByFile
,
});
});
},
},
...
@@ -352,4 +354,7 @@ export default {
...
@@ -352,4 +354,7 @@ export default {
[
types
.
SET_SHOW_SUGGEST_POPOVER
](
state
)
{
[
types
.
SET_SHOW_SUGGEST_POPOVER
](
state
)
{
state
.
showSuggestPopover
=
false
;
state
.
showSuggestPopover
=
false
;
},
},
[
types
.
SET_FILE_BY_FILE
](
state
,
fileByFile
)
{
state
.
viewDiffsFileByFile
=
fileByFile
;
},
};
};
spec/frontend/diffs/store/mutations_spec.js
View file @
ecae140f
...
@@ -892,4 +892,18 @@ describe('DiffsStoreMutations', () => {
...
@@ -892,4 +892,18 @@ describe('DiffsStoreMutations', () => {
expect
(
state
.
showSuggestPopover
).
toBe
(
false
);
expect
(
state
.
showSuggestPopover
).
toBe
(
false
);
});
});
});
});
describe
(
'
SET_FILE_BY_FILE
'
,
()
=>
{
it
.
each
`
value | opposite
${
true
}
|
${
false
}
${
false
}
|
${
true
}
`
(
'
sets viewDiffsFileByFile to $value
'
,
({
value
,
opposite
})
=>
{
const
state
=
{
viewDiffsFileByFile
:
opposite
};
mutations
[
types
.
SET_FILE_BY_FILE
](
state
,
value
);
expect
(
state
.
viewDiffsFileByFile
).
toBe
(
value
);
});
});
});
});
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