Commit 61517b8e authored by Filipa Lacerda's avatar Filipa Lacerda

Adjustments to received API response to use rollout_status_path key

parent 01d5a4dd
...@@ -30,7 +30,7 @@ class EnvironmentsStore { ...@@ -30,7 +30,7 @@ class EnvironmentsStore {
* If the `size` is bigger than 1, it means it should be rendered as a folder. * If the `size` is bigger than 1, it means it should be rendered as a folder.
* In those cases we add `isFolder` key in order to render it properly. * In those cases we add `isFolder` key in order to render it properly.
* *
* Top level environments - when the size is 1 - with `rollout_status` * Top level environments - when the size is 1 - with `rollout_status_path`
* can render a deploy board. We add `isDeployBoardVisible` and `deployBoardData` * can render a deploy board. We add `isDeployBoardVisible` and `deployBoardData`
* keys to those environments. * keys to those environments.
* The first key will let's us know if we should or not render the deploy board. * The first key will let's us know if we should or not render the deploy board.
...@@ -54,7 +54,7 @@ class EnvironmentsStore { ...@@ -54,7 +54,7 @@ class EnvironmentsStore {
if (filtered.size > 1) { if (filtered.size > 1) {
filtered = Object.assign(filtered, env, { isFolder: true, folderName: env.name }); filtered = Object.assign(filtered, env, { isFolder: true, folderName: env.name });
} else if (filtered.size === 1 && filtered.rollout_status) { } else if (filtered.size === 1 && filtered.rollout_status_path) {
filtered = Object.assign(filtered, env, { filtered = Object.assign(filtered, env, {
hasDeployBoard: true, hasDeployBoard: true,
isDeployBoardVisible: false, isDeployBoardVisible: false,
......
...@@ -36,7 +36,7 @@ describe('Environment item', () => { ...@@ -36,7 +36,7 @@ describe('Environment item', () => {
size: 1, size: 1,
environment_path: 'url', environment_path: 'url',
id: 1, id: 1,
rollout_status: 'url', rollout_status_path: 'url',
hasDeployBoard: true, hasDeployBoard: true,
deployBoardData: { deployBoardData: {
instances: [ instances: [
...@@ -74,7 +74,7 @@ describe('Environment item', () => { ...@@ -74,7 +74,7 @@ describe('Environment item', () => {
size: 1, size: 1,
environment_path: 'url', environment_path: 'url',
id: 1, id: 1,
rollout_status: 'url', rollout_status_path: 'url',
hasDeployBoard: true, hasDeployBoard: true,
deployBoardData: { deployBoardData: {
instances: [ instances: [
......
...@@ -22,12 +22,12 @@ const { serverData, deployBoardMockData } = require('./mock_data'); ...@@ -22,12 +22,12 @@ const { serverData, deployBoardMockData } = require('./mock_data');
expect(store.state.environments.length).toEqual(serverData.length); expect(store.state.environments.length).toEqual(serverData.length);
}); });
it('should store a non folder environment with deploy board if rollout_status key is provided', () => { it('should store a non folder environment with deploy board if rollout_status_path key is provided', () => {
const environment = { const environment = {
name: 'foo', name: 'foo',
size: 1, size: 1,
id: 1, id: 1,
rollout_status: 'url', rollout_status_path: 'url',
}; };
store.storeEnvironments([environment]); store.storeEnvironments([environment]);
......
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