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
84c9a3d3
Commit
84c9a3d3
authored
Mar 12, 2021
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a mutation that sets endpoints into the MR Notes state
parent
ac808b75
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
app/assets/javascripts/mr_notes/stores/modules/index.js
app/assets/javascripts/mr_notes/stores/modules/index.js
+1
-0
app/assets/javascripts/mr_notes/stores/mutation_types.js
app/assets/javascripts/mr_notes/stores/mutation_types.js
+1
-0
app/assets/javascripts/mr_notes/stores/mutations.js
app/assets/javascripts/mr_notes/stores/mutations.js
+3
-0
spec/frontend/mr_notes/stores/mutations_spec.js
spec/frontend/mr_notes/stores/mutations_spec.js
+16
-0
No files found.
app/assets/javascripts/mr_notes/stores/modules/index.js
View file @
84c9a3d3
...
@@ -4,6 +4,7 @@ import mutations from '../mutations';
...
@@ -4,6 +4,7 @@ import mutations from '../mutations';
export
default
()
=>
({
export
default
()
=>
({
state
:
{
state
:
{
endpoints
:
{},
activeTab
:
null
,
activeTab
:
null
,
},
},
actions
,
actions
,
...
...
app/assets/javascripts/mr_notes/stores/mutation_types.js
View file @
84c9a3d3
export
default
{
export
default
{
SET_ACTIVE_TAB
:
'
SET_ACTIVE_TAB
'
,
SET_ACTIVE_TAB
:
'
SET_ACTIVE_TAB
'
,
SET_ENDPOINTS
:
'
SET_ENDPOINTS
'
,
};
};
app/assets/javascripts/mr_notes/stores/mutations.js
View file @
84c9a3d3
...
@@ -4,4 +4,7 @@ export default {
...
@@ -4,4 +4,7 @@ export default {
[
types
.
SET_ACTIVE_TAB
](
state
,
tab
)
{
[
types
.
SET_ACTIVE_TAB
](
state
,
tab
)
{
Object
.
assign
(
state
,
{
activeTab
:
tab
});
Object
.
assign
(
state
,
{
activeTab
:
tab
});
},
},
[
types
.
SET_ENDPOINTS
](
state
,
endpoints
)
{
Object
.
assign
(
state
,
{
endpoints
});
},
};
};
spec/frontend/mr_notes/stores/mutations_spec.js
0 → 100644
View file @
84c9a3d3
import
mutationTypes
from
'
~/mr_notes/stores/mutation_types
'
;
import
mutations
from
'
~/mr_notes/stores/mutations
'
;
describe
(
'
MR Notes Mutations
'
,
()
=>
{
describe
(
mutationTypes
.
SET_ENDPOINTS
,
()
=>
{
it
(
'
should set the endpoints value
'
,
()
=>
{
const
state
=
{};
const
endpoints
=
{
endpointA
:
'
A
'
,
endpointB
:
'
B
'
};
mutations
[
mutationTypes
.
SET_ENDPOINTS
](
state
,
endpoints
);
expect
(
state
.
endpoints
.
endpointA
).
toBe
(
'
A
'
);
expect
(
state
.
endpoints
.
endpointB
).
toBe
(
'
B
'
);
});
});
});
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