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
296ede39
Commit
296ede39
authored
May 17, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pane/isActiveView getter
- No longer needed - Exporting getter functions can be confusing
parent
9fe79221
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
27 deletions
+12
-27
app/assets/javascripts/ide/stores/modules/pane/getters.js
app/assets/javascripts/ide/stores/modules/pane/getters.js
+3
-4
spec/frontend/ide/stores/modules/pane/getters_spec.js
spec/frontend/ide/stores/modules/pane/getters_spec.js
+9
-23
No files found.
app/assets/javascripts/ide/stores/modules/pane/getters.js
View file @
296ede39
export
const
isActiveView
=
state
=>
view
=>
state
.
currentView
===
view
;
export
const
isAliveView
=
(
state
,
getters
)
=>
view
=>
state
.
keepAliveViews
[
view
]
||
(
state
.
isOpen
&&
getters
.
isActiveView
(
view
));
// eslint-disable-next-line import/prefer-default-export
export
const
isAliveView
=
state
=>
view
=>
state
.
keepAliveViews
[
view
]
||
(
state
.
isOpen
&&
state
.
currentView
===
view
);
spec/frontend/ide/stores/modules/pane/getters_spec.js
View file @
296ede39
...
...
@@ -7,20 +7,6 @@ describe('IDE pane module getters', () => {
[
TEST_VIEW
]:
true
,
};
describe
(
'
isActiveView
'
,
()
=>
{
it
(
'
returns true if given view matches currentView
'
,
()
=>
{
const
result
=
getters
.
isActiveView
({
currentView
:
'
A
'
})(
'
A
'
);
expect
(
result
).
toBe
(
true
);
});
it
(
'
returns false if given view does not match currentView
'
,
()
=>
{
const
result
=
getters
.
isActiveView
({
currentView
:
'
A
'
})(
'
B
'
);
expect
(
result
).
toBe
(
false
);
});
});
describe
(
'
isAliveView
'
,
()
=>
{
it
(
'
returns true if given view is in keepAliveViews
'
,
()
=>
{
const
result
=
getters
.
isAliveView
({
keepAliveViews
:
TEST_KEEP_ALIVE_VIEWS
},
{})(
TEST_VIEW
);
...
...
@@ -29,25 +15,25 @@ describe('IDE pane module getters', () => {
});
it
(
'
returns true if given view is active view and open
'
,
()
=>
{
const
result
=
getters
.
isAliveView
(
{
...
state
(),
isOpen
:
true
},
{
isActiveView
:
()
=>
true
},
)(
TEST_VIEW
);
const
result
=
getters
.
isAliveView
({
...
state
(),
isOpen
:
true
,
currentView
:
TEST_VIEW
})(
TEST_VIEW
,
);
expect
(
result
).
toBe
(
true
);
});
it
(
'
returns false if given view is active view and closed
'
,
()
=>
{
const
result
=
getters
.
isAliveView
(
state
(),
{
isActiveView
:
()
=>
true
})(
TEST_VIEW
);
const
result
=
getters
.
isAliveView
(
{
...
state
(),
currentView
:
TEST_VIEW
})(
TEST_VIEW
);
expect
(
result
).
toBe
(
false
);
});
it
(
'
returns false if given view is not activeView
'
,
()
=>
{
const
result
=
getters
.
isAliveView
(
{
...
state
(),
isOpen
:
true
},
{
isActiveView
:
()
=>
false
},
)(
TEST_VIEW
);
const
result
=
getters
.
isAliveView
({
...
state
(),
isOpen
:
true
,
currentView
:
`
${
TEST_VIEW
}
_other`
,
})(
TEST_VIEW
);
expect
(
result
).
toBe
(
false
);
});
...
...
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