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
e00a5aef
Commit
e00a5aef
authored
May 17, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes unused code
parent
6c650355
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
61 deletions
+19
-61
app/assets/javascripts/environments/stores/environments_store.js
...ets/javascripts/environments/stores/environments_store.js
+19
-44
spec/javascripts/environments/environments_store_spec.js
spec/javascripts/environments/environments_store_spec.js
+0
-17
No files found.
app/assets/javascripts/environments/stores/environments_store.js
View file @
e00a5aef
...
...
@@ -133,48 +133,6 @@ export default class EnvironmentsStore {
return
count
;
}
/**
* Toggles deploy board visibility for the provided environment ID.
*
* @param {Object} environment
* @return {Array}
*/
toggleDeployBoard
(
environmentID
)
{
const
environments
=
this
.
state
.
environments
.
slice
();
this
.
state
.
environments
=
environments
.
map
((
env
)
=>
{
let
updated
=
Object
.
assign
({},
env
);
if
(
env
.
id
===
environmentID
)
{
updated
=
Object
.
assign
({},
updated
,
{
isDeployBoardVisible
:
!
env
.
isDeployBoardVisible
});
}
return
updated
;
});
return
this
.
state
.
environments
;
}
/**
* Store deploy board data for given environment.
*
* @param {Number} environmentID
* @param {Object} deployBoard
* @return {Array}
*/
storeDeployBoard
(
environmentID
,
deployBoard
)
{
const
environments
=
Object
.
assign
([],
this
.
state
.
environments
);
this
.
state
.
environments
=
environments
.
map
((
env
)
=>
{
let
updated
=
Object
.
assign
({},
env
);
if
(
env
.
id
===
environmentID
)
{
updated
=
Object
.
assign
({},
updated
,
{
deployBoardData
:
deployBoard
});
}
return
updated
;
});
return
this
.
state
.
environments
;
}
/*
* Toggles folder open property for the given folder.
*
...
...
@@ -241,7 +199,24 @@ export default class EnvironmentsStore {
return
environments
.
filter
(
env
=>
env
.
isFolder
&&
env
.
isOpen
);
}
getOpenDeployBoards
()
{
return
this
.
state
.
environments
.
filter
(
env
=>
env
.
isDeployBoardVisible
);
/**
* Toggles deploy board visibility for the provided environment ID.
*
* @param {Object} environment
* @return {Array}
*/
toggleDeployBoard
(
environmentID
)
{
const
environments
=
this
.
state
.
environments
.
slice
();
this
.
state
.
environments
=
environments
.
map
((
env
)
=>
{
let
updated
=
Object
.
assign
({},
env
);
if
(
env
.
id
===
environmentID
)
{
updated
=
Object
.
assign
({},
updated
,
{
isDeployBoardVisible
:
!
env
.
isDeployBoardVisible
});
}
return
updated
;
});
return
this
.
state
.
environments
;
}
}
spec/javascripts/environments/environments_store_spec.js
View file @
e00a5aef
...
...
@@ -228,21 +228,4 @@ describe('Store', () => {
expect
(
store
.
getOpenFolders
()[
0
]).
toEqual
(
store
.
state
.
environments
[
1
]);
});
});
describe
(
'
getOpenDeployBoards
'
,
()
=>
{
it
(
'
should return open deploy boards
'
,
()
=>
{
const
environment
=
{
name
:
'
foo
'
,
size
:
1
,
latest
:
{
id
:
1
,
},
rollout_status
:
deployBoardMockData
,
};
store
.
storeEnvironments
([
environment
]);
expect
(
store
.
getOpenDeployBoards
().
length
).
toEqual
(
1
);
});
});
});
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