Commit e00a5aef authored by Filipa Lacerda's avatar Filipa Lacerda

Removes unused code

parent 6c650355
...@@ -133,48 +133,6 @@ export default class EnvironmentsStore { ...@@ -133,48 +133,6 @@ export default class EnvironmentsStore {
return count; 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. * Toggles folder open property for the given folder.
* *
...@@ -241,7 +199,24 @@ export default class EnvironmentsStore { ...@@ -241,7 +199,24 @@ export default class EnvironmentsStore {
return environments.filter(env => env.isFolder && env.isOpen); 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;
} }
} }
...@@ -228,21 +228,4 @@ describe('Store', () => { ...@@ -228,21 +228,4 @@ describe('Store', () => {
expect(store.getOpenFolders()[0]).toEqual(store.state.environments[1]); 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);
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment